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

Issue 159476: Merge 21611 - Implemented proper pausethenseek behaviour for the media pipeli... (Closed)

Created:
11 years, 5 months ago by laforge
Modified:
9 years, 7 months ago
CC:
chromium-reviews_googlegroups.com, fbarchard, Alpha Left Google, kylep, awong, brettw, scherkus (not reviewing)
Visibility:
Public.

Description

Merge 21611 - Implemented proper pausethenseek behaviour for the media pipeline. MediaFilter now has asynchronous Play() and Pause() methods that are implemented by default. Since we are a completely pullbased system, it turns out only AudioRendererBase and VideoRendererBase need to override them to halt reading from decoders. When a seek is received by the pipeline, it goes through the following state transitions: 1) Playing > Pausing > Paused (notify filters to stop reading) 2) Paused > Seeking (notify filters to flush buffers and preroll) 3) Seeking > Playing (preroll completed, resume playback) The key to this system is that there must be no pending reads in *any* filter when we start transitioning into the seeking state. That means the audio/video renderers do not complete their pausing>paused transition until they have completed all pending reads. To reiterate, since we're pulled based if the renderers are not reading any data, then *nothing* is happening in the pipeline. We get a lot of nice benefits from this assertion, namely no callbacks are ever "lost", they are always replied to until we are fully paused. Furthermore, we can guarantee that the first buffer received after a Seek() will be guaranteed to be discontinuous. This change also properly handles endofstream, seeking from an endofstream state, and displaying frames while paused. In summary, I was able to call Seek() in a while(true) loop without crashing or going out of sync. BUG=16014, 16021, 17456 TEST=seeking should be way more robust Review URL: http://codereview.chromium.org/160005 TBR=scherkus@chromium.org Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=21799

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+671 lines, -361 lines) Patch
MM media/base/filters.h View 1 chunk +19 lines, -0 lines 0 comments Download
MM media/base/pipeline.h View 1 chunk +0 lines, -1 line 0 comments Download
MM media/base/pipeline_impl.h View 7 chunks +71 lines, -27 lines 0 comments Download
MM media/base/pipeline_impl.cc View 8 chunks +117 lines, -33 lines 0 comments Download
MM media/base/pipeline_impl_unittest.cc View 7 chunks +16 lines, -0 lines 0 comments Download
MM media/filters/audio_renderer_base.h View 4 chunks +25 lines, -8 lines 0 comments Download
MM media/filters/audio_renderer_base.cc View 8 chunks +80 lines, -53 lines 0 comments Download
MM media/filters/audio_renderer_base_unittest.cc View 2 chunks +16 lines, -8 lines 0 comments Download
MM media/filters/decoder_base.h View 7 chunks +33 lines, -33 lines 0 comments Download
MM media/filters/ffmpeg_demuxer.cc View 2 chunks +5 lines, -2 lines 0 comments Download
MM media/filters/ffmpeg_video_decoder.h View 1 chunk +1 line, -1 line 0 comments Download
MM media/filters/ffmpeg_video_decoder.cc View 3 chunks +9 lines, -7 lines 0 comments Download
MM media/filters/ffmpeg_video_decoder_unittest.cc View 2 chunks +32 lines, -15 lines 0 comments Download
MM media/filters/video_renderer_base.h View 3 chunks +38 lines, -15 lines 0 comments Download
MM media/filters/video_renderer_base.cc View 10 chunks +193 lines, -104 lines 0 comments Download
MM media/filters/video_renderer_base_unittest.cc View 2 chunks +16 lines, -54 lines 0 comments Download

Messages

Total messages: 2 (0 generated)
laforge
11 years, 5 months ago (2009-07-28 02:11:24 UTC) #1
scherkus (not reviewing)
11 years, 5 months ago (2009-07-28 02:12:37 UTC) #2
LGTM

Powered by Google App Engine
This is Rietveld 408576698