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

Unified Diff: media/renderers/renderer_impl.h

Issue 1034233002: Move underflow threshold limits out of the video renderer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@frame_time
Patch Set: Wait for frame duration. Created 5 years, 9 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/base/media_switches.cc ('k') | media/renderers/renderer_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/renderers/renderer_impl.h
diff --git a/media/renderers/renderer_impl.h b/media/renderers/renderer_impl.h
index 03942d52f3e863002a8809593c9e598b76f5c2cb..e0374fb5a334393aeb647de998fc8376087d1361 100644
--- a/media/renderers/renderer_impl.h
+++ b/media/renderers/renderer_impl.h
@@ -5,6 +5,7 @@
#ifndef MEDIA_RENDERERS_RENDERER_IMPL_H_
#define MEDIA_RENDERERS_RENDERER_IMPL_H_
+#include "base/cancelable_callback.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
@@ -64,6 +65,12 @@ class MEDIA_EXPORT RendererImpl : public Renderer {
// Helper functions for testing purposes. Must be called before Initialize().
void DisableUnderflowForTesting();
void EnableClocklessVideoPlaybackForTesting();
+ void set_time_source_for_testing(TimeSource* time_source) {
+ time_source_ = time_source;
+ }
+ void set_video_underflow_threshold_for_testing(base::TimeDelta threshold) {
+ video_underflow_threshold_ = threshold;
+ }
private:
enum State {
@@ -171,6 +178,13 @@ class MEDIA_EXPORT RendererImpl : public Renderer {
bool underflow_disabled_for_testing_;
bool clockless_video_playback_enabled_for_testing_;
+ // Used to defer underflow for video when audio is present.
+ base::CancelableClosure deferred_underflow_cb_;
+
+ // The amount of time to wait before declaring underflow if the video renderer
+ // runs out of data but the audio renderer still has enough.
+ base::TimeDelta video_underflow_threshold_;
+
base::WeakPtr<RendererImpl> weak_this_;
base::WeakPtrFactory<RendererImpl> weak_factory_;
« no previous file with comments | « media/base/media_switches.cc ('k') | media/renderers/renderer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698