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}
This commit is contained in:
Peter Boström
2016-01-07 15:42:47 +01:00
parent 3886fc8f57
commit 7776e782d6
8 changed files with 7 additions and 109 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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