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

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

Issue 1171263004: Allow setting memory limits on media::DemuxerStream (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merged CL that adds get/set buffer size on WMP Created 5 years, 6 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/fake_demuxer_stream.cc ('k') | media/base/fake_text_track_stream.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #include "base/message_loop/message_loop.h" 5 #include "base/message_loop/message_loop.h"
6 #include "media/base/audio_decoder_config.h" 6 #include "media/base/audio_decoder_config.h"
7 #include "media/base/demuxer_stream.h" 7 #include "media/base/demuxer_stream.h"
8 #include "media/base/video_decoder_config.h" 8 #include "media/base/video_decoder_config.h"
9 #include "testing/gmock/include/gmock/gmock.h" 9 #include "testing/gmock/include/gmock/gmock.h"
10 10
11 namespace media { 11 namespace media {
12 12
13 // Fake implementation of the DemuxerStream. These are the stream objects 13 // Fake implementation of the DemuxerStream. These are the stream objects
14 // we pass to the text renderer object when streams are added and removed. 14 // we pass to the text renderer object when streams are added and removed.
15 class FakeTextTrackStream : public DemuxerStream { 15 class FakeTextTrackStream : public DemuxerStream {
16 public: 16 public:
17 FakeTextTrackStream(); 17 FakeTextTrackStream();
18 ~FakeTextTrackStream() override; 18 ~FakeTextTrackStream() override;
19 19
20 // DemuxerStream implementation. 20 // DemuxerStream implementation.
21 void Read(const ReadCB&) override; 21 void Read(const ReadCB&) override;
22 MOCK_METHOD0(audio_decoder_config, AudioDecoderConfig()); 22 MOCK_METHOD0(audio_decoder_config, AudioDecoderConfig());
23 MOCK_METHOD0(video_decoder_config, VideoDecoderConfig()); 23 MOCK_METHOD0(video_decoder_config, VideoDecoderConfig());
24 Type type() const override; 24 Type type() const override;
25 MOCK_METHOD0(EnableBitstreamConverter, void()); 25 MOCK_METHOD0(EnableBitstreamConverter, void());
26 bool SupportsConfigChanges() override; 26 bool SupportsConfigChanges() override;
27 VideoRotation video_rotation() override; 27 VideoRotation video_rotation() override;
28 size_t GetMemoryLimit() const override;
29 void SetMemoryLimit(size_t memory_limit) override;
28 30
29 void SatisfyPendingRead(const base::TimeDelta& start, 31 void SatisfyPendingRead(const base::TimeDelta& start,
30 const base::TimeDelta& duration, 32 const base::TimeDelta& duration,
31 const std::string& id, 33 const std::string& id,
32 const std::string& content, 34 const std::string& content,
33 const std::string& settings); 35 const std::string& settings);
34 void AbortPendingRead(); 36 void AbortPendingRead();
35 void SendEosNotification(); 37 void SendEosNotification();
36 38
37 void Stop(); 39 void Stop();
38 40
39 MOCK_METHOD0(OnRead, void()); 41 MOCK_METHOD0(OnRead, void());
40 42
41 private: 43 private:
42 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; 44 scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
43 ReadCB read_cb_; 45 ReadCB read_cb_;
44 bool stopping_; 46 bool stopping_;
45 47
46 DISALLOW_COPY_AND_ASSIGN(FakeTextTrackStream); 48 DISALLOW_COPY_AND_ASSIGN(FakeTextTrackStream);
47 }; 49 };
48 50
49 } // namespace media 51 } // namespace media
OLDNEW
« no previous file with comments | « media/base/fake_demuxer_stream.cc ('k') | media/base/fake_text_track_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698