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

Side by Side Diff: media/test/pipeline_integration_test_base.h

Issue 1658303002: Create abstract interface for media::Pipeline. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix FakeMediaSource includes. Created 4 years, 10 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
« no previous file with comments | « media/test/pipeline_integration_test.cc ('k') | media/test/pipeline_integration_test_base.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
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_
OLDNEW
« no previous file with comments | « media/test/pipeline_integration_test.cc ('k') | media/test/pipeline_integration_test_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698