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

Side by Side Diff: media/base/mock_filters.h

Issue 2837613004: media: Support better decoder switching (Closed)
Patch Set: do not always keep decoder selector Created 3 years, 7 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/base/audio_decoder_config.h ('k') | media/base/mock_filters.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_BASE_MOCK_FILTERS_H_ 5 #ifndef MEDIA_BASE_MOCK_FILTERS_H_
6 #define MEDIA_BASE_MOCK_FILTERS_H_ 6 #define MEDIA_BASE_MOCK_FILTERS_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 Type type_; 172 Type type_;
173 Liveness liveness_; 173 Liveness liveness_;
174 AudioDecoderConfig audio_decoder_config_; 174 AudioDecoderConfig audio_decoder_config_;
175 VideoDecoderConfig video_decoder_config_; 175 VideoDecoderConfig video_decoder_config_;
176 176
177 DISALLOW_COPY_AND_ASSIGN(MockDemuxerStream); 177 DISALLOW_COPY_AND_ASSIGN(MockDemuxerStream);
178 }; 178 };
179 179
180 class MockVideoDecoder : public VideoDecoder { 180 class MockVideoDecoder : public VideoDecoder {
181 public: 181 public:
182 MockVideoDecoder(); 182 explicit MockVideoDecoder(const std::string& decoder_name = "");
watk 2017/05/04 23:58:36 repeating: You could put the default name here ins
xhwang 2017/05/05 00:07:46 Done.
183 virtual ~MockVideoDecoder(); 183 virtual ~MockVideoDecoder();
184 184
185 // VideoDecoder implementation. 185 // VideoDecoder implementation.
186 virtual std::string GetDisplayName() const; 186 virtual std::string GetDisplayName() const;
187 MOCK_METHOD5(Initialize, 187 MOCK_METHOD5(Initialize,
188 void(const VideoDecoderConfig& config, 188 void(const VideoDecoderConfig& config,
189 bool low_delay, 189 bool low_delay,
190 CdmContext* cdm_context, 190 CdmContext* cdm_context,
191 const InitCB& init_cb, 191 const InitCB& init_cb,
192 const OutputCB& output_cb)); 192 const OutputCB& output_cb));
193 MOCK_METHOD2(Decode, void(const scoped_refptr<DecoderBuffer>& buffer, 193 MOCK_METHOD2(Decode, void(const scoped_refptr<DecoderBuffer>& buffer,
194 const DecodeCB&)); 194 const DecodeCB&));
195 MOCK_METHOD1(Reset, void(const base::Closure&)); 195 MOCK_METHOD1(Reset, void(const base::Closure&));
196 MOCK_CONST_METHOD0(HasAlpha, bool()); 196 MOCK_CONST_METHOD0(HasAlpha, bool());
197 MOCK_CONST_METHOD0(CanReadWithoutStalling, bool()); 197 MOCK_CONST_METHOD0(CanReadWithoutStalling, bool());
198 198
199 private: 199 private:
200 std::string decoder_name_;
200 DISALLOW_COPY_AND_ASSIGN(MockVideoDecoder); 201 DISALLOW_COPY_AND_ASSIGN(MockVideoDecoder);
201 }; 202 };
202 203
203 class MockAudioDecoder : public AudioDecoder { 204 class MockAudioDecoder : public AudioDecoder {
204 public: 205 public:
205 MockAudioDecoder(); 206 explicit MockAudioDecoder(const std::string& decoder_name = "");
206 virtual ~MockAudioDecoder(); 207 virtual ~MockAudioDecoder();
207 208
208 // AudioDecoder implementation. 209 // AudioDecoder implementation.
209 virtual std::string GetDisplayName() const; 210 virtual std::string GetDisplayName() const;
210 MOCK_METHOD4(Initialize, 211 MOCK_METHOD4(Initialize,
211 void(const AudioDecoderConfig& config, 212 void(const AudioDecoderConfig& config,
212 CdmContext* cdm_context, 213 CdmContext* cdm_context,
213 const InitCB& init_cb, 214 const InitCB& init_cb,
214 const OutputCB& output_cb)); 215 const OutputCB& output_cb));
215 MOCK_METHOD2(Decode, 216 MOCK_METHOD2(Decode,
216 void(const scoped_refptr<DecoderBuffer>& buffer, 217 void(const scoped_refptr<DecoderBuffer>& buffer,
217 const DecodeCB&)); 218 const DecodeCB&));
218 MOCK_METHOD1(Reset, void(const base::Closure&)); 219 MOCK_METHOD1(Reset, void(const base::Closure&));
219 220
220 private: 221 private:
222 std::string decoder_name_;
221 DISALLOW_COPY_AND_ASSIGN(MockAudioDecoder); 223 DISALLOW_COPY_AND_ASSIGN(MockAudioDecoder);
222 }; 224 };
223 225
224 class MockRendererClient : public RendererClient { 226 class MockRendererClient : public RendererClient {
225 public: 227 public:
226 MockRendererClient(); 228 MockRendererClient();
227 ~MockRendererClient(); 229 ~MockRendererClient();
228 230
229 // RendererClient implementation. 231 // RendererClient implementation.
230 MOCK_METHOD1(OnError, void(PipelineStatus)); 232 MOCK_METHOD1(OnError, void(PipelineStatus));
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after
582 MOCK_METHOD0(Flush, void()); 584 MOCK_METHOD0(Flush, void());
583 MOCK_METHOD2(Parse, bool(const uint8_t*, int)); 585 MOCK_METHOD2(Parse, bool(const uint8_t*, int));
584 586
585 private: 587 private:
586 DISALLOW_COPY_AND_ASSIGN(MockStreamParser); 588 DISALLOW_COPY_AND_ASSIGN(MockStreamParser);
587 }; 589 };
588 590
589 } // namespace media 591 } // namespace media
590 592
591 #endif // MEDIA_BASE_MOCK_FILTERS_H_ 593 #endif // MEDIA_BASE_MOCK_FILTERS_H_
OLDNEW
« no previous file with comments | « media/base/audio_decoder_config.h ('k') | media/base/mock_filters.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698