| 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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 // to NO_ERROR or ERROR depending on success. | 87 // to NO_ERROR or ERROR depending on success. |
| 88 WAITING_FOR_CODEC, | 88 WAITING_FOR_CODEC, |
| 89 // Set when we have a codec, but it doesn't yet have a key. | 89 // Set when we have a codec, but it doesn't yet have a key. |
| 90 WAITING_FOR_KEY, | 90 WAITING_FOR_KEY, |
| 91 // The output surface was destroyed. We must not configure a new MediaCodec | 91 // The output surface was destroyed. We must not configure a new MediaCodec |
| 92 // with the destroyed surface. | 92 // with the destroyed surface. |
| 93 SURFACE_DESTROYED, | 93 SURFACE_DESTROYED, |
| 94 }; | 94 }; |
| 95 | 95 |
| 96 enum DrainType { | 96 enum DrainType { |
| 97 DRAIN_TYPE_NONE, | |
| 98 DRAIN_FOR_FLUSH, | 97 DRAIN_FOR_FLUSH, |
| 99 DRAIN_FOR_RESET, | 98 DRAIN_FOR_RESET, |
| 100 DRAIN_FOR_DESTROY, | 99 DRAIN_FOR_DESTROY, |
| 101 }; | 100 }; |
| 102 | 101 |
| 103 // Initialize of the picture buffer manager. This is to be called when the | 102 // Initialize of the picture buffer manager. This is to be called when the |
| 104 // SurfaceView in |surface_id_|, if any, is no longer busy. It will return | 103 // SurfaceView in |surface_id_|, if any, is no longer busy. It will return |
| 105 // false on failure, and true if initialization was successful. This includes | 104 // false on failure, and true if initialization was successful. This includes |
| 106 // synchronous and asynchronous init; the AVDA might not yet have a codec on | 105 // synchronous and asynchronous init; the AVDA might not yet have a codec on |
| 107 // success, but async init will at least be in progress. | 106 // success, but async init will at least be in progress. |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 | 274 |
| 276 // Keeps track of bitstream ids notified to the client with | 275 // Keeps track of bitstream ids notified to the client with |
| 277 // NotifyEndOfBitstreamBuffer() before getting output from the bitstream. | 276 // NotifyEndOfBitstreamBuffer() before getting output from the bitstream. |
| 278 std::list<int32_t> bitstreams_notified_in_advance_; | 277 std::list<int32_t> bitstreams_notified_in_advance_; |
| 279 | 278 |
| 280 AVDAPictureBufferManager picture_buffer_manager_; | 279 AVDAPictureBufferManager picture_buffer_manager_; |
| 281 | 280 |
| 282 // Time at which we last did useful work on io_timer_. | 281 // Time at which we last did useful work on io_timer_. |
| 283 base::TimeTicks most_recent_work_; | 282 base::TimeTicks most_recent_work_; |
| 284 | 283 |
| 285 // Type of a drain request. We need to distinguish between DRAIN_FOR_FLUSH | 284 // The ongoing drain operation, if any. |
| 286 // and other types, see IsDrainingForResetOrDestroy(). | 285 base::Optional<DrainType> drain_type_; |
| 287 DrainType drain_type_; | |
| 288 | 286 |
| 289 // Holds a ref-count to the CDM to avoid using the CDM after it's destroyed. | 287 // Holds a ref-count to the CDM to avoid using the CDM after it's destroyed. |
| 290 scoped_refptr<MediaKeys> cdm_for_reference_holding_only_; | 288 scoped_refptr<MediaKeys> cdm_for_reference_holding_only_; |
| 291 | 289 |
| 292 MediaDrmBridgeCdmContext* media_drm_bridge_cdm_context_; | 290 MediaDrmBridgeCdmContext* media_drm_bridge_cdm_context_; |
| 293 | 291 |
| 294 // MediaDrmBridge requires registration/unregistration of the player, this | 292 // MediaDrmBridge requires registration/unregistration of the player, this |
| 295 // registration id is used for this. | 293 // registration id is used for this. |
| 296 int cdm_registration_id_; | 294 int cdm_registration_id_; |
| 297 | 295 |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 330 | 328 |
| 331 // WeakPtrFactory for posting tasks back to |this|. | 329 // WeakPtrFactory for posting tasks back to |this|. |
| 332 base::WeakPtrFactory<AndroidVideoDecodeAccelerator> weak_this_factory_; | 330 base::WeakPtrFactory<AndroidVideoDecodeAccelerator> weak_this_factory_; |
| 333 | 331 |
| 334 friend class AndroidVideoDecodeAcceleratorTest; | 332 friend class AndroidVideoDecodeAcceleratorTest; |
| 335 }; | 333 }; |
| 336 | 334 |
| 337 } // namespace media | 335 } // namespace media |
| 338 | 336 |
| 339 #endif // MEDIA_GPU_ANDROID_VIDEO_DECODE_ACCELERATOR_H_ | 337 #endif // MEDIA_GPU_ANDROID_VIDEO_DECODE_ACCELERATOR_H_ |
| OLD | NEW |