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_FRAME_GENERATOR_FOR_TEST_H_
6 #define CHROMECAST_MEDIA_CMA_TEST_FRAME_GENERATOR_FOR_TEST_H_
10 #include "base/memory/ref_counted.h"
11 #include "base/time/time.h"
13 namespace chromecast
{
15 class DecoderBufferBase
;
17 class FrameGeneratorForTest
{
19 // Parameters used to generate frames.
24 // Indicates whether the frame comes with a new decoder configuration.
28 base::TimeDelta timestamp
;
29 bool has_decrypt_config
;
33 explicit FrameGeneratorForTest(const std::vector
<FrameSpec
> frame_specs
);
34 ~FrameGeneratorForTest();
36 // Indicates whether the next frame should come with a new decoder config.
37 bool HasDecoderConfig() const;
40 // Returns NULL is there is no frame left to generate.
41 scoped_refptr
<DecoderBufferBase
> Generate();
43 // Number of frames not generated yet.
44 size_t RemainingFrameCount() const;
47 std::vector
<FrameSpec
> frame_specs_
;
50 // Total size of A/V buffers generated so far.
51 size_t total_buffer_size_
;
53 DISALLOW_COPY_AND_ASSIGN(FrameGeneratorForTest
);
57 } // namespace chromecast
59 #endif // CHROMECAST_MEDIA_CMA_TEST_TEST_FRAME_GENERATOR_H_