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 #ifndef MEDIA_BASE_DEMUXER_STREAM_H_ | 5 #ifndef MEDIA_BASE_DEMUXER_STREAM_H_ |
6 #define MEDIA_BASE_DEMUXER_STREAM_H_ | 6 #define MEDIA_BASE_DEMUXER_STREAM_H_ |
7 | 7 |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "media/base/media_export.h" | 10 #include "media/base/media_export.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 enum Type { | 21 enum Type { |
22 UNKNOWN, | 22 UNKNOWN, |
23 AUDIO, | 23 AUDIO, |
24 VIDEO, | 24 VIDEO, |
25 NUM_TYPES, // Always keep this entry as the last one! | 25 NUM_TYPES, // Always keep this entry as the last one! |
26 }; | 26 }; |
27 | 27 |
28 // Request a buffer to returned via the provided callback. | 28 // Request a buffer to returned via the provided callback. |
29 // | 29 // |
30 // Buffers will be non-NULL yet may be end of stream buffers. | 30 // Buffers will be non-NULL yet may be end of stream buffers. |
31 typedef base::Callback<void(scoped_refptr<Buffer>)> ReadCallback; | 31 typedef base::Callback<void(const scoped_refptr<Buffer>&)> ReadCallback; |
32 virtual void Read(const ReadCallback& read_callback) = 0; | 32 virtual void Read(const ReadCallback& read_callback) = 0; |
33 | 33 |
34 // Returns the audio decoder configuration. It is an error to call this method | 34 // Returns the audio decoder configuration. It is an error to call this method |
35 // if type() != AUDIO. | 35 // if type() != AUDIO. |
36 virtual const AudioDecoderConfig& audio_decoder_config() = 0; | 36 virtual const AudioDecoderConfig& audio_decoder_config() = 0; |
37 | 37 |
38 // Returns the video decoder configuration. It is an error to call this method | 38 // Returns the video decoder configuration. It is an error to call this method |
39 // if type() != VIDEO. | 39 // if type() != VIDEO. |
40 virtual const VideoDecoderConfig& video_decoder_config() = 0; | 40 virtual const VideoDecoderConfig& video_decoder_config() = 0; |
41 | 41 |
42 // Returns the type of stream. | 42 // Returns the type of stream. |
43 virtual Type type() = 0; | 43 virtual Type type() = 0; |
44 | 44 |
45 virtual void EnableBitstreamConverter() = 0; | 45 virtual void EnableBitstreamConverter() = 0; |
46 | 46 |
47 protected: | 47 protected: |
48 friend class base::RefCountedThreadSafe<DemuxerStream>; | 48 friend class base::RefCountedThreadSafe<DemuxerStream>; |
49 virtual ~DemuxerStream(); | 49 virtual ~DemuxerStream(); |
50 }; | 50 }; |
51 | 51 |
52 } // namespace media | 52 } // namespace media |
53 | 53 |
54 #endif // MEDIA_BASE_DEMUXER_STREAM_H_ | 54 #endif // MEDIA_BASE_DEMUXER_STREAM_H_ |
OLD | NEW |