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

Side by Side Diff: media/cast/test/fake_media_source.cc

Issue 2004283002: AudioConverter: Express delay in frames rather than msec. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Missed files & removed rounding Created 4 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
« no previous file with comments | « media/cast/test/fake_media_source.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/cast/test/fake_media_source.h" 5 #include "media/cast/test/fake_media_source.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/files/scoped_file.h" 10 #include "base/files/scoped_file.h"
(...skipping 574 matching lines...) Expand 10 before | Expand all | Expand 10 after
585 } 585 }
586 586
587 if (audio_packet) 587 if (audio_packet)
588 DecodeAudio(std::move(packet)); 588 DecodeAudio(std::move(packet));
589 else 589 else
590 DecodeVideo(std::move(packet)); 590 DecodeVideo(std::move(packet));
591 } 591 }
592 } 592 }
593 593
594 double FakeMediaSource::ProvideInput(media::AudioBus* output_bus, 594 double FakeMediaSource::ProvideInput(media::AudioBus* output_bus,
595 base::TimeDelta buffer_delay) { 595 uint32_t frames_delayed) {
596 if (audio_fifo_->frames() >= output_bus->frames()) { 596 if (audio_fifo_->frames() >= output_bus->frames()) {
597 audio_fifo_->Consume(output_bus, 0, output_bus->frames()); 597 audio_fifo_->Consume(output_bus, 0, output_bus->frames());
598 return 1.0; 598 return 1.0;
599 } else { 599 } else {
600 LOG(WARNING) << "Not enough audio data for resampling."; 600 LOG(WARNING) << "Not enough audio data for resampling.";
601 output_bus->Zero(); 601 output_bus->Zero();
602 return 0.0; 602 return 0.0;
603 } 603 }
604 } 604 }
605 605
(...skipping 17 matching lines...) Expand all
623 AVCodecContext* FakeMediaSource::av_audio_context() { 623 AVCodecContext* FakeMediaSource::av_audio_context() {
624 return av_audio_stream()->codec; 624 return av_audio_stream()->codec;
625 } 625 }
626 626
627 AVCodecContext* FakeMediaSource::av_video_context() { 627 AVCodecContext* FakeMediaSource::av_video_context() {
628 return av_video_stream()->codec; 628 return av_video_stream()->codec;
629 } 629 }
630 630
631 } // namespace cast 631 } // namespace cast
632 } // namespace media 632 } // namespace media
OLDNEW
« no previous file with comments | « media/cast/test/fake_media_source.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698