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 // Implements the Demuxer interface using FFmpeg's libavformat. At this time | 5 // Implements the Demuxer interface using FFmpeg's libavformat. At this time |
6 // will support demuxing any audio/video format thrown at it. The streams | 6 // will support demuxing any audio/video format thrown at it. The streams |
7 // output mime types audio/x-ffmpeg and video/x-ffmpeg and include an integer | 7 // output mime types audio/x-ffmpeg and video/x-ffmpeg and include an integer |
8 // key FFmpegCodecID which contains the CodecID enumeration value. The CodecIDs | 8 // key FFmpegCodecID which contains the CodecID enumeration value. The CodecIDs |
9 // can be used to create and initialize the corresponding FFmpeg decoder. | 9 // can be used to create and initialize the corresponding FFmpeg decoder. |
10 // | 10 // |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 virtual bool SetPosition(int64 position); | 154 virtual bool SetPosition(int64 position); |
155 virtual bool GetSize(int64* size_out); | 155 virtual bool GetSize(int64* size_out); |
156 virtual bool IsStreaming(); | 156 virtual bool IsStreaming(); |
157 | 157 |
158 // Provide access to FFmpegDemuxerStream. | 158 // Provide access to FFmpegDemuxerStream. |
159 MessageLoop* message_loop(); | 159 MessageLoop* message_loop(); |
160 | 160 |
161 // For testing purposes. | 161 // For testing purposes. |
162 void disable_first_seek_hack_for_testing() { first_seek_hack_ = false; } | 162 void disable_first_seek_hack_for_testing() { first_seek_hack_ = false; } |
163 | 163 |
| 164 // Returns the bitrate of media file. May be obtained from container or |
| 165 // approximated. Returns 0 if it is unknown. |
| 166 int GetBitrate(); |
| 167 |
164 private: | 168 private: |
165 // Only allow a factory to create this class. | 169 // Only allow a factory to create this class. |
166 friend class MockFFmpegDemuxer; | 170 friend class MockFFmpegDemuxer; |
167 FRIEND_TEST_ALL_PREFIXES(FFmpegDemuxerTest, ProtocolRead); | 171 FRIEND_TEST_ALL_PREFIXES(FFmpegDemuxerTest, ProtocolRead); |
168 | 172 |
169 // Carries out initialization on the demuxer thread. | 173 // Carries out initialization on the demuxer thread. |
170 void InitializeTask( | 174 void InitializeTask( |
171 DataSource* data_source, const PipelineStatusCB& callback); | 175 DataSource* data_source, const PipelineStatusCB& callback); |
172 | 176 |
173 // Carries out a seek on the demuxer thread. | 177 // Carries out a seek on the demuxer thread. |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 // starting clock value to match the timestamps in the media file. Default | 258 // starting clock value to match the timestamps in the media file. Default |
255 // is 0. | 259 // is 0. |
256 base::TimeDelta start_time_; | 260 base::TimeDelta start_time_; |
257 | 261 |
258 DISALLOW_COPY_AND_ASSIGN(FFmpegDemuxer); | 262 DISALLOW_COPY_AND_ASSIGN(FFmpegDemuxer); |
259 }; | 263 }; |
260 | 264 |
261 } // namespace media | 265 } // namespace media |
262 | 266 |
263 #endif // MEDIA_FILTERS_FFMPEG_DEMUXER_H_ | 267 #endif // MEDIA_FILTERS_FFMPEG_DEMUXER_H_ |
OLD | NEW |