| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/formats/webm/webm_stream_parser.h" | 5 #include "media/formats/webm/webm_stream_parser.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/callback_helpers.h" | 10 #include "base/callback_helpers.h" |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 | 200 |
| 201 if (info_parser.duration() > 0) { | 201 if (info_parser.duration() > 0) { |
| 202 int64 duration_in_us = info_parser.duration() * timecode_scale_in_us; | 202 int64 duration_in_us = info_parser.duration() * timecode_scale_in_us; |
| 203 params.duration = base::TimeDelta::FromMicroseconds(duration_in_us); | 203 params.duration = base::TimeDelta::FromMicroseconds(duration_in_us); |
| 204 } | 204 } |
| 205 | 205 |
| 206 params.timeline_offset = info_parser.date_utc(); | 206 params.timeline_offset = info_parser.date_utc(); |
| 207 | 207 |
| 208 if (unknown_segment_size_ && (info_parser.duration() <= 0) && | 208 if (unknown_segment_size_ && (info_parser.duration() <= 0) && |
| 209 !info_parser.date_utc().is_null()) { | 209 !info_parser.date_utc().is_null()) { |
| 210 params.liveness = Demuxer::LIVENESS_LIVE; | 210 params.liveness = DemuxerStream::LIVENESS_LIVE; |
| 211 } else if (info_parser.duration() >= 0) { | 211 } else if (info_parser.duration() >= 0) { |
| 212 params.liveness = Demuxer::LIVENESS_RECORDED; | 212 params.liveness = DemuxerStream::LIVENESS_RECORDED; |
| 213 } else { | 213 } else { |
| 214 params.liveness = Demuxer::LIVENESS_UNKNOWN; | 214 params.liveness = DemuxerStream::LIVENESS_UNKNOWN; |
| 215 } | 215 } |
| 216 | 216 |
| 217 const AudioDecoderConfig& audio_config = tracks_parser.audio_decoder_config(); | 217 const AudioDecoderConfig& audio_config = tracks_parser.audio_decoder_config(); |
| 218 if (audio_config.is_encrypted()) | 218 if (audio_config.is_encrypted()) |
| 219 FireNeedKey(tracks_parser.audio_encryption_key_id()); | 219 FireNeedKey(tracks_parser.audio_encryption_key_id()); |
| 220 | 220 |
| 221 const VideoDecoderConfig& video_config = tracks_parser.video_decoder_config(); | 221 const VideoDecoderConfig& video_config = tracks_parser.video_decoder_config(); |
| 222 if (video_config.is_encrypted()) | 222 if (video_config.is_encrypted()) |
| 223 FireNeedKey(tracks_parser.video_encryption_key_id()); | 223 FireNeedKey(tracks_parser.video_encryption_key_id()); |
| 224 | 224 |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 | 274 |
| 275 return bytes_parsed; | 275 return bytes_parsed; |
| 276 } | 276 } |
| 277 | 277 |
| 278 void WebMStreamParser::FireNeedKey(const std::string& key_id) { | 278 void WebMStreamParser::FireNeedKey(const std::string& key_id) { |
| 279 std::vector<uint8> key_id_vector(key_id.begin(), key_id.end()); | 279 std::vector<uint8> key_id_vector(key_id.begin(), key_id.end()); |
| 280 need_key_cb_.Run(kWebMInitDataType, key_id_vector); | 280 need_key_cb_.Run(kWebMInitDataType, key_id_vector); |
| 281 } | 281 } |
| 282 | 282 |
| 283 } // namespace media | 283 } // namespace media |
| OLD | NEW |