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/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 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 if (timestamp_helper_) | 201 if (timestamp_helper_) |
202 base_timestamp = timestamp_helper_->GetTimestamp(); | 202 base_timestamp = timestamp_helper_->GetTimestamp(); |
203 | 203 |
204 timestamp_helper_.reset(new AudioTimestampHelper(sample_rate)); | 204 timestamp_helper_.reset(new AudioTimestampHelper(sample_rate)); |
205 timestamp_helper_->SetBaseTimestamp(base_timestamp); | 205 timestamp_helper_->SetBaseTimestamp(base_timestamp); |
206 | 206 |
207 VideoDecoderConfig video_config; | 207 VideoDecoderConfig video_config; |
208 bool success = config_cb_.Run(config_, video_config, TextTrackConfigMap()); | 208 bool success = config_cb_.Run(config_, video_config, TextTrackConfigMap()); |
209 | 209 |
210 if (!init_cb_.is_null()) | 210 if (!init_cb_.is_null()) |
211 base::ResetAndReturn(&init_cb_).Run(success, kInfiniteDuration(), true); | 211 base::ResetAndReturn(&init_cb_).Run( |
| 212 success, kInfiniteDuration(), base::Time(), true); |
212 | 213 |
213 if (!success) | 214 if (!success) |
214 return -1; | 215 return -1; |
215 } | 216 } |
216 | 217 |
217 // TODO(wolenetz/acolwell): Validate and use a common cross-parser TrackId | 218 // TODO(wolenetz/acolwell): Validate and use a common cross-parser TrackId |
218 // type and allow multiple audio tracks, if applicable. See | 219 // type and allow multiple audio tracks, if applicable. See |
219 // https://crbug.com/341581. | 220 // https://crbug.com/341581. |
220 scoped_refptr<StreamParserBuffer> buffer = | 221 scoped_refptr<StreamParserBuffer> buffer = |
221 StreamParserBuffer::CopyFrom(data, frame_size, true, | 222 StreamParserBuffer::CopyFrom(data, frame_size, true, |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
391 if (end_of_segment) { | 392 if (end_of_segment) { |
392 in_media_segment_ = false; | 393 in_media_segment_ = false; |
393 end_of_segment_cb_.Run(); | 394 end_of_segment_cb_.Run(); |
394 } | 395 } |
395 | 396 |
396 timestamp_helper_->SetBaseTimestamp(base::TimeDelta()); | 397 timestamp_helper_->SetBaseTimestamp(base::TimeDelta()); |
397 return true; | 398 return true; |
398 } | 399 } |
399 | 400 |
400 } // namespace media | 401 } // namespace media |
OLD | NEW |