Index: content/renderer/media/rtc_video_decoder.h |
diff --git a/content/renderer/media/rtc_video_decoder.h b/content/renderer/media/rtc_video_decoder.h |
index 8c4c195fe1302b86914e52fc7956959ee03bb63a..56f19260613d7ceef945da7245a805df7e69d58a 100644 |
--- a/content/renderer/media/rtc_video_decoder.h |
+++ b/content/renderer/media/rtc_video_decoder.h |
@@ -35,13 +35,11 @@ class DecoderBuffer; |
namespace content { |
// This class uses hardware accelerated video decoder to decode video for |
-// WebRTC. The message loop of RendererGpuVideoDecoderFactories is stored as |
-// |vda_message_loop_|. It is the compositor thread, or the renderer thread if |
-// threaded compositing is disabled. VDA::Client methods run on |
-// |vda_message_loop_|. webrtc::VideoDecoder methods run on WebRTC |
+// WebRTC. |vda_message_loop_| is the message loop proxy of the media thread, |
+// which VDA::Client methods run on. webrtc::VideoDecoder methods run on WebRTC |
// DecodingThread or Chrome_libJingle_WorkerThread, which are trampolined to |
// |vda_message_loop_|. Decode() is non-blocking and queues the buffers. Decoded |
-// frames are delivered on |vda_message_loop_|. |
+// frames are delivered to WebRTC on |vda_message_loop_|. |
class CONTENT_EXPORT RTCVideoDecoder |
: NON_EXPORTED_BASE(public webrtc::VideoDecoder), |
public media::VideoDecodeAccelerator::Client, |
@@ -49,8 +47,11 @@ class CONTENT_EXPORT RTCVideoDecoder |
public: |
virtual ~RTCVideoDecoder(); |
- // Creates a RTCVideoDecoder. Returns NULL if failed. |
+ // Creates a RTCVideoDecoder. Returns NULL if failed. |vda_loop_proxy| should |
+ // be the same as the one running |factories|. |
static scoped_ptr<RTCVideoDecoder> Create( |
+ webrtc::VideoCodecType type, |
+ const scoped_refptr<base::MessageLoopProxy> vda_loop_proxy, |
const scoped_refptr<media::GpuVideoDecoder::Factories>& factories); |
// webrtc::VideoDecoder implementation. |
@@ -110,7 +111,9 @@ class CONTENT_EXPORT RTCVideoDecoder |
FRIEND_TEST_ALL_PREFIXES(RTCVideoDecoderTest, IsBufferAfterReset); |
+ // |vda_loop_proxy| should be the same as the one running |factories|. |
RTCVideoDecoder( |
+ const scoped_refptr<base::MessageLoopProxy>& vda_loop_proxy, |
const scoped_refptr<media::GpuVideoDecoder::Factories>& factories); |
void Initialize(base::WaitableEvent* waiter); |
@@ -147,6 +150,7 @@ class CONTENT_EXPORT RTCVideoDecoder |
// Resets VDA. |
void ResetInternal(); |
+ void ReleaseInternal(); |
Ami GONE FROM CHROMIUM
2013/07/22 19:46:21
Any reason for this, given it's no different from
wuchengli
2013/07/23 16:29:28
You are right. ReleaseInternal is not required.
|
// Tells VDA that a picture buffer can be recycled. |
void ReusePictureBuffer(int64 picture_buffer_id, uint32 sync_point); |
@@ -201,15 +205,6 @@ class CONTENT_EXPORT RTCVideoDecoder |
// of |factories_|. |
scoped_refptr<base::MessageLoopProxy> vda_loop_proxy_; |
- // The thread to create shared memory. Factories::CreateSharedMemory is |
- // trampolined to the child thread. When |vda_loop_proxy_| is the compositor |
- // thread, blocking on the child thread will deadlock. During WebRTC hang up, |
- // the child thread waits for Chrome_libJingle_WorkerThread. libJingle thread |
- // cannot finish when DecodingThread holds a WebRTC lock and blocks on the |
- // child thread. So we need to call CreateSharedMemory asynchronously from a |
- // different thread. |
- base::Thread create_shm_thread_; |
- |
// The texture target used for decoded pictures. |
uint32 decoder_texture_target_; |