| 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 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 401 | 401 |
| 402 bool MPEGAudioStreamParserBase::SendBuffers(BufferQueue* buffers, | 402 bool MPEGAudioStreamParserBase::SendBuffers(BufferQueue* buffers, |
| 403 bool end_of_segment) { | 403 bool end_of_segment) { |
| 404 DCHECK(!buffers->empty()); | 404 DCHECK(!buffers->empty()); |
| 405 | 405 |
| 406 if (!in_media_segment_) { | 406 if (!in_media_segment_) { |
| 407 in_media_segment_ = true; | 407 in_media_segment_ = true; |
| 408 new_segment_cb_.Run(); | 408 new_segment_cb_.Run(); |
| 409 } | 409 } |
| 410 | 410 |
| 411 BufferQueue empty_video_buffers; | 411 BufferQueueMap buffer_queue_map; |
| 412 TextBufferQueueMap empty_text_map; | 412 buffer_queue_map.insert(std::make_pair(kMpegAudioTrackId, *buffers)); |
| 413 if (!new_buffers_cb_.Run(*buffers, empty_video_buffers, empty_text_map)) | 413 if (!new_buffers_cb_.Run(buffer_queue_map)) |
| 414 return false; | 414 return false; |
| 415 buffers->clear(); | 415 buffers->clear(); |
| 416 | 416 |
| 417 if (end_of_segment) { | 417 if (end_of_segment) { |
| 418 in_media_segment_ = false; | 418 in_media_segment_ = false; |
| 419 end_of_segment_cb_.Run(); | 419 end_of_segment_cb_.Run(); |
| 420 } | 420 } |
| 421 | 421 |
| 422 timestamp_helper_->SetBaseTimestamp(base::TimeDelta()); | 422 timestamp_helper_->SetBaseTimestamp(base::TimeDelta()); |
| 423 return true; | 423 return true; |
| 424 } | 424 } |
| 425 | 425 |
| 426 } // namespace media | 426 } // namespace media |
| OLD | NEW |