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

Issue 1560983002: Fix MP4 mid-stream resolution changes for MSE on android spitzer. (Closed)

Created:
4 years, 11 months ago by chcunningham
Modified:
4 years, 11 months ago
CC:
chromium-reviews, posciak+watch_chromium.org, jam, mcasas+watch_chromium.org, feature-media-reviews_chromium.org, darin-cc_chromium.org, piman+watch_chromium.org, sandersd (OOO until July 31)
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Fix MP4 mid-stream resolution changes for MSE on android spitzer. ANDROID CONTEXT: Android'S MediaCodec does not support mid-stream resolution changes prior to Kitkat. See b/7093648 and FEATURE_AdaptivePlayback. The workaround for earlier versions of Android is to call MediaCodec.flush() before starting to decode the new resolution. Flush has some gotchas: 1) All output buffers are immediately revoked at the point of the flush, so you'll want to signal then wait for end-of-stream before flushing to decode the last frames before the config change. 2) Buuut, flush does not work reliably after EOS before JB-MR2. So we need to completely Stop and reset MediaCodec for earlier versions (SDK_INT < 18). See b/8125974, b/8347958. CHROME CONTEXT: In WebRTC, the backward compatable workaround for the above Android bugs is to have the call Reset on the VDA whenever the client becomes aware of a config change. https://crrev.com/47123002 THIS CHANGE: For MSE, we can take advantage of the fact that every config change is preceeded by an EOS signal to drain the decoder [0]. This leaves MediaCodec in the "End of Stream" state, which is recovered from by calling flush. This change adds the flush call after EOS makes its way through the decoder, which conveniently prepares MediaCodec to recieve new buffers of a potentially different resolution. MediaCodec.flush() appears as MediaCodecBridge.reset() thanks to JNI and some confusing naming. To continue working around the broken flush for android < JB-MR2, we still stop and reconfigure MediaCodec when SDK_INT < 18. [0] https://code.google.com/p/chromium/codesearch#chromium/src/media/filters/decoder_stream.cc&rcl=1452025768&l=488 RUNNING THE TESTS: Tests must be run with additional command line flags to pass. --enable-unified-media-pipeline to enable spitzer --use-gl=egl to override using mesa (used in tests). Mesa is not compatible with SurfaceTextures used in HW accelerated decoding. BUG=555703 Committed: https://crrev.com/9e5ca6716a7d19b8f605c256251b80a6ae49eaa0 Cr-Commit-Position: refs/heads/master@{#368507}

Patch Set 1 #

Total comments: 20

Patch Set 2 : Rebase #

Patch Set 3 : CL feedback round 1 #

Patch Set 4 : Rebase + TODO comment in ResetCodecState #

Unified diffs Side-by-side diffs Delta from patch set Stats (+62 lines, -30 lines) Patch
M content/common/gpu/media/android_video_decode_accelerator.h View 1 2 3 1 chunk +6 lines, -0 lines 0 comments Download
M content/common/gpu/media/android_video_decode_accelerator.cc View 1 2 3 7 chunks +53 lines, -30 lines 0 comments Download
M media/filters/gpu_video_decoder.cc View 1 2 2 chunks +3 lines, -0 lines 0 comments Download

Messages

Total messages: 19 (7 generated)
chcunningham
This makes all of the resolution change tests pass! I'll do a follow up cl ...
4 years, 11 months ago (2016-01-06 01:31:56 UTC) #2
liberato (no reviews please)
nice. -fl https://codereview.chromium.org/1560983002/diff/1/content/common/gpu/media/android_video_decode_accelerator.cc File content/common/gpu/media/android_video_decode_accelerator.cc (right): https://codereview.chromium.org/1560983002/diff/1/content/common/gpu/media/android_video_decode_accelerator.cc#newcode373 content/common/gpu/media/android_video_decode_accelerator.cc:373: ResetOutputState(); we don't know that this is ...
4 years, 11 months ago (2016-01-06 18:06:32 UTC) #3
watk
I only had minor comments. I'll leave the rest up to you and Frank. https://codereview.chromium.org/1560983002/diff/1/content/common/gpu/media/android_video_decode_accelerator.cc ...
4 years, 11 months ago (2016-01-06 20:05:51 UTC) #4
chcunningham
https://codereview.chromium.org/1560983002/diff/1/content/common/gpu/media/android_video_decode_accelerator.cc File content/common/gpu/media/android_video_decode_accelerator.cc (right): https://codereview.chromium.org/1560983002/diff/1/content/common/gpu/media/android_video_decode_accelerator.cc#newcode373 content/common/gpu/media/android_video_decode_accelerator.cc:373: ResetOutputState(); On 2016/01/06 18:06:32, liberato wrote: > we don't ...
4 years, 11 months ago (2016-01-07 02:14:48 UTC) #5
liberato (no reviews please)
lgtm. regardless of whether we're trashing lots of codec buffers or not, it's still a ...
4 years, 11 months ago (2016-01-07 14:48:55 UTC) #6
chcunningham
Thanks guys! https://codereview.chromium.org/1560983002/diff/1/content/common/gpu/media/android_video_decode_accelerator.cc File content/common/gpu/media/android_video_decode_accelerator.cc (right): https://codereview.chromium.org/1560983002/diff/1/content/common/gpu/media/android_video_decode_accelerator.cc#newcode546 content/common/gpu/media/android_video_decode_accelerator.cc:546: strategy_->DismissOnePictureBuffer(it->second); On 2016/01/07 14:48:55, liberato wrote: > ...
4 years, 11 months ago (2016-01-08 22:49:36 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1560983002/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1560983002/60001
4 years, 11 months ago (2016-01-08 22:51:11 UTC) #10
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/133925)
4 years, 11 months ago (2016-01-09 00:26:07 UTC) #12
sandersd (OOO until July 31)
RS LGTM
4 years, 11 months ago (2016-01-09 00:29:05 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1560983002/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1560983002/60001
4 years, 11 months ago (2016-01-09 00:57:44 UTC) #16
commit-bot: I haz the power
Committed patchset #4 (id:60001)
4 years, 11 months ago (2016-01-09 02:06:17 UTC) #17
commit-bot: I haz the power
4 years, 11 months ago (2016-01-09 02:07:26 UTC) #19
Message was sent while issue was closed.
Patchset 4 (id:??) landed as
https://crrev.com/9e5ca6716a7d19b8f605c256251b80a6ae49eaa0
Cr-Commit-Position: refs/heads/master@{#368507}

Powered by Google App Engine
This is Rietveld 408576698