Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2198)

Side by Side Diff: media/formats/webm/webm_stream_parser.cc

Issue 692323002: Move Liveness from DemuxerStreamProvider to DemuxerStream. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix mojo Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « media/filters/video_renderer_impl_unittest.cc ('k') | media/mojo/services/demuxer_stream_provider_shim.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698