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

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: 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
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..c4d2c44681c30c4f38e1620b582d1e1cbc8d629e
--- /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);
+
+ // Parametrization of the frame provider.
gunsch 2014/09/09 15:58:19 nit: Parameterization
damienv1 2014/09/09 16:24:17 Done.
+ // |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_

Powered by Google App Engine
This is Rietveld 408576698