| 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()); | 211 base::ResetAndReturn(&init_cb_).Run(success, kInfiniteDuration(), true); |
| 212 | 212 |
| 213 if (!success) | 213 if (!success) |
| 214 return -1; | 214 return -1; |
| 215 } | 215 } |
| 216 | 216 |
| 217 // TODO(wolenetz/acolwell): Validate and use a common cross-parser TrackId | 217 // TODO(wolenetz/acolwell): Validate and use a common cross-parser TrackId |
| 218 // type and allow multiple audio tracks, if applicable. See | 218 // type and allow multiple audio tracks, if applicable. See |
| 219 // https://crbug.com/341581. | 219 // https://crbug.com/341581. |
| 220 scoped_refptr<StreamParserBuffer> buffer = | 220 scoped_refptr<StreamParserBuffer> buffer = |
| 221 StreamParserBuffer::CopyFrom(data, frame_size, true, | 221 StreamParserBuffer::CopyFrom(data, frame_size, true, |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 386 TextBufferQueueMap empty_text_map; | 386 TextBufferQueueMap empty_text_map; |
| 387 if (!new_buffers_cb_.Run(*buffers, empty_video_buffers, empty_text_map)) | 387 if (!new_buffers_cb_.Run(*buffers, empty_video_buffers, empty_text_map)) |
| 388 return false; | 388 return false; |
| 389 buffers->clear(); | 389 buffers->clear(); |
| 390 | 390 |
| 391 if (end_of_segment) { | 391 if (end_of_segment) { |
| 392 in_media_segment_ = false; | 392 in_media_segment_ = false; |
| 393 end_of_segment_cb_.Run(); | 393 end_of_segment_cb_.Run(); |
| 394 } | 394 } |
| 395 | 395 |
| 396 timestamp_helper_->SetBaseTimestamp(base::TimeDelta()); |
| 396 return true; | 397 return true; |
| 397 } | 398 } |
| 398 | 399 |
| 399 } // namespace media | 400 } // namespace media |
| OLD | NEW |