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

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

Issue 2254093002: Return buffers from StreamParsers in a single unified map (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Restored calling GetBuffers after each Parse in WebM test Created 4 years, 4 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
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 <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
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
OLDNEW
« no previous file with comments | « media/formats/mp4/mp4_stream_parser_unittest.cc ('k') | media/formats/webm/webm_cluster_parser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698