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

Unified Diff: media/renderers/video_renderer_impl.h

Issue 1863373002: Fix underflow and av/sync issues in low delay and stall presence. (Closed) Base URL: http://chromium.googlesource.com/chromium/src.git@master
Patch Set: Clarified comment. Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/filters/vpx_video_decoder.cc ('k') | media/renderers/video_renderer_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/renderers/video_renderer_impl.h
diff --git a/media/renderers/video_renderer_impl.h b/media/renderers/video_renderer_impl.h
index 9f1c01c7bba37615c7ed4ff479768b2b846603a5..8e40dc96ba4a1bb73583e307ef0a5e2620c23a66 100644
--- a/media/renderers/video_renderer_impl.h
+++ b/media/renderers/video_renderer_impl.h
@@ -79,6 +79,9 @@ class MEDIA_EXPORT VideoRendererImpl
void SetTickClockForTesting(scoped_ptr<base::TickClock> tick_clock);
void SetGpuMemoryBufferVideoForTesting(
scoped_ptr<GpuMemoryBufferVideoFramePool> gpu_memory_buffer_pool);
+ size_t frames_queued_for_testing() const {
+ return algorithm_->frames_queued();
+ }
// VideoRendererSink::RenderCallback implementation.
scoped_refptr<VideoFrame> Render(base::TimeTicks deadline_min,
@@ -155,6 +158,22 @@ class MEDIA_EXPORT VideoRendererImpl
// duration is before |start_timestamp_|.
bool IsBeforeStartTime(base::TimeDelta timestamp);
+ // Attempts to remove frames which are no longer effective for rendering when
+ // |buffering_state_| == BUFFERING_HAVE_NOTHING or |was_background_rendering_|
+ // is true. If the current media time as provided by |wall_clock_time_cb_| is
+ // null, no frame expiration will be done.
+ //
+ // When background rendering the method will expire all frames before the
+ // current wall clock time since it's expected that there will be long delays
+ // between each Render() call in this state.
+ //
+ // When in the underflow state the method will first attempt to remove expired
+ // frames before the current media time plus duration. If |sink_started_| is
+ // true, nothing more can be done. However, if false, and there are still no
+ // effective frames in the queue, the entire frame queue will be released to
+ // avoid any stalling.
+ void RemoveFramesForUnderflowOrBackgroundRendering();
+
scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
// Sink which calls into VideoRendererImpl via Render() for video frames. Do
« no previous file with comments | « media/filters/vpx_video_decoder.cc ('k') | media/renderers/video_renderer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698