OLD | NEW |
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 "content/renderer/media/webrtc_audio_capturer.h" | 5 #include "content/renderer/media/webrtc_audio_capturer.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
459 } | 459 } |
460 | 460 |
461 DCHECK(audio_processor->InputFormat().IsValid()); | 461 DCHECK(audio_processor->InputFormat().IsValid()); |
462 DCHECK_EQ(audio_source->channels(), | 462 DCHECK_EQ(audio_source->channels(), |
463 audio_processor->InputFormat().channels()); | 463 audio_processor->InputFormat().channels()); |
464 DCHECK_EQ(audio_source->frames(), | 464 DCHECK_EQ(audio_source->frames(), |
465 audio_processor->InputFormat().frames_per_buffer()); | 465 audio_processor->InputFormat().frames_per_buffer()); |
466 | 466 |
467 // Notify the tracks on when the format changes. This will do nothing if | 467 // Notify the tracks on when the format changes. This will do nothing if |
468 // |tracks_to_notify_format| is empty. | 468 // |tracks_to_notify_format| is empty. |
469 media::AudioParameters output_params = audio_processor_->OutputFormat(); | 469 media::AudioParameters output_params = audio_processor->OutputFormat(); |
470 for (TrackList::ItemList::const_iterator it = tracks_to_notify_format.begin(); | 470 for (TrackList::ItemList::const_iterator it = tracks_to_notify_format.begin(); |
471 it != tracks_to_notify_format.end(); ++it) { | 471 it != tracks_to_notify_format.end(); ++it) { |
472 (*it)->OnSetFormat(output_params); | 472 (*it)->OnSetFormat(output_params); |
473 } | 473 } |
474 | 474 |
475 // Push the data to the processor for processing. | 475 // Push the data to the processor for processing. |
476 audio_processor->PushCaptureData(audio_source); | 476 audio_processor->PushCaptureData(audio_source); |
477 | 477 |
478 // Process and consume the data in the processor until there is not enough | 478 // Process and consume the data in the processor until there is not enough |
479 // data in the processor. | 479 // data in the processor. |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
560 const scoped_refptr<media::AudioCapturerSource>& source, | 560 const scoped_refptr<media::AudioCapturerSource>& source, |
561 media::AudioParameters params) { | 561 media::AudioParameters params) { |
562 // Create a new audio stream as source which uses the new source. | 562 // Create a new audio stream as source which uses the new source. |
563 SetCapturerSource(source, params.channel_layout(), | 563 SetCapturerSource(source, params.channel_layout(), |
564 static_cast<float>(params.sample_rate()), | 564 static_cast<float>(params.sample_rate()), |
565 params.effects(), | 565 params.effects(), |
566 constraints_); | 566 constraints_); |
567 } | 567 } |
568 | 568 |
569 } // namespace content | 569 } // namespace content |
OLD | NEW |