Ring Daemon 16.0.0
|
#include <media_recorder.h>
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 () | |
Definition at line 41 of file media_recorder.h.
jami::MediaRecorder::MediaRecorder | ( | ) |
Definition at line 149 of file media_recorder.cpp.
jami::MediaRecorder::~MediaRecorder | ( | ) |
Definition at line 151 of file media_recorder.cpp.
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.
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().
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().
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().
bool jami::MediaRecorder::isRecording | ( | ) | const |
Gets whether or not the recorder is active.
Definition at line 158 of file media_recorder.cpp.
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.
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().
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.
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.
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.