OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef MEDIA_TEST_PIPELINE_INTEGRATION_TEST_BASE_H_ | 5 #ifndef MEDIA_TEST_PIPELINE_INTEGRATION_TEST_BASE_H_ |
6 #define MEDIA_TEST_PIPELINE_INTEGRATION_TEST_BASE_H_ | 6 #define MEDIA_TEST_PIPELINE_INTEGRATION_TEST_BASE_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "base/md5.h" | 10 #include "base/md5.h" |
11 #include "base/message_loop/message_loop.h" | 11 #include "base/message_loop/message_loop.h" |
12 #include "media/audio/clockless_audio_sink.h" | 12 #include "media/audio/clockless_audio_sink.h" |
13 #include "media/audio/null_audio_sink.h" | 13 #include "media/audio/null_audio_sink.h" |
14 #include "media/base/audio_hardware_config.h" | 14 #include "media/base/audio_hardware_config.h" |
15 #include "media/base/demuxer.h" | 15 #include "media/base/demuxer.h" |
16 #include "media/base/media_keys.h" | 16 #include "media/base/media_keys.h" |
17 #include "media/base/null_video_sink.h" | 17 #include "media/base/null_video_sink.h" |
18 #include "media/base/pipeline.h" | 18 #include "media/base/pipeline_impl.h" |
| 19 #include "media/base/pipeline_status.h" |
19 #include "media/base/text_track.h" | 20 #include "media/base/text_track.h" |
20 #include "media/base/text_track_config.h" | 21 #include "media/base/text_track_config.h" |
21 #include "media/base/video_frame.h" | 22 #include "media/base/video_frame.h" |
22 #include "media/renderers/video_renderer_impl.h" | 23 #include "media/renderers/video_renderer_impl.h" |
23 #include "testing/gmock/include/gmock/gmock.h" | 24 #include "testing/gmock/include/gmock/gmock.h" |
24 | 25 |
25 namespace base { | 26 namespace base { |
26 class FilePath; | 27 class FilePath; |
27 } | 28 } |
28 | 29 |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 // Starts the pipeline (optionally with a CdmContext), returning the final | 69 // Starts the pipeline (optionally with a CdmContext), returning the final |
69 // status code after it has started. |filename| points at a test file located | 70 // status code after it has started. |filename| points at a test file located |
70 // under media/test/data/. | 71 // under media/test/data/. |
71 PipelineStatus Start(const std::string& filename); | 72 PipelineStatus Start(const std::string& filename); |
72 PipelineStatus Start(const std::string& filename, CdmContext* cdm_context); | 73 PipelineStatus Start(const std::string& filename, CdmContext* cdm_context); |
73 | 74 |
74 // Starts the pipeline in a particular mode for advanced testing and | 75 // Starts the pipeline in a particular mode for advanced testing and |
75 // benchmarking purposes (e.g., underflow is disabled to ensure consistent | 76 // benchmarking purposes (e.g., underflow is disabled to ensure consistent |
76 // hashes). May be combined using the bitwise or operator (and as such must | 77 // hashes). May be combined using the bitwise or operator (and as such must |
77 // have values that are powers of two). | 78 // have values that are powers of two). |
78 enum TestTypeFlags { kHashed = 1, kClockless = 2}; | 79 enum TestTypeFlags { kHashed = 1, kClockless = 2 }; |
79 PipelineStatus Start(const std::string& filename, uint8_t test_type); | 80 PipelineStatus Start(const std::string& filename, uint8_t test_type); |
80 | 81 |
81 void Play(); | 82 void Play(); |
82 void Pause(); | 83 void Pause(); |
83 bool Seek(base::TimeDelta seek_time); | 84 bool Seek(base::TimeDelta seek_time); |
84 bool Suspend(); | 85 bool Suspend(); |
85 bool Resume(base::TimeDelta seek_time); | 86 bool Resume(base::TimeDelta seek_time); |
86 void Stop(); | 87 void Stop(); |
87 bool WaitUntilCurrentTimeIsAfter(const base::TimeDelta& wait_time); | 88 bool WaitUntilCurrentTimeIsAfter(const base::TimeDelta& wait_time); |
88 | 89 |
(...skipping 12 matching lines...) Expand all Loading... |
101 // Pipeline must have been started with clockless playback enabled. | 102 // Pipeline must have been started with clockless playback enabled. |
102 base::TimeDelta GetAudioTime(); | 103 base::TimeDelta GetAudioTime(); |
103 | 104 |
104 protected: | 105 protected: |
105 base::MessageLoop message_loop_; | 106 base::MessageLoop message_loop_; |
106 base::MD5Context md5_context_; | 107 base::MD5Context md5_context_; |
107 bool hashing_enabled_; | 108 bool hashing_enabled_; |
108 bool clockless_playback_; | 109 bool clockless_playback_; |
109 scoped_ptr<Demuxer> demuxer_; | 110 scoped_ptr<Demuxer> demuxer_; |
110 scoped_ptr<DataSource> data_source_; | 111 scoped_ptr<DataSource> data_source_; |
111 scoped_ptr<Pipeline> pipeline_; | 112 scoped_ptr<PipelineImpl> pipeline_; |
112 scoped_refptr<NullAudioSink> audio_sink_; | 113 scoped_refptr<NullAudioSink> audio_sink_; |
113 scoped_refptr<ClocklessAudioSink> clockless_audio_sink_; | 114 scoped_refptr<ClocklessAudioSink> clockless_audio_sink_; |
114 scoped_ptr<NullVideoSink> video_sink_; | 115 scoped_ptr<NullVideoSink> video_sink_; |
115 bool ended_; | 116 bool ended_; |
116 PipelineStatus pipeline_status_; | 117 PipelineStatus pipeline_status_; |
117 Demuxer::EncryptedMediaInitDataCB encrypted_media_init_data_cb_; | 118 Demuxer::EncryptedMediaInitDataCB encrypted_media_init_data_cb_; |
118 VideoPixelFormat last_video_frame_format_; | 119 VideoPixelFormat last_video_frame_format_; |
119 ColorSpace last_video_frame_color_space_; | 120 ColorSpace last_video_frame_color_space_; |
120 DummyTickClock dummy_clock_; | 121 DummyTickClock dummy_clock_; |
121 AudioHardwareConfig hardware_config_; | 122 AudioHardwareConfig hardware_config_; |
(...skipping 25 matching lines...) Expand all Loading... |
147 MOCK_METHOD1(DecryptorAttached, void(bool)); | 148 MOCK_METHOD1(DecryptorAttached, void(bool)); |
148 MOCK_METHOD2(OnAddTextTrack, | 149 MOCK_METHOD2(OnAddTextTrack, |
149 void(const TextTrackConfig& config, | 150 void(const TextTrackConfig& config, |
150 const AddTextTrackDoneCB& done_cb)); | 151 const AddTextTrackDoneCB& done_cb)); |
151 MOCK_METHOD0(OnWaitingForDecryptionKey, void(void)); | 152 MOCK_METHOD0(OnWaitingForDecryptionKey, void(void)); |
152 }; | 153 }; |
153 | 154 |
154 } // namespace media | 155 } // namespace media |
155 | 156 |
156 #endif // MEDIA_TEST_PIPELINE_INTEGRATION_TEST_BASE_H_ | 157 #endif // MEDIA_TEST_PIPELINE_INTEGRATION_TEST_BASE_H_ |
OLD | NEW |