Chromium Code Reviews| Index: chromecast/media/cma/test/media_component_device_feeder_for_test.h |
| diff --git a/chromecast/media/cma/test/media_component_device_feeder_for_test.h b/chromecast/media/cma/test/media_component_device_feeder_for_test.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..96912cb3a2aba62c3dd15fe02f0cf48e8d5f354f |
| --- /dev/null |
| +++ b/chromecast/media/cma/test/media_component_device_feeder_for_test.h |
| @@ -0,0 +1,74 @@ |
| +// 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_TEST_MEDIA_COMPONENT_DEVICE_FEEDER_FOR_TEST_H_ |
| +#define CHROMECAST_MEDIA_CMA_TEST_MEDIA_COMPONENT_DEVICE_FEEDER_FOR_TEST_H_ |
| + |
| +#include <list> |
| +#include <vector> |
| + |
| +#include "base/basictypes.h" |
| +#include "base/memory/ref_counted.h" |
| +#include "base/memory/scoped_ptr.h" |
| +#include "base/time/time.h" |
| +#include "chromecast/media/cma/backend/audio_pipeline_device.h" |
| +#include "chromecast/media/cma/backend/media_clock_device.h" |
| +#include "chromecast/media/cma/backend/media_pipeline_device.h" |
| +#include "chromecast/media/cma/backend/video_pipeline_device.h" |
| +#include "chromecast/media/cma/base/decoder_buffer_base.h" |
| + |
| +namespace chromecast { |
| +namespace media { |
| + |
| +typedef std::list<scoped_refptr<DecoderBufferBase> > FrameList; |
|
damienv1
2014/10/03 23:43:34
The name is different for the same structure in on
gunsch
2014/10/04 00:37:40
Done.
|
| + |
| +class MediaComponentDeviceFeederForTest { |
| + public: |
| + MediaComponentDeviceFeederForTest( |
| + MediaComponentDevice *device, |
| + const FrameList& frames, |
| + base::Callback<void(MediaComponentDeviceFeederForTest *)> eos_cb); |
|
damienv1
2014/10/03 23:43:34
|eos_cb| should be just a closure. Seems a bit wei
gunsch
2014/10/04 00:37:40
Sort of hard to bind the object, since you have to
|
| + |
| + virtual ~MediaComponentDeviceFeederForTest(); |
| + |
| + void Initialize(); |
| + |
| + // Feed one frame into the pipeline. |
| + void Feed(); |
| + |
| + // Cycle telling feeder how long to wait before feeding next frame |
| + // IE, on frame i, feeder will wait atleast (scheduler determined) |
| + // pattern[i % ||pattern||] before feeding next frame |
| + void SetDelayedFeedPattern(const std::vector<base::TimeDelta>& pattern); |
|
damienv1
2014/10/03 23:43:34
Does not seem to be used anymore. Please check wit
gunsch
2014/10/04 00:37:40
Done.
damienv1
2014/10/06 17:00:23
So, not interested in generating some underruns an
gunsch
2014/10/06 17:19:51
Sergey said it was fine to remove. I'm sure we can
|
| + |
| + private: |
| + void OnFramePushed(MediaComponentDevice::FrameStatus status); |
| + |
| + void OnEos(); |
| + |
| + MediaComponentDevice *media_component_device_; |
| + FrameList frames_; |
| + |
| + // Frame index where the audio device is switching to the kStateRunning. |
| + int rendering_frame_idx_; |
| + |
| + // Frame index where the clock device is switching to the kStateRunning |
| + int clock_frame_idx_; |
| + |
| + // Timing pattern to feed the pipeline. |
| + std::vector<base::TimeDelta> delayed_feed_pattern_; |
| + size_t delayed_feed_pattern_idx_; |
| + |
| + // Set to enable eos callback |
| + base::Callback<void(MediaComponentDeviceFeederForTest *)> eos_cb_; |
|
damienv1
2014/10/03 23:43:34
Should just be a closure.
gunsch
2014/10/04 00:37:40
Done.
|
| + |
| + bool feeding_completed_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(MediaComponentDeviceFeederForTest); |
| +}; |
| + |
| +} // namespace media |
| +} // namespace chromecast |
| + |
| +#endif // CHROMECAST_MEDIA_CMA_TEST_MEDIA_COMPONENT_DEVICE_FEEDER_FOR_TEST_H_ |