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

Side by Side Diff: media/filters/opus_audio_decoder.cc

Issue 17315021: Refactored DataBuffer to use unix_hacker style methods. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Inlined getters and setters on DataBuffer Created 7 years, 6 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/filters/opus_audio_decoder.h" 5 #include "media/filters/opus_audio_decoder.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/location.h" 9 #include "base/location.h"
10 #include "base/message_loop/message_loop_proxy.h" 10 #include "base/message_loop/message_loop_proxy.h"
(...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after
544 DCHECK_EQ(dropped_size % kBytesPerChannel, 0); 544 DCHECK_EQ(dropped_size % kBytesPerChannel, 0);
545 decoded_audio_data += dropped_size; 545 decoded_audio_data += dropped_size;
546 decoded_audio_size -= dropped_size; 546 decoded_audio_size -= dropped_size;
547 output_bytes_to_drop_ -= dropped_size; 547 output_bytes_to_drop_ -= dropped_size;
548 } 548 }
549 549
550 if (decoded_audio_size > 0) { 550 if (decoded_audio_size > 0) {
551 // Copy the audio samples into an output buffer. 551 // Copy the audio samples into an output buffer.
552 *output_buffer = DataBuffer::CopyFrom( 552 *output_buffer = DataBuffer::CopyFrom(
553 decoded_audio_data, decoded_audio_size); 553 decoded_audio_data, decoded_audio_size);
554 (*output_buffer)->SetTimestamp(output_timestamp_helper_->GetTimestamp()); 554 (*output_buffer)->set_timestamp(output_timestamp_helper_->GetTimestamp());
555 (*output_buffer)->SetDuration( 555 (*output_buffer)->set_duration(
556 output_timestamp_helper_->GetDuration(decoded_audio_size)); 556 output_timestamp_helper_->GetDuration(decoded_audio_size));
557 output_timestamp_helper_->AddBytes(decoded_audio_size); 557 output_timestamp_helper_->AddBytes(decoded_audio_size);
558 } 558 }
559 559
560 // Decoding finished successfully, update statistics. 560 // Decoding finished successfully, update statistics.
561 PipelineStatistics statistics; 561 PipelineStatistics statistics;
562 statistics.audio_bytes_decoded = decoded_audio_size; 562 statistics.audio_bytes_decoded = decoded_audio_size;
563 statistics_cb_.Run(statistics); 563 statistics_cb_.Run(statistics);
564 564
565 return true; 565 return true;
566 } 566 }
567 567
568 } // namespace media 568 } // namespace media
OLDNEW
« no previous file with comments | « media/filters/ffmpeg_audio_decoder_unittest.cc ('k') | webkit/plugins/ppapi/content_decryptor_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698