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

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

Issue 9717021: Make Callback::Reset() return a copy to support use-cases where Run() ends up modifying |*this|. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: no base:: Created 8 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « media/base/composite_filter_unittest.cc ('k') | media/base/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 // Filters are connected in a strongly typed manner, with downstream filters 5 // Filters are connected in a strongly typed manner, with downstream filters
6 // always reading data from upstream filters. Upstream filters have no clue 6 // always reading data from upstream filters. Upstream filters have no clue
7 // who is actually reading from them, and return the results via callbacks. 7 // who is actually reading from them, and return the results via callbacks.
8 // 8 //
9 // DemuxerStream(Video) <- VideoDecoder <- VideoRenderer 9 // DemuxerStream(Video) <- VideoDecoder <- VideoRenderer
10 // DataSource <- Demuxer < 10 // DataSource <- Demuxer <
(...skipping 27 matching lines...) Expand all
38 38
39 namespace media { 39 namespace media {
40 40
41 class AudioDecoder; 41 class AudioDecoder;
42 class Buffer; 42 class Buffer;
43 class Decoder; 43 class Decoder;
44 class DemuxerStream; 44 class DemuxerStream;
45 class Filter; 45 class Filter;
46 class FilterHost; 46 class FilterHost;
47 47
48 // These functions copy |*cb|, call Reset() on |*cb|, and then call Run()
49 // on the copy. This is used in the common case where you need to clear
50 // a callback member variable before running the callback.
51 MEDIA_EXPORT void ResetAndRunCB(PipelineStatusCB* cb, PipelineStatus status);
52 MEDIA_EXPORT void ResetAndRunCB(base::Closure* cb);
53
54 class MEDIA_EXPORT Filter : public base::RefCountedThreadSafe<Filter> { 48 class MEDIA_EXPORT Filter : public base::RefCountedThreadSafe<Filter> {
55 public: 49 public:
56 Filter(); 50 Filter();
57 51
58 // Sets the private member |host_|. This is the first method called by 52 // Sets the private member |host_|. This is the first method called by
59 // the FilterHost after a filter is created. The host holds a strong 53 // the FilterHost after a filter is created. The host holds a strong
60 // reference to the filter. The reference held by the host is guaranteed 54 // reference to the filter. The reference held by the host is guaranteed
61 // to be released before the host object is destroyed by the pipeline. 55 // to be released before the host object is destroyed by the pipeline.
62 virtual void set_host(FilterHost* host); 56 virtual void set_host(FilterHost* host);
63 57
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 210
217 // Resumes playback after underflow occurs. 211 // Resumes playback after underflow occurs.
218 // |buffer_more_audio| is set to true if you want to increase the size of the 212 // |buffer_more_audio| is set to true if you want to increase the size of the
219 // decoded audio buffer. 213 // decoded audio buffer.
220 virtual void ResumeAfterUnderflow(bool buffer_more_audio) = 0; 214 virtual void ResumeAfterUnderflow(bool buffer_more_audio) = 0;
221 }; 215 };
222 216
223 } // namespace media 217 } // namespace media
224 218
225 #endif // MEDIA_BASE_FILTERS_H_ 219 #endif // MEDIA_BASE_FILTERS_H_
OLDNEW
« no previous file with comments | « media/base/composite_filter_unittest.cc ('k') | media/base/filters.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698