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

Issue 2008933004: Make AVDA errors terminal; don't destruct until Decode() for Reset(). (Closed)

Created:
4 years, 7 months ago by DaleCurtis
Modified:
4 years, 1 month ago
CC:
chromium-reviews, feature-media-reviews_chromium.org, piman+watch_chromium.org, posciak+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@dont_reset_flush
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Make AVDA errors terminal; don't destruct until Decode() for Reset(). This expands our workaround for deferred ResetCodecState() to include cases where we might destruct the codec since that can be slow. As part of this fix, we also no longer let ResetCodecState() leave the error state and only reconstruct a codec when there are no errors. The latter change avoids codec destruction and recreation on all platforms if we happen to hit an unlucky SurfaceView destruction error. On the whole this doesn't seem to matter much on my N7v1 running 4.3.0 (API 18). Total suspend resume cycle time goes from ~297ms to ~287ms if I force codec destruction for this device. BUG=tbd TEST=timing.

Patch Set 1 #

Total comments: 5
Unified diffs Side-by-side diffs Delta from patch set Stats (+18 lines, -11 lines) Patch
M media/gpu/android_video_decode_accelerator.cc View 3 chunks +18 lines, -11 lines 5 comments Download

Depends on Patchset:

Messages

Total messages: 5 (1 generated)
DaleCurtis
At least on the N7v1 this doesn't seem to make much difference, but it might ...
4 years, 7 months ago (2016-05-25 00:09:02 UTC) #2
watk
lgtm https://codereview.chromium.org/2008933004/diff/1/media/gpu/android_video_decode_accelerator.cc File media/gpu/android_video_decode_accelerator.cc (right): https://codereview.chromium.org/2008933004/diff/1/media/gpu/android_video_decode_accelerator.cc#newcode1212 media/gpu/android_video_decode_accelerator.cc:1212: // TODO(liberato): revisit this once we sort out ...
4 years, 6 months ago (2016-05-26 20:53:28 UTC) #3
DaleCurtis
liberato: Any thoughts?
4 years, 6 months ago (2016-06-02 20:54:20 UTC) #4
liberato (no reviews please)
4 years, 6 months ago (2016-06-02 22:10:44 UTC) #5
sorry, forgot about it.

lgtm % one potential change.

-fl

https://codereview.chromium.org/2008933004/diff/1/media/gpu/android_video_dec...
File media/gpu/android_video_decode_accelerator.cc (right):

https://codereview.chromium.org/2008933004/diff/1/media/gpu/android_video_dec...
media/gpu/android_video_decode_accelerator.cc:1204: codec_needs_reset_ = false;
the idea here is to make the first call defer, and the second call wait, right?

it might be better to send in a flag with each call "may defer reset / new
codec", so that Decode can indicate that it always wants a ready-to-use codec. 
it seems more clear.

https://codereview.chromium.org/2008933004/diff/1/media/gpu/android_video_dec...
media/gpu/android_video_decode_accelerator.cc:1228:
g_avda_timer.Pointer()->StopTimer(this);
On 2016/05/26 20:53:28, watk wrote:
> unrelated, but it's a bit weird that the other branch doesn't also stop the
> timer..

i don't think that it should.  the next decode will restart it, but i don't
think that we want to depend on that.  it'll be okay now since there aren't any
cases where we'd need the timer and decoding is paused waiting for flush, i
think.  but, soon, there may be for switching SV <-> ST.  in that case, we don't
want to stop the timer in the reset case.

in this branch, it's fine.  when the codec is ready, it'll restart it in
OnCodecConfigured.

Powered by Google App Engine
This is Rietveld 408576698