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 the hardware video decoder present on the Exynos SoC. | 6 // that utilizes the hardware video decoder present on the Exynos SoC. |
7 | 7 |
8 #ifndef CONTENT_COMMON_GPU_MEDIA_EXYNOS_VIDEO_DECODE_ACCELERATOR_H_ | 8 #ifndef CONTENT_COMMON_GPU_MEDIA_EXYNOS_VIDEO_DECODE_ACCELERATOR_H_ |
9 #define CONTENT_COMMON_GPU_MEDIA_EXYNOS_VIDEO_DECODE_ACCELERATOR_H_ | 9 #define CONTENT_COMMON_GPU_MEDIA_EXYNOS_VIDEO_DECODE_ACCELERATOR_H_ |
10 | 10 |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 // decoder_thread_, so there are no synchronization issues. | 54 // decoder_thread_, so there are no synchronization issues. |
55 // ... well, there are, but it's a matter of getting messages posted in the | 55 // ... well, there are, but it's a matter of getting messages posted in the |
56 // right order, not fiddling with locks. | 56 // right order, not fiddling with locks. |
57 class CONTENT_EXPORT ExynosVideoDecodeAccelerator : | 57 class CONTENT_EXPORT ExynosVideoDecodeAccelerator : |
58 public media::VideoDecodeAccelerator { | 58 public media::VideoDecodeAccelerator { |
59 public: | 59 public: |
60 ExynosVideoDecodeAccelerator( | 60 ExynosVideoDecodeAccelerator( |
61 EGLDisplay egl_display, | 61 EGLDisplay egl_display, |
62 EGLContext egl_context, | 62 EGLContext egl_context, |
63 Client* client, | 63 Client* client, |
64 const base::Callback<bool(void)>& make_context_current); | 64 const base::Callback<bool(void)>& make_context_current, |
| 65 const scoped_refptr<base::MessageLoopProxy>& io_message_loop_proxy); |
65 virtual ~ExynosVideoDecodeAccelerator(); | 66 virtual ~ExynosVideoDecodeAccelerator(); |
66 | 67 |
67 // media::VideoDecodeAccelerator implementation. | 68 // media::VideoDecodeAccelerator implementation. |
68 // Note: Initialize() and Destroy() are synchronous. | 69 // Note: Initialize() and Destroy() are synchronous. |
69 virtual bool Initialize(media::VideoCodecProfile profile) OVERRIDE; | 70 virtual bool Initialize(media::VideoCodecProfile profile) OVERRIDE; |
70 virtual void Decode(const media::BitstreamBuffer& bitstream_buffer) OVERRIDE; | 71 virtual void Decode(const media::BitstreamBuffer& bitstream_buffer) OVERRIDE; |
71 virtual void AssignPictureBuffers( | 72 virtual void AssignPictureBuffers( |
72 const std::vector<media::PictureBuffer>& buffers) OVERRIDE; | 73 const std::vector<media::PictureBuffer>& buffers) OVERRIDE; |
73 virtual void ReusePictureBuffer(int32 picture_buffer_id) OVERRIDE; | 74 virtual void ReusePictureBuffer(int32 picture_buffer_id) OVERRIDE; |
74 virtual void Flush() OVERRIDE; | 75 virtual void Flush() OVERRIDE; |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
304 // Destroy buffers. | 305 // Destroy buffers. |
305 void DestroyMfcInputBuffers(); | 306 void DestroyMfcInputBuffers(); |
306 void DestroyMfcOutputBuffers(); | 307 void DestroyMfcOutputBuffers(); |
307 void DestroyGscInputBuffers(); | 308 void DestroyGscInputBuffers(); |
308 void DestroyGscOutputBuffers(); | 309 void DestroyGscOutputBuffers(); |
309 void ResolutionChangeDestroyBuffers(); | 310 void ResolutionChangeDestroyBuffers(); |
310 | 311 |
311 // Our original calling message loop for the child thread. | 312 // Our original calling message loop for the child thread. |
312 scoped_refptr<base::MessageLoopProxy> child_message_loop_proxy_; | 313 scoped_refptr<base::MessageLoopProxy> child_message_loop_proxy_; |
313 | 314 |
| 315 // Message loop of the IO thread. |
| 316 scoped_refptr<base::MessageLoopProxy> io_message_loop_proxy_; |
| 317 |
314 // WeakPtr<> pointing to |this| for use in posting tasks from the decoder or | 318 // WeakPtr<> pointing to |this| for use in posting tasks from the decoder or |
315 // device worker threads back to the child thread. Because the worker threads | 319 // device worker threads back to the child thread. Because the worker threads |
316 // are members of this class, any task running on those threads is guaranteed | 320 // are members of this class, any task running on those threads is guaranteed |
317 // that this object is still alive. As a result, tasks posted from the child | 321 // that this object is still alive. As a result, tasks posted from the child |
318 // thread to the decoder or device thread should use base::Unretained(this), | 322 // thread to the decoder or device thread should use base::Unretained(this), |
319 // and tasks posted the other way should use |weak_this_|. | 323 // and tasks posted the other way should use |weak_this_|. |
320 base::WeakPtr<ExynosVideoDecodeAccelerator> weak_this_; | 324 base::WeakPtr<ExynosVideoDecodeAccelerator> weak_this_; |
321 | 325 |
322 // To expose client callbacks from VideoDecodeAccelerator. | 326 // To expose client callbacks from VideoDecodeAccelerator. |
323 // NOTE: all calls to these objects *MUST* be executed on | 327 // NOTE: all calls to these objects *MUST* be executed on |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
450 | 454 |
451 // The codec we'll be decoding for. | 455 // The codec we'll be decoding for. |
452 media::VideoCodecProfile video_profile_; | 456 media::VideoCodecProfile video_profile_; |
453 | 457 |
454 DISALLOW_COPY_AND_ASSIGN(ExynosVideoDecodeAccelerator); | 458 DISALLOW_COPY_AND_ASSIGN(ExynosVideoDecodeAccelerator); |
455 }; | 459 }; |
456 | 460 |
457 } // namespace content | 461 } // namespace content |
458 | 462 |
459 #endif // CONTENT_COMMON_GPU_MEDIA_EXYNOS_VIDEO_DECODE_ACCELERATOR_H_ | 463 #endif // CONTENT_COMMON_GPU_MEDIA_EXYNOS_VIDEO_DECODE_ACCELERATOR_H_ |
OLD | NEW |