| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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_COMMON_GPU_MEDIA_ANDROID_VIDEO_DECODE_ACCELERATOR_H_ | 5 #ifndef CONTENT_COMMON_GPU_MEDIA_ANDROID_VIDEO_DECODE_ACCELERATOR_H_ |
| 6 #define CONTENT_COMMON_GPU_MEDIA_ANDROID_VIDEO_DECODE_ACCELERATOR_H_ | 6 #define CONTENT_COMMON_GPU_MEDIA_ANDROID_VIDEO_DECODE_ACCELERATOR_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <queue> | 10 #include <queue> |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 }; | 88 }; |
| 89 | 89 |
| 90 AndroidVideoDecodeAccelerator( | 90 AndroidVideoDecodeAccelerator( |
| 91 const base::WeakPtr<gpu::gles2::GLES2Decoder> decoder, | 91 const base::WeakPtr<gpu::gles2::GLES2Decoder> decoder, |
| 92 const base::Callback<bool(void)>& make_context_current, | 92 const base::Callback<bool(void)>& make_context_current, |
| 93 scoped_ptr<BackingStrategy> strategy); | 93 scoped_ptr<BackingStrategy> strategy); |
| 94 | 94 |
| 95 ~AndroidVideoDecodeAccelerator() override; | 95 ~AndroidVideoDecodeAccelerator() override; |
| 96 | 96 |
| 97 // media::VideoDecodeAccelerator implementation: | 97 // media::VideoDecodeAccelerator implementation: |
| 98 bool Initialize(media::VideoCodecProfile profile, Client* client) override; | 98 bool Initialize(const Config& config, Client* client) override; |
| 99 void SetCdm(int cdm_id) override; | 99 void SetCdm(int cdm_id) override; |
| 100 void Decode(const media::BitstreamBuffer& bitstream_buffer) override; | 100 void Decode(const media::BitstreamBuffer& bitstream_buffer) override; |
| 101 void AssignPictureBuffers( | 101 void AssignPictureBuffers( |
| 102 const std::vector<media::PictureBuffer>& buffers) override; | 102 const std::vector<media::PictureBuffer>& buffers) override; |
| 103 void ReusePictureBuffer(int32 picture_buffer_id) override; | 103 void ReusePictureBuffer(int32 picture_buffer_id) override; |
| 104 void Flush() override; | 104 void Flush() override; |
| 105 void Reset() override; | 105 void Reset() override; |
| 106 void Destroy() override; | 106 void Destroy() override; |
| 107 bool CanDecodeOnIOThread() override; | 107 bool CanDecodeOnIOThread() override; |
| 108 | 108 |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 | 171 |
| 172 // To expose client callbacks from VideoDecodeAccelerator. | 172 // To expose client callbacks from VideoDecodeAccelerator. |
| 173 Client* client_; | 173 Client* client_; |
| 174 | 174 |
| 175 // Callback to set the correct gl context. | 175 // Callback to set the correct gl context. |
| 176 base::Callback<bool(void)> make_context_current_; | 176 base::Callback<bool(void)> make_context_current_; |
| 177 | 177 |
| 178 // Codec type. Used when we configure media codec. | 178 // Codec type. Used when we configure media codec. |
| 179 media::VideoCodec codec_; | 179 media::VideoCodec codec_; |
| 180 | 180 |
| 181 // Whether the stream is encrypted. |
| 182 bool is_encrypted_; |
| 183 |
| 181 // The current state of this class. For now, this is used only for setting | 184 // The current state of this class. For now, this is used only for setting |
| 182 // error state. | 185 // error state. |
| 183 State state_; | 186 State state_; |
| 184 | 187 |
| 185 // This map maintains the picture buffers passed to the client for decoding. | 188 // This map maintains the picture buffers passed to the client for decoding. |
| 186 // The key is the picture buffer id. | 189 // The key is the picture buffer id. |
| 187 OutputBufferMap output_picture_buffers_; | 190 OutputBufferMap output_picture_buffers_; |
| 188 | 191 |
| 189 // This keeps the free picture buffer ids which can be used for sending | 192 // This keeps the free picture buffer ids which can be used for sending |
| 190 // decoded frames to the client. | 193 // decoded frames to the client. |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 | 238 |
| 236 // WeakPtrFactory for posting tasks back to |this|. | 239 // WeakPtrFactory for posting tasks back to |this|. |
| 237 base::WeakPtrFactory<AndroidVideoDecodeAccelerator> weak_this_factory_; | 240 base::WeakPtrFactory<AndroidVideoDecodeAccelerator> weak_this_factory_; |
| 238 | 241 |
| 239 friend class AndroidVideoDecodeAcceleratorTest; | 242 friend class AndroidVideoDecodeAcceleratorTest; |
| 240 }; | 243 }; |
| 241 | 244 |
| 242 } // namespace content | 245 } // namespace content |
| 243 | 246 |
| 244 #endif // CONTENT_COMMON_GPU_MEDIA_ANDROID_VIDEO_DECODE_ACCELERATOR_H_ | 247 #endif // CONTENT_COMMON_GPU_MEDIA_ANDROID_VIDEO_DECODE_ACCELERATOR_H_ |
| OLD | NEW |