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 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 virtual ~FFmpegDemuxer(); | 161 virtual ~FFmpegDemuxer(); |
162 | 162 |
163 // Demuxer implementation. | 163 // Demuxer implementation. |
164 virtual void Initialize(DemuxerHost* host, | 164 virtual void Initialize(DemuxerHost* host, |
165 const PipelineStatusCB& status_cb, | 165 const PipelineStatusCB& status_cb, |
166 bool enable_text_tracks) OVERRIDE; | 166 bool enable_text_tracks) OVERRIDE; |
167 virtual void Stop() OVERRIDE; | 167 virtual void Stop() OVERRIDE; |
168 virtual void Seek(base::TimeDelta time, const PipelineStatusCB& cb) OVERRIDE; | 168 virtual void Seek(base::TimeDelta time, const PipelineStatusCB& cb) OVERRIDE; |
169 virtual base::Time GetTimelineOffset() const OVERRIDE; | 169 virtual base::Time GetTimelineOffset() const OVERRIDE; |
170 virtual DemuxerStream* GetStream(DemuxerStream::Type type) OVERRIDE; | 170 virtual DemuxerStream* GetStream(DemuxerStream::Type type) OVERRIDE; |
| 171 virtual base::TimeDelta GetStartTime() const OVERRIDE; |
171 virtual Liveness GetLiveness() const OVERRIDE; | 172 virtual Liveness GetLiveness() const OVERRIDE; |
172 | 173 |
173 // Calls |need_key_cb_| with the initialization data encountered in the file. | 174 // Calls |need_key_cb_| with the initialization data encountered in the file. |
174 void FireNeedKey(const std::string& init_data_type, | 175 void FireNeedKey(const std::string& init_data_type, |
175 const std::string& encryption_key_id); | 176 const std::string& encryption_key_id); |
176 | 177 |
177 // Allow FFmpegDemuxerStream to notify us when there is updated information | 178 // Allow FFmpegDemuxerStream to notify us when there is updated information |
178 // about capacity and what buffered data is available. | 179 // about capacity and what buffered data is available. |
179 void NotifyCapacityAvailable(); | 180 void NotifyCapacityAvailable(); |
180 void NotifyBufferingChanged(); | 181 void NotifyBufferingChanged(); |
181 | 182 |
182 // The lowest demuxed timestamp. DemuxerStream's must use this to adjust | 183 // The lowest demuxed timestamp. If negative, DemuxerStreams must use this to |
183 // packet timestamps such that external clients see a zero-based timeline. | 184 // adjust packet timestamps such that external clients see a zero-based |
| 185 // timeline. |
184 base::TimeDelta start_time() const { return start_time_; } | 186 base::TimeDelta start_time() const { return start_time_; } |
185 | 187 |
186 private: | 188 private: |
187 // To allow tests access to privates. | 189 // To allow tests access to privates. |
188 friend class FFmpegDemuxerTest; | 190 friend class FFmpegDemuxerTest; |
189 | 191 |
190 // FFmpeg callbacks during initialization. | 192 // FFmpeg callbacks during initialization. |
191 void OnOpenContextDone(const PipelineStatusCB& status_cb, bool result); | 193 void OnOpenContextDone(const PipelineStatusCB& status_cb, bool result); |
192 void OnFindStreamInfoDone(const PipelineStatusCB& status_cb, int result); | 194 void OnFindStreamInfoDone(const PipelineStatusCB& status_cb, int result); |
193 | 195 |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 | 297 |
296 // NOTE: Weak pointers must be invalidated before all other member variables. | 298 // NOTE: Weak pointers must be invalidated before all other member variables. |
297 base::WeakPtrFactory<FFmpegDemuxer> weak_factory_; | 299 base::WeakPtrFactory<FFmpegDemuxer> weak_factory_; |
298 | 300 |
299 DISALLOW_COPY_AND_ASSIGN(FFmpegDemuxer); | 301 DISALLOW_COPY_AND_ASSIGN(FFmpegDemuxer); |
300 }; | 302 }; |
301 | 303 |
302 } // namespace media | 304 } // namespace media |
303 | 305 |
304 #endif // MEDIA_FILTERS_FFMPEG_DEMUXER_H_ | 306 #endif // MEDIA_FILTERS_FFMPEG_DEMUXER_H_ |
OLD | NEW |