| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 // Demuxer implementation. | 148 // Demuxer implementation. |
| 149 virtual void Initialize(DemuxerHost* host, | 149 virtual void Initialize(DemuxerHost* host, |
| 150 const PipelineStatusCB& status_cb, | 150 const PipelineStatusCB& status_cb, |
| 151 bool enable_text_tracks) OVERRIDE; | 151 bool enable_text_tracks) OVERRIDE; |
| 152 virtual void Stop(const base::Closure& callback) OVERRIDE; | 152 virtual void Stop(const base::Closure& callback) OVERRIDE; |
| 153 virtual void Seek(base::TimeDelta time, const PipelineStatusCB& cb) OVERRIDE; | 153 virtual void Seek(base::TimeDelta time, const PipelineStatusCB& cb) OVERRIDE; |
| 154 virtual void OnAudioRendererDisabled() OVERRIDE; | 154 virtual void OnAudioRendererDisabled() OVERRIDE; |
| 155 virtual DemuxerStream* GetStream(DemuxerStream::Type type) OVERRIDE; | 155 virtual DemuxerStream* GetStream(DemuxerStream::Type type) OVERRIDE; |
| 156 virtual base::TimeDelta GetStartTime() const OVERRIDE; | 156 virtual base::TimeDelta GetStartTime() const OVERRIDE; |
| 157 virtual base::Time GetTimelineOffset() const OVERRIDE; | 157 virtual base::Time GetTimelineOffset() const OVERRIDE; |
| 158 virtual Liveness GetLiveness() const OVERRIDE; |
| 158 | 159 |
| 159 // Calls |need_key_cb_| with the initialization data encountered in the file. | 160 // Calls |need_key_cb_| with the initialization data encountered in the file. |
| 160 void FireNeedKey(const std::string& init_data_type, | 161 void FireNeedKey(const std::string& init_data_type, |
| 161 const std::string& encryption_key_id); | 162 const std::string& encryption_key_id); |
| 162 | 163 |
| 163 // Allow FFmpegDemuxerStream to notify us when there is updated information | 164 // Allow FFmpegDemuxerStream to notify us when there is updated information |
| 164 // about capacity and what buffered data is available. | 165 // about capacity and what buffered data is available. |
| 165 void NotifyCapacityAvailable(); | 166 void NotifyCapacityAvailable(); |
| 166 void NotifyBufferingChanged(); | 167 void NotifyBufferingChanged(); |
| 167 | 168 |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 | 245 |
| 245 // The first timestamp of the opened media file. This is used to set the | 246 // The first timestamp of the opened media file. This is used to set the |
| 246 // starting clock value to match the timestamps in the media file. Default | 247 // starting clock value to match the timestamps in the media file. Default |
| 247 // is 0. | 248 // is 0. |
| 248 base::TimeDelta start_time_; | 249 base::TimeDelta start_time_; |
| 249 | 250 |
| 250 // The Time associated with timestamp 0. Set to a null | 251 // The Time associated with timestamp 0. Set to a null |
| 251 // time if the file doesn't have an association to Time. | 252 // time if the file doesn't have an association to Time. |
| 252 base::Time timeline_offset_; | 253 base::Time timeline_offset_; |
| 253 | 254 |
| 255 // Liveness of the stream. |
| 256 Liveness liveness_; |
| 257 |
| 254 // Whether audio has been disabled for this demuxer (in which case this class | 258 // Whether audio has been disabled for this demuxer (in which case this class |
| 255 // drops packets destined for AUDIO demuxer streams on the floor). | 259 // drops packets destined for AUDIO demuxer streams on the floor). |
| 256 bool audio_disabled_; | 260 bool audio_disabled_; |
| 257 | 261 |
| 258 // Whether text streams have been enabled for this demuxer. | 262 // Whether text streams have been enabled for this demuxer. |
| 259 bool text_enabled_; | 263 bool text_enabled_; |
| 260 | 264 |
| 261 // Set if we know duration of the audio stream. Used when processing end of | 265 // Set if we know duration of the audio stream. Used when processing end of |
| 262 // stream -- at this moment we definitely know duration. | 266 // stream -- at this moment we definitely know duration. |
| 263 bool duration_known_; | 267 bool duration_known_; |
| 264 | 268 |
| 265 // FFmpegURLProtocol implementation and corresponding glue bits. | 269 // FFmpegURLProtocol implementation and corresponding glue bits. |
| 266 scoped_ptr<BlockingUrlProtocol> url_protocol_; | 270 scoped_ptr<BlockingUrlProtocol> url_protocol_; |
| 267 scoped_ptr<FFmpegGlue> glue_; | 271 scoped_ptr<FFmpegGlue> glue_; |
| 268 | 272 |
| 269 const NeedKeyCB need_key_cb_; | 273 const NeedKeyCB need_key_cb_; |
| 270 | 274 |
| 271 // NOTE: Weak pointers must be invalidated before all other member variables. | 275 // NOTE: Weak pointers must be invalidated before all other member variables. |
| 272 base::WeakPtrFactory<FFmpegDemuxer> weak_factory_; | 276 base::WeakPtrFactory<FFmpegDemuxer> weak_factory_; |
| 273 | 277 |
| 274 DISALLOW_COPY_AND_ASSIGN(FFmpegDemuxer); | 278 DISALLOW_COPY_AND_ASSIGN(FFmpegDemuxer); |
| 275 }; | 279 }; |
| 276 | 280 |
| 277 } // namespace media | 281 } // namespace media |
| 278 | 282 |
| 279 #endif // MEDIA_FILTERS_FFMPEG_DEMUXER_H_ | 283 #endif // MEDIA_FILTERS_FFMPEG_DEMUXER_H_ |
| OLD | NEW |