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

Side by Side 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: updates test, addresses damien's feedback 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 unified diff | Download patch
OLDNEW
(Empty)
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.
4
5 #ifndef CHROMECAST_MEDIA_CMA_TEST_MEDIA_COMPONENT_DEVICE_FEEDER_FOR_TEST_H_
6 #define CHROMECAST_MEDIA_CMA_TEST_MEDIA_COMPONENT_DEVICE_FEEDER_FOR_TEST_H_
7
8 #include <list>
9 #include <vector>
10
11 #include "base/basictypes.h"
12 #include "base/memory/ref_counted.h"
13 #include "base/memory/scoped_ptr.h"
14 #include "base/time/time.h"
15 #include "chromecast/media/cma/backend/audio_pipeline_device.h"
16 #include "chromecast/media/cma/backend/media_clock_device.h"
17 #include "chromecast/media/cma/backend/media_pipeline_device.h"
18 #include "chromecast/media/cma/backend/video_pipeline_device.h"
19 #include "chromecast/media/cma/base/decoder_buffer_base.h"
20
21 namespace chromecast {
22 namespace media {
23
24 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.
25
26 class MediaComponentDeviceFeederForTest {
27 public:
28 MediaComponentDeviceFeederForTest(
29 MediaComponentDevice *device,
30 const FrameList& frames,
31 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
32
33 virtual ~MediaComponentDeviceFeederForTest();
34
35 void Initialize();
36
37 // Feed one frame into the pipeline.
38 void Feed();
39
40 // Cycle telling feeder how long to wait before feeding next frame
41 // IE, on frame i, feeder will wait atleast (scheduler determined)
42 // pattern[i % ||pattern||] before feeding next frame
43 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
44
45 private:
46 void OnFramePushed(MediaComponentDevice::FrameStatus status);
47
48 void OnEos();
49
50 MediaComponentDevice *media_component_device_;
51 FrameList frames_;
52
53 // Frame index where the audio device is switching to the kStateRunning.
54 int rendering_frame_idx_;
55
56 // Frame index where the clock device is switching to the kStateRunning
57 int clock_frame_idx_;
58
59 // Timing pattern to feed the pipeline.
60 std::vector<base::TimeDelta> delayed_feed_pattern_;
61 size_t delayed_feed_pattern_idx_;
62
63 // Set to enable eos callback
64 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.
65
66 bool feeding_completed_;
67
68 DISALLOW_COPY_AND_ASSIGN(MediaComponentDeviceFeederForTest);
69 };
70
71 } // namespace media
72 } // namespace chromecast
73
74 #endif // CHROMECAST_MEDIA_CMA_TEST_MEDIA_COMPONENT_DEVICE_FEEDER_FOR_TEST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698