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

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

Issue 257563007: Don't double correct for discarded codec delay frames. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Style cleanup. Fix rendundant Initialize(). Created 6 years, 8 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 | Annotate | Revision Log
« 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 "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "media/base/media_export.h" 10 #include "media/base/media_export.h"
11 11
12 struct AVCodecContext; 12 struct AVCodecContext;
13 struct AVPacket;
13 14
14 namespace base { class TimeDelta; } 15 namespace base { class TimeDelta; }
15 16
16 namespace media { 17 namespace media {
17 18
18 class AudioBus; 19 class AudioBus;
19 class FFmpegGlue; 20 class FFmpegGlue;
20 class FFmpegURLProtocol; 21 class FFmpegURLProtocol;
21 22
22 class MEDIA_EXPORT AudioFileReader { 23 class MEDIA_EXPORT AudioFileReader {
(...skipping 24 matching lines...) Expand all
47 int sample_rate() const { return sample_rate_; } 48 int sample_rate() const { return sample_rate_; }
48 49
49 // Please note that GetDuration() and GetNumberOfFrames() attempt to be 50 // Please note that GetDuration() and GetNumberOfFrames() attempt to be
50 // accurate, but are only estimates. For some encoded formats, the actual 51 // accurate, but are only estimates. For some encoded formats, the actual
51 // duration of the file can only be determined once all the file data has been 52 // duration of the file can only be determined once all the file data has been
52 // read. The Read() method returns the actual number of sample-frames it has 53 // read. The Read() method returns the actual number of sample-frames it has
53 // read. 54 // read.
54 base::TimeDelta GetDuration() const; 55 base::TimeDelta GetDuration() const;
55 int GetNumberOfFrames() const; 56 int GetNumberOfFrames() const;
56 57
58 // Helper methods which allows AudioFileReader to double as a test utility for
59 // demuxing audio files. Returns true if a packet could be demuxed from the
60 // first audio stream in the file, |output_packet| will contain the demuxed
61 // packet then.
62 bool ReadPacketForTesting(AVPacket* output_packet);
63
64 const AVCodecContext* codec_context_for_testing() const {
65 return codec_context_;
66 }
67
57 private: 68 private:
69 bool ReadPacket(AVPacket* output_packet);
70
58 scoped_ptr<FFmpegGlue> glue_; 71 scoped_ptr<FFmpegGlue> glue_;
59 AVCodecContext* codec_context_; 72 AVCodecContext* codec_context_;
60 int stream_index_; 73 int stream_index_;
61 FFmpegURLProtocol* protocol_; 74 FFmpegURLProtocol* protocol_;
62 int channels_; 75 int channels_;
63 int sample_rate_; 76 int sample_rate_;
64 77
65 // AVSampleFormat initially requested; not Chrome's SampleFormat. 78 // AVSampleFormat initially requested; not Chrome's SampleFormat.
66 int av_sample_format_; 79 int av_sample_format_;
67 80
68 DISALLOW_COPY_AND_ASSIGN(AudioFileReader); 81 DISALLOW_COPY_AND_ASSIGN(AudioFileReader);
69 }; 82 };
70 83
71 } // namespace media 84 } // namespace media
72 85
73 #endif // MEDIA_FILTERS_AUDIO_FILE_READER_H_ 86 #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