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

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

Issue 6625059: Implementing preload=metadata for video (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Cleanup defer strategy, fix logic bug Created 9 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 | « no previous file | media/base/filters.cc » ('j') | media/base/filters.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 // 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 25 matching lines...) Expand all
36 namespace media { 36 namespace media {
37 37
38 class Buffer; 38 class Buffer;
39 class Decoder; 39 class Decoder;
40 class DemuxerStream; 40 class DemuxerStream;
41 class Filter; 41 class Filter;
42 class FilterHost; 42 class FilterHost;
43 43
44 struct PipelineStatistics; 44 struct PipelineStatistics;
45 45
46 // Used to specify video preload states.
acolwell GONE FROM CHROMIUM 2011/03/25 04:35:28 You should add a note here that this enum must mat
vrk (LEFT CHROMIUM) 2011/03/25 21:33:32 Done.
47 enum Preload {
48 PRELOAD_NONE,
49 PRELOAD_METADATA,
50 PRELOAD_AUTO,
51 };
52
46 // Used for completing asynchronous methods. 53 // Used for completing asynchronous methods.
47 typedef Callback0::Type FilterCallback; 54 typedef Callback0::Type FilterCallback;
48 55
49 // Used for updating pipeline statistics. 56 // Used for updating pipeline statistics.
50 typedef Callback1<const PipelineStatistics&>::Type StatisticsCallback; 57 typedef Callback1<const PipelineStatistics&>::Type StatisticsCallback;
51 58
52 class Filter : public base::RefCountedThreadSafe<Filter> { 59 class Filter : public base::RefCountedThreadSafe<Filter> {
53 public: 60 public:
54 Filter(); 61 Filter();
55 62
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 virtual void Read(int64 position, size_t size, 127 virtual void Read(int64 position, size_t size,
121 uint8* data, ReadCallback* read_callback) = 0; 128 uint8* data, ReadCallback* read_callback) = 0;
122 129
123 // Returns true and the file size, false if the file size could not be 130 // Returns true and the file size, false if the file size could not be
124 // retrieved. 131 // retrieved.
125 virtual bool GetSize(int64* size_out) = 0; 132 virtual bool GetSize(int64* size_out) = 0;
126 133
127 // Returns true if we are performing streaming. In this case seeking is 134 // Returns true if we are performing streaming. In this case seeking is
128 // not possible. 135 // not possible.
129 virtual bool IsStreaming() = 0; 136 virtual bool IsStreaming() = 0;
137
138 // Alert the DataSource that the video preload value has been changed.
139 virtual void SetPreload(Preload preload);
acolwell GONE FROM CHROMIUM 2011/03/25 04:35:28 Make this pure virtual like the other methods.
vrk (LEFT CHROMIUM) 2011/03/25 21:33:32 Done.
130 }; 140 };
131 141
132 class DemuxerStream : public base::RefCountedThreadSafe<DemuxerStream> { 142 class DemuxerStream : public base::RefCountedThreadSafe<DemuxerStream> {
133 public: 143 public:
134 enum Type { 144 enum Type {
135 UNKNOWN, 145 UNKNOWN,
136 AUDIO, 146 AUDIO,
137 VIDEO, 147 VIDEO,
138 NUM_TYPES, // Always keep this entry as the last one! 148 NUM_TYPES, // Always keep this entry as the last one!
139 }; 149 };
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 virtual void* QueryInterface(const char* interface_id); 183 virtual void* QueryInterface(const char* interface_id);
174 184
175 friend class base::RefCountedThreadSafe<DemuxerStream>; 185 friend class base::RefCountedThreadSafe<DemuxerStream>;
176 virtual ~DemuxerStream(); 186 virtual ~DemuxerStream();
177 }; 187 };
178 188
179 class Demuxer : public Filter { 189 class Demuxer : public Filter {
180 public: 190 public:
181 // Returns the given stream type, or NULL if that type is not present. 191 // Returns the given stream type, or NULL if that type is not present.
182 virtual scoped_refptr<DemuxerStream> GetStream(DemuxerStream::Type type) = 0; 192 virtual scoped_refptr<DemuxerStream> GetStream(DemuxerStream::Type type) = 0;
193
194 // Alert the Demuxer that the video preload value has been changed.
195 virtual void SetPreload(Preload preload);
acolwell GONE FROM CHROMIUM 2011/03/25 04:35:28 Make this pure virtual like the other method so im
vrk (LEFT CHROMIUM) 2011/03/25 21:33:32 Done.
183 }; 196 };
184 197
185 198
186 class VideoDecoder : public Filter { 199 class VideoDecoder : public Filter {
187 public: 200 public:
188 // Initialize a VideoDecoder with the given DemuxerStream, executing the 201 // Initialize a VideoDecoder with the given DemuxerStream, executing the
189 // callback upon completion. 202 // callback upon completion.
190 // stats_callback is used to update global pipeline statistics. 203 // stats_callback is used to update global pipeline statistics.
191 virtual void Initialize(DemuxerStream* stream, FilterCallback* callback, 204 virtual void Initialize(DemuxerStream* stream, FilterCallback* callback,
192 StatisticsCallback* stats_callback) = 0; 205 StatisticsCallback* stats_callback) = 0;
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 // buffer. 298 // buffer.
286 virtual bool HasEnded() = 0; 299 virtual bool HasEnded() = 0;
287 300
288 // Sets the output volume. 301 // Sets the output volume.
289 virtual void SetVolume(float volume) = 0; 302 virtual void SetVolume(float volume) = 0;
290 }; 303 };
291 304
292 } // namespace media 305 } // namespace media
293 306
294 #endif // MEDIA_BASE_FILTERS_H_ 307 #endif // MEDIA_BASE_FILTERS_H_
OLDNEW
« no previous file with comments | « no previous file | media/base/filters.cc » ('j') | media/base/filters.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698