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

Unified Diff: media/gpu/android_video_decode_accelerator.h

Issue 2147843002: Drop idle MediaCodec instances after a few seconds within AVDA. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Reduce to 1 second. Make const. Created 4 years, 5 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 fd99ebc0ff8a7ca2e74a4bd047c212cbbece37d8..4c4c5e82bb73049f8d043f8b70d23660702ab4df 100644
--- a/media/gpu/android_video_decode_accelerator.h
+++ b/media/gpu/android_video_decode_accelerator.h
@@ -371,6 +371,10 @@ class MEDIA_GPU_EXPORT AndroidVideoDecodeAccelerator
// have safer versions elsewhere.
bool IsMediaCodecSoftwareDecodingForbidden() const;
+ // Closes idle MediaCodec instances if no Decode() call is received within a
+ // few seconds.
+ void CloseIdleCodec();
+
// Used to DCHECK that we are called on the correct thread.
base::ThreadChecker thread_checker_;
@@ -484,6 +488,11 @@ class MEDIA_GPU_EXPORT AndroidVideoDecodeAccelerator
OnDestroyingSurfaceCallback on_destroying_surface_cb_;
+ // Timer used to destroy the MediaCodec if no Decode() call is received after
+ // some period of idle activity. This prevents older devices from falling over
+ // when too many MediaCodec instances are outstanding.
+ base::OneShotTimer no_decode_timeout_;
+
// WeakPtrFactory for posting tasks back to |this|.
base::WeakPtrFactory<AndroidVideoDecodeAccelerator> weak_this_factory_;
« 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