Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Unified Diff: content/renderer/media/gpu/rtc_video_decoder_factory.cc

Issue 2363303002: [WIP] Proxy RtcVideoDecoder calls to a media::VideoDecoder.
Patch Set: Now working with remote ffmpeg decoder Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698