diff options
author | Peter Boström <pbos@webrtc.org> | 2016-01-07 15:42:47 +0100 |
---|---|---|
committer | Peter Boström <pbos@webrtc.org> | 2016-01-07 14:42:58 +0000 |
commit | 7776e782d6073b44f90a61da6a49d4b27ef7284a (patch) | |
tree | a60a0c56f6e57e95ef058451eecaa29a813cb3a6 /webrtc/modules | |
parent | 3886fc8f57770ade76fb4bca29474659fedc7609 (diff) | |
download | webrtc-7776e782d6073b44f90a61da6a49d4b27ef7284a.tar.gz |
Remove unused methods in VideoCodingModule.
Also voids ::Codec which always passed.
BUG=
R=stefan@webrtc.org
Review URL: https://codereview.webrtc.org/1464313004 .
Cr-Commit-Position: refs/heads/master@{#11167}
Diffstat (limited to 'webrtc/modules')
8 files changed, 7 insertions, 109 deletions
diff --git a/webrtc/modules/video_coding/include/video_coding.h b/webrtc/modules/video_coding/include/video_coding.h index 853e2a15fc..c46896c823 100644 --- a/webrtc/modules/video_coding/include/video_coding.h +++ b/webrtc/modules/video_coding/include/video_coding.h @@ -77,22 +77,6 @@ class VideoCodingModule : public Module { static void Destroy(VideoCodingModule* module); - // Get number of supported codecs - // - // Return value : Number of supported codecs - static uint8_t NumberOfCodecs(); - - // Get supported codec settings with using id - // - // Input: - // - listId : Id or index of the codec to look up - // - codec : Memory where the codec settings will be stored - // - // Return value : VCM_OK, on success - // VCM_PARAMETER_ERROR if codec not supported or id too - // high - static int32_t Codec(const uint8_t listId, VideoCodec* codec); - // Get supported codec settings using codec type // // Input: @@ -101,7 +85,7 @@ class VideoCodingModule : public Module { // // Return value : VCM_OK, on success // VCM_PARAMETER_ERROR if codec not supported - static int32_t Codec(VideoCodecType codecType, VideoCodec* codec); + static void Codec(VideoCodecType codecType, VideoCodec* codec); /* * Sender @@ -125,40 +109,6 @@ class VideoCodingModule : public Module { uint32_t numberOfCores, uint32_t maxPayloadSize) = 0; - // Get the current send codec in use. - // - // If a codec has not been set yet, the |id| property of the return value - // will be 0 and |name| empty. - // - // NOTE: This method intentionally does not hold locks and minimizes data - // copying. It must be called on the thread where the VCM was constructed. - virtual const VideoCodec& GetSendCodec() const = 0; - - // DEPRECATED: Use GetSendCodec() instead. - // - // API to get the current send codec in use. - // - // Input: - // - currentSendCodec : Address where the sendCodec will be written. - // - // Return value : VCM_OK, on success. - // < 0, on error. - // - // NOTE: The returned codec information is not guaranteed to be current when - // the call returns. This method acquires a lock that is aligned with - // video encoding, so it should be assumed to be allowed to block for - // several milliseconds. - virtual int32_t SendCodec(VideoCodec* currentSendCodec) const = 0; - - // DEPRECATED: Use GetSendCodec() instead. - // - // API to get the current send codec type - // - // Return value : Codec type, on success. - // kVideoCodecUnknown, on error or if no send codec is set - // NOTE: Same notes apply as for SendCodec() above. - virtual VideoCodecType SendCodec() const = 0; - // Register an external encoder object. This can not be used together with // external decoder callbacks. // diff --git a/webrtc/modules/video_coding/test/vcm_payload_sink_factory.cc b/webrtc/modules/video_coding/test/vcm_payload_sink_factory.cc index d4ee93f7ad..c9ec372f41 100644 --- a/webrtc/modules/video_coding/test/vcm_payload_sink_factory.cc +++ b/webrtc/modules/video_coding/test/vcm_payload_sink_factory.cc @@ -137,9 +137,7 @@ PayloadSinkInterface* VcmPayloadSinkFactory::Create( if (it->codec_type() != kVideoCodecULPFEC && it->codec_type() != kVideoCodecRED) { VideoCodec codec; - if (VideoCodingModule::Codec(it->codec_type(), &codec) < 0) { - return NULL; - } + VideoCodingModule::Codec(it->codec_type(), &codec); codec.plType = it->payload_type(); if (vcm->RegisterReceiveCodec(&codec, 1) < 0) { return NULL; diff --git a/webrtc/modules/video_coding/video_coding_impl.cc b/webrtc/modules/video_coding/video_coding_impl.cc index c471ddaf7e..1e26a7e243 100644 --- a/webrtc/modules/video_coding/video_coding_impl.cc +++ b/webrtc/modules/video_coding/video_coding_impl.cc @@ -108,20 +108,6 @@ class VideoCodingModuleImpl : public VideoCodingModule { return sender_.RegisterSendCodec(sendCodec, numberOfCores, maxPayloadSize); } - const VideoCodec& GetSendCodec() const override { - return sender_.GetSendCodec(); - } - - // DEPRECATED. - int32_t SendCodec(VideoCodec* currentSendCodec) const override { - return sender_.SendCodecBlocking(currentSendCodec); - } - - // DEPRECATED. - VideoCodecType SendCodec() const override { - return sender_.SendCodecBlocking(); - } - int32_t RegisterExternalEncoder(VideoEncoder* externalEncoder, uint8_t payloadType, bool internalSource) override { @@ -306,9 +292,8 @@ class VideoCodingModuleImpl : public VideoCodingModule { }; } // namespace -int32_t VideoCodingModule::Codec(VideoCodecType codecType, VideoCodec* codec) { +void VideoCodingModule::Codec(VideoCodecType codecType, VideoCodec* codec) { VCMCodecDataBase::Codec(codecType, codec); - return 0; } VideoCodingModule* VideoCodingModule::Create( diff --git a/webrtc/modules/video_coding/video_coding_impl.h b/webrtc/modules/video_coding/video_coding_impl.h index 2134e4d533..f105fa9c18 100644 --- a/webrtc/modules/video_coding/video_coding_impl.h +++ b/webrtc/modules/video_coding/video_coding_impl.h @@ -67,20 +67,6 @@ class VideoSender { int32_t RegisterSendCodec(const VideoCodec* sendCodec, uint32_t numberOfCores, uint32_t maxPayloadSize); - // Non-blocking access to the currently active send codec configuration. - // Must be called from the same thread as the VideoSender instance was - // created on. - const VideoCodec& GetSendCodec() const; - - // Get a copy of the currently configured send codec. - // This method acquires a lock to copy the current configuration out, - // so it can block and the returned information is not guaranteed to be - // accurate upon return. Consider using GetSendCodec() instead and make - // decisions on that thread with regards to the current codec. - int32_t SendCodecBlocking(VideoCodec* currentSendCodec) const; - - // Same as SendCodecBlocking. Try to use GetSendCodec() instead. - VideoCodecType SendCodecBlocking() const; void RegisterExternalEncoder(VideoEncoder* externalEncoder, uint8_t payloadType, diff --git a/webrtc/modules/video_coding/video_coding_robustness_unittest.cc b/webrtc/modules/video_coding/video_coding_robustness_unittest.cc index 94c62dc38e..dd6565d505 100644 --- a/webrtc/modules/video_coding/video_coding_robustness_unittest.cc +++ b/webrtc/modules/video_coding/video_coding_robustness_unittest.cc @@ -42,7 +42,7 @@ class VCMRobustnessTest : public ::testing::Test { vcm_->SetNackSettings(kMaxNackListSize, kMaxPacketAgeToNack, 0); ASSERT_EQ(0, vcm_->RegisterFrameTypeCallback(&frame_type_callback_)); ASSERT_EQ(0, vcm_->RegisterPacketRequestCallback(&request_callback_)); - ASSERT_EQ(VCM_OK, vcm_->Codec(kVideoCodecVP8, &video_codec_)); + VideoCodingModule::Codec(kVideoCodecVP8, &video_codec_); ASSERT_EQ(VCM_OK, vcm_->RegisterReceiveCodec(&video_codec_, 1)); vcm_->RegisterExternalDecoder(&decoder_, video_codec_.plType); } diff --git a/webrtc/modules/video_coding/video_receiver_unittest.cc b/webrtc/modules/video_coding/video_receiver_unittest.cc index 8fd46ecc80..820ce9ae2d 100644 --- a/webrtc/modules/video_coding/video_receiver_unittest.cc +++ b/webrtc/modules/video_coding/video_receiver_unittest.cc @@ -39,8 +39,7 @@ class TestVideoReceiver : public ::testing::Test { const int kMaxPacketAgeToNack = 450; receiver_->SetNackSettings(kMaxNackListSize, kMaxPacketAgeToNack, 0); - memset(&settings_, 0, sizeof(settings_)); - EXPECT_EQ(0, VideoCodingModule::Codec(kVideoCodecVP8, &settings_)); + VideoCodingModule::Codec(kVideoCodecVP8, &settings_); settings_.plType = kUnusedPayloadType; // Use the mocked encoder. EXPECT_EQ(0, receiver_->RegisterReceiveCodec(&settings_, 1, true)); } diff --git a/webrtc/modules/video_coding/video_sender.cc b/webrtc/modules/video_coding/video_sender.cc index 3bc33812a2..ac901f95b9 100644 --- a/webrtc/modules/video_coding/video_sender.cc +++ b/webrtc/modules/video_coding/video_sender.cc @@ -133,24 +133,6 @@ int32_t VideoSender::RegisterSendCodec(const VideoCodec* sendCodec, return VCM_OK; } -const VideoCodec& VideoSender::GetSendCodec() const { - RTC_DCHECK(main_thread_.CalledOnValidThread()); - return current_codec_; -} - -int32_t VideoSender::SendCodecBlocking(VideoCodec* currentSendCodec) const { - rtc::CritScope lock(&send_crit_); - if (currentSendCodec == nullptr) { - return VCM_PARAMETER_ERROR; - } - return _codecDataBase.SendCodec(currentSendCodec) ? 0 : -1; -} - -VideoCodecType VideoSender::SendCodecBlocking() const { - rtc::CritScope lock(&send_crit_); - return _codecDataBase.SendCodec(); -} - // Register an external decoder object. // This can not be used together with external decoder callbacks. void VideoSender::RegisterExternalEncoder(VideoEncoder* externalEncoder, diff --git a/webrtc/modules/video_coding/video_sender_unittest.cc b/webrtc/modules/video_coding/video_sender_unittest.cc index 9a438ff2b7..741c7b7a60 100644 --- a/webrtc/modules/video_coding/video_sender_unittest.cc +++ b/webrtc/modules/video_coding/video_sender_unittest.cc @@ -205,8 +205,7 @@ class TestVideoSenderWithMockEncoder : public TestVideoSender { void SetUp() override { TestVideoSender::SetUp(); sender_->RegisterExternalEncoder(&encoder_, kUnusedPayloadType, false); - memset(&settings_, 0, sizeof(settings_)); - EXPECT_EQ(0, VideoCodingModule::Codec(kVideoCodecVP8, &settings_)); + VideoCodingModule::Codec(kVideoCodecVP8, &settings_); settings_.numberOfSimulcastStreams = kNumberOfStreams; ConfigureStream(kDefaultWidth / 4, kDefaultHeight / 4, 100, &settings_.simulcastStream[0]); @@ -380,8 +379,7 @@ class TestVideoSenderWithVp8 : public TestVideoSender { int height, int temporal_layers) { VideoCodec codec; - memset(&codec, 0, sizeof(codec)); - EXPECT_EQ(0, VideoCodingModule::Codec(kVideoCodecVP8, &codec)); + VideoCodingModule::Codec(kVideoCodecVP8, &codec); codec.width = width; codec.height = height; codec.codecSpecific.VP8.numberOfTemporalLayers = temporal_layers; |