summaryrefslogtreecommitdiffstats
path: root/media/base/null_video_sink.h
diff options
context:
space:
mode:
authordalecurtis <dalecurtis@chromium.org>2015-05-05 00:23:15 -0700
committerCommit bot <commit-bot@chromium.org>2015-05-05 07:23:49 +0000
commit3e8bda613486ae81f53428ab9f41a7dbb7f9f0c3 (patch)
tree515411b1d64ba6bb8c318d7d4ac31ca7c8a55f2a /media/base/null_video_sink.h
parentc4a4946256cd0abd02b187bd9efbd8d9b3c99b2a (diff)
downloadchromium_src-3e8bda613486ae81f53428ab9f41a7dbb7f9f0c3.zip
chromium_src-3e8bda613486ae81f53428ab9f41a7dbb7f9f0c3.tar.gz
chromium_src-3e8bda613486ae81f53428ab9f41a7dbb7f9f0c3.tar.bz2
Move background rendering pump to VideoFrameCompositor. Fixes tests.
Moving the pump to VFC cleans up a lot of code around dealing with stale frames and makes it possible to ensure we always have a frame ready for testing and upon ended without having to make an extra call during Stop. Doing this required / exposed: - Issues with firing the transition to HAVE_NOTHING, tests added. - Adding a |background_rendering| flag to the render callback. - NullAudioSink being built with non-test code. BUG=439548 TEST=new tests, all layout tests pass. Review URL: https://codereview.chromium.org/1121103002 Cr-Commit-Position: refs/heads/master@{#328295}
Diffstat (limited to 'media/base/null_video_sink.h')
-rw-r--r--media/base/null_video_sink.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/media/base/null_video_sink.h b/media/base/null_video_sink.h
index f1e076c..66ff79f 100644
--- a/media/base/null_video_sink.h
+++ b/media/base/null_video_sink.h
@@ -6,7 +6,6 @@
#define MEDIA_AUDIO_NULL_VIDEO_SINK_H_
#include "base/cancelable_callback.h"
-#include "base/md5.h"
#include "base/memory/scoped_ptr.h"
#include "base/time/default_tick_clock.h"
#include "base/time/tick_clock.h"
@@ -18,7 +17,7 @@ class SingleThreadTaskRunner;
namespace media {
-class MEDIA_EXPORT NullVideoSink : NON_EXPORTED_BASE(public VideoRendererSink) {
+class NullVideoSink : public VideoRendererSink {
public:
using NewFrameCB = base::Callback<void(const scoped_refptr<VideoFrame>&)>;
@@ -38,9 +37,6 @@ class MEDIA_EXPORT NullVideoSink : NON_EXPORTED_BASE(public VideoRendererSink) {
void PaintFrameUsingOldRenderingPath(
const scoped_refptr<VideoFrame>& frame) override;
- // Allows tests to simulate suspension of Render() callbacks.
- void PauseRenderCallbacks(base::TimeTicks pause_until);
-
void set_tick_clock_for_testing(base::TickClock* tick_clock) {
tick_clock_ = tick_clock;
}
@@ -52,6 +48,10 @@ class MEDIA_EXPORT NullVideoSink : NON_EXPORTED_BASE(public VideoRendererSink) {
bool is_started() const { return started_; }
+ void set_background_render(bool is_background_rendering) {
+ background_render_ = is_background_rendering;
+ }
+
private:
// Task that periodically calls Render() to consume video data.
void CallRender();
@@ -74,9 +74,6 @@ class MEDIA_EXPORT NullVideoSink : NON_EXPORTED_BASE(public VideoRendererSink) {
// to maintain stable periodicity of callbacks.
base::TimeTicks current_render_time_;
- // Used to suspend Render() callbacks to |callback_| for some time.
- base::TimeTicks pause_end_time_;
-
// Allow for an injectable tick clock for testing.
base::DefaultTickClock default_tick_clock_;
base::TimeTicks last_now_;
@@ -87,6 +84,9 @@ class MEDIA_EXPORT NullVideoSink : NON_EXPORTED_BASE(public VideoRendererSink) {
// If set, called when Stop() is called.
base::Closure stop_cb_;
+ // Value passed to RenderCallback::Render().
+ bool background_render_;
+
DISALLOW_COPY_AND_ASSIGN(NullVideoSink);
};