Chromium Code Reviews| 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 #ifndef MEDIA_GPU_IPC_CLIENT_GPU_VIDEO_DECODE_ACCELERATOR_HOST_H_ | 5 #ifndef MEDIA_GPU_IPC_CLIENT_GPU_VIDEO_DECODE_ACCELERATOR_HOST_H_ |
| 6 #define MEDIA_GPU_IPC_CLIENT_GPU_VIDEO_DECODE_ACCELERATOR_HOST_H_ | 6 #define MEDIA_GPU_IPC_CLIENT_GPU_VIDEO_DECODE_ACCELERATOR_HOST_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 29 matching lines...) Expand all Loading... | |
| 40 | 40 |
| 41 // VideoDecodeAccelerator implementation. | 41 // VideoDecodeAccelerator implementation. |
| 42 bool Initialize(const Config& config, Client* client) override; | 42 bool Initialize(const Config& config, Client* client) override; |
| 43 void SetCdm(int cdm_id) override; | 43 void SetCdm(int cdm_id) override; |
| 44 void Decode(const BitstreamBuffer& bitstream_buffer) override; | 44 void Decode(const BitstreamBuffer& bitstream_buffer) override; |
| 45 void AssignPictureBuffers(const std::vector<PictureBuffer>& buffers) override; | 45 void AssignPictureBuffers(const std::vector<PictureBuffer>& buffers) override; |
| 46 void ReusePictureBuffer(int32_t picture_buffer_id) override; | 46 void ReusePictureBuffer(int32_t picture_buffer_id) override; |
| 47 void Flush() override; | 47 void Flush() override; |
| 48 void Reset() override; | 48 void Reset() override; |
| 49 void Destroy() override; | 49 void Destroy() override; |
| 50 VideoPixelFormat GetOutputFormat() const override; | |
| 50 | 51 |
| 51 // gpu::CommandBufferProxyImpl::DeletionObserver implemetnation. | 52 // gpu::CommandBufferProxyImpl::DeletionObserver implemetnation. |
| 52 void OnWillDeleteImpl() override; | 53 void OnWillDeleteImpl() override; |
| 53 | 54 |
| 54 private: | 55 private: |
| 55 // Only Destroy() should be deleting |this|. | 56 // Only Destroy() should be deleting |this|. |
| 56 ~GpuVideoDecodeAcceleratorHost() override; | 57 ~GpuVideoDecodeAcceleratorHost() override; |
| 57 | 58 |
| 58 // Notify |client_| of an error. Posts a task to avoid re-entrancy. | 59 // Notify |client_| of an error. Posts a task to avoid re-entrancy. |
| 59 void PostNotifyError(Error); | 60 void PostNotifyError(Error); |
| 60 | 61 |
| 61 void Send(IPC::Message* message); | 62 void Send(IPC::Message* message); |
| 62 | 63 |
| 63 // IPC handlers, proxying VideoDecodeAccelerator::Client for the GPU | 64 // IPC handlers, proxying VideoDecodeAccelerator::Client for the GPU |
| 64 // process. Should not be called directly. | 65 // process. Should not be called directly. |
| 65 void OnInitializationComplete(bool success); | 66 void OnInitializationComplete(bool success); |
| 66 void OnBitstreamBufferProcessed(int32_t bitstream_buffer_id); | 67 void OnBitstreamBufferProcessed(int32_t bitstream_buffer_id); |
| 67 void OnProvidePictureBuffer(uint32_t num_requested_buffers, | 68 void OnProvidePictureBuffer(VideoPixelFormat format, |
| 69 uint32_t num_requested_buffers, | |
| 68 uint32_t textures_per_buffer, | 70 uint32_t textures_per_buffer, |
| 69 const gfx::Size& dimensions, | 71 const gfx::Size& dimensions, |
| 70 uint32_t texture_target); | 72 uint32_t texture_target); |
| 71 void OnDismissPictureBuffer(int32_t picture_buffer_id); | 73 void OnDismissPictureBuffer(int32_t picture_buffer_id); |
| 72 void OnPictureReady(int32_t picture_buffer_id, | 74 void OnPictureReady(int32_t picture_buffer_id, |
| 73 int32_t bitstream_buffer_id, | 75 int32_t bitstream_buffer_id, |
| 74 const gfx::Rect& visible_rect, | 76 const gfx::Rect& visible_rect, |
| 75 bool allow_overlay, | 77 bool allow_overlay, |
| 76 bool size_changed); | 78 bool size_changed); |
| 77 void OnFlushDone(); | 79 void OnFlushDone(); |
| 78 void OnResetDone(); | 80 void OnResetDone(); |
| 79 void OnNotifyError(uint32_t error); | 81 void OnNotifyError(uint32_t error); |
| 80 | 82 |
| 81 scoped_refptr<gpu::GpuChannelHost> channel_; | 83 scoped_refptr<gpu::GpuChannelHost> channel_; |
| 82 | 84 |
| 83 // Route ID for the associated decoder in the GPU process. | 85 // Route ID for the associated decoder in the GPU process. |
| 84 int32_t decoder_route_id_; | 86 int32_t decoder_route_id_; |
| 85 | 87 |
| 86 // The client that will receive callbacks from the decoder. | 88 // The client that will receive callbacks from the decoder. |
| 87 Client* client_; | 89 Client* client_; |
| 88 | 90 |
| 89 // Unowned reference to the gpu::CommandBufferProxyImpl that created us. | 91 // Unowned reference to the gpu::CommandBufferProxyImpl that created us. |
| 90 // |this| registers as a DeletionObserver of |impl_|, the so reference is | 92 // |this| registers as a DeletionObserver of |impl_|, the so reference is |
| 91 // always valid as long as it is not NULL. | 93 // always valid as long as it is not NULL. |
| 92 gpu::CommandBufferProxyImpl* impl_; | 94 gpu::CommandBufferProxyImpl* impl_; |
| 93 | 95 |
| 94 // Requested dimensions of the buffer, from ProvidePictureBuffers(). | 96 // Requested dimensions of the buffer, from ProvidePictureBuffers(). |
| 95 gfx::Size picture_buffer_dimensions_; | 97 gfx::Size picture_buffer_dimensions_; |
| 96 | 98 |
| 99 VideoPixelFormat picture_buffer_format_; | |
|
miu
2016/05/12 20:03:02
This should have default initialization (PIXEL_FOR
| |
| 100 | |
| 97 // WeakPtr factory for posting tasks back to itself. | 101 // WeakPtr factory for posting tasks back to itself. |
| 98 base::WeakPtrFactory<GpuVideoDecodeAcceleratorHost> weak_this_factory_; | 102 base::WeakPtrFactory<GpuVideoDecodeAcceleratorHost> weak_this_factory_; |
| 99 | 103 |
| 100 DISALLOW_COPY_AND_ASSIGN(GpuVideoDecodeAcceleratorHost); | 104 DISALLOW_COPY_AND_ASSIGN(GpuVideoDecodeAcceleratorHost); |
| 101 }; | 105 }; |
| 102 | 106 |
| 103 } // namespace media | 107 } // namespace media |
| 104 | 108 |
| 105 #endif // MEDIA_GPU_IPC_CLIENT_GPU_VIDEO_DECODE_ACCELERATOR_HOST_H_ | 109 #endif // MEDIA_GPU_IPC_CLIENT_GPU_VIDEO_DECODE_ACCELERATOR_HOST_H_ |
| OLD | NEW |