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

Unified Diff: content/common/gpu/media/android_video_decode_accelerator.cc

Issue 1687143002: Remove calls to MediaCodec#stop from AVDA (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/gpu/media/android_video_decode_accelerator.cc
diff --git a/content/common/gpu/media/android_video_decode_accelerator.cc b/content/common/gpu/media/android_video_decode_accelerator.cc
index 126daba961d2389210d109d03a51ffeb62f915a6..58078831cc8380d13d7bc9fbd720b1de754cc715 100644
--- a/content/common/gpu/media/android_video_decode_accelerator.cc
+++ b/content/common/gpu/media/android_video_decode_accelerator.cc
@@ -764,9 +764,9 @@ void AndroidVideoDecodeAccelerator::ResetCodecState() {
// When codec is not in error state we can quickly reset (internally calls
// flush()) for JB-MR2 and beyond. Prior to JB-MR2, flush() had several bugs
- // (b/8125974, b/8347958) so we must stop() and reconfigure MediaCodec. The
- // full reconfigure is much slower and may cause visible freezing if done
- // mid-stream.
+ // (b/8125974, b/8347958) so we must delete the MediaCodec and create a new
+ // one. The full reconfigure is much slower and may cause visible freezing if
+ // done mid-stream.
if (state_ == NO_ERROR &&
base::android::BuildInfo::GetInstance()->sdk_int() >= 18) {
DVLOG(3) << __FUNCTION__ << " Doing fast MediaCodec reset (flush).";
@@ -776,9 +776,9 @@ void AndroidVideoDecodeAccelerator::ResetCodecState() {
strategy_->CodecChanged(media_codec_.get(), output_picture_buffers_);
} else {
DVLOG(3) << __FUNCTION__
- << " Doing slow MediaCodec reset (stop/re-configure).";
+ << " Deleting the MediaCodec and creating a new one.";
io_timer_.Stop();
- media_codec_->Stop();
+ media_codec_.reset();
// Changing the codec will also notify the strategy to forget about any
// output buffers it has currently.
state_ = NO_ERROR;
@@ -848,7 +848,7 @@ void AndroidVideoDecodeAccelerator::Destroy() {
weak_this_factory_.InvalidateWeakPtrs();
if (media_codec_) {
io_timer_.Stop();
- media_codec_->Stop();
+ media_codec_.reset();
}
delete this;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698