Ring Daemon 16.0.0
Loading...
Searching...
No Matches
jami::MediaRecorder Class Reference

#include <media_recorder.h>

Inheritance diagram for jami::MediaRecorder:
Inheritance graph
Collaboration diagram for jami::MediaRecorder:
Collaboration graph

Classes

struct  StreamObserver
 

Public Member Functions

Observer< std::shared_ptr< MediaFrame > > * addStream (const MediaStream &ms)
 Adds a stream to the recorder.
 
void audioOnly (bool audioOnly)
 Resulting file will be audio or video.
 
std::string getPath () const
 Get file path of file to be recorded.
 
Observer< std::shared_ptr< MediaFrame > > * getStream (const std::string &name) const
 Gets the stream observer.
 
bool isRecording () const
 Gets whether or not the recorder is active.
 
 MediaRecorder ()
 
void removeStream (const MediaStream &ms)
 Removes a stream from the recorder.
 
void setMetadata (const std::string &title, const std::string &desc)
 Sets title and description metadata for the file.
 
void setPath (const std::string &path)
 Sets output file path.
 
int startRecording ()
 Initializes the file.
 
void stopRecording ()
 Finalizes the file.
 
 ~MediaRecorder ()
 

Detailed Description

Definition at line 41 of file media_recorder.h.

Constructor & Destructor Documentation

◆ MediaRecorder()

jami::MediaRecorder::MediaRecorder ( )

Definition at line 149 of file media_recorder.cpp.

◆ ~MediaRecorder()

jami::MediaRecorder::~MediaRecorder ( )

Definition at line 151 of file media_recorder.cpp.

Member Function Documentation

◆ addStream()

Observer< std::shared_ptr< MediaFrame > > * jami::MediaRecorder::addStream ( const MediaStream ms)

Adds a stream to the recorder.

Caller must then attach this to the media source.

Definition at line 276 of file media_recorder.cpp.

References jami::emitSignal(), jami::MediaStream::format, jami::MediaStream::isVideo, JAMI_ERR, JAMI_LOG, and jami::MediaStream::name.

Here is the call graph for this function:

◆ audioOnly()

void jami::MediaRecorder::audioOnly ( bool  audioOnly)

Resulting file will be audio or video.

Sets whether or not output file will have audio. Determines the extension of the output file (.ogg or .webm).

Definition at line 173 of file media_recorder.cpp.

References audioOnly().

Referenced by audioOnly().

Here is the call graph for this function:

◆ getPath()

std::string jami::MediaRecorder::getPath ( ) const

Get file path of file to be recorded.

Same path as sent to @setPath, but with file extension appended.

NOTE @audioOnly must be called to have the right extension.

Definition at line 164 of file media_recorder.cpp.

Referenced by startRecording(), and stopRecording().

◆ getStream()

Observer< std::shared_ptr< MediaFrame > > * jami::MediaRecorder::getStream ( const std::string &  name) const

Gets the stream observer.

This is so the caller can detach it from the media source.

Definition at line 333 of file media_recorder.cpp.

References jami::emitSignal().

Here is the call graph for this function:

◆ isRecording()

bool jami::MediaRecorder::isRecording ( ) const

Gets whether or not the recorder is active.

Definition at line 158 of file media_recorder.cpp.

◆ removeStream()

void jami::MediaRecorder::removeStream ( const MediaStream ms)

Removes a stream from the recorder.

Caller must then detach this from the media source.

Definition at line 314 of file media_recorder.cpp.

References jami::emitSignal(), jami::MediaStream::isVideo, JAMI_LOG, and jami::MediaStream::name.

Here is the call graph for this function:

◆ setMetadata()

void jami::MediaRecorder::setMetadata ( const std::string &  title,
const std::string &  desc 
)

Sets title and description metadata for the file.

Uses default if either is empty. Default title is "Conversation at %Y-%m-%d %H:%M:%S". Default description is "Recorded with Jami https://jami.net".

NOTE replaces TIMESTAMP with time at start of recording

Definition at line 185 of file media_recorder.cpp.

References jami::emitSignal().

Here is the call graph for this function:

◆ setPath()

void jami::MediaRecorder::setPath ( const std::string &  path)

Sets output file path.

NOTE An empty path will put the output file in the working directory.

Definition at line 179 of file media_recorder.cpp.

◆ startRecording()

int jami::MediaRecorder::startRecording ( )

Initializes the file.

Streams must have been added using Observable::attach and @addStream.

Definition at line 192 of file media_recorder.cpp.

References jami::emitSignal(), getPath(), JAMI_ERR, and JAMI_LOG.

Here is the call graph for this function:

◆ stopRecording()

void jami::MediaRecorder::stopRecording ( )

Finalizes the file.

Streams must be removed using Observable::detach afterwards.

Definition at line 258 of file media_recorder.cpp.

References jami::emitSignal(), getPath(), and JAMI_DBG.

Here is the call graph for this function:

The documentation for this class was generated from the following files: