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; | |
77 | 76 |
78 // Notify the client that an error has occurred and decoding cannot continue. | 77 // Notify the client that an error has occurred and decoding cannot continue. |
79 void NotifyError(Error error); | 78 void NotifyError(Error error); |
80 | 79 |
81 // Map the received input buffer into this process' address space and | 80 // Map the received input buffer into this process' address space and |
82 // queue it for decode. | 81 // queue it for decode. |
83 void MapAndQueueNewInputBuffer( | 82 void MapAndQueueNewInputBuffer( |
84 const media::BitstreamBuffer& bitstream_buffer); | 83 const media::BitstreamBuffer& bitstream_buffer); |
85 | 84 |
86 // Get a new input buffer from the queue and set it up in decoder. This will | 85 // 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... |
269 VASurface::ReleaseCB va_surface_release_cb_; | 268 VASurface::ReleaseCB va_surface_release_cb_; |
270 | 269 |
271 // To expose client callbacks from VideoDecodeAccelerator. | 270 // To expose client callbacks from VideoDecodeAccelerator. |
272 // NOTE: all calls to these objects *MUST* be executed on message_loop_. | 271 // NOTE: all calls to these objects *MUST* be executed on message_loop_. |
273 scoped_ptr<base::WeakPtrFactory<Client> > client_ptr_factory_; | 272 scoped_ptr<base::WeakPtrFactory<Client> > client_ptr_factory_; |
274 base::WeakPtr<Client> client_; | 273 base::WeakPtr<Client> client_; |
275 | 274 |
276 // Accelerators come after vaapi_wrapper_ to ensure they are destroyed first. | 275 // Accelerators come after vaapi_wrapper_ to ensure they are destroyed first. |
277 scoped_ptr<VaapiH264Accelerator> h264_accelerator_; | 276 scoped_ptr<VaapiH264Accelerator> h264_accelerator_; |
278 scoped_ptr<VaapiVP8Accelerator> vp8_accelerator_; | 277 scoped_ptr<VaapiVP8Accelerator> vp8_accelerator_; |
279 scoped_ptr<VaapiVP9Accelerator> vp9_accelerator_; | |
280 // After *_accelerator_ to ensure correct destruction order. | 278 // After *_accelerator_ to ensure correct destruction order. |
281 scoped_ptr<AcceleratedVideoDecoder> decoder_; | 279 scoped_ptr<AcceleratedVideoDecoder> decoder_; |
282 | 280 |
283 base::Thread decoder_thread_; | 281 base::Thread decoder_thread_; |
284 // Use this to post tasks to |decoder_thread_| instead of | 282 // Use this to post tasks to |decoder_thread_| instead of |
285 // |decoder_thread_.message_loop()| because the latter will be NULL once | 283 // |decoder_thread_.message_loop()| because the latter will be NULL once |
286 // |decoder_thread_.Stop()| returns. | 284 // |decoder_thread_.Stop()| returns. |
287 scoped_refptr<base::SingleThreadTaskRunner> decoder_thread_task_runner_; | 285 scoped_refptr<base::SingleThreadTaskRunner> decoder_thread_task_runner_; |
288 | 286 |
289 int num_frames_at_client_; | 287 int num_frames_at_client_; |
(...skipping 17 matching lines...) Expand all Loading... |
307 | 305 |
308 // The WeakPtrFactory for |weak_this_|. | 306 // The WeakPtrFactory for |weak_this_|. |
309 base::WeakPtrFactory<VaapiVideoDecodeAccelerator> weak_this_factory_; | 307 base::WeakPtrFactory<VaapiVideoDecodeAccelerator> weak_this_factory_; |
310 | 308 |
311 DISALLOW_COPY_AND_ASSIGN(VaapiVideoDecodeAccelerator); | 309 DISALLOW_COPY_AND_ASSIGN(VaapiVideoDecodeAccelerator); |
312 }; | 310 }; |
313 | 311 |
314 } // namespace content | 312 } // namespace content |
315 | 313 |
316 #endif // CONTENT_COMMON_GPU_MEDIA_VAAPI_VIDEO_DECODE_ACCELERATOR_H_ | 314 #endif // CONTENT_COMMON_GPU_MEDIA_VAAPI_VIDEO_DECODE_ACCELERATOR_H_ |
OLD | NEW |