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 #include "media/base/media_track.h" | 5 #include "media/base/media_track.h" |
6 | 6 |
7 namespace media { | 7 namespace media { |
8 | 8 |
9 MediaTrack::MediaTrack(Type type, | 9 MediaTrack::MediaTrack(Type type, |
10 StreamParser::TrackId bytestream_track_id, | 10 StreamParser::TrackId bytestream_track_id, |
11 const std::string& kind, | 11 const std::string& kind, |
12 const std::string& label, | 12 const std::string& label, |
13 const std::string& lang) | 13 const std::string& lang) |
14 : type_(type), | 14 : type_(type), |
15 bytestream_track_id_(bytestream_track_id), | 15 bytestream_track_id_(bytestream_track_id), |
16 kind_(kind), | 16 kind_(kind), |
17 label_(label), | 17 label_(label), |
18 language_(lang) {} | 18 language_(lang) {} |
19 | 19 |
20 MediaTrack::~MediaTrack() {} | 20 MediaTrack::~MediaTrack() {} |
21 | 21 |
| 22 const char* TrackTypeToStr(MediaTrack::Type type) { |
| 23 switch (type) { |
| 24 case MediaTrack::Audio: |
| 25 return "audio"; |
| 26 case MediaTrack::Text: |
| 27 return "text"; |
| 28 case MediaTrack::Video: |
| 29 return "video"; |
| 30 } |
| 31 NOTREACHED(); |
| 32 return "INVALID"; |
| 33 } |
| 34 |
22 } // namespace media | 35 } // namespace media |
OLD | NEW |