| Index: content/common/gpu/media/android_video_decode_accelerator.h
|
| diff --git a/content/common/gpu/media/android_video_decode_accelerator.h b/content/common/gpu/media/android_video_decode_accelerator.h
|
| index dec3efcbe72adf12ce8003c884fb6aaf9e42a90d..c8cc04ded950ce104444c915496233d19a70c917 100644
|
| --- a/content/common/gpu/media/android_video_decode_accelerator.h
|
| +++ b/content/common/gpu/media/android_video_decode_accelerator.h
|
| @@ -19,6 +19,7 @@
|
| #include "base/timer/timer.h"
|
| #include "content/common/content_export.h"
|
| #include "content/common/gpu/media/avda_state_provider.h"
|
| +#include "content/common/gpu/media/avda_surface_tracker.h"
|
| #include "content/common/gpu/media/gpu_video_decode_accelerator_helpers.h"
|
| #include "gpu/command_buffer/service/gles2_cmd_decoder.h"
|
| #include "gpu/command_buffer/service/gpu_preferences.h"
|
| @@ -164,6 +165,9 @@ class CONTENT_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 CONTENT_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 CONTENT_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_;
|
|
|
|
|