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

Unified Diff: media/gpu/avda_codec_allocator.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/avda_codec_allocator.h
diff --git a/media/gpu/avda_codec_allocator.h b/media/gpu/avda_codec_allocator.h
index 180a91acb1e4fd762c772be808def655420f64e8..8cfb4b0f1b42181d511408e79bea6b81ee78f492 100644
--- a/media/gpu/avda_codec_allocator.h
+++ b/media/gpu/avda_codec_allocator.h
@@ -54,6 +54,10 @@ class CodecConfig : public base::RefCountedThreadSafe<CodecConfig> {
gl::ScopedJavaSurface surface;
int surface_id = SurfaceManager::kNoSurfaceID;
+ // The SurfaceTexture attached to |surface|, or nullptr if |surface| is
+ // SurfaceView backed.
+ scoped_refptr<gl::SurfaceTexture> surface_texture;
liberato (no reviews please) 2017/01/17 18:58:24 is this used?
watk 2017/01/17 19:02:48 Yes, I put a comment on its usage. The point of it
+
// The MediaCrypto that MediaCodec is configured with for an encrypted stream.
MediaDrmBridgeCdmContext::JavaObjectPtr media_crypto;
@@ -160,6 +164,9 @@ class MEDIA_GPU_EXPORT AVDACodecAllocator {
// both threads are hung.
base::Optional<TaskType> TaskTypeForAllocation();
+ // Return the task runner for tasks of type |type|.
+ scoped_refptr<base::SingleThreadTaskRunner> TaskRunnerFor(TaskType task_type);
+
// Return a reference to the thread for unit tests.
base::Thread& GetThreadForTesting(TaskType task_type);
@@ -203,9 +210,6 @@ class MEDIA_GPU_EXPORT AVDACodecAllocator {
base::WaitableEvent* stop_event = nullptr);
~AVDACodecAllocator();
- // Return the task runner for tasks of type |type|.
- scoped_refptr<base::SingleThreadTaskRunner> TaskRunnerFor(TaskType task_type);
-
void OnMediaCodecAndSurfaceReleased(int surface_id);
// Stop the thread indicated by |index|. This signals stop_event_for_testing_

Powered by Google App Engine
This is Rietveld 408576698