Commit 1237f6a1 authored by Pierre Lespagnol's avatar Pierre Lespagnol Committed by Sébastien Blin

recorder: allow recording from call to conference and vice versa

A new recording file is created during a change

Change-Id: I5ac72b31c0d78211a994036150dde34b07d7854a
Gitlab: #276
parent e0e7f6af
......@@ -114,6 +114,15 @@ Conference::~Conference()
call->sendTextMessage(std::map<std::string, std::string> {{"application/confInfo+json",
"[]"}},
call->getAccount().getFromUri());
// Continue the recording for the call if the conference was recorded
if (this->isRecording()) {
JAMI_DBG("Stop recording for conf %s", getConfID().c_str());
this->toggleRecording();
if (not call->isRecording()) {
JAMI_DBG("Conference was recorded, start recording for conf %s", call->getCallId().c_str());
call->toggleRecording();
}
}
}
}
#endif // ENABLE_VIDEO
......@@ -136,8 +145,18 @@ Conference::add(const std::string& participant_id)
{
if (participants_.insert(participant_id).second) {
#ifdef ENABLE_VIDEO
if (auto call = Manager::instance().callFactory.getCall<SIPCall>(participant_id))
if (auto call = Manager::instance().callFactory.getCall<SIPCall>(participant_id)) {
call->getVideoRtp().enterConference(this);
// Continue the recording for the conference if one participant was recording
if (call->isRecording()) {
JAMI_DBG("Stop recording for call %s", call->getCallId().c_str());
call->toggleRecording();
if (not this->isRecording()) {
JAMI_DBG("One participant was recording, start recording for conference %s", getConfID().c_str());
this->toggleRecording();
}
}
}
else
JAMI_ERR("no call associate to participant %s", participant_id.c_str());
#endif // ENABLE_VIDEO
......
......@@ -269,16 +269,11 @@ MediaRecorder::onFrame(const std::string& name, const std::shared_ptr<MediaFrame
clone = std::make_unique<MediaFrame>();
clone->copyFrom(*frame);
}
#if (defined(TARGET_OS_IOS) && TARGET_OS_IOS)
clone->pointer()->pts = av_rescale_q_rnd(av_gettime() - startTimeStamp_,
{1, AV_TIME_BASE},
ms.timeBase,
static_cast<AVRounding>(AV_ROUND_NEAR_INF
| AV_ROUND_PASS_MINMAX));
#else
clone->pointer()->pts -= ms.firstTimestamp;
#endif
std::unique_ptr<MediaFrame> filteredFrame;
if (ms.isVideo) {
std::lock_guard<std::mutex> lk(mutexFilterVideo_);
......
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