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

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: Fix after review from Chris 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 }
33
34 MediaStreamDevice::MediaStreamDevice(
35 MediaStreamType type,
36 const std::string& id,
37 const std::string& name,
38 int sample_rate,
39 int channel_layout)
40 : type(type),
41 id(id),
42 name(name),
43 sample_rate(sample_rate),
44 channel_layout(channel_layout) {
30 } 45 }
31 46
32 MediaStreamDevice::~MediaStreamDevice() {} 47 MediaStreamDevice::~MediaStreamDevice() {}
33 48
34 MediaStreamRequest::MediaStreamRequest( 49 MediaStreamRequest::MediaStreamRequest(
35 int render_process_id, 50 int render_process_id,
36 int render_view_id, 51 int render_view_id,
37 const GURL& security_origin, 52 const GURL& security_origin,
38 MediaStreamRequestType request_type, 53 MediaStreamRequestType request_type,
39 const std::string& requested_device_id, 54 const std::string& requested_device_id,
40 MediaStreamType audio_type, 55 MediaStreamType audio_type,
41 MediaStreamType video_type) 56 MediaStreamType video_type)
42 : render_process_id(render_process_id), 57 : render_process_id(render_process_id),
43 render_view_id(render_view_id), 58 render_view_id(render_view_id),
44 security_origin(security_origin), 59 security_origin(security_origin),
45 request_type(request_type), 60 request_type(request_type),
46 requested_device_id(requested_device_id), 61 requested_device_id(requested_device_id),
47 audio_type(audio_type), 62 audio_type(audio_type),
48 video_type(video_type) { 63 video_type(video_type) {
49 } 64 }
50 65
51 MediaStreamRequest::~MediaStreamRequest() {} 66 MediaStreamRequest::~MediaStreamRequest() {}
52 67
53 } // namespace content 68 } // namespace content
OLDNEW
« no previous file with comments | « content/public/common/media_stream_request.h ('k') | content/renderer/media/media_stream_dependency_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698