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 MEDIA_GPU_ANDROID_VIDEO_DECODE_ACCELERATOR_H_ | 5 #ifndef MEDIA_GPU_ANDROID_VIDEO_DECODE_ACCELERATOR_H_ |
6 #define MEDIA_GPU_ANDROID_VIDEO_DECODE_ACCELERATOR_H_ | 6 #define MEDIA_GPU_ANDROID_VIDEO_DECODE_ACCELERATOR_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <list> | 10 #include <list> |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
203 gfx::Size initial_expected_coded_size_; | 203 gfx::Size initial_expected_coded_size_; |
204 | 204 |
205 protected: | 205 protected: |
206 friend class base::RefCountedThreadSafe<CodecConfig>; | 206 friend class base::RefCountedThreadSafe<CodecConfig>; |
207 virtual ~CodecConfig(); | 207 virtual ~CodecConfig(); |
208 | 208 |
209 private: | 209 private: |
210 DISALLOW_COPY_AND_ASSIGN(CodecConfig); | 210 DISALLOW_COPY_AND_ASSIGN(CodecConfig); |
211 }; | 211 }; |
212 | 212 |
213 // Callback that is called when the SurfaceView becomes available, if it's | |
214 // not during Initialize. |success| is true if it is now available, false | |
215 // if initialization should stop. | |
216 void OnSurfaceAvailable(bool success); | |
217 | |
218 // Finish initialization of the strategy. This is to be called when the | |
219 // SurfaceView in |surface_id_|, if any, is no longer busy. It will return | |
220 // false on failure, and true if initialization was successful. This includes | |
221 // synchronous and asynchronous init; the AVDA might not yet have a codec on | |
222 // success, but async init will at least be in progress. | |
223 bool InitializeStrategy(); | |
watk
2016/05/18 20:38:18
Header order doesn't match cc order
liberato (no reviews please)
2016/05/18 21:13:13
not sure that i follow -- OnSurfaceAvailable prece
watk
2016/05/18 21:21:14
Sorry, I just noticed that InitializeStrategy is f
| |
224 | |
213 // A part of destruction process that is sometimes postponed after the drain. | 225 // A part of destruction process that is sometimes postponed after the drain. |
214 void ActualDestroy(); | 226 void ActualDestroy(); |
215 | 227 |
216 // Configures |media_codec_| with the given codec parameters from the client. | 228 // Configures |media_codec_| with the given codec parameters from the client. |
217 // This configuration will (probably) not be complete before this call | 229 // This configuration will (probably) not be complete before this call |
218 // returns. Multiple calls before completion will be ignored. |state_| | 230 // returns. Multiple calls before completion will be ignored. |state_| |
219 // must be NO_ERROR or WAITING_FOR_CODEC. Note that, once you call this, | 231 // must be NO_ERROR or WAITING_FOR_CODEC. Note that, once you call this, |
220 // you should be careful to avoid modifying members of |codec_config_| until | 232 // you should be careful to avoid modifying members of |codec_config_| until |
221 // |state_| is no longer WAITING_FOR_CODEC. | 233 // |state_| is no longer WAITING_FOR_CODEC. |
222 void ConfigureMediaCodecAsynchronously(); | 234 void ConfigureMediaCodecAsynchronously(); |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
256 bool DequeueOutput(); | 268 bool DequeueOutput(); |
257 | 269 |
258 // Requests picture buffers from the client. | 270 // Requests picture buffers from the client. |
259 void RequestPictureBuffers(); | 271 void RequestPictureBuffers(); |
260 | 272 |
261 // Decode the content in the |bitstream_buffer|. Note that a | 273 // Decode the content in the |bitstream_buffer|. Note that a |
262 // |bitstream_buffer| of id as -1 indicates a flush command. | 274 // |bitstream_buffer| of id as -1 indicates a flush command. |
263 void DecodeBuffer(const media::BitstreamBuffer& bitstream_buffer); | 275 void DecodeBuffer(const media::BitstreamBuffer& bitstream_buffer); |
264 | 276 |
265 // Called during Initialize() for encrypted streams to set up the CDM. | 277 // Called during Initialize() for encrypted streams to set up the CDM. |
266 void InitializeCdm(int cdm_id); | 278 void InitializeCdm(); |
267 | 279 |
268 // Called after the CDM obtains a MediaCrypto object. | 280 // Called after the CDM obtains a MediaCrypto object. |
269 void OnMediaCryptoReady( | 281 void OnMediaCryptoReady( |
270 media::MediaDrmBridgeCdmContext::JavaObjectPtr media_crypto, | 282 media::MediaDrmBridgeCdmContext::JavaObjectPtr media_crypto, |
271 bool needs_protected_surface); | 283 bool needs_protected_surface); |
272 | 284 |
273 // Called when a new key is added to the CDM. | 285 // Called when a new key is added to the CDM. |
274 void OnKeyAdded(); | 286 void OnKeyAdded(); |
275 | 287 |
276 // Notifies the client of the result of deferred initialization. | 288 // Notifies the client of the result of deferred initialization. |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
418 // from being sent after a reset. | 430 // from being sent after a reset. |
419 int error_sequence_token_; | 431 int error_sequence_token_; |
420 | 432 |
421 // PostError will defer sending an error if and only if this is true. | 433 // PostError will defer sending an error if and only if this is true. |
422 bool defer_errors_; | 434 bool defer_errors_; |
423 | 435 |
424 // True if and only if VDA initialization is deferred, and we have not yet | 436 // True if and only if VDA initialization is deferred, and we have not yet |
425 // called NotifyInitializationComplete. | 437 // called NotifyInitializationComplete. |
426 bool deferred_initialization_pending_; | 438 bool deferred_initialization_pending_; |
427 | 439 |
440 // Cdm id that we will use in InitializeCdm(). | |
441 int cdm_id_; | |
442 | |
428 int surface_id_; | 443 int surface_id_; |
429 | 444 |
430 OnDestroyingSurfaceCallback on_destroying_surface_cb_; | 445 OnDestroyingSurfaceCallback on_destroying_surface_cb_; |
431 | 446 |
432 // WeakPtrFactory for posting tasks back to |this|. | 447 // WeakPtrFactory for posting tasks back to |this|. |
433 base::WeakPtrFactory<AndroidVideoDecodeAccelerator> weak_this_factory_; | 448 base::WeakPtrFactory<AndroidVideoDecodeAccelerator> weak_this_factory_; |
434 | 449 |
435 friend class AndroidVideoDecodeAcceleratorTest; | 450 friend class AndroidVideoDecodeAcceleratorTest; |
436 }; | 451 }; |
437 | 452 |
438 } // namespace media | 453 } // namespace media |
439 | 454 |
440 #endif // MEDIA_GPU_ANDROID_VIDEO_DECODE_ACCELERATOR_H_ | 455 #endif // MEDIA_GPU_ANDROID_VIDEO_DECODE_ACCELERATOR_H_ |
OLD | NEW |