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); |
}; |