Move VideoDecoder::Create() logic to separate internal video decoder factory
The goal with this CL is to move implementation details out from the
webrtc root (webrtc/video_decoder.h) to simplify the dependency graph.
Another goal is to streamline the creation of VideoDecoders in
webrtcvideoengine2.cc; it will now have two factories of the same
WebRtcVideoDecoderFactory type, one internal and one external.
Specifically, this CL:
* Removes webrtc::VideoDecoder::DecoderType and use webrtc::VideoCodecType
instead.
* Removes 'static VideoDecoder* Create(DecoderType codec_type)' and
moves the create function to the internal decoder factory instead.
* Removes video_decoder.cc. webrtc::VideoDecoder is now just an
interface without any static functions.
BUG=webrtc:6743
Review-Url: https://codereview.webrtc.org/2521203002
Cr-Commit-Position: refs/heads/master@{#15350}
diff --git a/webrtc/test/encoder_settings.cc b/webrtc/test/encoder_settings.cc
index 80c42ef..061fafc 100644
--- a/webrtc/test/encoder_settings.cc
+++ b/webrtc/test/encoder_settings.cc
@@ -12,8 +12,10 @@
#include <algorithm>
#include <string>
+#include "webrtc/modules/video_coding/codecs/h264/include/h264.h"
+#include "webrtc/modules/video_coding/codecs/vp8/include/vp8.h"
+#include "webrtc/modules/video_coding/codecs/vp9/include/vp9.h"
#include "webrtc/test/fake_decoder.h"
-#include "webrtc/video_decoder.h"
namespace webrtc {
namespace test {
@@ -85,11 +87,11 @@
decoder.payload_type = encoder_settings.payload_type;
decoder.payload_name = encoder_settings.payload_name;
if (encoder_settings.payload_name == "H264") {
- decoder.decoder = VideoDecoder::Create(VideoDecoder::kH264);
+ decoder.decoder = H264Decoder::Create();
} else if (encoder_settings.payload_name == "VP8") {
- decoder.decoder = VideoDecoder::Create(VideoDecoder::kVp8);
+ decoder.decoder = VP8Decoder::Create();
} else if (encoder_settings.payload_name == "VP9") {
- decoder.decoder = VideoDecoder::Create(VideoDecoder::kVp9);
+ decoder.decoder = VP9Decoder::Create();
} else {
decoder.decoder = new FakeDecoder();
}