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_FILTERS_GPU_VIDEO_DECODER_H_ | 5 #ifndef MEDIA_FILTERS_GPU_VIDEO_DECODER_H_ |
6 #define MEDIA_FILTERS_GPU_VIDEO_DECODER_H_ | 6 #define MEDIA_FILTERS_GPU_VIDEO_DECODER_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 const RequestSurfaceCB& request_surface_cb, | 51 const RequestSurfaceCB& request_surface_cb, |
52 scoped_refptr<MediaLog> media_log); | 52 scoped_refptr<MediaLog> media_log); |
53 | 53 |
54 // VideoDecoder implementation. | 54 // VideoDecoder implementation. |
55 std::string GetDisplayName() const override; | 55 std::string GetDisplayName() const override; |
56 void Initialize(const VideoDecoderConfig& config, | 56 void Initialize(const VideoDecoderConfig& config, |
57 bool low_delay, | 57 bool low_delay, |
58 CdmContext* cdm_context, | 58 CdmContext* cdm_context, |
59 const InitCB& init_cb, | 59 const InitCB& init_cb, |
60 const OutputCB& output_cb) override; | 60 const OutputCB& output_cb) override; |
61 void CompleteInitialization(int cdm_id, int surface_id); | |
62 void Decode(const scoped_refptr<DecoderBuffer>& buffer, | 61 void Decode(const scoped_refptr<DecoderBuffer>& buffer, |
63 const DecodeCB& decode_cb) override; | 62 const DecodeCB& decode_cb) override; |
64 void Reset(const base::Closure& closure) override; | 63 void Reset(const base::Closure& closure) override; |
65 bool NeedsBitstreamConversion() const override; | 64 bool NeedsBitstreamConversion() const override; |
66 bool CanReadWithoutStalling() const override; | 65 bool CanReadWithoutStalling() const override; |
67 int GetMaxDecodeRequests() const override; | 66 int GetMaxDecodeRequests() const override; |
68 | 67 |
69 // VideoDecodeAccelerator::Client implementation. | 68 // VideoDecodeAccelerator::Client implementation. |
70 void NotifyInitializationComplete(bool success) override; | 69 void NotifyInitializationComplete(bool success) override; |
71 void ProvidePictureBuffers(uint32_t count, | 70 void ProvidePictureBuffers(uint32_t count, |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 // |profile|, |coded_size|, and |is_encrypted|. | 148 // |profile|, |coded_size|, and |is_encrypted|. |
150 bool IsProfileSupported( | 149 bool IsProfileSupported( |
151 const VideoDecodeAccelerator::Capabilities& capabilities, | 150 const VideoDecodeAccelerator::Capabilities& capabilities, |
152 VideoCodecProfile profile, | 151 VideoCodecProfile profile, |
153 const gfx::Size& coded_size, | 152 const gfx::Size& coded_size, |
154 bool is_encrypted); | 153 bool is_encrypted); |
155 | 154 |
156 // Assert the contract that this class is operated on the right thread. | 155 // Assert the contract that this class is operated on the right thread. |
157 void DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent() const; | 156 void DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent() const; |
158 | 157 |
| 158 // Provided to the |request_surface_cb_| callback given during construction; |
| 159 // sets or changes the output surface. |
| 160 void OnSurfaceAvailable(int surface_id); |
| 161 |
| 162 // If the VDA supports external surfaces, we must wait for the surface before |
| 163 // completing initialization. This will be called by OnSurfaceAvailable() once |
| 164 // the surface is known or immediately by Initialize() if external surfaces |
| 165 // are unsupported. |
| 166 void CompleteInitialization(); |
| 167 |
159 bool needs_bitstream_conversion_; | 168 bool needs_bitstream_conversion_; |
160 | 169 |
161 GpuVideoAcceleratorFactories* factories_; | 170 GpuVideoAcceleratorFactories* factories_; |
162 | 171 |
163 // For requesting a suface to render to. If this is null the VDA will return | 172 // For requesting a suface to render to. If this is null the VDA will return |
164 // normal video frames and not render them to a surface. | 173 // normal video frames and not render them to a surface. |
165 RequestSurfaceCB request_surface_cb_; | 174 RequestSurfaceCB request_surface_cb_; |
166 | 175 |
167 scoped_refptr<MediaLog> media_log_; | 176 scoped_refptr<MediaLog> media_log_; |
168 | 177 |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 bool needs_all_picture_buffers_to_decode_; | 245 bool needs_all_picture_buffers_to_decode_; |
237 | 246 |
238 // If true, then the VDA supports deferred initialization via | 247 // If true, then the VDA supports deferred initialization via |
239 // NotifyInitializationComplete. Otherwise, it will return initialization | 248 // NotifyInitializationComplete. Otherwise, it will return initialization |
240 // status synchronously from VDA::Initialize. | 249 // status synchronously from VDA::Initialize. |
241 bool supports_deferred_initialization_; | 250 bool supports_deferred_initialization_; |
242 | 251 |
243 // This flag translates to COPY_REQUIRED flag for each frame. | 252 // This flag translates to COPY_REQUIRED flag for each frame. |
244 bool requires_texture_copy_; | 253 bool requires_texture_copy_; |
245 | 254 |
| 255 // Set during Initialize(); given to the VDA for purposes for handling |
| 256 // encrypted content. |
| 257 int cdm_id_; |
| 258 |
246 // Bound to factories_->GetMessageLoop(). | 259 // Bound to factories_->GetMessageLoop(). |
247 // NOTE: Weak pointers must be invalidated before all other member variables. | 260 // NOTE: Weak pointers must be invalidated before all other member variables. |
248 base::WeakPtrFactory<GpuVideoDecoder> weak_factory_; | 261 base::WeakPtrFactory<GpuVideoDecoder> weak_factory_; |
249 | 262 |
250 DISALLOW_COPY_AND_ASSIGN(GpuVideoDecoder); | 263 DISALLOW_COPY_AND_ASSIGN(GpuVideoDecoder); |
251 }; | 264 }; |
252 | 265 |
253 } // namespace media | 266 } // namespace media |
254 | 267 |
255 #endif // MEDIA_FILTERS_GPU_VIDEO_DECODER_H_ | 268 #endif // MEDIA_FILTERS_GPU_VIDEO_DECODER_H_ |
OLD | NEW |