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

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

Issue 2837613004: media: Support better decoder switching (Closed)
Patch Set: Mock*Decoder name 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
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(
183 const std::string& decoder_name = "MockVideoDecoder");
183 virtual ~MockVideoDecoder(); 184 virtual ~MockVideoDecoder();
184 185
185 // VideoDecoder implementation. 186 // VideoDecoder implementation.
186 virtual std::string GetDisplayName() const; 187 virtual std::string GetDisplayName() const;
187 MOCK_METHOD5(Initialize, 188 MOCK_METHOD5(Initialize,
188 void(const VideoDecoderConfig& config, 189 void(const VideoDecoderConfig& config,
189 bool low_delay, 190 bool low_delay,
190 CdmContext* cdm_context, 191 CdmContext* cdm_context,
191 const InitCB& init_cb, 192 const InitCB& init_cb,
192 const OutputCB& output_cb)); 193 const OutputCB& output_cb));
193 MOCK_METHOD2(Decode, void(const scoped_refptr<DecoderBuffer>& buffer, 194 MOCK_METHOD2(Decode, void(const scoped_refptr<DecoderBuffer>& buffer,
194 const DecodeCB&)); 195 const DecodeCB&));
195 MOCK_METHOD1(Reset, void(const base::Closure&)); 196 MOCK_METHOD1(Reset, void(const base::Closure&));
196 MOCK_CONST_METHOD0(HasAlpha, bool()); 197 MOCK_CONST_METHOD0(HasAlpha, bool());
197 MOCK_CONST_METHOD0(CanReadWithoutStalling, bool()); 198 MOCK_CONST_METHOD0(CanReadWithoutStalling, bool());
198 199
199 private: 200 private:
201 std::string decoder_name_;
200 DISALLOW_COPY_AND_ASSIGN(MockVideoDecoder); 202 DISALLOW_COPY_AND_ASSIGN(MockVideoDecoder);
201 }; 203 };
202 204
203 class MockAudioDecoder : public AudioDecoder { 205 class MockAudioDecoder : public AudioDecoder {
204 public: 206 public:
205 MockAudioDecoder(); 207 explicit MockAudioDecoder(
208 const std::string& decoder_name = "MockAudioDecoder");
206 virtual ~MockAudioDecoder(); 209 virtual ~MockAudioDecoder();
207 210
208 // AudioDecoder implementation. 211 // AudioDecoder implementation.
209 virtual std::string GetDisplayName() const; 212 virtual std::string GetDisplayName() const;
210 MOCK_METHOD4(Initialize, 213 MOCK_METHOD4(Initialize,
211 void(const AudioDecoderConfig& config, 214 void(const AudioDecoderConfig& config,
212 CdmContext* cdm_context, 215 CdmContext* cdm_context,
213 const InitCB& init_cb, 216 const InitCB& init_cb,
214 const OutputCB& output_cb)); 217 const OutputCB& output_cb));
215 MOCK_METHOD2(Decode, 218 MOCK_METHOD2(Decode,
216 void(const scoped_refptr<DecoderBuffer>& buffer, 219 void(const scoped_refptr<DecoderBuffer>& buffer,
217 const DecodeCB&)); 220 const DecodeCB&));
218 MOCK_METHOD1(Reset, void(const base::Closure&)); 221 MOCK_METHOD1(Reset, void(const base::Closure&));
219 222
220 private: 223 private:
224 std::string decoder_name_;
221 DISALLOW_COPY_AND_ASSIGN(MockAudioDecoder); 225 DISALLOW_COPY_AND_ASSIGN(MockAudioDecoder);
222 }; 226 };
223 227
224 class MockRendererClient : public RendererClient { 228 class MockRendererClient : public RendererClient {
225 public: 229 public:
226 MockRendererClient(); 230 MockRendererClient();
227 ~MockRendererClient(); 231 ~MockRendererClient();
228 232
229 // RendererClient implementation. 233 // RendererClient implementation.
230 MOCK_METHOD1(OnError, void(PipelineStatus)); 234 MOCK_METHOD1(OnError, void(PipelineStatus));
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after
582 MOCK_METHOD0(Flush, void()); 586 MOCK_METHOD0(Flush, void());
583 MOCK_METHOD2(Parse, bool(const uint8_t*, int)); 587 MOCK_METHOD2(Parse, bool(const uint8_t*, int));
584 588
585 private: 589 private:
586 DISALLOW_COPY_AND_ASSIGN(MockStreamParser); 590 DISALLOW_COPY_AND_ASSIGN(MockStreamParser);
587 }; 591 };
588 592
589 } // namespace media 593 } // namespace media
590 594
591 #endif // MEDIA_BASE_MOCK_FILTERS_H_ 595 #endif // MEDIA_BASE_MOCK_FILTERS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698