Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef MEDIA_BASE_MEDIA_TRACK_H_ | 5 #ifndef MEDIA_BASE_MEDIA_TRACK_H_ |
| 6 #define MEDIA_BASE_MEDIA_TRACK_H_ | 6 #define MEDIA_BASE_MEDIA_TRACK_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "media/base/media_export.h" | 10 #include "media/base/media_export.h" |
| 11 #include "media/base/stream_parser.h" | 11 #include "media/base/stream_parser.h" |
| 12 | 12 |
| 13 namespace media { | 13 namespace media { |
| 14 class DemuxerStream; | |
|
xhwang
2016/06/09 06:06:02
Why is this needed?
servolk
2016/06/09 19:14:46
Not needed, leftover from earlier prototyping. Rem
| |
| 14 | 15 |
| 15 class MEDIA_EXPORT MediaTrack { | 16 class MEDIA_EXPORT MediaTrack { |
| 16 public: | 17 public: |
| 17 enum Type { Text, Audio, Video }; | 18 enum Type { Text, Audio, Video }; |
| 19 using TrackId = std::string; | |
|
xhwang
2016/06/09 06:06:02
Will it work if s/Trackid/Id? MediaTrack::TrackId
servolk
2016/06/09 19:14:46
Done.
| |
| 18 MediaTrack(Type type, | 20 MediaTrack(Type type, |
| 19 StreamParser::TrackId byteStreamTrackId, | 21 StreamParser::TrackId byteStreamTrackId, |
| 20 const std::string& kind, | 22 const std::string& kind, |
| 21 const std::string& label, | 23 const std::string& label, |
| 22 const std::string& lang); | 24 const std::string& lang); |
| 23 ~MediaTrack(); | 25 ~MediaTrack(); |
| 24 | 26 |
| 25 Type type() const { return type_; } | 27 Type type() const { return type_; } |
| 26 | 28 |
| 27 StreamParser::TrackId byteStreamTrackId() const { return byteStreamTrackId_; } | 29 StreamParser::TrackId byteStreamTrackId() const { return byteStreamTrackId_; } |
| 28 const std::string& kind() const { return kind_; } | 30 const std::string& kind() const { return kind_; } |
| 29 const std::string& label() const { return label_; } | 31 const std::string& label() const { return label_; } |
| 30 const std::string& language() const { return language_; } | 32 const std::string& language() const { return language_; } |
| 31 | 33 |
| 34 TrackId id() const; | |
| 35 void setId(TrackId id); | |
|
xhwang
2016/06/09 06:06:02
set_id()
servolk
2016/06/09 19:14:46
Done.
| |
| 36 | |
| 32 private: | 37 private: |
| 33 Type type_; | 38 Type type_; |
| 34 StreamParser::TrackId byteStreamTrackId_; | 39 StreamParser::TrackId byteStreamTrackId_; |
|
xhwang
2016/06/09 06:06:02
nit: use lower_cast instead of CamelCase
servolk
2016/06/09 19:14:46
Done.
| |
| 35 std::string kind_; | 40 std::string kind_; |
| 36 std::string label_; | 41 std::string label_; |
| 37 std::string language_; | 42 std::string language_; |
|
xhwang
2016/06/09 06:06:02
Can you add comments about what these fields are?
servolk
2016/06/09 19:14:46
Done.
| |
| 43 TrackId id_; | |
|
xhwang
2016/06/09 06:06:02
What's the requirement on the uniqueness of the tr
xhwang
2016/06/09 06:06:02
Can you comment about the difference b/w byteStrea
servolk
2016/06/09 19:14:46
IIUC these need to be unique in the scope of a sin
servolk
2016/06/09 19:14:46
Done.
| |
| 38 }; | 44 }; |
| 39 | 45 |
| 40 } // namespace media | 46 } // namespace media |
| 41 | 47 |
| 42 #endif // MEDIA_BASE_MEDIA_TRACK_H_ | 48 #endif // MEDIA_BASE_MEDIA_TRACK_H_ |
| OLD | NEW |