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

Issue 1869103002: Enable adaptive playback for spitzer, use conservative size. (Closed)

Created:
4 years, 8 months ago by liberato (no reviews please)
Modified:
4 years, 8 months ago
CC:
avayvod+watch_chromium.org, chromium-reviews, darin-cc_chromium.org, feature-media-reviews_chromium.org, jam, mcasas+watch_chromium.org, mlamouri+watch-media_chromium.org, piman+watch_chromium.org, posciak+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Enable adaptive playback for spitzer, use conservative size. Android MediaCodec allocates memory for adaptive playback (dynamic resolution change) based on hints provided to the codec during construction about the maximum expected decoded frame dimensions. That can signficantly increate the memory usage / reduce the number of concurrent codec instances that chrome can use. On some devices (Samsung S3), adaptive playback also entirely breaks decoding. Decoded frames can be tiled / black and white / generally quite incorrect. Spitzer had previously turned off dynamic resolution support to fix both of these. However, it turns out that enabling adaptive support is necessary: - returning unused decoded buffers to MediaCodec without rendering can incorrectly stop MediaCodec from decoding more frames without adaptive playback enabled. - some videos on some devices (N7) play very slowly otherwise. This CL requests adaptive playback when AVDA creates the MediaCodec instance. It also plumbs the inital coded size to AVDA, and send it to MediaCodecBridge. MediaCodecBridge now uses this size, rather than 1920x1080, as the max adaptive size hint to save memory. For devices like the S3, MediaCodecBridge ignores the request for adaptive playback, and keeps it off. Providing the size to MediaCodec will also allow it to choose an appropriate input buffer size. Previously, it used the requested size of 320x240 when estimating the size of an encoded frame. BUG=599908, 596211, 601066 Committed: https://crrev.com/62cf4f1fab4e0cc2560983465d3fd15fde537f00 Cr-Commit-Position: refs/heads/master@{#386091}

Patch Set 1 #

Patch Set 2 : removed a stale comment. #

Total comments: 12

Patch Set 3 : cl feedback. #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+59 lines, -13 lines) Patch
M content/common/gpu/media/android_video_decode_accelerator.h View 1 2 1 chunk +4 lines, -0 lines 0 comments Download
M content/common/gpu/media/android_video_decode_accelerator.cc View 1 2 2 chunks +4 lines, -4 lines 0 comments Download
M media/base/android/java/src/org/chromium/media/MediaCodecBridge.java View 1 2 3 chunks +18 lines, -9 lines 1 comment Download
M media/base/android/java/src/org/chromium/media/MediaCodecUtil.java View 2 chunks +28 lines, -0 lines 0 comments Download
M media/filters/gpu_video_decoder.cc View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M media/gpu/ipc/common/media_param_traits_macros.h View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M media/video/video_decode_accelerator.h View 1 2 1 chunk +3 lines, -0 lines 0 comments Download

Messages

Total messages: 18 (6 generated)
liberato (no reviews please)
4 years, 8 months ago (2016-04-07 18:33:49 UTC) #3
DaleCurtis
https://codereview.chromium.org/1869103002/diff/20001/content/common/gpu/media/android_video_decode_accelerator.h File content/common/gpu/media/android_video_decode_accelerator.h (right): https://codereview.chromium.org/1869103002/diff/20001/content/common/gpu/media/android_video_decode_accelerator.h#newcode187 content/common/gpu/media/android_video_decode_accelerator.h:187: // Initial coded size. Add a note that this ...
4 years, 8 months ago (2016-04-07 18:40:44 UTC) #4
DaleCurtis
https://codereview.chromium.org/1869103002/diff/20001/media/video/video_decode_accelerator.h File media/video/video_decode_accelerator.h (right): https://codereview.chromium.org/1869103002/diff/20001/media/video/video_decode_accelerator.h#newcode126 media/video/video_decode_accelerator.h:126: // Coded size of the video frame. Ditto on ...
4 years, 8 months ago (2016-04-07 18:41:25 UTC) #5
Tima Vaisburd
I like the approach! lgtm % nits https://codereview.chromium.org/1869103002/diff/20001/content/common/gpu/media/android_video_decode_accelerator.cc File content/common/gpu/media/android_video_decode_accelerator.cc (right): https://codereview.chromium.org/1869103002/diff/20001/content/common/gpu/media/android_video_decode_accelerator.cc#newcode958 content/common/gpu/media/android_video_decode_accelerator.cc:958: gfx::Size(codec_config->coded_size_.width(), nit: ...
4 years, 8 months ago (2016-04-07 18:50:01 UTC) #6
liberato (no reviews please)
https://codereview.chromium.org/1869103002/diff/20001/content/common/gpu/media/android_video_decode_accelerator.cc File content/common/gpu/media/android_video_decode_accelerator.cc (right): https://codereview.chromium.org/1869103002/diff/20001/content/common/gpu/media/android_video_decode_accelerator.cc#newcode958 content/common/gpu/media/android_video_decode_accelerator.cc:958: gfx::Size(codec_config->coded_size_.width(), On 2016/04/07 18:50:01, Tima Vaisburd wrote: > nit: ...
4 years, 8 months ago (2016-04-07 20:46:29 UTC) #7
DaleCurtis
lgtm https://codereview.chromium.org/1869103002/diff/40001/media/base/android/java/src/org/chromium/media/MediaCodecBridge.java File media/base/android/java/src/org/chromium/media/MediaCodecBridge.java (right): https://codereview.chromium.org/1869103002/diff/40001/media/base/android/java/src/org/chromium/media/MediaCodecBridge.java#newcode465 media/base/android/java/src/org/chromium/media/MediaCodecBridge.java:465: format.setInteger( FWIW, since I had to go check, ...
4 years, 8 months ago (2016-04-07 22:55:17 UTC) #8
DaleCurtis
To confirm on the N4 you were able to get plenty of codecs?
4 years, 8 months ago (2016-04-07 22:55:34 UTC) #9
liberato (no reviews please)
On 2016/04/07 22:55:34, DaleCurtis wrote: > To confirm on the N4 you were able to ...
4 years, 8 months ago (2016-04-08 05:34:14 UTC) #10
liberato (no reviews please)
On 2016/04/08 05:34:14, liberato wrote: > On 2016/04/07 22:55:34, DaleCurtis wrote: > > To confirm ...
4 years, 8 months ago (2016-04-08 15:00:20 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1869103002/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1869103002/40001
4 years, 8 months ago (2016-04-08 15:00:42 UTC) #14
commit-bot: I haz the power
Committed patchset #3 (id:40001)
4 years, 8 months ago (2016-04-08 16:05:52 UTC) #16
commit-bot: I haz the power
4 years, 8 months ago (2016-04-08 16:08:23 UTC) #18
Message was sent while issue was closed.
Patchset 3 (id:??) landed as
https://crrev.com/62cf4f1fab4e0cc2560983465d3fd15fde537f00
Cr-Commit-Position: refs/heads/master@{#386091}

Powered by Google App Engine
This is Rietveld 408576698