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

Unified Diff: content/renderer/media/media_stream_dependency_factory.cc

Issue 12440027: Do not pass the string device_id via IPC message to create an audio input stream (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed the tab capture apitests Created 7 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 side-by-side diff with in-line comments
Download patch
Index: content/renderer/media/media_stream_dependency_factory.cc
diff --git a/content/renderer/media/media_stream_dependency_factory.cc b/content/renderer/media/media_stream_dependency_factory.cc
index c6df648a4846dd93b582fb366dca1161f471d001..ba38461e590b599dcd591cd8783648512aa7280a 100644
--- a/content/renderer/media/media_stream_dependency_factory.cc
+++ b/content/renderer/media/media_stream_dependency_factory.cc
@@ -462,7 +462,11 @@ MediaStreamDependencyFactory::CreateLocalVideoSource(
bool MediaStreamDependencyFactory::InitializeAudioSource(
const StreamDeviceInfo& device_info) {
DVLOG(1) << "MediaStreamDependencyFactory::InitializeAudioSource()";
- const MediaStreamDevice device = device_info.device;
+
+ // TODO(henrika): the current design does not support a unique source
+ // for each audio track.
+ if (device_info.session_id <= 0)
+ return false;
// Initialize the source using audio parameters for the selected
// capture device.
@@ -470,18 +474,10 @@ bool MediaStreamDependencyFactory::InitializeAudioSource(
// TODO(henrika): refactor \content\public\common\media_stream_request.h
// to allow dependency of media::ChannelLayout and avoid static_cast.
if (!capturer->Initialize(
- static_cast<media::ChannelLayout>(device.channel_layout),
- device.sample_rate))
- return false;
-
- // Specify which capture device to use. The acquired session id is used
- // for identification.
- // TODO(henrika): the current design does not support a uniqe source
- // for each audio track.
- if (device_info.session_id <= 0)
+ static_cast<media::ChannelLayout>(device_info.device.channel_layout),
+ device_info.device.sample_rate, device_info.session_id))
return false;
- capturer->SetDevice(device_info.session_id);
return true;
}

Powered by Google App Engine
This is Rietveld 408576698