| 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 #include <memory> |
| 9 | 10 |
| 10 #include "base/md5.h" | 11 #include "base/md5.h" |
| 11 #include "base/message_loop/message_loop.h" | 12 #include "base/message_loop/message_loop.h" |
| 12 #include "media/audio/clockless_audio_sink.h" | 13 #include "media/audio/clockless_audio_sink.h" |
| 13 #include "media/audio/null_audio_sink.h" | 14 #include "media/audio/null_audio_sink.h" |
| 14 #include "media/base/audio_hardware_config.h" | 15 #include "media/base/audio_hardware_config.h" |
| 15 #include "media/base/demuxer.h" | 16 #include "media/base/demuxer.h" |
| 16 #include "media/base/media_keys.h" | 17 #include "media/base/media_keys.h" |
| 17 #include "media/base/null_video_sink.h" | 18 #include "media/base/null_video_sink.h" |
| 18 #include "media/base/pipeline_impl.h" | 19 #include "media/base/pipeline_impl.h" |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 void set_encrypted_media_init_data_cb( | 114 void set_encrypted_media_init_data_cb( |
| 114 const Demuxer::EncryptedMediaInitDataCB& encrypted_media_init_data_cb) { | 115 const Demuxer::EncryptedMediaInitDataCB& encrypted_media_init_data_cb) { |
| 115 encrypted_media_init_data_cb_ = encrypted_media_init_data_cb; | 116 encrypted_media_init_data_cb_ = encrypted_media_init_data_cb; |
| 116 } | 117 } |
| 117 | 118 |
| 118 protected: | 119 protected: |
| 119 base::MessageLoop message_loop_; | 120 base::MessageLoop message_loop_; |
| 120 base::MD5Context md5_context_; | 121 base::MD5Context md5_context_; |
| 121 bool hashing_enabled_; | 122 bool hashing_enabled_; |
| 122 bool clockless_playback_; | 123 bool clockless_playback_; |
| 123 scoped_ptr<Demuxer> demuxer_; | 124 std::unique_ptr<Demuxer> demuxer_; |
| 124 scoped_ptr<DataSource> data_source_; | 125 std::unique_ptr<DataSource> data_source_; |
| 125 scoped_ptr<PipelineImpl> pipeline_; | 126 std::unique_ptr<PipelineImpl> pipeline_; |
| 126 scoped_refptr<NullAudioSink> audio_sink_; | 127 scoped_refptr<NullAudioSink> audio_sink_; |
| 127 scoped_refptr<ClocklessAudioSink> clockless_audio_sink_; | 128 scoped_refptr<ClocklessAudioSink> clockless_audio_sink_; |
| 128 scoped_ptr<NullVideoSink> video_sink_; | 129 std::unique_ptr<NullVideoSink> video_sink_; |
| 129 bool ended_; | 130 bool ended_; |
| 130 PipelineStatus pipeline_status_; | 131 PipelineStatus pipeline_status_; |
| 131 Demuxer::EncryptedMediaInitDataCB encrypted_media_init_data_cb_; | 132 Demuxer::EncryptedMediaInitDataCB encrypted_media_init_data_cb_; |
| 132 VideoPixelFormat last_video_frame_format_; | 133 VideoPixelFormat last_video_frame_format_; |
| 133 ColorSpace last_video_frame_color_space_; | 134 ColorSpace last_video_frame_color_space_; |
| 134 DummyTickClock dummy_clock_; | 135 DummyTickClock dummy_clock_; |
| 135 AudioHardwareConfig hardware_config_; | 136 AudioHardwareConfig hardware_config_; |
| 136 PipelineMetadata metadata_; | 137 PipelineMetadata metadata_; |
| 137 | 138 |
| 138 PipelineStatus StartInternal(scoped_ptr<DataSource> data_source, | 139 PipelineStatus StartInternal(std::unique_ptr<DataSource> data_source, |
| 139 CdmContext* cdm_context, | 140 CdmContext* cdm_context, |
| 140 uint8_t test_type); | 141 uint8_t test_type); |
| 141 | 142 |
| 142 PipelineStatus StartWithFile(const std::string& filename, | 143 PipelineStatus StartWithFile(const std::string& filename, |
| 143 CdmContext* cdm_context, | 144 CdmContext* cdm_context, |
| 144 uint8_t test_type); | 145 uint8_t test_type); |
| 145 | 146 |
| 146 void OnSeeked(base::TimeDelta seek_time, PipelineStatus status); | 147 void OnSeeked(base::TimeDelta seek_time, PipelineStatus status); |
| 147 void OnStatusCallback(PipelineStatus status); | 148 void OnStatusCallback(PipelineStatus status); |
| 148 void DemuxerEncryptedMediaInitDataCB(EmeInitDataType type, | 149 void DemuxerEncryptedMediaInitDataCB(EmeInitDataType type, |
| 149 const std::vector<uint8_t>& init_data); | 150 const std::vector<uint8_t>& init_data); |
| 150 | 151 |
| 151 void DemuxerMediaTracksUpdatedCB(scoped_ptr<MediaTracks> tracks); | 152 void DemuxerMediaTracksUpdatedCB(std::unique_ptr<MediaTracks> tracks); |
| 152 | 153 |
| 153 void OnEnded(); | 154 void OnEnded(); |
| 154 void OnError(PipelineStatus status); | 155 void OnError(PipelineStatus status); |
| 155 void QuitAfterCurrentTimeTask(const base::TimeDelta& quit_time); | 156 void QuitAfterCurrentTimeTask(const base::TimeDelta& quit_time); |
| 156 | 157 |
| 157 // Creates Demuxer and sets |demuxer_|. | 158 // Creates Demuxer and sets |demuxer_|. |
| 158 void CreateDemuxer(scoped_ptr<DataSource> data_source); | 159 void CreateDemuxer(std::unique_ptr<DataSource> data_source); |
| 159 | 160 |
| 160 // Creates and returns a Renderer. | 161 // Creates and returns a Renderer. |
| 161 virtual scoped_ptr<Renderer> CreateRenderer(); | 162 virtual std::unique_ptr<Renderer> CreateRenderer(); |
| 162 | 163 |
| 163 void OnVideoFramePaint(const scoped_refptr<VideoFrame>& frame); | 164 void OnVideoFramePaint(const scoped_refptr<VideoFrame>& frame); |
| 164 | 165 |
| 165 MOCK_METHOD1(OnMetadata, void(PipelineMetadata)); | 166 MOCK_METHOD1(OnMetadata, void(PipelineMetadata)); |
| 166 MOCK_METHOD1(OnBufferingStateChanged, void(BufferingState)); | 167 MOCK_METHOD1(OnBufferingStateChanged, void(BufferingState)); |
| 167 MOCK_METHOD1(DecryptorAttached, void(bool)); | 168 MOCK_METHOD1(DecryptorAttached, void(bool)); |
| 168 MOCK_METHOD2(OnAddTextTrack, | 169 MOCK_METHOD2(OnAddTextTrack, |
| 169 void(const TextTrackConfig& config, | 170 void(const TextTrackConfig& config, |
| 170 const AddTextTrackDoneCB& done_cb)); | 171 const AddTextTrackDoneCB& done_cb)); |
| 171 MOCK_METHOD0(OnWaitingForDecryptionKey, void(void)); | 172 MOCK_METHOD0(OnWaitingForDecryptionKey, void(void)); |
| 172 }; | 173 }; |
| 173 | 174 |
| 174 } // namespace media | 175 } // namespace media |
| 175 | 176 |
| 176 #endif // MEDIA_TEST_PIPELINE_INTEGRATION_TEST_BASE_H_ | 177 #endif // MEDIA_TEST_PIPELINE_INTEGRATION_TEST_BASE_H_ |
| OLD | NEW |