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" | |
wolenetz
2016/02/26 00:06:21
nit: is this include necessary in this file?
servolk
2016/02/26 01:56:32
Done.
| |
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(); | |
wolenetz
2016/02/26 00:06:21
ditto: is virtual needed here?
servolk
2016/02/26 01:56:31
Done.
| |
27 | |
28 void AddAudioTrack(const AudioDecoderConfig& config, | |
wolenetz
2016/02/26 00:06:21
What is the behavior if any of these params are in
servolk
2016/02/26 01:56:32
Well this CL was meant to be a quick prototype to
wolenetz
2016/02/26 19:29:27
Please add a comment that |id| collision within ea
servolk
2016/02/26 22:02:41
Done + actually added CHECKs in the method impl to
| |
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; | |
wolenetz
2016/02/26 00:06:21
nit: typedef at top of class (per https://google.g
servolk
2016/02/26 01:56:32
Done.
| |
40 const MediaTracksCollection& tracks() const { return tracks_; } | |
41 | |
42 const AudioDecoderConfig& getAudioConfig(const std::string& id) const; | |
wolenetz
2016/02/26 00:06:21
What is the behavior if there is no audio/video co
servolk
2016/02/26 01:56:32
it'll return an invalid a/v config.
| |
43 const VideoDecoderConfig& getVideoConfig(const std::string& id) const; | |
44 | |
45 // TODO(servolk): These are temporary helpers useful until all code paths are | |
wolenetz
2016/02/26 00:06:21
nit: what about text tracks?
servolk
2016/02/26 01:56:32
Currently the text tracks seem to be already suppo
| |
46 // converted to properly handle multiple media tracks. | |
47 const AudioDecoderConfig& getFirstAudioConfig() const; | |
wolenetz
2016/02/26 00:06:21
What is the behavior if there is no first audio/vi
servolk
2016/02/26 01:56:32
Current behavior is to return invalid A/V configs.
| |
48 const VideoDecoderConfig& getFirstVideoConfig() const; | |
49 | |
50 private: | |
51 DISALLOW_COPY_AND_ASSIGN(MediaTracks); | |
wolenetz
2016/02/26 00:06:21
nit: should be last thing in the class (https://go
servolk
2016/02/26 01:56:32
Done.
| |
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 |