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 <memory> | 7 #include <memory> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/callback_helpers.h" | 10 #include "base/callback_helpers.h" |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 timestamp_helper_->SetBaseTimestamp(base_timestamp); | 221 timestamp_helper_->SetBaseTimestamp(base_timestamp); |
222 | 222 |
223 std::unique_ptr<MediaTracks> media_tracks(new MediaTracks()); | 223 std::unique_ptr<MediaTracks> media_tracks(new MediaTracks()); |
224 if (config_.IsValidConfig()) { | 224 if (config_.IsValidConfig()) { |
225 media_tracks->AddAudioTrack(config_, 1, "main", "", ""); | 225 media_tracks->AddAudioTrack(config_, 1, "main", "", ""); |
226 } | 226 } |
227 if (!config_cb_.Run(std::move(media_tracks), TextTrackConfigMap())) | 227 if (!config_cb_.Run(std::move(media_tracks), TextTrackConfigMap())) |
228 return -1; | 228 return -1; |
229 | 229 |
230 if (!init_cb_.is_null()) { | 230 if (!init_cb_.is_null()) { |
231 InitParameters params(kInfiniteDuration()); | 231 InitParameters params(kInfiniteDuration); |
232 params.detected_audio_track_count = 1; | 232 params.detected_audio_track_count = 1; |
233 params.auto_update_timestamp_offset = true; | 233 params.auto_update_timestamp_offset = true; |
234 base::ResetAndReturn(&init_cb_).Run(params); | 234 base::ResetAndReturn(&init_cb_).Run(params); |
235 } | 235 } |
236 } | 236 } |
237 | 237 |
238 if (metadata_frame) | 238 if (metadata_frame) |
239 return frame_size; | 239 return frame_size; |
240 | 240 |
241 // TODO(wolenetz/acolwell): Validate and use a common cross-parser TrackId | 241 // TODO(wolenetz/acolwell): Validate and use a common cross-parser TrackId |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
416 if (end_of_segment) { | 416 if (end_of_segment) { |
417 in_media_segment_ = false; | 417 in_media_segment_ = false; |
418 end_of_segment_cb_.Run(); | 418 end_of_segment_cb_.Run(); |
419 } | 419 } |
420 | 420 |
421 timestamp_helper_->SetBaseTimestamp(base::TimeDelta()); | 421 timestamp_helper_->SetBaseTimestamp(base::TimeDelta()); |
422 return true; | 422 return true; |
423 } | 423 } |
424 | 424 |
425 } // namespace media | 425 } // namespace media |
OLD | NEW |