Commit a617ed7e authored by Philippe Gorley's avatar Philippe Gorley Committed by Sébastien Blin

change startRecorder to initRecorder

It better explains what the method does, as the recorder is not started
at that moment).

Change-Id: Ib536600b663e9ee188257b3b166f497f5a2b2c1e
Reviewed-by: Sébastien Blin's avatarSebastien Blin <sebastien.blin@savoirfairelinux.com>
parent f8bd331d
......@@ -59,7 +59,7 @@ class AudioSender {
void setMuted(bool isMuted);
uint16_t getLastSeqValue();
void startRecorder(std::shared_ptr<MediaRecorder>& rec);
void initRecorder(std::shared_ptr<MediaRecorder>& rec);
private:
NON_COPYABLE(AudioSender);
......@@ -203,10 +203,10 @@ AudioSender::getLastSeqValue()
}
void
AudioSender::startRecorder(std::shared_ptr<MediaRecorder>& rec)
AudioSender::initRecorder(std::shared_ptr<MediaRecorder>& rec)
{
if (audioEncoder_)
audioEncoder_->startRecorder(rec);
audioEncoder_->initRecorder(rec);
}
class AudioReceiveThread
......@@ -220,7 +220,7 @@ class AudioReceiveThread
void addIOContext(SocketPair &socketPair);
void startLoop();
void startRecorder(std::shared_ptr<MediaRecorder>& rec);
void initRecorder(std::shared_ptr<MediaRecorder>& rec);
private:
NON_COPYABLE(AudioReceiveThread);
......@@ -382,10 +382,10 @@ AudioReceiveThread::startLoop()
}
void
AudioReceiveThread::startRecorder(std::shared_ptr<MediaRecorder>& rec)
AudioReceiveThread::initRecorder(std::shared_ptr<MediaRecorder>& rec)
{
if (audioDecoder_)
audioDecoder_->startRecorder(rec);
audioDecoder_->initRecorder(rec);
}
AudioRtpSession::AudioRtpSession(const std::string& id)
......@@ -517,12 +517,12 @@ AudioRtpSession::setMuted(bool isMuted)
}
void
AudioRtpSession::startRecorder(std::shared_ptr<MediaRecorder>& rec)
AudioRtpSession::initRecorder(std::shared_ptr<MediaRecorder>& rec)
{
if (receiveThread_)
receiveThread_->startRecorder(rec);
receiveThread_->initRecorder(rec);
if (sender_)
sender_->startRecorder(rec);
sender_->initRecorder(rec);
}
} // namespace ring
......@@ -49,7 +49,7 @@ class AudioRtpSession : public RtpSession {
void setMuted(bool isMuted);
void startRecorder(std::shared_ptr<MediaRecorder>& rec) override;
void initRecorder(std::shared_ptr<MediaRecorder>& rec) override;
private:
void startSender();
......
......@@ -526,7 +526,7 @@ MediaDecoder::correctPixFmt(int input_pix_fmt) {
}
void
MediaDecoder::startRecorder(std::shared_ptr<MediaRecorder>& rec)
MediaDecoder::initRecorder(std::shared_ptr<MediaRecorder>& rec)
{
// recording will start once we can send an AVPacket to the recorder
recordingStarted_ = false;
......
......@@ -100,7 +100,7 @@ class MediaDecoder {
void enableAccel(bool enableAccel);
#endif
void startRecorder(std::shared_ptr<MediaRecorder>& rec);
void initRecorder(std::shared_ptr<MediaRecorder>& rec);
private:
NON_COPYABLE(MediaDecoder);
......
......@@ -716,7 +716,7 @@ MediaEncoder::getStreamCount() const
}
void
MediaEncoder::startRecorder(std::shared_ptr<MediaRecorder>& rec)
MediaEncoder::initRecorder(std::shared_ptr<MediaRecorder>& rec)
{
// recording will start once we can send an AVPacket to the recorder
recordingStarted_ = false;
......
......@@ -98,7 +98,7 @@ public:
unsigned getStreamCount() const;
void startRecorder(std::shared_ptr<MediaRecorder>& rec);
void initRecorder(std::shared_ptr<MediaRecorder>& rec);
private:
NON_COPYABLE(MediaEncoder);
......
......@@ -55,7 +55,7 @@ public:
void setMtu(uint16_t mtu) { mtu_ = mtu; }
virtual void startRecorder(std::shared_ptr<MediaRecorder>& rec) = 0;
virtual void initRecorder(std::shared_ptr<MediaRecorder>& rec) = 0;
protected:
std::recursive_mutex mutex_;
......
......@@ -588,10 +588,10 @@ VideoInput::foundDecOpts(const DeviceParams& params)
}
void
VideoInput::startRecorder(std::shared_ptr<MediaRecorder>& rec)
VideoInput::initRecorder(std::shared_ptr<MediaRecorder>& rec)
{
if (decoder_)
decoder_->startRecorder(rec);
decoder_->initRecorder(rec);
}
}} // namespace ring::video
......@@ -89,7 +89,7 @@ public:
void releaseFrame(void *frame);
#endif
void startRecorder(std::shared_ptr<MediaRecorder>& rec);
void initRecorder(std::shared_ptr<MediaRecorder>& rec);
private:
NON_COPYABLE(VideoInput);
......
......@@ -239,10 +239,10 @@ VideoReceiveThread::triggerKeyFrameRequest()
}
void
VideoReceiveThread::startRecorder(std::shared_ptr<ring::MediaRecorder>& rec)
VideoReceiveThread::initRecorder(std::shared_ptr<ring::MediaRecorder>& rec)
{
if (videoDecoder_)
videoDecoder_->startRecorder(rec);
videoDecoder_->initRecorder(rec);
}
}} // namespace ring::video
......@@ -62,7 +62,7 @@ public:
int getPixelFormat() const;
void triggerKeyFrameRequest();
void startRecorder(std::shared_ptr<ring::MediaRecorder>& rec);
void initRecorder(std::shared_ptr<ring::MediaRecorder>& rec);
private:
NON_COPYABLE(VideoReceiveThread);
......
......@@ -565,14 +565,14 @@ VideoRtpSession::processPacketLoss()
}
void
VideoRtpSession::startRecorder(std::shared_ptr<MediaRecorder>& rec)
VideoRtpSession::initRecorder(std::shared_ptr<MediaRecorder>& rec)
{
// video recording needs to start with keyframes
const constexpr int keyframes = 3;
if (receiveThread_)
receiveThread_->startRecorder(rec);
receiveThread_->initRecorder(rec);
if (auto vidInput = std::static_pointer_cast<VideoInput>(videoLocal_))
vidInput->startRecorder(rec);
vidInput->initRecorder(rec);
for (int i = 0; i < keyframes; ++i)
if (receiveThread_)
receiveThread_->triggerKeyFrameRequest();
......
......@@ -80,7 +80,7 @@ public:
bool useCodec(const AccountVideoCodecInfo* codec) const;
void startRecorder(std::shared_ptr<MediaRecorder>& rec) override;
void initRecorder(std::shared_ptr<MediaRecorder>& rec) override;
private:
void setupConferenceVideoPipeline(Conference& conference);
......
......@@ -1159,10 +1159,10 @@ SIPCall::toggleRecording()
<< getSIPAccount().getUserUri() << " and " << peerUri_;
recorder_->setMetadata(ss.str(), ""); // use default description
if (avformatrtp_)
avformatrtp_->startRecorder(recorder_);
avformatrtp_->initRecorder(recorder_);
#ifdef RING_VIDEO
if (!isAudioOnly_ && videortp_)
videortp_->startRecorder(recorder_);
videortp_->initRecorder(recorder_);
#endif
}
return startRecording;
......
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