Remove VideoCodingModule::InitializeSender.
This code is no longer used to reset, so we can just initialize the object in the constructor. BUG=4391 R=stefan@webrtc.org Review URL: https://webrtc-codereview.appspot.com/51619005 Cr-Commit-Position: refs/heads/master@{#9043}
This commit is contained in:
parent
95702246d7
commit
9dbbcfbcb5
@ -119,18 +119,6 @@ public:
|
||||
* Sender
|
||||
*/
|
||||
|
||||
// Any encoder-related state of VCM will be initialized to the
|
||||
// same state as when the VCM was created. This will not interrupt
|
||||
// or effect decoding functionality of VCM. VCM will lose all the
|
||||
// encoding-related settings by calling this function.
|
||||
// For instance, a send codec has to be registered again.
|
||||
//
|
||||
// NOTE: Must be called on the thread that constructed the VCM instance.
|
||||
//
|
||||
// Return value : VCM_OK, on success.
|
||||
// < 0, on error.
|
||||
virtual int32_t InitializeSender() = 0;
|
||||
|
||||
// Registers a codec to be used for encoding. Calling this
|
||||
// API multiple times overwrites any previously registered codecs.
|
||||
//
|
||||
|
@ -106,8 +106,6 @@ class VideoCodingModuleImpl : public VideoCodingModule {
|
||||
return receiver_return;
|
||||
}
|
||||
|
||||
int32_t InitializeSender() override { return sender_->InitializeSender(); }
|
||||
|
||||
int32_t RegisterSendCodec(const VideoCodec* sendCodec,
|
||||
uint32_t numberOfCores,
|
||||
uint32_t maxPayloadSize) override {
|
||||
|
@ -63,8 +63,6 @@ class VideoSender {
|
||||
|
||||
~VideoSender();
|
||||
|
||||
int32_t InitializeSender();
|
||||
|
||||
// Register the send codec to be used.
|
||||
// This method must be called on the construction thread.
|
||||
int32_t RegisterSendCodec(const VideoCodec* sendCodec,
|
||||
|
@ -67,7 +67,7 @@ VideoSender::VideoSender(Clock* clock,
|
||||
recorder_(new DebugRecorder()),
|
||||
process_crit_sect_(CriticalSectionWrapper::CreateCriticalSection()),
|
||||
_sendCritSect(CriticalSectionWrapper::CreateCriticalSection()),
|
||||
_encoder(),
|
||||
_encoder(nullptr),
|
||||
_encodedFrameCallback(post_encode_callback),
|
||||
_nextFrameTypes(1, kVideoFrameDelta),
|
||||
_mediaOpt(clock_),
|
||||
@ -82,6 +82,7 @@ VideoSender::VideoSender(Clock* clock,
|
||||
// construction. This is currently how this class is being used by at least
|
||||
// one external project (diffractor).
|
||||
_mediaOpt.EnableQM(qm_settings_callback_ != nullptr);
|
||||
_mediaOpt.Reset();
|
||||
main_thread_.DetachFromThread();
|
||||
}
|
||||
|
||||
@ -105,17 +106,6 @@ int32_t VideoSender::Process() {
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
// Reset send side to initial state - all components
|
||||
int32_t VideoSender::InitializeSender() {
|
||||
DCHECK(main_thread_.CalledOnValidThread());
|
||||
CriticalSectionScoped cs(_sendCritSect);
|
||||
_codecDataBase.ResetSender();
|
||||
_encoder = nullptr;
|
||||
_encodedFrameCallback.SetTransportCallback(nullptr);
|
||||
_mediaOpt.Reset(); // Resetting frame dropper
|
||||
return VCM_OK;
|
||||
}
|
||||
|
||||
int64_t VideoSender::TimeUntilNextProcess() {
|
||||
return _sendStatsTimer.TimeUntilProcess();
|
||||
}
|
||||
|
@ -179,7 +179,6 @@ class TestVideoSender : public ::testing::Test {
|
||||
void SetUp() override {
|
||||
sender_.reset(
|
||||
new VideoSender(&clock_, &post_encode_callback_, nullptr, nullptr));
|
||||
EXPECT_EQ(0, sender_->InitializeSender());
|
||||
EXPECT_EQ(0, sender_->RegisterTransportCallback(&packetization_callback_));
|
||||
}
|
||||
|
||||
|
@ -147,9 +147,6 @@ ViEEncoder::ViEEncoder(int32_t channel_id,
|
||||
}
|
||||
|
||||
bool ViEEncoder::Init() {
|
||||
if (vcm_->InitializeSender() != 0) {
|
||||
return false;
|
||||
}
|
||||
vpm_->EnableTemporalDecimation(true);
|
||||
|
||||
// Enable/disable content analysis: off by default for now.
|
||||
|
Loading…
x
Reference in New Issue
Block a user