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_FILTERS_AUDIO_FILE_READER_H_ | 5 #ifndef MEDIA_FILTERS_AUDIO_FILE_READER_H_ |
6 #define MEDIA_FILTERS_AUDIO_FILE_READER_H_ | 6 #define MEDIA_FILTERS_AUDIO_FILE_READER_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 #include "media/filters/ffmpeg_glue.h" | 9 #include "media/filters/ffmpeg_glue.h" |
10 | 10 |
11 struct AVCodec; | 11 struct AVCodec; |
12 struct AVCodecContext; | 12 struct AVCodecContext; |
13 struct AVFormatContext; | 13 struct AVFormatContext; |
14 | 14 |
15 namespace base { class TimeDelta; } | 15 namespace base { class TimeDelta; } |
16 | 16 |
17 namespace media { | 17 namespace media { |
18 | 18 |
19 class FFmpegURLProtocol; | 19 class FFmpegURLProtocol; |
20 | 20 |
21 class MEDIA_EXPORT AudioFileReader { | 21 class AudioFileReader { |
22 public: | 22 public: |
23 // Audio file data will be read using the given protocol. | 23 // Audio file data will be read using the given protocol. |
24 // The AudioFileReader does not take ownership of |protocol| and | 24 // The AudioFileReader does not take ownership of |protocol| and |
25 // simply maintains a weak reference to it. | 25 // simply maintains a weak reference to it. |
26 explicit AudioFileReader(FFmpegURLProtocol* protocol); | 26 explicit AudioFileReader(FFmpegURLProtocol* protocol); |
27 virtual ~AudioFileReader(); | 27 virtual ~AudioFileReader(); |
28 | 28 |
29 // Open() reads the audio data format so that the sample_rate(), | 29 // Open() reads the audio data format so that the sample_rate(), |
30 // channels(), duration(), and number_of_frames() methods can be called. | 30 // channels(), duration(), and number_of_frames() methods can be called. |
31 // It returns |true| on success. | 31 // It returns |true| on success. |
(...skipping 18 matching lines...) Expand all Loading... |
50 AVFormatContext* format_context_; | 50 AVFormatContext* format_context_; |
51 AVCodecContext* codec_context_; | 51 AVCodecContext* codec_context_; |
52 AVCodec* codec_; | 52 AVCodec* codec_; |
53 | 53 |
54 DISALLOW_COPY_AND_ASSIGN(AudioFileReader); | 54 DISALLOW_COPY_AND_ASSIGN(AudioFileReader); |
55 }; | 55 }; |
56 | 56 |
57 } // namespace media | 57 } // namespace media |
58 | 58 |
59 #endif // MEDIA_FILTERS_AUDIO_FILE_READER_H_ | 59 #endif // MEDIA_FILTERS_AUDIO_FILE_READER_H_ |
OLD | NEW |