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

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: Fixes include order 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.
76 int sample_rate;
77
78 // Preferred channel configuration for the device.
79 // Only utilized for audio devices.
80 // TODO(henrika): ideally, we would like to use media::ChannelLayout here
81 // but including media/base/channel_layout.h violates checkdeps rules.
82 int channel_layout;
66 }; 83 };
67 84
68 typedef std::vector<MediaStreamDevice> MediaStreamDevices; 85 typedef std::vector<MediaStreamDevice> MediaStreamDevices;
69 86
70 typedef std::map<MediaStreamType, MediaStreamDevices> MediaStreamDeviceMap; 87 typedef std::map<MediaStreamType, MediaStreamDevices> MediaStreamDeviceMap;
71 88
72 // Represents a request for media streams (audio/video). 89 // Represents a request for media streams (audio/video).
73 struct CONTENT_EXPORT MediaStreamRequest { 90 struct CONTENT_EXPORT MediaStreamRequest {
74 MediaStreamRequest( 91 MediaStreamRequest(
75 int render_process_id, 92 int render_process_id,
(...skipping 23 matching lines...) Expand all
99 // Flag to indicate if the request contains audio. 116 // Flag to indicate if the request contains audio.
100 MediaStreamType audio_type; 117 MediaStreamType audio_type;
101 118
102 // Flag to indicate if the request contains video. 119 // Flag to indicate if the request contains video.
103 MediaStreamType video_type; 120 MediaStreamType video_type;
104 }; 121 };
105 122
106 } // namespace content 123 } // namespace content
107 124
108 #endif // CONTENT_PUBLIC_COMMON_MEDIA_STREAM_REQUEST_H_ 125 #endif // CONTENT_PUBLIC_COMMON_MEDIA_STREAM_REQUEST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698