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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 friend class FFmpegDemuxerTest; | 117 friend class FFmpegDemuxerTest; |
118 | 118 |
119 // Runs |read_cb_| if present with the front of |buffer_queue_|, calling | 119 // Runs |read_cb_| if present with the front of |buffer_queue_|, calling |
120 // NotifyCapacityAvailable() if capacity is still available. | 120 // NotifyCapacityAvailable() if capacity is still available. |
121 void SatisfyPendingRead(); | 121 void SatisfyPendingRead(); |
122 | 122 |
123 // Converts an FFmpeg stream timestamp into a base::TimeDelta. | 123 // Converts an FFmpeg stream timestamp into a base::TimeDelta. |
124 static base::TimeDelta ConvertStreamTimestamp(const AVRational& time_base, | 124 static base::TimeDelta ConvertStreamTimestamp(const AVRational& time_base, |
125 int64 timestamp); | 125 int64 timestamp); |
126 | 126 |
| 127 // Resets any currently active bitstream converters. |
| 128 void ResetBitstreamConverter(); |
| 129 |
127 FFmpegDemuxer* demuxer_; | 130 FFmpegDemuxer* demuxer_; |
128 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | 131 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
129 AVStream* stream_; | 132 AVStream* stream_; |
130 AudioDecoderConfig audio_config_; | 133 AudioDecoderConfig audio_config_; |
131 VideoDecoderConfig video_config_; | 134 VideoDecoderConfig video_config_; |
132 Type type_; | 135 Type type_; |
133 base::TimeDelta duration_; | 136 base::TimeDelta duration_; |
134 bool end_of_stream_; | 137 bool end_of_stream_; |
135 base::TimeDelta last_packet_timestamp_; | 138 base::TimeDelta last_packet_timestamp_; |
136 base::TimeDelta last_packet_duration_; | 139 base::TimeDelta last_packet_duration_; |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 | 300 |
298 // NOTE: Weak pointers must be invalidated before all other member variables. | 301 // NOTE: Weak pointers must be invalidated before all other member variables. |
299 base::WeakPtrFactory<FFmpegDemuxer> weak_factory_; | 302 base::WeakPtrFactory<FFmpegDemuxer> weak_factory_; |
300 | 303 |
301 DISALLOW_COPY_AND_ASSIGN(FFmpegDemuxer); | 304 DISALLOW_COPY_AND_ASSIGN(FFmpegDemuxer); |
302 }; | 305 }; |
303 | 306 |
304 } // namespace media | 307 } // namespace media |
305 | 308 |
306 #endif // MEDIA_FILTERS_FFMPEG_DEMUXER_H_ | 309 #endif // MEDIA_FILTERS_FFMPEG_DEMUXER_H_ |
OLD | NEW |