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

Unified Diff: media/filters/chunk_demuxer.h

Issue 1812543003: Allow muting/unmuting audio through media track API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@blink-sb-tracks6
Patch Set: rebase Created 4 years, 9 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
Index: media/filters/chunk_demuxer.h
diff --git a/media/filters/chunk_demuxer.h b/media/filters/chunk_demuxer.h
index 677fa2a41cff9bee3114f9e7f46872b887899e44..beae244c95b5391edc75ed6d2d289139dfea8f0d 100644
--- a/media/filters/chunk_demuxer.h
+++ b/media/filters/chunk_demuxer.h
@@ -208,6 +208,15 @@ class MEDIA_EXPORT ChunkDemuxer : public Demuxer {
void SetTracksWatcher(const std::string& id,
const MediaTracksUpdatedCB& tracks_updated_cb);
+ // Notifies the demuxer that a track id has been assigned to a media track.
+ // If |track| is null the association for this |track_id| is removed.
wolenetz 2016/03/30 00:31:32 who owns the memory pointed to by |track|?
servolk 2016/03/30 01:13:13 It doesn't matter, because we don't actually care
wolenetz 2016/03/30 20:15:55 Hmm. Using a pointer just as an ID is not clear an
+ void OnTrackIdAssigned(unsigned track_id, const MediaTrack* track) override;
+
+ // Finds a DemuxerStream corresponding to the given blink |track_id|. Note
+ // that the input track id is blink track id and not bytestream track id.
+ const DemuxerStream* GetDemuxerStreamByTrackId(
+ unsigned track_id) const override;
+
// Removed an ID & associated resources that were previously added with
// AddId().
void RemoveId(const std::string& id);
@@ -318,10 +327,10 @@ class MEDIA_EXPORT ChunkDemuxer : public Demuxer {
// MediaSourceState callbacks.
void OnSourceInitDone(const StreamParser::InitParameters& params);
- // Creates a DemuxerStream for the specified |type|.
+ // Creates a DemuxerStream for the specified |media_track|.
// Returns a new ChunkDemuxerStream instance if a stream of this type
// has not been created before. Returns NULL otherwise.
- ChunkDemuxerStream* CreateDemuxerStream(DemuxerStream::Type type);
+ ChunkDemuxerStream* CreateDemuxerStream(const MediaTrack& media_track);
void OnNewTextTrack(ChunkDemuxerStream* text_stream,
const TextTrackConfig& config);
@@ -381,6 +390,9 @@ class MEDIA_EXPORT ChunkDemuxer : public Demuxer {
scoped_ptr<ChunkDemuxerStream> audio_;
scoped_ptr<ChunkDemuxerStream> video_;
+ std::map<unsigned, const MediaTrack*> track_id_to_track_map_;
+ std::map<const MediaTrack*, const DemuxerStream*> track_to_stream_map_;
+
base::TimeDelta duration_;
// The duration passed to the last SetDuration(). If

Powered by Google App Engine
This is Rietveld 408576698