| 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 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 321 scoped_refptr<MediaLog> media_log_; | 321 scoped_refptr<MediaLog> media_log_; |
| 322 | 322 |
| 323 // Derived bitrate after initialization has completed. | 323 // Derived bitrate after initialization has completed. |
| 324 int bitrate_; | 324 int bitrate_; |
| 325 | 325 |
| 326 // The first timestamp of the audio or video stream, whichever is lower. This | 326 // The first timestamp of the audio or video stream, whichever is lower. This |
| 327 // is used to adjust timestamps so that external consumers always see a zero | 327 // is used to adjust timestamps so that external consumers always see a zero |
| 328 // based timeline. | 328 // based timeline. |
| 329 base::TimeDelta start_time_; | 329 base::TimeDelta start_time_; |
| 330 | 330 |
| 331 // Finds the stream with the lowest known start time (i.e. not kNoTimestamp |
| 332 // start time) with enabled status matching |enabled|. |
| 333 FFmpegDemuxerStream* FindStreamWithLowestStartTimestamp(bool enabled); |
| 334 |
| 331 // Finds a preferred stream for seeking to |seek_time|. Preference is | 335 // Finds a preferred stream for seeking to |seek_time|. Preference is |
| 332 // typically given to video streams, unless the |seek_time| is earlier than | 336 // typically given to video streams, unless the |seek_time| is earlier than |
| 333 // the start time of the video stream. In that case a stream with the earliest | 337 // the start time of the video stream. In that case a stream with the earliest |
| 334 // start time is preferred. Disabled streams are not considered. | 338 // start time is preferred. Disabled streams are considered only as the last |
| 339 // fallback option. |
| 335 FFmpegDemuxerStream* FindPreferredStreamForSeeking(base::TimeDelta seek_time); | 340 FFmpegDemuxerStream* FindPreferredStreamForSeeking(base::TimeDelta seek_time); |
| 336 | 341 |
| 337 // The Time associated with timestamp 0. Set to a null | 342 // The Time associated with timestamp 0. Set to a null |
| 338 // time if the file doesn't have an association to Time. | 343 // time if the file doesn't have an association to Time. |
| 339 base::Time timeline_offset_; | 344 base::Time timeline_offset_; |
| 340 | 345 |
| 341 // Whether text streams have been enabled for this demuxer. | 346 // Whether text streams have been enabled for this demuxer. |
| 342 bool text_enabled_; | 347 bool text_enabled_; |
| 343 | 348 |
| 344 // Set if we know duration of the audio stream. Used when processing end of | 349 // Set if we know duration of the audio stream. Used when processing end of |
| (...skipping 14 matching lines...) Expand all Loading... |
| 359 base::WeakPtr<FFmpegDemuxer> weak_this_; | 364 base::WeakPtr<FFmpegDemuxer> weak_this_; |
| 360 base::WeakPtrFactory<FFmpegDemuxer> cancel_pending_seek_factory_; | 365 base::WeakPtrFactory<FFmpegDemuxer> cancel_pending_seek_factory_; |
| 361 base::WeakPtrFactory<FFmpegDemuxer> weak_factory_; | 366 base::WeakPtrFactory<FFmpegDemuxer> weak_factory_; |
| 362 | 367 |
| 363 DISALLOW_COPY_AND_ASSIGN(FFmpegDemuxer); | 368 DISALLOW_COPY_AND_ASSIGN(FFmpegDemuxer); |
| 364 }; | 369 }; |
| 365 | 370 |
| 366 } // namespace media | 371 } // namespace media |
| 367 | 372 |
| 368 #endif // MEDIA_FILTERS_FFMPEG_DEMUXER_H_ | 373 #endif // MEDIA_FILTERS_FFMPEG_DEMUXER_H_ |
| OLD | NEW |