Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(107)

Side by Side Diff: media/filters/ffmpeg_demuxer.h

Issue 1260193005: Fix incorrect opus seek preroll and flaky pre-skip removal. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Simplify Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 void SetEndOfStream(); 70 void SetEndOfStream();
71 71
72 // Drops queued buffers and clears end of stream state. 72 // Drops queued buffers and clears end of stream state.
73 void FlushBuffers(); 73 void FlushBuffers();
74 74
75 // Empties the queues and ignores any additional calls to Read(). 75 // Empties the queues and ignores any additional calls to Read().
76 void Stop(); 76 void Stop();
77 77
78 base::TimeDelta duration() const { return duration_; } 78 base::TimeDelta duration() const { return duration_; }
79 79
80 // Enables fixes for ogg files with negative timestamps. For AUDIO streams, 80 // Enables fixes for files with negative timestamps. For AUDIO streams, all
81 // all packets with negative timestamps will be marked for post-decode 81 // packets with negative timestamps will be marked for post-decode discard.
82 // discard. For all other stream types, if FFmpegDemuxer::start_time() is 82 // For all other stream types, if FFmpegDemuxer::start_time() is negative, it
83 // negative, it will not be used to shift timestamps during EnqueuePacket(). 83 // will not be used to shift timestamps during EnqueuePacket().
84 void enable_negative_timestamp_fixups_for_ogg() { 84 void enable_negative_timestamp_fixups() {
85 fixup_negative_ogg_timestamps_ = true; 85 fixup_negative_timestamps_ = true;
86 } 86 }
87 87
88 // DemuxerStream implementation. 88 // DemuxerStream implementation.
89 Type type() const override; 89 Type type() const override;
90 Liveness liveness() const override; 90 Liveness liveness() const override;
91 void Read(const ReadCB& read_cb) override; 91 void Read(const ReadCB& read_cb) override;
92 void EnableBitstreamConverter() override; 92 void EnableBitstreamConverter() override;
93 bool SupportsConfigChanges() override; 93 bool SupportsConfigChanges() override;
94 AudioDecoderConfig audio_decoder_config() override; 94 AudioDecoderConfig audio_decoder_config() override;
95 VideoDecoderConfig video_decoder_config() override; 95 VideoDecoderConfig video_decoder_config() override;
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 VideoRotation video_rotation_; 148 VideoRotation video_rotation_;
149 149
150 DecoderBufferQueue buffer_queue_; 150 DecoderBufferQueue buffer_queue_;
151 ReadCB read_cb_; 151 ReadCB read_cb_;
152 152
153 #if defined(USE_PROPRIETARY_CODECS) 153 #if defined(USE_PROPRIETARY_CODECS)
154 scoped_ptr<FFmpegBitstreamConverter> bitstream_converter_; 154 scoped_ptr<FFmpegBitstreamConverter> bitstream_converter_;
155 #endif 155 #endif
156 156
157 std::string encryption_key_id_; 157 std::string encryption_key_id_;
158 bool fixup_negative_ogg_timestamps_; 158 bool fixup_negative_timestamps_;
159 159
160 DISALLOW_COPY_AND_ASSIGN(FFmpegDemuxerStream); 160 DISALLOW_COPY_AND_ASSIGN(FFmpegDemuxerStream);
161 }; 161 };
162 162
163 class MEDIA_EXPORT FFmpegDemuxer : public Demuxer { 163 class MEDIA_EXPORT FFmpegDemuxer : public Demuxer {
164 public: 164 public:
165 FFmpegDemuxer(const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, 165 FFmpegDemuxer(const scoped_refptr<base::SingleThreadTaskRunner>& task_runner,
166 DataSource* data_source, 166 DataSource* data_source,
167 const EncryptedMediaInitDataCB& encrypted_media_init_data_cb, 167 const EncryptedMediaInitDataCB& encrypted_media_init_data_cb,
168 const scoped_refptr<MediaLog>& media_log); 168 const scoped_refptr<MediaLog>& media_log);
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 305
306 // NOTE: Weak pointers must be invalidated before all other member variables. 306 // NOTE: Weak pointers must be invalidated before all other member variables.
307 base::WeakPtrFactory<FFmpegDemuxer> weak_factory_; 307 base::WeakPtrFactory<FFmpegDemuxer> weak_factory_;
308 308
309 DISALLOW_COPY_AND_ASSIGN(FFmpegDemuxer); 309 DISALLOW_COPY_AND_ASSIGN(FFmpegDemuxer);
310 }; 310 };
311 311
312 } // namespace media 312 } // namespace media
313 313
314 #endif // MEDIA_FILTERS_FFMPEG_DEMUXER_H_ 314 #endif // MEDIA_FILTERS_FFMPEG_DEMUXER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698