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

Unified 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: rebase 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/filters/decrypting_demuxer_stream.cc ('k') | media/filters/ffmpeg_demuxer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/ffmpeg_demuxer.h
diff --git a/media/filters/ffmpeg_demuxer.h b/media/filters/ffmpeg_demuxer.h
index def9d2a45d987fd8b9613eff6c895dc25322e043..550316f8918ab001e9970e2fbafd5f7ece69e03a 100644
--- a/media/filters/ffmpeg_demuxer.h
+++ b/media/filters/ffmpeg_demuxer.h
@@ -110,6 +110,9 @@ class FFmpegDemuxerStream : public DemuxerStream {
AudioDecoderConfig audio_decoder_config() override;
VideoDecoderConfig video_decoder_config() override;
VideoRotation video_rotation() override;
+ bool enabled() const override;
+ void set_enabled(bool enabled, base::TimeDelta timestamp) override;
+ void SetStreamRestartedCB(const StreamRestartedCB& cb) override;
void SetLiveness(Liveness liveness);
@@ -171,9 +174,12 @@ class FFmpegDemuxerStream : public DemuxerStream {
base::TimeDelta last_packet_duration_;
Ranges<base::TimeDelta> buffered_ranges_;
VideoRotation video_rotation_;
+ bool is_enabled_;
+ bool waiting_for_keyframe_;
DecoderBufferQueue buffer_queue_;
ReadCB read_cb_;
+ StreamRestartedCB stream_restarted_cb_;
#if defined(USE_PROPRIETARY_CODECS)
std::unique_ptr<FFmpegBitstreamConverter> bitstream_converter_;
@@ -218,6 +224,12 @@ class MEDIA_EXPORT FFmpegDemuxer : public Demuxer {
void NotifyCapacityAvailable();
void NotifyBufferingChanged();
+ void OnEnabledAudioTracksChanged(const std::vector<MediaTrack::Id>& track_ids,
+ base::TimeDelta currTime) override;
+ // |track_ids| is either empty or contains a single video track id.
+ void OnSelectedVideoTrackChanged(const std::vector<MediaTrack::Id>& track_ids,
+ base::TimeDelta currTime) override;
+
// The lowest demuxed timestamp. If negative, DemuxerStreams must use this to
// adjust packet timestamps such that external clients see a zero-based
// timeline.
@@ -334,6 +346,8 @@ class MEDIA_EXPORT FFmpegDemuxer : public Demuxer {
const MediaTracksUpdatedCB media_tracks_updated_cb_;
+ std::map<MediaTrack::Id, const DemuxerStream*> track_id_to_demux_stream_map_;
+
// NOTE: Weak pointers must be invalidated before all other member variables.
base::WeakPtrFactory<FFmpegDemuxer> weak_factory_;
« no previous file with comments | « media/filters/decrypting_demuxer_stream.cc ('k') | media/filters/ffmpeg_demuxer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698