|
|
Created:
6 years, 4 months ago by Owen Lin Modified:
6 years, 3 months ago Reviewers:
Pawel Osciak 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, wjia+watch_chromium.org Base URL:
https://chromium.googlesource.com/chromium/src.git@master Project:
chromium Visibility:
Public. |
Descriptionrendering_helper - Wait for rendering before resetting the decoder.
BUG=391641
TEST= Run the test on lumpy
Committed: https://crrev.com/1cc19e420c43d6ec628a0b62bdcc86625d366a65
Cr-Commit-Position: refs/heads/master@{#291635}
Patch Set 1 #
Total comments: 4
Patch Set 2 : Addressing review comment #Patch Set 3 : address review comments #
Total comments: 2
Patch Set 4 : address review comment #Patch Set 5 : rebased to TOT #
Total comments: 1
Patch Set 6 : add document to frames_at_render_. #
Messages
Total messages: 21 (0 generated)
PTAL. Thanks.
On 2014/08/13 10:05:02, Owen Lin wrote: > PTAL. Thanks. What do you think about this idea instead: We already have a callback, ReusePicture(). And media::VideoFrame has a bool end_of_stream_. We could set it for last frame and keep a count of frames_at_render, and if it's not at 0 when we flush, then do this in ReusePicture when the count drops to 0. And the RenderingHelper would know to release last picture if it checks for end_of_stream_ in VF after rendering?
https://codereview.chromium.org/465293002/diff/1/content/common/gpu/media/ren... File content/common/gpu/media/rendering_helper.cc (right): https://codereview.chromium.org/465293002/diff/1/content/common/gpu/media/ren... content/common/gpu/media/rendering_helper.cc:97: Clear(); Should we assert that pending frames are empty? https://codereview.chromium.org/465293002/diff/1/content/common/gpu/media/ren... content/common/gpu/media/rendering_helper.cc:540: base::ResetAndReturn(&client->wait_rendering_cb).Run(); I think we have to pop the last frame here?
On 2014/08/14 05:08:33, Pawel Osciak wrote: > On 2014/08/13 10:05:02, Owen Lin wrote: > > PTAL. Thanks. > > What do you think about this idea instead: > > We already have a callback, ReusePicture(). And media::VideoFrame has a bool > end_of_stream_. We could set it for last frame and keep a count of > frames_at_render, and if it's not at 0 when we flush, then do this in > ReusePicture when the count drops to 0. > And the RenderingHelper would know to release last picture if it checks for > end_of_stream_ in VF after rendering? A problem is it is hard to know which VideoFrame would be the last. There are some cases we will play the video more than once. But I am not clear why it related to ReusePicture. (no mater it is ReturnPicture or ReusePictureBuffer?)
On 2014/08/14 08:22:17, Owen Lin wrote: > On 2014/08/14 05:08:33, Pawel Osciak wrote: > > On 2014/08/13 10:05:02, Owen Lin wrote: > > > PTAL. Thanks. > > > > What do you think about this idea instead: > > > > We already have a callback, ReusePicture(). And media::VideoFrame has a bool > > end_of_stream_. We could set it for last frame and keep a count of > > frames_at_render, and if it's not at 0 when we flush, then do this in > > ReusePicture when the count drops to 0. > > And the RenderingHelper would know to release last picture if it checks for > > end_of_stream_ in VF after rendering? > > A problem is it is hard to know which VideoFrame would be the last. There are > some cases we will play the video more than once. But I am not clear why it > related to ReusePicture. (no mater it is ReturnPicture or ReusePictureBuffer?) I guess I'd be ok with a Flush() call to the rendering helper too. Oh, and I meant ReturnPicture in your other CL, sorry.
On 2014/08/14 08:54:28, Pawel Osciak wrote: > On 2014/08/14 08:22:17, Owen Lin wrote: > > On 2014/08/14 05:08:33, Pawel Osciak wrote: > > > On 2014/08/13 10:05:02, Owen Lin wrote: > > > > PTAL. Thanks. > > > > > > What do you think about this idea instead: > > > > > > We already have a callback, ReusePicture(). And media::VideoFrame has a bool > > > end_of_stream_. We could set it for last frame and keep a count of > > > frames_at_render, and if it's not at 0 when we flush, then do this in > > > ReusePicture when the count drops to 0. > > > And the RenderingHelper would know to release last picture if it checks for > > > end_of_stream_ in VF after rendering? > > > > A problem is it is hard to know which VideoFrame would be the last. There are > > some cases we will play the video more than once. But I am not clear why it > > related to ReusePicture. (no mater it is ReturnPicture or ReusePictureBuffer?) > > I guess I'd be ok with a Flush() call to the rendering helper too. > Oh, and I meant ReturnPicture in your other CL, sorry. Thanks. I see, I will 1. Rename SetWaitRenderingCB() to Flush(). 2. Add a member "in_flushing" to RenderedVideo. So that we can release the last picture. How do you think ?
PTAL. Thanks. https://codereview.chromium.org/465293002/diff/1/content/common/gpu/media/ren... File content/common/gpu/media/rendering_helper.cc (right): https://codereview.chromium.org/465293002/diff/1/content/common/gpu/media/ren... content/common/gpu/media/rendering_helper.cc:97: Clear(); On 2014/08/14 05:11:07, Pawel Osciak wrote: > Should we assert that pending frames are empty? It's OK to have pending frames, Clear() will also clear it. https://codereview.chromium.org/465293002/diff/1/content/common/gpu/media/ren... content/common/gpu/media/rendering_helper.cc:540: base::ResetAndReturn(&client->wait_rendering_cb).Run(); On 2014/08/14 05:11:07, Pawel Osciak wrote: > I think we have to pop the last frame here? Done.
https://codereview.chromium.org/465293002/diff/40001/content/common/gpu/media... File content/common/gpu/media/rendering_helper.h (right): https://codereview.chromium.org/465293002/diff/40001/content/common/gpu/media... content/common/gpu/media/rendering_helper.h:103: void Flush(size_t window_id, const base::Closure& flush_done_cb); You misunderstood me. I don't think we need flush_done_cb. You can just do flush done check in ReturnPicture in the client. You need to keep a counter of frames_at_render_ in the client for this and if it reaches 0 when in flushing in ReturnPicture, we are done.
In this PS, I moved rendering_helper->Flush() from NotifyFlushDone() to NotifyResetDone(). It actually failed in the testcase "ReplayAfterEOS". In that test, there would be still coming frames after NotifyFlushDone(). However, the moving makes DropPendingFrames() in a invalid state. It was originally designed for the case of MidStreamReset. So that we don't need to wait for those pending frames after reset. I guess it is OK to change the behavior. If you don't agree, we can figure out some other way to do it, e.g., add a memeber "drop_pending_frames_at_reset". Please take another look and thank you for the feedback. https://codereview.chromium.org/465293002/diff/40001/content/common/gpu/media... File content/common/gpu/media/rendering_helper.h (right): https://codereview.chromium.org/465293002/diff/40001/content/common/gpu/media... content/common/gpu/media/rendering_helper.h:103: void Flush(size_t window_id, const base::Closure& flush_done_cb); On 2014/08/15 06:06:43, Pawel Osciak wrote: > You misunderstood me. I don't think we need flush_done_cb. You can just do flush > done check in ReturnPicture in the client. You need to keep a counter of > frames_at_render_ in the client for this and if it reaches 0 when in flushing in > ReturnPicture, we are done. Ah! I see. Thanks. We can save one CB.
Oh, you rebased on top of the other CL... It won't work this way and it's also difficult to review. Please delete this rebased PS and upload only the diff without changes from the other CL included. If you cannot do this, please commit the other CL first and then rebase and upload again. Thanks.
I just rebased onto the TOT. PTAL. So many thanks.
lgtm % nit https://chromiumcodereview.appspot.com/465293002/diff/80001/content/common/gp... File content/common/gpu/media/video_decode_accelerator_unittest.cc (right): https://chromiumcodereview.appspot.com/465293002/diff/80001/content/common/gp... content/common/gpu/media/video_decode_accelerator_unittest.cc:319: int frames_at_render_; Please document.
The CQ bit was checked by owenlin@chromium.org
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/owenlin@chromium.org/465293002/100001
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: linux_gpu_triggered_tests on tryserver.chromium.gpu (http://build.chromium.org/p/tryserver.chromium.gpu/builders/linux_gpu_trigger...) android_dbg_tests_recipe on tryserver.chromium.linux (http://build.chromium.org/p/tryserver.chromium.linux/builders/android_dbg_tes...)
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: android_dbg_tests_recipe on tryserver.chromium.linux (http://build.chromium.org/p/tryserver.chromium.linux/builders/android_dbg_tes...)
The CQ bit was checked by posciak@chromium.org
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/owenlin@chromium.org/465293002/100001
Message was sent while issue was closed.
Committed patchset #6 (100001) as cc7dccb80ac4aba6762d960c718f56acc825b2f2
Message was sent while issue was closed.
Patchset 6 (id:??) landed as https://crrev.com/1cc19e420c43d6ec628a0b62bdcc86625d366a65 Cr-Commit-Position: refs/heads/master@{#291635} |