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

Unified Diff: media/base/media_tracks.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: Avoid ChunkDemuxer/PipelineImpl deadlock Created 4 years, 8 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/base/demuxer.h ('k') | media/base/media_tracks.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/media_tracks.h
diff --git a/media/base/media_tracks.h b/media/base/media_tracks.h
index 4e0fbb0fc1f88195ce14cc05d14a424924be4d5d..b45f81dd7b37cbb522b36576867360c35bd215e6 100644
--- a/media/base/media_tracks.h
+++ b/media/base/media_tracks.h
@@ -17,30 +17,47 @@
namespace media {
class AudioDecoderConfig;
+class DemuxerStream;
class VideoDecoderConfig;
class MEDIA_EXPORT MediaTracks {
public:
typedef std::vector<scoped_ptr<MediaTrack>> MediaTracksCollection;
+ typedef std::map<unsigned, const DemuxerStream*> TrackIdToDemuxStreamMap;
MediaTracks();
~MediaTracks();
// Callers need to ensure that track id is unique.
- void AddAudioTrack(const AudioDecoderConfig& config,
- const std::string& id,
- const std::string& kind,
- const std::string& label,
- const std::string& language);
+ const MediaTrack* AddAudioTrack(const AudioDecoderConfig& config,
+ const std::string& id,
+ const std::string& kind,
+ const std::string& label,
+ const std::string& language);
// Callers need to ensure that track id is unique.
- void AddVideoTrack(const VideoDecoderConfig& config,
- const std::string& id,
- const std::string& kind,
- const std::string& label,
- const std::string& language);
+ const MediaTrack* AddVideoTrack(const VideoDecoderConfig& config,
+ const std::string& id,
+ const std::string& kind,
+ const std::string& label,
+ const std::string& language);
const MediaTracksCollection& tracks() const { return tracks_; }
+ // TODO(servolk,wolenetz): Consider refactoring media track creation in MSE to
+ // simplify track id to DemuxerStream mapping. crbug.com/604088
+
+ // Notifies MediaTracks that a given media |track| object is backed by the
+ // given DemuxerStream |stream| object.
+ void SetDemuxerStreamForMediaTrack(const MediaTrack* track,
+ const DemuxerStream* stream);
+ // Notifies MediaTracks that external (blink) track ids have been assigned to
+ // the media |tracks_|. The size and ordering of |track_ids| must match the
+ // size and ordering of tracks in the |tracks_| collection, and
+ // |track_to_demux_stream_map_| must have an entry for each track in |tracks_|
+ // (set by SetDemuxerStreamForMediaTrack()).
+ TrackIdToDemuxStreamMap OnTrackIdsAssigned(
+ const std::vector<unsigned>& track_ids) const;
+
const AudioDecoderConfig& getAudioConfig(const std::string& id) const;
const VideoDecoderConfig& getVideoConfig(const std::string& id) const;
@@ -54,6 +71,10 @@ class MEDIA_EXPORT MediaTracks {
std::map<std::string, AudioDecoderConfig> audio_configs_;
std::map<std::string, VideoDecoderConfig> video_configs_;
+ typedef std::map<const MediaTrack*, const DemuxerStream*>
+ TrackToDemuxStreamMap;
+ TrackToDemuxStreamMap track_to_demux_stream_map_;
+
DISALLOW_COPY_AND_ASSIGN(MediaTracks);
};
« no previous file with comments | « media/base/demuxer.h ('k') | media/base/media_tracks.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698