Commit 747b1848 authored by Sylvain Berfini's avatar Sylvain Berfini 🎩

Added is_recording method on LinphoneCall object

parent 60b34eb3
......@@ -739,6 +739,13 @@ LINPHONE_PUBLIC void linphone_call_start_recording(LinphoneCall *call);
**/
LINPHONE_PUBLIC void linphone_call_stop_recording(LinphoneCall *call);
/**
* Returns whether or not the call is currently being recorded
* @param call LinphoneCall for which we can to know the recording state
* @return true if recording is in progress, false otherwise
**/
LINPHONE_PUBLIC bool_t linphone_call_is_recording(LinphoneCall *call);
/**
* Get a player associated with the call to play a local file and stream it to the remote peer.
* @param[in] call #LinphoneCall object
......
......@@ -573,6 +573,10 @@ void linphone_call_stop_recording (LinphoneCall *call) {
L_GET_CPP_PTR_FROM_C_OBJECT(call)->stopRecording();
}
bool_t linphone_call_is_recording (LinphoneCall *call) {
return L_GET_CPP_PTR_FROM_C_OBJECT(call)->isRecording();
}
LinphonePlayer *linphone_call_get_player (LinphoneCall *call) {
return L_GET_CPP_PTR_FROM_C_OBJECT(call)->getPlayer();
}
......
......@@ -610,6 +610,11 @@ void Call::stopRecording () {
static_pointer_cast<MediaSession>(d->getActiveSession())->stopRecording();
}
bool Call::isRecording () {
L_D();
return static_pointer_cast<MediaSession>(d->getActiveSession())->isRecording();
}
LinphoneStatus Call::takePreviewSnapshot (const string &file) {
L_D();
return static_pointer_cast<MediaSession>(d->getActiveSession())->takePreviewSnapshot(file);
......
......@@ -61,6 +61,7 @@ public:
void sendVfuRequest ();
void startRecording ();
void stopRecording ();
bool isRecording ();
LinphoneStatus takePreviewSnapshot (const std::string &file);
LinphoneStatus takeVideoSnapshot (const std::string &file);
LinphoneStatus terminate (const LinphoneErrorInfo *ei = nullptr);
......
......@@ -4476,6 +4476,11 @@ void MediaSession::stopRecording () {
d->recordActive = false;
}
bool MediaSession::isRecording () {
L_D();
return d->recordActive;
}
void MediaSession::terminateBecauseOfLostMedia () {
L_D();
d->nonOpError = true;
......
......@@ -61,6 +61,7 @@ public:
int startInvite (const Address *destination, const std::string &subject = "", const Content *content = nullptr) override;
void startRecording ();
void stopRecording ();
bool isRecording ();
void terminateBecauseOfLostMedia ();
LinphoneStatus update (const MediaSessionParams *msp, const std::string &subject = "");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment