OLD | NEW |
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 #ifndef CONTENT_RENDERER_MEDIA_RTC_VIDEO_DECODER_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_RTC_VIDEO_DECODER_H_ |
6 #define CONTENT_RENDERER_MEDIA_RTC_VIDEO_DECODER_H_ | 6 #define CONTENT_RENDERER_MEDIA_RTC_VIDEO_DECODER_H_ |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 #include <list> | 9 #include <list> |
10 #include <map> | 10 #include <map> |
(...skipping 15 matching lines...) Expand all Loading... |
26 | 26 |
27 namespace base { | 27 namespace base { |
28 class WaitableEvent; | 28 class WaitableEvent; |
29 }; | 29 }; |
30 | 30 |
31 namespace media { | 31 namespace media { |
32 class DecoderBuffer; | 32 class DecoderBuffer; |
33 class GpuVideoAcceleratorFactories; | 33 class GpuVideoAcceleratorFactories; |
34 } | 34 } |
35 | 35 |
| 36 namespace gpu { |
| 37 struct SyncToken; |
| 38 } |
| 39 |
36 namespace content { | 40 namespace content { |
37 | 41 |
38 // This class uses hardware accelerated video decoder to decode video for | 42 // This class uses hardware accelerated video decoder to decode video for |
39 // WebRTC. |vda_message_loop_| is the message loop proxy of the media thread, | 43 // WebRTC. |vda_message_loop_| is the message loop proxy of the media thread, |
40 // which VDA::Client methods run on. webrtc::VideoDecoder methods run on WebRTC | 44 // which VDA::Client methods run on. webrtc::VideoDecoder methods run on WebRTC |
41 // DecodingThread or Chrome_libJingle_WorkerThread, which are trampolined to | 45 // DecodingThread or Chrome_libJingle_WorkerThread, which are trampolined to |
42 // |vda_message_loop_|. Decode() is non-blocking and queues the buffers. Decoded | 46 // |vda_message_loop_|. Decode() is non-blocking and queues the buffers. Decoded |
43 // frames are delivered to WebRTC on |vda_message_loop_|. | 47 // frames are delivered to WebRTC on |vda_message_loop_|. |
44 class CONTENT_EXPORT RTCVideoDecoder | 48 class CONTENT_EXPORT RTCVideoDecoder |
45 : NON_EXPORTED_BASE(public webrtc::VideoDecoder), | 49 : NON_EXPORTED_BASE(public webrtc::VideoDecoder), |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 const gfx::Rect& visible_rect); | 143 const gfx::Rect& visible_rect); |
140 | 144 |
141 // Resets VDA. | 145 // Resets VDA. |
142 void ResetInternal(); | 146 void ResetInternal(); |
143 | 147 |
144 // Static method is to allow it to run even after RVD is deleted. | 148 // Static method is to allow it to run even after RVD is deleted. |
145 static void ReleaseMailbox(base::WeakPtr<RTCVideoDecoder> decoder, | 149 static void ReleaseMailbox(base::WeakPtr<RTCVideoDecoder> decoder, |
146 media::GpuVideoAcceleratorFactories* factories, | 150 media::GpuVideoAcceleratorFactories* factories, |
147 int64 picture_buffer_id, | 151 int64 picture_buffer_id, |
148 uint32 texture_id, | 152 uint32 texture_id, |
149 uint32 release_sync_point); | 153 const gpu::SyncToken& release_sync_token); |
150 // Tells VDA that a picture buffer can be recycled. | 154 // Tells VDA that a picture buffer can be recycled. |
151 void ReusePictureBuffer(int64 picture_buffer_id); | 155 void ReusePictureBuffer(int64 picture_buffer_id); |
152 | 156 |
153 // Create |vda_| on |vda_loop_proxy_|. | 157 // Create |vda_| on |vda_loop_proxy_|. |
154 void CreateVDA(media::VideoCodecProfile profile, base::WaitableEvent* waiter); | 158 void CreateVDA(media::VideoCodecProfile profile, base::WaitableEvent* waiter); |
155 | 159 |
156 void DestroyTextures(); | 160 void DestroyTextures(); |
157 void DestroyVDA(); | 161 void DestroyVDA(); |
158 | 162 |
159 // Gets a shared-memory segment of at least |min_size| bytes from | 163 // Gets a shared-memory segment of at least |min_size| bytes from |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
275 // Must be destroyed, or invalidated, on |vda_loop_proxy_| | 279 // Must be destroyed, or invalidated, on |vda_loop_proxy_| |
276 // NOTE: Weak pointers must be invalidated before all other member variables. | 280 // NOTE: Weak pointers must be invalidated before all other member variables. |
277 base::WeakPtrFactory<RTCVideoDecoder> weak_factory_; | 281 base::WeakPtrFactory<RTCVideoDecoder> weak_factory_; |
278 | 282 |
279 DISALLOW_COPY_AND_ASSIGN(RTCVideoDecoder); | 283 DISALLOW_COPY_AND_ASSIGN(RTCVideoDecoder); |
280 }; | 284 }; |
281 | 285 |
282 } // namespace content | 286 } // namespace content |
283 | 287 |
284 #endif // CONTENT_RENDERER_MEDIA_RTC_VIDEO_DECODER_H_ | 288 #endif // CONTENT_RENDERER_MEDIA_RTC_VIDEO_DECODER_H_ |
OLD | NEW |