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

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

Issue 10912080: Switch to AVIO instead of a custom FFmpeg URLProtocol handler. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebase. Created 8 years, 1 month 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
« no previous file with comments | « media/ffmpeg/ffmpeg_common.cc ('k') | media/filters/audio_file_reader.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) 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 "base/basictypes.h"
9 #include "media/filters/ffmpeg_glue.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "media/base/media_export.h"
10 11
11 struct AVCodecContext; 12 struct AVCodecContext;
12 struct AVFormatContext;
13 13
14 namespace base { class TimeDelta; } 14 namespace base { class TimeDelta; }
15 15
16 namespace media { 16 namespace media {
17 17
18 class AudioBus; 18 class AudioBus;
19 class FFmpegGlue;
19 class FFmpegURLProtocol; 20 class FFmpegURLProtocol;
20 21
21 class MEDIA_EXPORT AudioFileReader { 22 class MEDIA_EXPORT AudioFileReader {
22 public: 23 public:
23 // Audio file data will be read using the given protocol. 24 // Audio file data will be read using the given protocol.
24 // The AudioFileReader does not take ownership of |protocol| and 25 // The AudioFileReader does not take ownership of |protocol| and
25 // simply maintains a weak reference to it. 26 // simply maintains a weak reference to it.
26 explicit AudioFileReader(FFmpegURLProtocol* protocol); 27 explicit AudioFileReader(FFmpegURLProtocol* protocol);
27 virtual ~AudioFileReader(); 28 virtual ~AudioFileReader();
28 29
(...skipping 17 matching lines...) Expand all
46 int sample_rate() const; 47 int sample_rate() const;
47 48
48 // Please note that duration() and number_of_frames() attempt to be accurate, 49 // Please note that duration() and number_of_frames() attempt to be accurate,
49 // but are only estimates. For some encoded formats, the actual duration 50 // but are only estimates. For some encoded formats, the actual duration
50 // of the file can only be determined once all the file data has been read. 51 // of the file can only be determined once all the file data has been read.
51 // The Read() method returns the actual number of sample-frames it has read. 52 // The Read() method returns the actual number of sample-frames it has read.
52 base::TimeDelta duration() const; 53 base::TimeDelta duration() const;
53 int64 number_of_frames() const; 54 int64 number_of_frames() const;
54 55
55 private: 56 private:
56 FFmpegURLProtocol* protocol_; 57 scoped_ptr<FFmpegGlue> glue_;
57 AVFormatContext* format_context_;
58 AVCodecContext* codec_context_; 58 AVCodecContext* codec_context_;
59 int stream_index_; 59 int stream_index_;
60 FFmpegURLProtocol* protocol_;
60 61
61 DISALLOW_COPY_AND_ASSIGN(AudioFileReader); 62 DISALLOW_COPY_AND_ASSIGN(AudioFileReader);
62 }; 63 };
63 64
64 } // namespace media 65 } // namespace media
65 66
66 #endif // MEDIA_FILTERS_AUDIO_FILE_READER_H_ 67 #endif // MEDIA_FILTERS_AUDIO_FILE_READER_H_
OLDNEW
« no previous file with comments | « media/ffmpeg/ffmpeg_common.cc ('k') | media/filters/audio_file_reader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698