Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(549)

Unified Diff: media/gpu/android_video_decode_accelerator.h

Issue 2629223003: media: Ensure MediaCodecs are released before attached SurfaceTextures (Closed)
Patch Set: more comments Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 74d1b27a29f9f51701bbb5ba105394e9698f2e6e..172d2dce489ad1ab1fc81688fe1e37d8c3e76b06 100644
--- a/media/gpu/android_video_decode_accelerator.h
+++ b/media/gpu/android_video_decode_accelerator.h
@@ -28,6 +28,7 @@
#include "media/gpu/media_gpu_export.h"
#include "media/video/video_decode_accelerator.h"
#include "ui/gl/android/scoped_java_surface.h"
+#include "ui/gl/android/surface_texture.h"
namespace media {
class SharedMemoryRegion;
@@ -215,6 +216,10 @@ class MEDIA_GPU_EXPORT AndroidVideoDecodeAccelerator
// error if the surface change fails. Returns false on failure.
bool UpdateSurface();
+ // Release |media_codec_| if it's not null, and notify
+ // |picture_buffer_manager_|.
+ void ReleaseCodec();
+
// Used to DCHECK that we are called on the correct thread.
base::ThreadChecker thread_checker_;
@@ -322,6 +327,10 @@ class MEDIA_GPU_EXPORT AndroidVideoDecodeAccelerator
// pictures have been rendered in DequeueOutput().
base::Optional<int32_t> pending_surface_id_;
+ // The task type used for the last codec release. For posting SurfaceTexture
+ // release to the same thread.
+ TaskType last_release_task_type_;
+
// Copy of the VDA::Config we were given.
Config config_;
« no previous file with comments | « no previous file | media/gpu/android_video_decode_accelerator.cc » ('j') | media/gpu/android_video_decode_accelerator.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698