| 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 // 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 14 matching lines...) Expand all Loading... |
| 25 | 25 |
| 26 #include <limits> | 26 #include <limits> |
| 27 #include <string> | 27 #include <string> |
| 28 | 28 |
| 29 #include "base/callback.h" | 29 #include "base/callback.h" |
| 30 #include "base/callback_old.h" | 30 #include "base/callback_old.h" |
| 31 #include "base/memory/ref_counted.h" | 31 #include "base/memory/ref_counted.h" |
| 32 #include "base/memory/scoped_ptr.h" | 32 #include "base/memory/scoped_ptr.h" |
| 33 #include "base/time.h" | 33 #include "base/time.h" |
| 34 #include "media/base/audio_decoder_config.h" | 34 #include "media/base/audio_decoder_config.h" |
| 35 #include "media/base/media_format.h" | |
| 36 #include "media/base/pipeline_status.h" | 35 #include "media/base/pipeline_status.h" |
| 37 #include "media/base/video_frame.h" | 36 #include "media/base/video_frame.h" |
| 38 | 37 |
| 39 struct AVStream; | 38 struct AVStream; |
| 40 | 39 |
| 41 namespace media { | 40 namespace media { |
| 42 | 41 |
| 43 class Buffer; | 42 class Buffer; |
| 44 class Decoder; | 43 class Decoder; |
| 45 class DemuxerStream; | 44 class DemuxerStream; |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 // Schedules a read. When the |read_callback| is called, the downstream | 169 // Schedules a read. When the |read_callback| is called, the downstream |
| 171 // filter takes ownership of the buffer by AddRef()'ing the buffer. | 170 // filter takes ownership of the buffer by AddRef()'ing the buffer. |
| 172 virtual void Read(const ReadCallback& read_callback) = 0; | 171 virtual void Read(const ReadCallback& read_callback) = 0; |
| 173 | 172 |
| 174 // Returns an |AVStream*| if supported, or NULL. | 173 // Returns an |AVStream*| if supported, or NULL. |
| 175 virtual AVStream* GetAVStream(); | 174 virtual AVStream* GetAVStream(); |
| 176 | 175 |
| 177 // Returns the type of stream. | 176 // Returns the type of stream. |
| 178 virtual Type type() = 0; | 177 virtual Type type() = 0; |
| 179 | 178 |
| 180 // Returns the media format of this stream. | |
| 181 virtual const MediaFormat& media_format() = 0; | |
| 182 | |
| 183 virtual void EnableBitstreamConverter() = 0; | 179 virtual void EnableBitstreamConverter() = 0; |
| 184 | 180 |
| 185 protected: | 181 protected: |
| 186 friend class base::RefCountedThreadSafe<DemuxerStream>; | 182 friend class base::RefCountedThreadSafe<DemuxerStream>; |
| 187 virtual ~DemuxerStream(); | 183 virtual ~DemuxerStream(); |
| 188 }; | 184 }; |
| 189 | 185 |
| 190 class Demuxer : public Filter { | 186 class Demuxer : public Filter { |
| 191 public: | 187 public: |
| 192 // Returns the given stream type, or NULL if that type is not present. | 188 // Returns the given stream type, or NULL if that type is not present. |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 310 // buffer. | 306 // buffer. |
| 311 virtual bool HasEnded() = 0; | 307 virtual bool HasEnded() = 0; |
| 312 | 308 |
| 313 // Sets the output volume. | 309 // Sets the output volume. |
| 314 virtual void SetVolume(float volume) = 0; | 310 virtual void SetVolume(float volume) = 0; |
| 315 }; | 311 }; |
| 316 | 312 |
| 317 } // namespace media | 313 } // namespace media |
| 318 | 314 |
| 319 #endif // MEDIA_BASE_FILTERS_H_ | 315 #endif // MEDIA_BASE_FILTERS_H_ |
| OLD | NEW |