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

Unified Diff: media/gpu/android_video_decode_accelerator.h

Issue 2116573002: Release MediaCodec on another thread more often. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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
« no previous file with comments | « no previous file | media/gpu/android_video_decode_accelerator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 e9a6ae30181bd19ce66ea44bf14655d079a4a587..658c2304aa4b95d4c143bf13e9fcaf194035dfc3 100644
--- a/media/gpu/android_video_decode_accelerator.h
+++ b/media/gpu/android_video_decode_accelerator.h
@@ -326,6 +326,12 @@ class MEDIA_GPU_EXPORT AndroidVideoDecodeAccelerator
// start the timer. Calling it with false may stop the timer.
void ManageTimer(bool did_work);
+ // Safely clear |media_codec_|. Do this instead of calling reset() / assign.
+ // Otherwise, the destructor can hang if mediaserver is in a bad state. This
+ // will release immediately if safe, else post to a separate thread. Either
+ // way, |media_codec_| will be null upon return.
+ void ReleaseMediaCodec();
+
// Start the MediaCodec drain process by adding end_of_stream() buffer to the
// encoded buffers queue. When we receive EOS from the output buffer the drain
// process completes and we perform the action depending on the |drain_type|.
« no previous file with comments | « no previous file | media/gpu/android_video_decode_accelerator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698