Index: content/renderer/media/gpu/rtc_video_decoder_factory.cc |
diff --git a/content/renderer/media/gpu/rtc_video_decoder_factory.cc b/content/renderer/media/gpu/rtc_video_decoder_factory.cc |
index c8e45b24985aa7618842c738263c4ec7f2c9da9f..0df28626e451ba86dedda4997c1e2a6e453496c4 100644 |
--- a/content/renderer/media/gpu/rtc_video_decoder_factory.cc |
+++ b/content/renderer/media/gpu/rtc_video_decoder_factory.cc |
@@ -6,14 +6,19 @@ |
#include <memory> |
+#include "base/single_thread_task_runner.h" |
#include "content/renderer/media/gpu/rtc_video_decoder.h" |
-#include "media/renderers/gpu_video_accelerator_factories.h" |
+ |
+// Debug! Remove! |
+#include "media/filters/ffmpeg_video_decoder.h" |
namespace content { |
RTCVideoDecoderFactory::RTCVideoDecoderFactory( |
- media::GpuVideoAcceleratorFactories* gpu_factories) |
- : gpu_factories_(gpu_factories) { |
+ const CreateVideoDecoderCB& create_video_decoder_cb, |
+ const scoped_refptr<base::SingleThreadTaskRunner>& decoder_task_runner) |
+ : create_video_decoder_cb_(create_video_decoder_cb), |
+ decoder_task_runner_(decoder_task_runner) { |
DVLOG(2) << __func__; |
} |
@@ -23,14 +28,33 @@ RTCVideoDecoderFactory::~RTCVideoDecoderFactory() { |
webrtc::VideoDecoder* RTCVideoDecoderFactory::CreateVideoDecoder( |
webrtc::VideoCodecType type) { |
- DVLOG(2) << __func__; |
- return RTCVideoDecoder::Create(type, gpu_factories_).release(); |
+ VLOG(0) << __func__; |
+ |
+ ///////////////// Debug! ////////////////////// |
+ media::VideoCodec codec; |
+ switch (type) { |
+ case webrtc::kVideoCodecVP8: |
+ codec = media::kCodecVP8; |
+ break; |
+ case webrtc::kVideoCodecH264: |
+ codec = media::kCodecH264; |
+ break; |
+ default: |
+ return nullptr; |
+ } |
+ |
+ DCHECK(media::FFmpegVideoDecoder::IsCodecSupported(codec)) << type; |
+ //////////////////////////////////////////// |
+ |
+ return RTCVideoDecoder::Create(type, create_video_decoder_cb_, |
+ decoder_task_runner_) |
+ .release(); |
} |
void RTCVideoDecoderFactory::DestroyVideoDecoder( |
webrtc::VideoDecoder* decoder) { |
DVLOG(2) << __func__; |
- RTCVideoDecoder::Destroy(decoder, gpu_factories_); |
+ RTCVideoDecoder::Destroy(decoder, decoder_task_runner_); |
} |
} // namespace content |