OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "media/base/filters.h" | 5 #include "media/base/filters.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 | 8 |
9 namespace media { | 9 namespace media { |
10 | 10 |
11 FilterStatusCB CopyAndResetCB(FilterStatusCB& cb) { | |
12 FilterStatusCB ret(cb); | |
13 cb.Reset(); | |
14 return ret; | |
15 } | |
11 Filter::Filter() : host_(NULL) {} | 16 Filter::Filter() : host_(NULL) {} |
12 | 17 |
13 Filter::~Filter() {} | 18 Filter::~Filter() {} |
14 | 19 |
15 void Filter::set_host(FilterHost* host) { | 20 void Filter::set_host(FilterHost* host) { |
16 DCHECK(host); | 21 DCHECK(host); |
17 DCHECK(!host_); | 22 DCHECK(!host_); |
18 host_ = host; | 23 host_ = host; |
19 } | 24 } |
20 | 25 |
(...skipping 28 matching lines...) Expand all Loading... | |
49 void Filter::Stop(FilterCallback* callback) { | 54 void Filter::Stop(FilterCallback* callback) { |
50 DCHECK(callback); | 55 DCHECK(callback); |
51 if (callback) { | 56 if (callback) { |
52 callback->Run(); | 57 callback->Run(); |
53 delete callback; | 58 delete callback; |
54 } | 59 } |
55 } | 60 } |
56 | 61 |
57 void Filter::SetPlaybackRate(float playback_rate) {} | 62 void Filter::SetPlaybackRate(float playback_rate) {} |
58 | 63 |
59 void Filter::Seek(base::TimeDelta time, FilterCallback* callback) { | 64 void Filter::Seek(base::TimeDelta time, const FilterStatusCB& callback) { |
60 scoped_ptr<FilterCallback> seek_callback(callback); | 65 DCHECK(!callback.is_null()); |
61 if (seek_callback.get()) { | 66 if (!callback.is_null()) |
Ami GONE FROM CHROMIUM
2011/05/12 20:42:16
I don't understand the DCHECK+if.
Is there a missi
acolwell GONE FROM CHROMIUM
2011/05/12 22:30:40
I was just making it match the other methods. I'll
| |
62 seek_callback->Run(); | 67 callback.Run(PIPELINE_OK); |
Ami GONE FROM CHROMIUM
2011/05/12 20:42:16
outdent
acolwell GONE FROM CHROMIUM
2011/05/12 22:30:40
Done.
| |
63 } | |
64 } | 68 } |
65 | 69 |
66 void Filter::OnAudioRendererDisabled() { | 70 void Filter::OnAudioRendererDisabled() { |
67 } | 71 } |
68 | 72 |
69 AVStream* DemuxerStream::GetAVStream() { | 73 AVStream* DemuxerStream::GetAVStream() { |
70 return NULL; | 74 return NULL; |
71 } | 75 } |
72 | 76 |
73 DemuxerStream::~DemuxerStream() {} | 77 DemuxerStream::~DemuxerStream() {} |
74 | 78 |
75 VideoDecoder::VideoDecoder() {} | 79 VideoDecoder::VideoDecoder() {} |
76 | 80 |
77 VideoDecoder::~VideoDecoder() {} | 81 VideoDecoder::~VideoDecoder() {} |
78 | 82 |
79 AudioDecoder::AudioDecoder() {} | 83 AudioDecoder::AudioDecoder() {} |
80 | 84 |
81 AudioDecoder::~AudioDecoder() {} | 85 AudioDecoder::~AudioDecoder() {} |
82 | 86 |
83 void AudioDecoder::ConsumeAudioSamples(scoped_refptr<Buffer> buffer) { | 87 void AudioDecoder::ConsumeAudioSamples(scoped_refptr<Buffer> buffer) { |
84 consume_audio_samples_callback_.Run(buffer); | 88 consume_audio_samples_callback_.Run(buffer); |
85 } | 89 } |
86 | 90 |
87 } // namespace media | 91 } // namespace media |
OLD | NEW |