OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // This file contains an implementation of VideoDecoderAccelerator | 5 // This file contains an implementation of VideoDecoderAccelerator |
6 // that utilizes hardware video decoder present on Intel CPUs. | 6 // that utilizes hardware video decoder present on Intel CPUs. |
7 | 7 |
8 #ifndef CONTENT_COMMON_GPU_MEDIA_VAAPI_VIDEO_DECODE_ACCELERATOR_H_ | 8 #ifndef CONTENT_COMMON_GPU_MEDIA_VAAPI_VIDEO_DECODE_ACCELERATOR_H_ |
9 #define CONTENT_COMMON_GPU_MEDIA_VAAPI_VIDEO_DECODE_ACCELERATOR_H_ | 9 #define CONTENT_COMMON_GPU_MEDIA_VAAPI_VIDEO_DECODE_ACCELERATOR_H_ |
10 | 10 |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 void Reset() override; | 66 void Reset() override; |
67 void Destroy() override; | 67 void Destroy() override; |
68 bool CanDecodeOnIOThread() override; | 68 bool CanDecodeOnIOThread() override; |
69 | 69 |
70 static media::VideoDecodeAccelerator::SupportedProfiles | 70 static media::VideoDecodeAccelerator::SupportedProfiles |
71 GetSupportedProfiles(); | 71 GetSupportedProfiles(); |
72 | 72 |
73 private: | 73 private: |
74 class VaapiH264Accelerator; | 74 class VaapiH264Accelerator; |
75 class VaapiVP8Accelerator; | 75 class VaapiVP8Accelerator; |
| 76 class VaapiVP9Accelerator; |
76 | 77 |
77 // Notify the client that an error has occurred and decoding cannot continue. | 78 // Notify the client that an error has occurred and decoding cannot continue. |
78 void NotifyError(Error error); | 79 void NotifyError(Error error); |
79 | 80 |
80 // Map the received input buffer into this process' address space and | 81 // Map the received input buffer into this process' address space and |
81 // queue it for decode. | 82 // queue it for decode. |
82 void MapAndQueueNewInputBuffer( | 83 void MapAndQueueNewInputBuffer( |
83 const media::BitstreamBuffer& bitstream_buffer); | 84 const media::BitstreamBuffer& bitstream_buffer); |
84 | 85 |
85 // Get a new input buffer from the queue and set it up in decoder. This will | 86 // Get a new input buffer from the queue and set it up in decoder. This will |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 VASurface::ReleaseCB va_surface_release_cb_; | 269 VASurface::ReleaseCB va_surface_release_cb_; |
269 | 270 |
270 // To expose client callbacks from VideoDecodeAccelerator. | 271 // To expose client callbacks from VideoDecodeAccelerator. |
271 // NOTE: all calls to these objects *MUST* be executed on message_loop_. | 272 // NOTE: all calls to these objects *MUST* be executed on message_loop_. |
272 scoped_ptr<base::WeakPtrFactory<Client> > client_ptr_factory_; | 273 scoped_ptr<base::WeakPtrFactory<Client> > client_ptr_factory_; |
273 base::WeakPtr<Client> client_; | 274 base::WeakPtr<Client> client_; |
274 | 275 |
275 // Accelerators come after vaapi_wrapper_ to ensure they are destroyed first. | 276 // Accelerators come after vaapi_wrapper_ to ensure they are destroyed first. |
276 scoped_ptr<VaapiH264Accelerator> h264_accelerator_; | 277 scoped_ptr<VaapiH264Accelerator> h264_accelerator_; |
277 scoped_ptr<VaapiVP8Accelerator> vp8_accelerator_; | 278 scoped_ptr<VaapiVP8Accelerator> vp8_accelerator_; |
| 279 scoped_ptr<VaapiVP9Accelerator> vp9_accelerator_; |
278 // After *_accelerator_ to ensure correct destruction order. | 280 // After *_accelerator_ to ensure correct destruction order. |
279 scoped_ptr<AcceleratedVideoDecoder> decoder_; | 281 scoped_ptr<AcceleratedVideoDecoder> decoder_; |
280 | 282 |
281 base::Thread decoder_thread_; | 283 base::Thread decoder_thread_; |
282 // Use this to post tasks to |decoder_thread_| instead of | 284 // Use this to post tasks to |decoder_thread_| instead of |
283 // |decoder_thread_.message_loop()| because the latter will be NULL once | 285 // |decoder_thread_.message_loop()| because the latter will be NULL once |
284 // |decoder_thread_.Stop()| returns. | 286 // |decoder_thread_.Stop()| returns. |
285 scoped_refptr<base::SingleThreadTaskRunner> decoder_thread_task_runner_; | 287 scoped_refptr<base::SingleThreadTaskRunner> decoder_thread_task_runner_; |
286 | 288 |
287 int num_frames_at_client_; | 289 int num_frames_at_client_; |
(...skipping 17 matching lines...) Expand all Loading... |
305 | 307 |
306 // The WeakPtrFactory for |weak_this_|. | 308 // The WeakPtrFactory for |weak_this_|. |
307 base::WeakPtrFactory<VaapiVideoDecodeAccelerator> weak_this_factory_; | 309 base::WeakPtrFactory<VaapiVideoDecodeAccelerator> weak_this_factory_; |
308 | 310 |
309 DISALLOW_COPY_AND_ASSIGN(VaapiVideoDecodeAccelerator); | 311 DISALLOW_COPY_AND_ASSIGN(VaapiVideoDecodeAccelerator); |
310 }; | 312 }; |
311 | 313 |
312 } // namespace content | 314 } // namespace content |
313 | 315 |
314 #endif // CONTENT_COMMON_GPU_MEDIA_VAAPI_VIDEO_DECODE_ACCELERATOR_H_ | 316 #endif // CONTENT_COMMON_GPU_MEDIA_VAAPI_VIDEO_DECODE_ACCELERATOR_H_ |
OLD | NEW |