Revert of WebRtcVoiceEngine: Use AudioDecoderFactory to generate recv codecs. (patchset #10 id:200001 of https://codereview.webrtc.org/2072753002/ )

Reason for revert:
For some reason, payload_type_mapper.cc is not being picked up in Chrome builds, leading to undefined references. Reverting while investigating.

Original issue's description:
> WebRtcVoiceEngine: Use AudioDecoderFactory to generate recv codecs.
>
> Changed WebRtcVoiceEngine to present receive codecs from the formats
> provided by its decoder factory. Added supported formats to
> BuiltinAudioDecoderFactory. Added helper functions for creating some
> simple decoder factories for mocking.
>
> Created a PayloadTypeMapper for assigning payload types to formats. I
> think we'll eventually want to use this further up, or possibly in
> both the audio and video sides. It would be best if the engines didn't
> have to talk payload types at all, but it might be more difficult to
> get around when payload types depend on each-other, like the RTX
> codecs for video.
>
> This CL also includes some changes to rtc::Optional. I've put them in
> a separate CL that should (or should not) land first, making these
> changes void.
> See: https://codereview.webrtc.org/2072713002/
>
> BUG=webrtc:5805
>
> Committed: https://crrev.com/95eb1ba0db79d8fd134ae61b0a24648598684e8a
> Cr-Commit-Position: refs/heads/master@{#13459}

TBR=ivoc@webrtc.org,tina.legrand@webrtc.org,tommi@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:5805

Review-Url: https://codereview.webrtc.org/2151453002
Cr-Commit-Position: refs/heads/master@{#13460}
This commit is contained in:
ossu
2016-07-13 06:31:30 -07:00
committed by Commit bot
parent 95eb1ba0db
commit f93be584f7
12 changed files with 30 additions and 542 deletions

View File

@ -14,7 +14,6 @@
#include <vector>
#include "testing/gmock/include/gmock/gmock.h"
#include "webrtc/base/scoped_ref_ptr.h"
#include "webrtc/modules/audio_coding/codecs/audio_decoder_factory.h"
namespace webrtc {
@ -31,45 +30,6 @@ class MockAudioDecoderFactory : public AudioDecoderFactory {
MOCK_METHOD2(MakeAudioDecoderMock,
void(const SdpAudioFormat& format,
std::unique_ptr<AudioDecoder>* return_value));
// Creates a MockAudioDecoderFactory with no formats and that may not be
// invoked to create a codec - useful for initializing a voice engine, for
// example.
static rtc::scoped_refptr<webrtc::MockAudioDecoderFactory>
CreateUnusedFactory() {
using testing::_;
using testing::AnyNumber;
using testing::Return;
rtc::scoped_refptr<webrtc::MockAudioDecoderFactory> factory =
new rtc::RefCountedObject<webrtc::MockAudioDecoderFactory>;
ON_CALL(*factory.get(), GetSupportedFormats())
.WillByDefault(Return(std::vector<webrtc::SdpAudioFormat>()));
EXPECT_CALL(*factory.get(), GetSupportedFormats()).Times(AnyNumber());
EXPECT_CALL(*factory.get(), MakeAudioDecoderMock(_, _)).Times(0);
return factory;
}
// Creates a MockAudioDecoderFactory with no formats that may be invoked to
// create a codec any number of times. It will, though, return nullptr on each
// call, since it supports no codecs.
static rtc::scoped_refptr<webrtc::MockAudioDecoderFactory>
CreateEmptyFactory() {
using testing::_;
using testing::AnyNumber;
using testing::Return;
using testing::SetArgPointee;
rtc::scoped_refptr<webrtc::MockAudioDecoderFactory> factory =
new rtc::RefCountedObject<webrtc::MockAudioDecoderFactory>;
ON_CALL(*factory.get(), GetSupportedFormats())
.WillByDefault(Return(std::vector<webrtc::SdpAudioFormat>()));
EXPECT_CALL(*factory.get(), GetSupportedFormats()).Times(AnyNumber());
ON_CALL(*factory.get(), MakeAudioDecoderMock(_, _))
.WillByDefault(SetArgPointee<1>(nullptr));
EXPECT_CALL(*factory.get(), MakeAudioDecoderMock(_, _)).Times(AnyNumber());
return factory;
}
};
} // namespace webrtc