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

Side by Side Diff: content/renderer/media/rtc_video_decoder_factory.cc

Issue 19638008: Refactor GpuVideoDecoder::Factories out of GpuVideoDecoder. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 7 years, 4 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/media/rtc_video_decoder_factory.h" 5 #include "content/renderer/media/rtc_video_decoder_factory.h"
6 6
7 #include "base/location.h" 7 #include "base/location.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "content/renderer/media/rtc_video_decoder.h" 9 #include "content/renderer/media/rtc_video_decoder.h"
10 #include "media/filters/gpu_video_decoder_factories.h"
10 11
11 namespace content { 12 namespace content {
12 13
13 RTCVideoDecoderFactory::RTCVideoDecoderFactory( 14 RTCVideoDecoderFactory::RTCVideoDecoderFactory(
14 const scoped_refptr<media::GpuVideoDecoder::Factories>& gpu_factories) 15 const scoped_refptr<media::GpuVideoDecoderFactories>& gpu_factories)
15 : vda_loop_proxy_(gpu_factories->GetMessageLoop()) { 16 : vda_loop_proxy_(gpu_factories->GetMessageLoop()) {
16 DVLOG(2) << "RTCVideoDecoderFactory"; 17 DVLOG(2) << "RTCVideoDecoderFactory";
17 // The decoder cannot be created in CreateVideoDecoder because VDA has to be 18 // The decoder cannot be created in CreateVideoDecoder because VDA has to be
18 // created on |vda_loop_proxy_|, which can be the child thread. The child 19 // created on |vda_loop_proxy_|, which can be the child thread. The child
19 // thread is blocked when CreateVideoDecoder runs. This supports only one 20 // thread is blocked when CreateVideoDecoder runs. This supports only one
20 // VDA-powered <video> tag at a time. 21 // VDA-powered <video> tag at a time.
21 // TODO(wuchengli): remove this restriction. 22 // TODO(wuchengli): remove this restriction.
22 // |decoder_| can be null if VDA does not support VP8. 23 // |decoder_| can be null if VDA does not support VP8.
23 decoder_ = RTCVideoDecoder::Create(gpu_factories); 24 decoder_ = RTCVideoDecoder::Create(gpu_factories);
24 } 25 }
(...skipping 19 matching lines...) Expand all
44 void RTCVideoDecoderFactory::DestroyVideoDecoder( 45 void RTCVideoDecoderFactory::DestroyVideoDecoder(
45 webrtc::VideoDecoder* decoder) { 46 webrtc::VideoDecoder* decoder) {
46 DVLOG(2) << "DestroyVideoDecoder"; 47 DVLOG(2) << "DestroyVideoDecoder";
47 // Save back the decoder because it is the only one. VideoDecoder::Release 48 // Save back the decoder because it is the only one. VideoDecoder::Release
48 // should have been called. 49 // should have been called.
49 decoder->RegisterDecodeCompleteCallback(NULL); 50 decoder->RegisterDecodeCompleteCallback(NULL);
50 decoder_.reset(decoder); 51 decoder_.reset(decoder);
51 } 52 }
52 53
53 } // namespace content 54 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/media/rtc_video_decoder_factory.h ('k') | content/renderer/media/rtc_video_decoder_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698