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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 // happens when we're starting up or re-configuring mid-stream. Any | 82 // happens when we're starting up or re-configuring mid-stream. Any |
83 // previously provided codec should no longer be referenced. | 83 // previously provided codec should no longer be referenced. |
84 // For convenience, a container of PictureBuffers is provided in case | 84 // For convenience, a container of PictureBuffers is provided in case |
85 // per-image cleanup is needed. | 85 // per-image cleanup is needed. |
86 virtual void CodecChanged(media::VideoCodecBridge* codec, | 86 virtual void CodecChanged(media::VideoCodecBridge* codec, |
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); | |
94 | 93 |
95 ~AndroidVideoDecodeAccelerator() override; | 94 ~AndroidVideoDecodeAccelerator() override; |
96 | 95 |
97 // media::VideoDecodeAccelerator implementation: | 96 // media::VideoDecodeAccelerator implementation: |
98 bool Initialize(media::VideoCodecProfile profile, Client* client) override; | 97 bool Initialize(media::VideoCodecProfile profile, Client* client) override; |
99 void SetCdm(int cdm_id) override; | 98 void SetCdm(int cdm_id) override; |
100 void Decode(const media::BitstreamBuffer& bitstream_buffer) override; | 99 void Decode(const media::BitstreamBuffer& bitstream_buffer) override; |
101 void AssignPictureBuffers( | 100 void AssignPictureBuffers( |
102 const std::vector<media::PictureBuffer>& buffers) override; | 101 const std::vector<media::PictureBuffer>& buffers) override; |
103 void ReusePictureBuffer(int32 picture_buffer_id) override; | 102 void ReusePictureBuffer(int32 picture_buffer_id) override; |
104 void Flush() override; | 103 void Flush() override; |
105 void Reset() override; | 104 void Reset() override; |
106 void Destroy() override; | 105 void Destroy() override; |
107 bool CanDecodeOnIOThread() override; | 106 bool CanDecodeOnIOThread() override; |
108 | 107 |
109 // AVDAStateProvider implementation: | 108 // AVDAStateProvider implementation: |
110 const gfx::Size& GetSize() const override; | 109 const gfx::Size& GetSize() const override; |
111 const base::ThreadChecker& ThreadChecker() const override; | 110 const base::ThreadChecker& ThreadChecker() const override; |
112 base::WeakPtr<gpu::gles2::GLES2Decoder> GetGlDecoder() const override; | 111 base::WeakPtr<gpu::gles2::GLES2Decoder> GetGlDecoder() const override; |
113 void PostError(const ::tracked_objects::Location& from_here, | 112 void PostError(const ::tracked_objects::Location& from_here, |
114 media::VideoDecodeAccelerator::Error error) override; | 113 media::VideoDecodeAccelerator::Error error) override; |
115 | 114 |
116 static media::VideoDecodeAccelerator::SupportedProfiles | 115 static media::VideoDecodeAccelerator::Capabilities GetCapabilities(); |
117 GetSupportedProfiles(); | |
118 | 116 |
119 private: | 117 private: |
120 enum State { | 118 enum State { |
121 NO_ERROR, | 119 NO_ERROR, |
122 ERROR, | 120 ERROR, |
123 }; | 121 }; |
124 | 122 |
125 static const base::TimeDelta kDecodePollDelay; | 123 static const base::TimeDelta kDecodePollDelay; |
126 | 124 |
127 // Configures |media_codec_| with the given codec parameters from the client. | 125 // Configures |media_codec_| with the given codec parameters from the client. |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 | 233 |
236 // WeakPtrFactory for posting tasks back to |this|. | 234 // WeakPtrFactory for posting tasks back to |this|. |
237 base::WeakPtrFactory<AndroidVideoDecodeAccelerator> weak_this_factory_; | 235 base::WeakPtrFactory<AndroidVideoDecodeAccelerator> weak_this_factory_; |
238 | 236 |
239 friend class AndroidVideoDecodeAcceleratorTest; | 237 friend class AndroidVideoDecodeAcceleratorTest; |
240 }; | 238 }; |
241 | 239 |
242 } // namespace content | 240 } // namespace content |
243 | 241 |
244 #endif // CONTENT_COMMON_GPU_MEDIA_ANDROID_VIDEO_DECODE_ACCELERATOR_H_ | 242 #endif // CONTENT_COMMON_GPU_MEDIA_ANDROID_VIDEO_DECODE_ACCELERATOR_H_ |
OLD | NEW |