OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef MEDIA_BASE_MEDIA_TRACKS_H_ |
| 6 #define MEDIA_BASE_MEDIA_TRACKS_H_ |
| 7 |
| 8 #include <map> |
| 9 #include <string> |
| 10 #include <vector> |
| 11 |
| 12 #include "base/callback.h" |
| 13 #include "base/macros.h" |
| 14 #include "base/memory/scoped_ptr.h" |
| 15 #include "media/base/media_export.h" |
| 16 #include "media/base/media_track.h" |
| 17 |
| 18 namespace media { |
| 19 |
| 20 class AudioDecoderConfig; |
| 21 class VideoDecoderConfig; |
| 22 |
| 23 class MEDIA_EXPORT MediaTracks { |
| 24 public: |
| 25 MediaTracks(); |
| 26 virtual ~MediaTracks(); |
| 27 |
| 28 void AddAudioTrack(const AudioDecoderConfig& config, |
| 29 const std::string& id, |
| 30 const std::string& kind, |
| 31 const std::string& label, |
| 32 const std::string& language); |
| 33 void AddVideoTrack(const VideoDecoderConfig& config, |
| 34 const std::string& id, |
| 35 const std::string& kind, |
| 36 const std::string& label, |
| 37 const std::string& language); |
| 38 |
| 39 typedef std::vector<scoped_ptr<MediaTrack>> MediaTracksCollection; |
| 40 const MediaTracksCollection& tracks() const { return tracks_; } |
| 41 |
| 42 const AudioDecoderConfig& getAudioConfig(const std::string& id) const; |
| 43 const VideoDecoderConfig& getVideoConfig(const std::string& id) const; |
| 44 |
| 45 // TODO(servolk): These are temporary helpers useful until all code paths are |
| 46 // converted to properly handle multiple media tracks. |
| 47 const AudioDecoderConfig& getFirstAudioConfig() const; |
| 48 const VideoDecoderConfig& getFirstVideoConfig() const; |
| 49 |
| 50 private: |
| 51 DISALLOW_COPY_AND_ASSIGN(MediaTracks); |
| 52 |
| 53 MediaTracksCollection tracks_; |
| 54 std::map<std::string, AudioDecoderConfig> audio_configs_; |
| 55 std::map<std::string, VideoDecoderConfig> video_configs_; |
| 56 }; |
| 57 |
| 58 } // namespace media |
| 59 |
| 60 #endif // MEDIA_BASE_MEDIA_TRACKS_H_ |
OLD | NEW |