| Index: media/gpu/android_video_decode_accelerator.h
|
| diff --git a/media/gpu/android_video_decode_accelerator.h b/media/gpu/android_video_decode_accelerator.h
|
| index 5d94987ba30ea82b4b3b4f974c80ee0a38559ac4..16cf8875a952fd09152e79a94fe288bb92921564 100644
|
| --- a/media/gpu/android_video_decode_accelerator.h
|
| +++ b/media/gpu/android_video_decode_accelerator.h
|
| @@ -23,6 +23,7 @@
|
| #include "media/base/android/sdk_media_codec_bridge.h"
|
| #include "media/base/media_keys.h"
|
| #include "media/gpu/avda_state_provider.h"
|
| +#include "media/gpu/avda_surface_tracker.h"
|
| #include "media/gpu/gpu_video_decode_accelerator_helpers.h"
|
| #include "media/gpu/media_gpu_export.h"
|
| #include "media/video/video_decode_accelerator.h"
|
| @@ -164,6 +165,9 @@ class MEDIA_GPU_EXPORT AndroidVideoDecodeAccelerator
|
| WAITING_FOR_CODEC,
|
| // Set when we have a codec, but it doesn't yet have a key.
|
| WAITING_FOR_KEY,
|
| + // The output surface was destroyed. We must not configure a new MediaCodec
|
| + // with the destroyed surface.
|
| + SURFACE_DESTROYED,
|
| };
|
|
|
| enum DrainType {
|
| @@ -318,6 +322,11 @@ class MEDIA_GPU_EXPORT AndroidVideoDecodeAccelerator
|
| // can be a null callback.
|
| void ResetCodecState(const base::Closure& done_cb);
|
|
|
| + // Registered to be called when surfaces are being destroyed. If |surface_id|
|
| + // is our surface, we should release the MediaCodec before returning from
|
| + // this.
|
| + void OnDestroyingSurface(int surface_id);
|
| +
|
| // Return true if and only if we should use deferred rendering.
|
| static bool UseDeferredRenderingStrategy(
|
| const gpu::GpuPreferences& gpu_preferences);
|
| @@ -416,6 +425,10 @@ class MEDIA_GPU_EXPORT AndroidVideoDecodeAccelerator
|
| // called NotifyInitializationComplete.
|
| bool deferred_initialization_pending_;
|
|
|
| + int surface_id_;
|
| +
|
| + OnDestroyingSurfaceCallback on_destroying_surface_cb_;
|
| +
|
| // WeakPtrFactory for posting tasks back to |this|.
|
| base::WeakPtrFactory<AndroidVideoDecodeAccelerator> weak_this_factory_;
|
|
|
|
|