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

Side by Side Diff: media/formats/mpeg/mpeg_audio_stream_parser_base.cc

Issue 231283005: Add live mode detection in WebM MediaSource parser. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 months 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 | Annotate | Revision Log
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/mpeg/mpeg_audio_stream_parser_base.h" 5 #include "media/formats/mpeg/mpeg_audio_stream_parser_base.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback_helpers.h" 8 #include "base/callback_helpers.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "media/base/buffers.h" 10 #include "media/base/buffers.h"
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 base::TimeDelta base_timestamp; 215 base::TimeDelta base_timestamp;
216 if (timestamp_helper_) 216 if (timestamp_helper_)
217 base_timestamp = timestamp_helper_->GetTimestamp(); 217 base_timestamp = timestamp_helper_->GetTimestamp();
218 218
219 timestamp_helper_.reset(new AudioTimestampHelper(sample_rate)); 219 timestamp_helper_.reset(new AudioTimestampHelper(sample_rate));
220 timestamp_helper_->SetBaseTimestamp(base_timestamp); 220 timestamp_helper_->SetBaseTimestamp(base_timestamp);
221 221
222 VideoDecoderConfig video_config; 222 VideoDecoderConfig video_config;
223 bool success = config_cb_.Run(config_, video_config, TextTrackConfigMap()); 223 bool success = config_cb_.Run(config_, video_config, TextTrackConfigMap());
224 224
225 if (!init_cb_.is_null()) 225 if (!init_cb_.is_null()) {
226 base::ResetAndReturn(&init_cb_).Run( 226 base::ResetAndReturn(&init_cb_).Run(
227 success, kInfiniteDuration(), base::Time(), true); 227 success, kInfiniteDuration(), base::Time(), true, false);
228 }
228 229
229 if (!success) 230 if (!success)
230 return -1; 231 return -1;
231 } 232 }
232 233
233 if (metadata_frame) 234 if (metadata_frame)
234 return frame_size; 235 return frame_size;
235 236
236 // TODO(wolenetz/acolwell): Validate and use a common cross-parser TrackId 237 // TODO(wolenetz/acolwell): Validate and use a common cross-parser TrackId
237 // type and allow multiple audio tracks, if applicable. See 238 // type and allow multiple audio tracks, if applicable. See
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
410 if (end_of_segment) { 411 if (end_of_segment) {
411 in_media_segment_ = false; 412 in_media_segment_ = false;
412 end_of_segment_cb_.Run(); 413 end_of_segment_cb_.Run();
413 } 414 }
414 415
415 timestamp_helper_->SetBaseTimestamp(base::TimeDelta()); 416 timestamp_helper_->SetBaseTimestamp(base::TimeDelta());
416 return true; 417 return true;
417 } 418 }
418 419
419 } // namespace media 420 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698