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

Side by Side Diff: chromecast/media/cma/base/mock_frame_provider.h

Issue 609383004: Chromecast: adds test frame-segmenter code to support CMA unit tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cma-decrypt-context
Patch Set: style fixes Created 6 years, 2 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROMECAST_MEDIA_CMA_BASE_MOCK_FRAME_PROVIDER_H_
6 #define CHROMECAST_MEDIA_CMA_BASE_MOCK_FRAME_PROVIDER_H_
7
8 #include <vector>
9
10 #include "base/macros.h"
11 #include "chromecast/media/cma/base/coded_frame_provider.h"
12
13 namespace chromecast {
14 namespace media {
15 class FrameGeneratorForTest;
16
17 class MockFrameProvider : public CodedFrameProvider {
18 public:
19 MockFrameProvider();
20 virtual ~MockFrameProvider();
21
22 void Configure(
23 const std::vector<bool>& delayed_task_pattern,
24 scoped_ptr<FrameGeneratorForTest> frame_generator);
25
26 // CodedFrameProvider implementation.
27 virtual void Read(const ReadCB& read_cb) OVERRIDE;
28 virtual void Flush(const base::Closure& flush_cb) OVERRIDE;
29
30 private:
31 void DoRead(const ReadCB& read_cb);
32
33 // Parameterization of the frame provider.
34 // |delayed_task_pattern_| indicates the pattern for delivering frames,
35 // i.e. after receiving a Read request, either delivers a frame right away
36 // or wait some time before delivering the frame.
37 // |pattern_idx_| is the current index in the pattern.
38 std::vector<bool> delayed_task_pattern_;
39 size_t pattern_idx_;
40
41 scoped_ptr<FrameGeneratorForTest> frame_generator_;
42
43 DISALLOW_COPY_AND_ASSIGN(MockFrameProvider);
44 };
45
46 } // namespace media
47 } // namespace chromecast
48
49 #endif // CHROMECAST_MEDIA_CMA_BASE_MOCK_FRAME_PROVIDER_H_
OLDNEW
« 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