OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/webm/webm_tracks_parser.h" | 5 #include "media/webm/webm_tracks_parser.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
9 #include "media/base/buffers.h" | 9 #include "media/base/buffers.h" |
10 #include "media/webm/webm_constants.h" | 10 #include "media/webm/webm_constants.h" |
11 #include "media/webm/webm_content_encodings.h" | 11 #include "media/webm/webm_content_encodings.h" |
12 | 12 |
13 namespace media { | 13 namespace media { |
14 | 14 |
15 // Values for TrackType element. | 15 // Values for TrackType element. |
16 static const int kWebMTrackTypeVideo = 1; | 16 static const int kWebMTrackTypeVideo = 1; |
17 static const int kWebMTrackTypeAudio = 2; | 17 static const int kWebMTrackTypeAudio = 2; |
18 | 18 |
19 WebMTracksParser::WebMTracksParser(int64 timecode_scale) | 19 WebMTracksParser::WebMTracksParser() |
20 : timecode_scale_(timecode_scale), | 20 : track_type_(-1), |
21 track_type_(-1), | |
22 track_num_(-1), | 21 track_num_(-1), |
23 audio_track_num_(-1), | 22 audio_track_num_(-1), |
24 video_track_num_(-1) { | 23 video_track_num_(-1) { |
25 } | 24 } |
26 | 25 |
27 WebMTracksParser::~WebMTracksParser() {} | 26 WebMTracksParser::~WebMTracksParser() {} |
28 | 27 |
29 const uint8* WebMTracksParser::video_encryption_key_id() const { | 28 const uint8* WebMTracksParser::video_encryption_key_id() const { |
30 if (!video_content_encodings_client_.get()) | 29 if (!video_content_encodings_client_.get()) |
31 return NULL; | 30 return NULL; |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 bool WebMTracksParser::OnString(int id, const std::string& str) { | 150 bool WebMTracksParser::OnString(int id, const std::string& str) { |
152 if (id == kWebMIdCodecID && str != "A_VORBIS" && str != "V_VP8") { | 151 if (id == kWebMIdCodecID && str != "A_VORBIS" && str != "V_VP8") { |
153 DVLOG(1) << "Unexpected CodecID " << str; | 152 DVLOG(1) << "Unexpected CodecID " << str; |
154 return false; | 153 return false; |
155 } | 154 } |
156 | 155 |
157 return true; | 156 return true; |
158 } | 157 } |
159 | 158 |
160 } // namespace media | 159 } // namespace media |
OLD | NEW |