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

Side by Side Diff: content/renderer/media/webrtc_audio_capturer.cc

Issue 177113012: Minor fixes to the capturer and the processor (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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 | Annotate | Revision Log
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 "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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698