| 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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 const OutputBufferMap& buffer_map) = 0; | 87 const OutputBufferMap& buffer_map) = 0; |
| 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 // Does not take ownership of |client| which must outlive |*this|. | 97 // media::VideoDecodeAccelerator implementation: |
| 98 bool Initialize(media::VideoCodecProfile profile, Client* client) override; | 98 bool Initialize(media::VideoCodecProfile profile, Client* client) override; |
| 99 void SetCdm(int cdm_id) override; |
| 99 void Decode(const media::BitstreamBuffer& bitstream_buffer) override; | 100 void Decode(const media::BitstreamBuffer& bitstream_buffer) override; |
| 100 void AssignPictureBuffers( | 101 void AssignPictureBuffers( |
| 101 const std::vector<media::PictureBuffer>& buffers) override; | 102 const std::vector<media::PictureBuffer>& buffers) override; |
| 102 void ReusePictureBuffer(int32 picture_buffer_id) override; | 103 void ReusePictureBuffer(int32 picture_buffer_id) override; |
| 103 void Flush() override; | 104 void Flush() override; |
| 104 void Reset() override; | 105 void Reset() override; |
| 105 void Destroy() override; | 106 void Destroy() override; |
| 106 bool CanDecodeOnIOThread() override; | 107 bool CanDecodeOnIOThread() override; |
| 107 | 108 |
| 108 // AndroidVideoDecodeStateProvider | 109 // AVDAStateProvider implementation: |
| 109 const gfx::Size& GetSize() const override; | 110 const gfx::Size& GetSize() const override; |
| 110 const base::ThreadChecker& ThreadChecker() const override; | 111 const base::ThreadChecker& ThreadChecker() const override; |
| 111 base::WeakPtr<gpu::gles2::GLES2Decoder> GetGlDecoder() const override; | 112 base::WeakPtr<gpu::gles2::GLES2Decoder> GetGlDecoder() const override; |
| 112 void PostError(const ::tracked_objects::Location& from_here, | 113 void PostError(const ::tracked_objects::Location& from_here, |
| 113 media::VideoDecodeAccelerator::Error error) override; | 114 media::VideoDecodeAccelerator::Error error) override; |
| 114 | 115 |
| 115 static media::VideoDecodeAccelerator::SupportedProfiles | 116 static media::VideoDecodeAccelerator::SupportedProfiles |
| 116 GetSupportedProfiles(); | 117 GetSupportedProfiles(); |
| 117 | 118 |
| 118 private: | 119 private: |
| (...skipping 20 matching lines...) Expand all Loading... |
| 139 void QueueInput(); | 140 void QueueInput(); |
| 140 | 141 |
| 141 // Dequeues output from |media_codec_| and feeds the decoded frame to the | 142 // Dequeues output from |media_codec_| and feeds the decoded frame to the |
| 142 // client. Returns a hint about whether calling again might produce | 143 // client. Returns a hint about whether calling again might produce |
| 143 // more output. | 144 // more output. |
| 144 bool DequeueOutput(); | 145 bool DequeueOutput(); |
| 145 | 146 |
| 146 // Requests picture buffers from the client. | 147 // Requests picture buffers from the client. |
| 147 void RequestPictureBuffers(); | 148 void RequestPictureBuffers(); |
| 148 | 149 |
| 150 // Notifies the client of the CDM setting result. |
| 151 void NotifyCdmAttached(bool success); |
| 152 |
| 149 // Notifies the client about the availability of a picture. | 153 // Notifies the client about the availability of a picture. |
| 150 void NotifyPictureReady(const media::Picture& picture); | 154 void NotifyPictureReady(const media::Picture& picture); |
| 151 | 155 |
| 152 // Notifies the client that the input buffer identifed by input_buffer_id has | 156 // Notifies the client that the input buffer identifed by input_buffer_id has |
| 153 // been processed. | 157 // been processed. |
| 154 void NotifyEndOfBitstreamBuffer(int input_buffer_id); | 158 void NotifyEndOfBitstreamBuffer(int input_buffer_id); |
| 155 | 159 |
| 156 // Notifies the client that the decoder was flushed. | 160 // Notifies the client that the decoder was flushed. |
| 157 void NotifyFlushDone(); | 161 void NotifyFlushDone(); |
| 158 | 162 |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 | 235 |
| 232 // WeakPtrFactory for posting tasks back to |this|. | 236 // WeakPtrFactory for posting tasks back to |this|. |
| 233 base::WeakPtrFactory<AndroidVideoDecodeAccelerator> weak_this_factory_; | 237 base::WeakPtrFactory<AndroidVideoDecodeAccelerator> weak_this_factory_; |
| 234 | 238 |
| 235 friend class AndroidVideoDecodeAcceleratorTest; | 239 friend class AndroidVideoDecodeAcceleratorTest; |
| 236 }; | 240 }; |
| 237 | 241 |
| 238 } // namespace content | 242 } // namespace content |
| 239 | 243 |
| 240 #endif // CONTENT_COMMON_GPU_MEDIA_ANDROID_VIDEO_DECODE_ACCELERATOR_H_ | 244 #endif // CONTENT_COMMON_GPU_MEDIA_ANDROID_VIDEO_DECODE_ACCELERATOR_H_ |
| OLD | NEW |