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/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 Loading... |
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 Loading... |
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 |
OLD | NEW |