Chromium Code Reviews| Index: chromecast/media/cma/base/frame_generator_for_test.h |
| diff --git a/chromecast/media/cma/base/frame_generator_for_test.h b/chromecast/media/cma/base/frame_generator_for_test.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..62441eb04a63f08741faea31cc082eb8efe72939 |
| --- /dev/null |
| +++ b/chromecast/media/cma/base/frame_generator_for_test.h |
| @@ -0,0 +1,59 @@ |
| +// 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_FRAME_GENERATOR_FOR_TEST_H_ |
| +#define CHROMECAST_MEDIA_CMA_BASE_FRAME_GENERATOR_FOR_TEST_H_ |
| + |
| +#include <vector> |
| + |
| +#include "base/memory/ref_counted.h" |
| +#include "base/time/time.h" |
| + |
| +namespace chromecast { |
| +namespace media { |
| +class DecoderBufferBase; |
| + |
| +class FrameGeneratorForTest { |
| + public: |
| + // Parameters used to generate frames. |
| + struct FrameSpec { |
| + FrameSpec(); |
| + ~FrameSpec(); |
| + |
| + // Indicate whether the frame comes with a new decoder configuration. |
| + bool has_config; |
| + |
| + bool is_eos; |
| + base::TimeDelta timestamp; |
| + bool has_decrypt_config; |
| + size_t size; |
| + }; |
| + |
| + explicit FrameGeneratorForTest(const std::vector<FrameSpec> frame_specs); |
| + ~FrameGeneratorForTest(); |
| + |
| + // Indicate whether the next frame should come with a new decoder config. |
|
gunsch
2014/09/09 15:58:19
nit: Indicates
damienv1
2014/09/09 16:24:17
Done.
|
| + bool HasDecoderConfig() const; |
| + |
| + // Generate a frame. |
|
gunsch
2014/09/09 15:58:19
nit: Generates
damienv1
2014/09/09 16:24:17
Done.
|
| + // Return NULL is there is no frame left to generate. |
| + scoped_refptr<DecoderBufferBase> Generate(); |
| + |
| + // Number of frames not generated yet. |
| + size_t RemainingFrameCount() const; |
| + |
| + private: |
| + std::vector<FrameSpec> frame_specs_; |
| + size_t frame_idx_; |
| + |
| + // Total size of A/V buffers generated so far. |
| + size_t total_buffer_size_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(FrameGeneratorForTest); |
| +}; |
| + |
| +} // namespace media |
| +} // namespace chromecast |
| + |
| +#endif // CHROMECAST_MEDIA_CMA_BASE_TEST_FRAME_GENERATOR_H_ |