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

Side by Side Diff: content/public/common/media_stream_request.h

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 #ifndef CONTENT_PUBLIC_COMMON_MEDIA_STREAM_REQUEST_H_ 5 #ifndef CONTENT_PUBLIC_COMMON_MEDIA_STREAM_REQUEST_H_
6 #define CONTENT_PUBLIC_COMMON_MEDIA_STREAM_REQUEST_H_ 6 #define CONTENT_PUBLIC_COMMON_MEDIA_STREAM_REQUEST_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 // TODO(xians): Change the structs to classes. 46 // TODO(xians): Change the structs to classes.
47 // Represents one device in a request for media stream(s). 47 // Represents one device in a request for media stream(s).
48 struct CONTENT_EXPORT MediaStreamDevice { 48 struct CONTENT_EXPORT MediaStreamDevice {
49 MediaStreamDevice(); 49 MediaStreamDevice();
50 50
51 MediaStreamDevice( 51 MediaStreamDevice(
52 MediaStreamType type, 52 MediaStreamType type,
53 const std::string& id, 53 const std::string& id,
54 const std::string& name); 54 const std::string& name);
55 55
56 MediaStreamDevice(
57 MediaStreamType type,
58 const std::string& id,
59 const std::string& name,
60 int sample_rate,
61 int channel_layout);
62
56 ~MediaStreamDevice(); 63 ~MediaStreamDevice();
57 64
58 // The device's type. 65 // The device's type.
59 MediaStreamType type; 66 MediaStreamType type;
60 67
61 // The device's unique ID. 68 // The device's unique ID.
62 std::string id; 69 std::string id;
63 70
64 // The device's "friendly" name. Not guaranteed to be unique. 71 // The device's "friendly" name. Not guaranteed to be unique.
65 std::string name; 72 std::string name;
73
74 // Preferred sample rate in samples per second for the device.
75 // Only utilized for audio devices. Will be set to 0 if the constructor
76 // with three parameters (intended for video) is used.
jam 2013/01/16 17:57:24 nit: here and below, I would skip this comment sin
77 int sample_rate;
78
79 // Preferred channel configuration for the device.
80 // Only utilized for audio devices. Will be set to 0 if the constructor
81 // with three parameters (intended for video) is used.
82 // TODO(henrika): ideally, we would like to use media::ChannelLayout here
83 // but including media/base/channel_layout.h violates checkdeps rules.
84 int channel_layout;
66 }; 85 };
67 86
68 typedef std::vector<MediaStreamDevice> MediaStreamDevices; 87 typedef std::vector<MediaStreamDevice> MediaStreamDevices;
69 88
70 typedef std::map<MediaStreamType, MediaStreamDevices> MediaStreamDeviceMap; 89 typedef std::map<MediaStreamType, MediaStreamDevices> MediaStreamDeviceMap;
71 90
72 // Represents a request for media streams (audio/video). 91 // Represents a request for media streams (audio/video).
73 struct CONTENT_EXPORT MediaStreamRequest { 92 struct CONTENT_EXPORT MediaStreamRequest {
74 MediaStreamRequest( 93 MediaStreamRequest(
75 int render_process_id, 94 int render_process_id,
(...skipping 29 matching lines...) Expand all
105 // Flag to indicate if the request contains audio. 124 // Flag to indicate if the request contains audio.
106 MediaStreamType audio_type; 125 MediaStreamType audio_type;
107 126
108 // Flag to indicate if the request contains video. 127 // Flag to indicate if the request contains video.
109 MediaStreamType video_type; 128 MediaStreamType video_type;
110 }; 129 };
111 130
112 } // namespace content 131 } // namespace content
113 132
114 #endif // CONTENT_PUBLIC_COMMON_MEDIA_STREAM_REQUEST_H_ 133 #endif // CONTENT_PUBLIC_COMMON_MEDIA_STREAM_REQUEST_H_
OLDNEW
« no previous file with comments | « content/common/media/media_stream_options.cc ('k') | content/public/common/media_stream_request.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698