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

Unified Diff: chromecast/media/cma/base/mock_frame_provider.h

Issue 554893003: Introduce some buffering into the cast media pipeline. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Adjust weak pointer management. Created 6 years, 3 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 | « chromecast/media/cma/base/mock_frame_consumer.cc ('k') | chromecast/media/cma/base/mock_frame_provider.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromecast/media/cma/base/mock_frame_provider.h
diff --git a/chromecast/media/cma/base/mock_frame_provider.h b/chromecast/media/cma/base/mock_frame_provider.h
new file mode 100644
index 0000000000000000000000000000000000000000..fbea1cf61e8e2d327800c97521e9ebe031db8b2d
--- /dev/null
+++ b/chromecast/media/cma/base/mock_frame_provider.h
@@ -0,0 +1,49 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROMECAST_MEDIA_CMA_BASE_MOCK_FRAME_PROVIDER_H_
+#define CHROMECAST_MEDIA_CMA_BASE_MOCK_FRAME_PROVIDER_H_
+
+#include <vector>
+
+#include "base/macros.h"
+#include "chromecast/media/cma/base/coded_frame_provider.h"
+
+namespace chromecast {
+namespace media {
+class FrameGeneratorForTest;
+
+class MockFrameProvider : public CodedFrameProvider {
+ public:
+ MockFrameProvider();
+ virtual ~MockFrameProvider();
+
+ void Configure(
+ const std::vector<bool>& delayed_task_pattern,
+ scoped_ptr<FrameGeneratorForTest> frame_generator);
+
+ // CodedFrameProvider implementation.
+ virtual void Read(const ReadCB& read_cb) OVERRIDE;
+ virtual void Flush(const base::Closure& flush_cb) OVERRIDE;
+
+ private:
+ void DoRead(const ReadCB& read_cb);
+
+ // Parameterization of the frame provider.
+ // |delayed_task_pattern_| indicates the pattern for delivering frames,
+ // i.e. after receiving a Read request, either delivers a frame right away
+ // or wait some time before delivering the frame.
+ // |pattern_idx_| is the current index in the pattern.
+ std::vector<bool> delayed_task_pattern_;
+ size_t pattern_idx_;
+
+ scoped_ptr<FrameGeneratorForTest> frame_generator_;
+
+ DISALLOW_COPY_AND_ASSIGN(MockFrameProvider);
+};
+
+} // namespace media
+} // namespace chromecast
+
+#endif // CHROMECAST_MEDIA_CMA_BASE_MOCK_FRAME_PROVIDER_H_
« no previous file with comments | « chromecast/media/cma/base/mock_frame_consumer.cc ('k') | chromecast/media/cma/base/mock_frame_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698