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

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: AVIO! Created 8 years, 2 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
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 11 matching lines...) Expand all
40 // Returns |true| on success. 41 // Returns |true| on success.
41 bool Read(AudioBus* audio_bus); 42 bool Read(AudioBus* audio_bus);
42 43
43 // These methods can be called once Open() has been called. 44 // These methods can be called once Open() has been called.
44 int channels() const; 45 int channels() const;
45 int sample_rate() const; 46 int sample_rate() const;
46 base::TimeDelta duration() const; 47 base::TimeDelta duration() const;
47 int64 number_of_frames() const; 48 int64 number_of_frames() const;
48 49
49 private: 50 private:
50 FFmpegURLProtocol* protocol_; 51 scoped_ptr<FFmpegGlue> glue_;
51 AVFormatContext* format_context_;
52 AVCodecContext* codec_context_; 52 AVCodecContext* codec_context_;
53 int stream_index_; 53 int stream_index_;
54 54
55 DISALLOW_COPY_AND_ASSIGN(AudioFileReader); 55 DISALLOW_COPY_AND_ASSIGN(AudioFileReader);
56 }; 56 };
57 57
58 } // namespace media 58 } // namespace media
59 59
60 #endif // MEDIA_FILTERS_AUDIO_FILE_READER_H_ 60 #endif // MEDIA_FILTERS_AUDIO_FILE_READER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698