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

Unified Diff: chromecast/media/cma/test/media_component_device_feeder_for_test.h

Issue 622853002: Chromecast: adds interfaces for hardware layer of CMA pipeline. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cma-decrypt-context
Patch Set: style feedback/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 side-by-side diff with in-line comments
Download patch
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..e3f6e51627b03b5c6838f6dbac9ade7b04d5dc1c
--- /dev/null
+++ b/chromecast/media/cma/test/media_component_device_feeder_for_test.h
@@ -0,0 +1,67 @@
+// 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> > BufferList;
+
+class MediaComponentDeviceFeederForTest {
+ public:
+ MediaComponentDeviceFeederForTest(
+ MediaComponentDevice *device,
+ const BufferList& frames);
+
+ virtual ~MediaComponentDeviceFeederForTest();
+
+ void Initialize(const base::Closure& eos_cb);
+
+ // Feeds one frame into the pipeline.
+ void Feed();
+
+ private:
+ void OnFramePushed(MediaComponentDevice::FrameStatus status);
+
+ void OnEos();
+
+ MediaComponentDevice *media_component_device_;
+ BufferList 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
damienv1 2014/10/06 17:00:23 nit: consistency (add "." as the end).
gunsch 2014/10/06 17:19:51 Done.
+ int clock_frame_idx_;
+
+ // Timing pattern to feed the pipeline.
+ std::vector<base::TimeDelta> delayed_feed_pattern_;
+ size_t delayed_feed_pattern_idx_;
+
+ base::Closure eos_cb_;
+
+ bool feeding_completed_;
+
+ DISALLOW_COPY_AND_ASSIGN(MediaComponentDeviceFeederForTest);
+};
+
+} // namespace media
+} // namespace chromecast
+
+#endif // CHROMECAST_MEDIA_CMA_TEST_MEDIA_COMPONENT_DEVICE_FEEDER_FOR_TEST_H_

Powered by Google App Engine
This is Rietveld 408576698