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

Side by Side 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: Had to restore usage of UTF16ToUTF8() in MediaStreamImpl::OnCreateNativeSourcesComplete to build on… 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 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/public/common/media_stream_request.h" 5 #include "content/public/common/media_stream_request.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 8
9 namespace content { 9 namespace content {
10 10
11 bool IsAudioMediaType(MediaStreamType type) { 11 bool IsAudioMediaType(MediaStreamType type) {
12 return (type == content::MEDIA_DEVICE_AUDIO_CAPTURE || 12 return (type == content::MEDIA_DEVICE_AUDIO_CAPTURE ||
13 type == content::MEDIA_TAB_AUDIO_CAPTURE); 13 type == content::MEDIA_TAB_AUDIO_CAPTURE);
14 } 14 }
15 15
16 bool IsVideoMediaType(MediaStreamType type) { 16 bool IsVideoMediaType(MediaStreamType type) {
17 return (type == content::MEDIA_DEVICE_VIDEO_CAPTURE || 17 return (type == content::MEDIA_DEVICE_VIDEO_CAPTURE ||
18 type == content::MEDIA_TAB_VIDEO_CAPTURE); 18 type == content::MEDIA_TAB_VIDEO_CAPTURE);
19 } 19 }
20 20
21 MediaStreamDevice::MediaStreamDevice() : type(MEDIA_NO_SERVICE) {} 21 MediaStreamDevice::MediaStreamDevice() : type(MEDIA_NO_SERVICE) {}
22 22
23 MediaStreamDevice::MediaStreamDevice( 23 MediaStreamDevice::MediaStreamDevice(
24 MediaStreamType type, 24 MediaStreamType type,
25 const std::string& id, 25 const std::string& id,
26 const std::string& name) 26 const std::string& name)
27 : type(type), 27 : type(type),
28 id(id), 28 id(id),
29 name(name) { 29 name(name),
30 sample_rate(0),
31 channel_layout(0) {
32 DCHECK(IsVideoMediaType(type));
33 }
34
35 MediaStreamDevice::MediaStreamDevice(
36 MediaStreamType type,
37 const std::string& id,
38 const std::string& name,
39 int sample_rate,
40 int channel_layout)
41 : type(type),
42 id(id),
43 name(name),
44 sample_rate(sample_rate),
45 channel_layout(channel_layout) {
46 DCHECK(IsAudioMediaType(type));
30 } 47 }
31 48
32 MediaStreamDevice::~MediaStreamDevice() {} 49 MediaStreamDevice::~MediaStreamDevice() {}
33 50
34 MediaStreamRequest::MediaStreamRequest( 51 MediaStreamRequest::MediaStreamRequest(
35 int render_process_id, 52 int render_process_id,
36 int render_view_id, 53 int render_view_id,
37 const GURL& security_origin, 54 const GURL& security_origin,
38 MediaStreamRequestType request_type, 55 MediaStreamRequestType request_type,
39 const std::string& requested_device_id, 56 const std::string& requested_device_id,
40 MediaStreamType audio_type, 57 MediaStreamType audio_type,
41 MediaStreamType video_type) 58 MediaStreamType video_type)
42 : render_process_id(render_process_id), 59 : render_process_id(render_process_id),
43 render_view_id(render_view_id), 60 render_view_id(render_view_id),
44 security_origin(security_origin), 61 security_origin(security_origin),
45 request_type(request_type), 62 request_type(request_type),
46 requested_device_id(requested_device_id), 63 requested_device_id(requested_device_id),
47 audio_type(audio_type), 64 audio_type(audio_type),
48 video_type(video_type) { 65 video_type(video_type) {
49 } 66 }
50 67
51 MediaStreamRequest::~MediaStreamRequest() {} 68 MediaStreamRequest::~MediaStreamRequest() {}
52 69
53 } // namespace content 70 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698