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: Sebastien Blin <sebastien.blin@savoirfairelinux.com>
This commit is contained in:
philippegorley
2018-07-10 14:41:31 -04:00
committed by Sébastien Blin
parent f8bd331d66
commit a617ed7e36
14 changed files with 27 additions and 27 deletions

View File

@ -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

View File

@ -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();

View File

@ -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;

View File

@ -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);

View File

@ -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;

View File

@ -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);

View File

@ -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_;

View File

@ -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

View File

@ -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);

View File

@ -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

View File

@ -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);

View File

@ -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();

View File

@ -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);

View File

@ -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;