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

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

Issue 1935873002: Implement disabling and enabling media tracks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@track-control2
Patch Set: Updated comments + dchecks in ffmpeg demux stream Created 4 years, 6 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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 104
105 // DemuxerStream implementation. 105 // DemuxerStream implementation.
106 Type type() const override; 106 Type type() const override;
107 Liveness liveness() const override; 107 Liveness liveness() const override;
108 void Read(const ReadCB& read_cb) override; 108 void Read(const ReadCB& read_cb) override;
109 void EnableBitstreamConverter() override; 109 void EnableBitstreamConverter() override;
110 bool SupportsConfigChanges() override; 110 bool SupportsConfigChanges() override;
111 AudioDecoderConfig audio_decoder_config() override; 111 AudioDecoderConfig audio_decoder_config() override;
112 VideoDecoderConfig video_decoder_config() override; 112 VideoDecoderConfig video_decoder_config() override;
113 VideoRotation video_rotation() override; 113 VideoRotation video_rotation() override;
114 bool enabled() const override;
115 void set_enabled(bool enabled, base::TimeDelta timestamp) override;
114 116
115 void SetLiveness(Liveness liveness); 117 void SetLiveness(Liveness liveness);
116 118
117 // Returns the range of buffered data in this stream. 119 // Returns the range of buffered data in this stream.
118 Ranges<base::TimeDelta> GetBufferedRanges() const; 120 Ranges<base::TimeDelta> GetBufferedRanges() const;
119 121
120 // Returns elapsed time based on the already queued packets. 122 // Returns elapsed time based on the already queued packets.
121 // Used to determine stream duration when it's not known ahead of time. 123 // Used to determine stream duration when it's not known ahead of time.
122 base::TimeDelta GetElapsedTime() const; 124 base::TimeDelta GetElapsedTime() const;
123 125
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 std::unique_ptr<AudioDecoderConfig> audio_config_; 167 std::unique_ptr<AudioDecoderConfig> audio_config_;
166 std::unique_ptr<VideoDecoderConfig> video_config_; 168 std::unique_ptr<VideoDecoderConfig> video_config_;
167 Type type_; 169 Type type_;
168 Liveness liveness_; 170 Liveness liveness_;
169 base::TimeDelta duration_; 171 base::TimeDelta duration_;
170 bool end_of_stream_; 172 bool end_of_stream_;
171 base::TimeDelta last_packet_timestamp_; 173 base::TimeDelta last_packet_timestamp_;
172 base::TimeDelta last_packet_duration_; 174 base::TimeDelta last_packet_duration_;
173 Ranges<base::TimeDelta> buffered_ranges_; 175 Ranges<base::TimeDelta> buffered_ranges_;
174 VideoRotation video_rotation_; 176 VideoRotation video_rotation_;
177 bool is_enabled_;
175 178
176 DecoderBufferQueue buffer_queue_; 179 DecoderBufferQueue buffer_queue_;
177 ReadCB read_cb_; 180 ReadCB read_cb_;
178 181
179 #if defined(USE_PROPRIETARY_CODECS) 182 #if defined(USE_PROPRIETARY_CODECS)
180 std::unique_ptr<FFmpegBitstreamConverter> bitstream_converter_; 183 std::unique_ptr<FFmpegBitstreamConverter> bitstream_converter_;
181 #endif 184 #endif
182 185
183 std::string encryption_key_id_; 186 std::string encryption_key_id_;
184 bool fixup_negative_timestamps_; 187 bool fixup_negative_timestamps_;
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
348 351
349 // NOTE: Weak pointers must be invalidated before all other member variables. 352 // NOTE: Weak pointers must be invalidated before all other member variables.
350 base::WeakPtrFactory<FFmpegDemuxer> weak_factory_; 353 base::WeakPtrFactory<FFmpegDemuxer> weak_factory_;
351 354
352 DISALLOW_COPY_AND_ASSIGN(FFmpegDemuxer); 355 DISALLOW_COPY_AND_ASSIGN(FFmpegDemuxer);
353 }; 356 };
354 357
355 } // namespace media 358 } // namespace media
356 359
357 #endif // MEDIA_FILTERS_FFMPEG_DEMUXER_H_ 360 #endif // MEDIA_FILTERS_FFMPEG_DEMUXER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698