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 <memory> |
| 9 |
8 #include "base/macros.h" | 10 #include "base/macros.h" |
9 #include "base/memory/scoped_ptr.h" | |
10 #include "media/base/audio_codecs.h" | 11 #include "media/base/audio_codecs.h" |
11 #include "media/base/media_export.h" | 12 #include "media/base/media_export.h" |
12 #include "media/filters/ffmpeg_glue.h" | 13 #include "media/filters/ffmpeg_glue.h" |
13 | 14 |
14 struct AVCodecContext; | 15 struct AVCodecContext; |
15 struct AVPacket; | 16 struct AVPacket; |
16 struct AVStream; | 17 struct AVStream; |
17 | 18 |
18 namespace base { class TimeDelta; } | 19 namespace base { class TimeDelta; } |
19 | 20 |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 const AVStream* GetAVStreamForTesting() const; | 76 const AVStream* GetAVStreamForTesting() const; |
76 const AVCodecContext* codec_context_for_testing() const { | 77 const AVCodecContext* codec_context_for_testing() const { |
77 return codec_context_; | 78 return codec_context_; |
78 } | 79 } |
79 | 80 |
80 private: | 81 private: |
81 bool OpenDemuxer(); | 82 bool OpenDemuxer(); |
82 bool OpenDecoder(); | 83 bool OpenDecoder(); |
83 bool ReadPacket(AVPacket* output_packet); | 84 bool ReadPacket(AVPacket* output_packet); |
84 | 85 |
85 scoped_ptr<FFmpegGlue> glue_; | 86 std::unique_ptr<FFmpegGlue> glue_; |
86 AVCodecContext* codec_context_; | 87 AVCodecContext* codec_context_; |
87 int stream_index_; | 88 int stream_index_; |
88 FFmpegURLProtocol* protocol_; | 89 FFmpegURLProtocol* protocol_; |
89 AudioCodec audio_codec_; | 90 AudioCodec audio_codec_; |
90 int channels_; | 91 int channels_; |
91 int sample_rate_; | 92 int sample_rate_; |
92 | 93 |
93 // AVSampleFormat initially requested; not Chrome's SampleFormat. | 94 // AVSampleFormat initially requested; not Chrome's SampleFormat. |
94 int av_sample_format_; | 95 int av_sample_format_; |
95 | 96 |
96 DISALLOW_COPY_AND_ASSIGN(AudioFileReader); | 97 DISALLOW_COPY_AND_ASSIGN(AudioFileReader); |
97 }; | 98 }; |
98 | 99 |
99 } // namespace media | 100 } // namespace media |
100 | 101 |
101 #endif // MEDIA_FILTERS_AUDIO_FILE_READER_H_ | 102 #endif // MEDIA_FILTERS_AUDIO_FILE_READER_H_ |
OLD | NEW |