| 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" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 id_ = id; | 39 id_ = id; |
| 40 } | 40 } |
| 41 | 41 |
| 42 private: | 42 private: |
| 43 Type type_; | 43 Type type_; |
| 44 | 44 |
| 45 // |bytestream_track_id_| is read from the bytestream and is guaranteed to be | 45 // |bytestream_track_id_| is read from the bytestream and is guaranteed to be |
| 46 // unique only within the scope of single bytestream's initialization segment. | 46 // unique only within the scope of single bytestream's initialization segment. |
| 47 // But we might have multiple bytestreams (MediaSource might have multiple | 47 // But we might have multiple bytestreams (MediaSource might have multiple |
| 48 // SourceBuffers attached to it, which translates into ChunkDemuxer having | 48 // SourceBuffers attached to it, which translates into ChunkDemuxer having |
| 49 // multiple MediaSourceStates and multiple bytestreams) or subsequent init | 49 // multiple SourceBufferStates and multiple bytestreams) or subsequent init |
| 50 // segments may redefine the bytestream ids. Thus bytestream track ids are not | 50 // segments may redefine the bytestream ids. Thus bytestream track ids are not |
| 51 // guaranteed to be unique at the Demuxer and HTMLMediaElement level. So we | 51 // guaranteed to be unique at the Demuxer and HTMLMediaElement level. So we |
| 52 // generate truly unique media track |id_| on the Demuxer level. | 52 // generate truly unique media track |id_| on the Demuxer level. |
| 53 StreamParser::TrackId bytestream_track_id_; | 53 StreamParser::TrackId bytestream_track_id_; |
| 54 Id id_; | 54 Id id_; |
| 55 | 55 |
| 56 // These properties are read from input streams by stream parsers as specified | 56 // These properties are read from input streams by stream parsers as specified |
| 57 // in https://dev.w3.org/html5/html-sourcing-inband-tracks/. | 57 // in https://dev.w3.org/html5/html-sourcing-inband-tracks/. |
| 58 std::string kind_; | 58 std::string kind_; |
| 59 std::string label_; | 59 std::string label_; |
| 60 std::string language_; | 60 std::string language_; |
| 61 }; | 61 }; |
| 62 | 62 |
| 63 // Helper for logging. | 63 // Helper for logging. |
| 64 MEDIA_EXPORT const char* TrackTypeToStr(MediaTrack::Type type); | 64 MEDIA_EXPORT const char* TrackTypeToStr(MediaTrack::Type type); |
| 65 | 65 |
| 66 } // namespace media | 66 } // namespace media |
| 67 | 67 |
| 68 #endif // MEDIA_BASE_MEDIA_TRACK_H_ | 68 #endif // MEDIA_BASE_MEDIA_TRACK_H_ |
| OLD | NEW |