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.
5 #ifndef CHROMECAST_MEDIA_CMA_TEST_MOCK_FRAME_PROVIDER_H_
6 #define CHROMECAST_MEDIA_CMA_TEST_MOCK_FRAME_PROVIDER_H_
10 #include "base/macros.h"
11 #include "chromecast/media/cma/base/coded_frame_provider.h"
13 namespace chromecast
{
15 class FrameGeneratorForTest
;
17 class MockFrameProvider
: public CodedFrameProvider
{
20 ~MockFrameProvider() override
;
23 const std::vector
<bool>& delayed_task_pattern
,
24 scoped_ptr
<FrameGeneratorForTest
> frame_generator
);
25 void SetDelayFlush(bool delay_flush
);
27 // CodedFrameProvider implementation.
28 void Read(const ReadCB
& read_cb
) override
;
29 void Flush(const base::Closure
& flush_cb
) override
;
32 void DoRead(const ReadCB
& read_cb
);
34 // Parameterization of the frame provider.
35 // |delayed_task_pattern_| indicates the pattern for delivering frames,
36 // i.e. after receiving a Read request, either delivers a frame right away
37 // or wait some time before delivering the frame.
38 // |pattern_idx_| is the current index in the pattern.
39 // |delay_flush_| indicates whether to delay flush cb in Flush. Default is
41 std::vector
<bool> delayed_task_pattern_
;
45 scoped_ptr
<FrameGeneratorForTest
> frame_generator_
;
47 DISALLOW_COPY_AND_ASSIGN(MockFrameProvider
);
51 } // namespace chromecast
53 #endif // CHROMECAST_MEDIA_CMA_TEST_MOCK_FRAME_PROVIDER_H_