Chromium Code Reviews| 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 #include <memory> |
| 10 | 10 |
| 11 #include "base/md5.h" | 11 #include "base/md5.h" |
| 12 #include "base/memory/scoped_vector.h" | 12 #include "base/memory/scoped_vector.h" |
| 13 #include "base/message_loop/message_loop.h" | 13 #include "base/message_loop/message_loop.h" |
| 14 #include "base/test/scoped_task_scheduler.h" | |
| 14 #include "media/audio/clockless_audio_sink.h" | 15 #include "media/audio/clockless_audio_sink.h" |
| 15 #include "media/audio/null_audio_sink.h" | 16 #include "media/audio/null_audio_sink.h" |
| 16 #include "media/base/demuxer.h" | 17 #include "media/base/demuxer.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" |
| 19 #include "media/base/pipeline_status.h" | 20 #include "media/base/pipeline_status.h" |
| 20 #include "media/base/text_track.h" | 21 #include "media/base/text_track.h" |
| 21 #include "media/base/text_track_config.h" | 22 #include "media/base/text_track_config.h" |
| 22 #include "media/base/video_frame.h" | 23 #include "media/base/video_frame.h" |
| 23 #include "media/renderers/video_renderer_impl.h" | 24 #include "media/renderers/video_renderer_impl.h" |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 122 base::TimeDelta GetAudioTime(); | 123 base::TimeDelta GetAudioTime(); |
| 123 | 124 |
| 124 // Sets a callback to handle EME "encrypted" event. Must be called to test | 125 // Sets a callback to handle EME "encrypted" event. Must be called to test |
| 125 // potentially encrypted media. | 126 // potentially encrypted media. |
| 126 void set_encrypted_media_init_data_cb( | 127 void set_encrypted_media_init_data_cb( |
| 127 const Demuxer::EncryptedMediaInitDataCB& encrypted_media_init_data_cb) { | 128 const Demuxer::EncryptedMediaInitDataCB& encrypted_media_init_data_cb) { |
| 128 encrypted_media_init_data_cb_ = encrypted_media_init_data_cb; | 129 encrypted_media_init_data_cb_ = encrypted_media_init_data_cb; |
| 129 } | 130 } |
| 130 | 131 |
| 131 protected: | 132 protected: |
| 132 base::MessageLoop message_loop_; | 133 base::MessageLoop message_loop_; |
|
gab
2017/02/24 01:09:05
If you feel like cleaning this up: ThreadTaskRunne
DaleCurtis
2017/02/24 23:40:29
Too big of a change to do this in this CL, will po
| |
| 133 base::MD5Context md5_context_; | 134 base::MD5Context md5_context_; |
| 134 bool hashing_enabled_; | 135 bool hashing_enabled_; |
| 135 bool clockless_playback_; | 136 bool clockless_playback_; |
| 137 std::unique_ptr<base::test::ScopedTaskScheduler> task_scheduler_; | |
|
gab
2017/02/24 01:09:06
Why does it have to be delay initialized?
DaleCurtis
2017/02/24 23:40:29
It's only needed for FFmpegDemuxer; which half of
gab
2017/02/26 18:01:35
I see, add a comment to that effect on this member
DaleCurtis
2017/02/27 21:26:30
Done.
| |
| 136 std::unique_ptr<Demuxer> demuxer_; | 138 std::unique_ptr<Demuxer> demuxer_; |
| 137 std::unique_ptr<DataSource> data_source_; | 139 std::unique_ptr<DataSource> data_source_; |
| 138 std::unique_ptr<PipelineImpl> pipeline_; | 140 std::unique_ptr<PipelineImpl> pipeline_; |
| 139 scoped_refptr<NullAudioSink> audio_sink_; | 141 scoped_refptr<NullAudioSink> audio_sink_; |
| 140 scoped_refptr<ClocklessAudioSink> clockless_audio_sink_; | 142 scoped_refptr<ClocklessAudioSink> clockless_audio_sink_; |
| 141 std::unique_ptr<NullVideoSink> video_sink_; | 143 std::unique_ptr<NullVideoSink> video_sink_; |
| 142 bool ended_; | 144 bool ended_; |
| 143 PipelineStatus pipeline_status_; | 145 PipelineStatus pipeline_status_; |
| 144 Demuxer::EncryptedMediaInitDataCB encrypted_media_init_data_cb_; | 146 Demuxer::EncryptedMediaInitDataCB encrypted_media_init_data_cb_; |
| 145 VideoPixelFormat last_video_frame_format_; | 147 VideoPixelFormat last_video_frame_format_; |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 205 const AddTextTrackDoneCB& done_cb)); | 207 const AddTextTrackDoneCB& done_cb)); |
| 206 MOCK_METHOD0(OnWaitingForDecryptionKey, void(void)); | 208 MOCK_METHOD0(OnWaitingForDecryptionKey, void(void)); |
| 207 MOCK_METHOD1(OnVideoNaturalSizeChange, void(const gfx::Size&)); | 209 MOCK_METHOD1(OnVideoNaturalSizeChange, void(const gfx::Size&)); |
| 208 MOCK_METHOD1(OnVideoOpacityChange, void(bool)); | 210 MOCK_METHOD1(OnVideoOpacityChange, void(bool)); |
| 209 MOCK_METHOD0(OnVideoAverageKeyframeDistanceUpdate, void()); | 211 MOCK_METHOD0(OnVideoAverageKeyframeDistanceUpdate, void()); |
| 210 }; | 212 }; |
| 211 | 213 |
| 212 } // namespace media | 214 } // namespace media |
| 213 | 215 |
| 214 #endif // MEDIA_TEST_PIPELINE_INTEGRATION_TEST_BASE_H_ | 216 #endif // MEDIA_TEST_PIPELINE_INTEGRATION_TEST_BASE_H_ |
| OLD | NEW |