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 10 matching lines...) Expand all Loading... |
21 #include "media/base/video_decoder.h" | 21 #include "media/base/video_decoder.h" |
22 #include "media/video/picture.h" | 22 #include "media/video/picture.h" |
23 #include "media/video/video_decode_accelerator.h" | 23 #include "media/video/video_decode_accelerator.h" |
24 #include "third_party/webrtc/modules/video_coding/codecs/interface/video_codec_i
nterface.h" | 24 #include "third_party/webrtc/modules/video_coding/codecs/interface/video_codec_i
nterface.h" |
25 | 25 |
26 namespace base { | 26 namespace base { |
27 class WaitableEvent; | 27 class WaitableEvent; |
28 class MessageLoopProxy; | 28 class MessageLoopProxy; |
29 }; | 29 }; |
30 | 30 |
31 namespace gpu { | |
32 struct MailboxHolder; | |
33 } | |
34 | |
35 namespace media { | 31 namespace media { |
36 class DecoderBuffer; | 32 class DecoderBuffer; |
37 class GpuVideoAcceleratorFactories; | 33 class GpuVideoAcceleratorFactories; |
38 } | 34 } |
39 | 35 |
40 namespace content { | 36 namespace content { |
41 | 37 |
42 // This class uses hardware accelerated video decoder to decode video for | 38 // This class uses hardware accelerated video decoder to decode video for |
43 // WebRTC. |vda_message_loop_| is the message loop proxy of the media thread, | 39 // WebRTC. |vda_message_loop_| is the message loop proxy of the media thread, |
44 // which VDA::Client methods run on. webrtc::VideoDecoder methods run on WebRTC | 40 // which VDA::Client methods run on. webrtc::VideoDecoder methods run on WebRTC |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 | 145 |
150 // Resets VDA. | 146 // Resets VDA. |
151 void ResetInternal(); | 147 void ResetInternal(); |
152 | 148 |
153 // Static method is to allow it to run even after RVD is deleted. | 149 // Static method is to allow it to run even after RVD is deleted. |
154 static void ReleaseMailbox( | 150 static void ReleaseMailbox( |
155 base::WeakPtr<RTCVideoDecoder> decoder, | 151 base::WeakPtr<RTCVideoDecoder> decoder, |
156 const scoped_refptr<media::GpuVideoAcceleratorFactories>& factories, | 152 const scoped_refptr<media::GpuVideoAcceleratorFactories>& factories, |
157 int64 picture_buffer_id, | 153 int64 picture_buffer_id, |
158 uint32 texture_id, | 154 uint32 texture_id, |
159 scoped_ptr<gpu::MailboxHolder> mailbox_holder); | 155 const std::vector<uint32>& release_sync_points); |
160 // Tells VDA that a picture buffer can be recycled. | 156 // Tells VDA that a picture buffer can be recycled. |
161 void ReusePictureBuffer(int64 picture_buffer_id); | 157 void ReusePictureBuffer(int64 picture_buffer_id); |
162 | 158 |
163 // Create |vda_| on |vda_loop_proxy_|. | 159 // Create |vda_| on |vda_loop_proxy_|. |
164 void CreateVDA(media::VideoCodecProfile profile, base::WaitableEvent* waiter); | 160 void CreateVDA(media::VideoCodecProfile profile, base::WaitableEvent* waiter); |
165 | 161 |
166 void DestroyTextures(); | 162 void DestroyTextures(); |
167 void DestroyVDA(); | 163 void DestroyVDA(); |
168 | 164 |
169 // Gets a shared-memory segment of at least |min_size| bytes from | 165 // Gets a shared-memory segment of at least |min_size| bytes from |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 // Must be destroyed, or invalidated, on |vda_loop_proxy_| | 268 // Must be destroyed, or invalidated, on |vda_loop_proxy_| |
273 // NOTE: Weak pointers must be invalidated before all other member variables. | 269 // NOTE: Weak pointers must be invalidated before all other member variables. |
274 base::WeakPtrFactory<RTCVideoDecoder> weak_factory_; | 270 base::WeakPtrFactory<RTCVideoDecoder> weak_factory_; |
275 | 271 |
276 DISALLOW_COPY_AND_ASSIGN(RTCVideoDecoder); | 272 DISALLOW_COPY_AND_ASSIGN(RTCVideoDecoder); |
277 }; | 273 }; |
278 | 274 |
279 } // namespace content | 275 } // namespace content |
280 | 276 |
281 #endif // CONTENT_RENDERER_MEDIA_RTC_VIDEO_DECODER_H_ | 277 #endif // CONTENT_RENDERER_MEDIA_RTC_VIDEO_DECODER_H_ |
OLD | NEW |