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

Unified Diff: content/public/common/media_stream_request.cc

Issue 11783059: Ensures that WebRTC works for device selection using a different sample rate than default (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed content_unittests Created 7 years, 11 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/public/common/media_stream_request.cc
diff --git a/content/public/common/media_stream_request.cc b/content/public/common/media_stream_request.cc
index 016807c7d0c4ccac14c486c3db64bcb501ccb6b9..79d836fd84a4f8328457b99a7c3880038a525414 100644
--- a/content/public/common/media_stream_request.cc
+++ b/content/public/common/media_stream_request.cc
@@ -4,6 +4,8 @@
#include "content/public/common/media_stream_request.h"
+#include "base/logging.h"
+
namespace content {
bool IsAudioMediaType(MediaStreamType type) {
@@ -24,7 +26,24 @@ MediaStreamDevice::MediaStreamDevice(
const std::string& name)
: type(type),
id(id),
- name(name) {
+ name(name),
+ sample_rate(0),
+ channel_layout(0) {
+ DCHECK(IsVideoMediaType(type));
+}
+
+MediaStreamDevice::MediaStreamDevice(
+ MediaStreamType type,
+ const std::string& id,
+ const std::string& name,
+ int sample_rate,
+ int channel_layout)
+ : type(type),
+ id(id),
+ name(name),
+ sample_rate(sample_rate),
+ channel_layout(channel_layout) {
+ DCHECK(IsAudioMediaType(type));
tommi (sloooow) - chröme 2013/01/15 17:43:49 these dchecks are a nice touch.
henrika (OOO until Aug 14) 2013/01/16 16:37:17 I know ;-)
}
MediaStreamDevice::~MediaStreamDevice() {}

Powered by Google App Engine
This is Rietveld 408576698