OLD | NEW |
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 20 matching lines...) Expand all Loading... |
31 MEDIA_TAB_VIDEO_CAPTURE, | 31 MEDIA_TAB_VIDEO_CAPTURE, |
32 | 32 |
33 // Desktop media sources. | 33 // Desktop media sources. |
34 MEDIA_DESKTOP_VIDEO_CAPTURE, | 34 MEDIA_DESKTOP_VIDEO_CAPTURE, |
35 | 35 |
36 // Capture system audio (post-mix loopback stream). | 36 // Capture system audio (post-mix loopback stream). |
37 // | 37 // |
38 // TODO(sergeyu): Replace with MEDIA_DESKTOP_AUDIO_CAPTURE. | 38 // TODO(sergeyu): Replace with MEDIA_DESKTOP_AUDIO_CAPTURE. |
39 MEDIA_LOOPBACK_AUDIO_CAPTURE, | 39 MEDIA_LOOPBACK_AUDIO_CAPTURE, |
40 | 40 |
41 // This is used for enumerating audio output devices. | |
42 // TODO(grunell): Output isn't really a part of media streams. Device | |
43 // enumeration should be decoupled from media streams and related code. | |
44 MEDIA_DEVICE_AUDIO_OUTPUT, | |
45 | |
46 NUM_MEDIA_TYPES | 41 NUM_MEDIA_TYPES |
47 }; | 42 }; |
48 | 43 |
49 // Types of media stream requests that can be made to the media controller. | 44 // Types of media stream requests that can be made to the media controller. |
50 enum MediaStreamRequestType { | 45 enum MediaStreamRequestType { |
51 MEDIA_DEVICE_ACCESS = 0, | 46 MEDIA_DEVICE_ACCESS = 0, |
52 MEDIA_GENERATE_STREAM, | 47 MEDIA_GENERATE_STREAM, |
53 MEDIA_ENUMERATE_DEVICES, | 48 MEDIA_ENUMERATE_DEVICES, |
54 MEDIA_OPEN_DEVICE // Only used in requests made by Pepper. | 49 MEDIA_OPEN_DEVICE // Only used in requests made by Pepper. |
55 }; | 50 }; |
(...skipping 19 matching lines...) Expand all Loading... |
75 MEDIA_DEVICE_TAB_CAPTURE_FAILURE, | 70 MEDIA_DEVICE_TAB_CAPTURE_FAILURE, |
76 MEDIA_DEVICE_SCREEN_CAPTURE_FAILURE, | 71 MEDIA_DEVICE_SCREEN_CAPTURE_FAILURE, |
77 MEDIA_DEVICE_CAPTURE_FAILURE, | 72 MEDIA_DEVICE_CAPTURE_FAILURE, |
78 MEDIA_DEVICE_TRACK_START_FAILURE, | 73 MEDIA_DEVICE_TRACK_START_FAILURE, |
79 | 74 |
80 NUM_MEDIA_REQUEST_RESULTS | 75 NUM_MEDIA_REQUEST_RESULTS |
81 }; | 76 }; |
82 | 77 |
83 // Convenience predicates to determine whether the given type represents some | 78 // Convenience predicates to determine whether the given type represents some |
84 // audio or some video device. | 79 // audio or some video device. |
85 CONTENT_EXPORT bool IsAudioInputMediaType(MediaStreamType type); | 80 CONTENT_EXPORT bool IsAudioMediaType(MediaStreamType type); |
86 CONTENT_EXPORT bool IsVideoMediaType(MediaStreamType type); | 81 CONTENT_EXPORT bool IsVideoMediaType(MediaStreamType type); |
87 | 82 |
88 // TODO(xians): Change the structs to classes. | 83 // TODO(xians): Change the structs to classes. |
89 // Represents one device in a request for media stream(s). | 84 // Represents one device in a request for media stream(s). |
90 struct CONTENT_EXPORT MediaStreamDevice { | 85 struct CONTENT_EXPORT MediaStreamDevice { |
91 MediaStreamDevice(); | 86 MediaStreamDevice(); |
92 | 87 |
93 MediaStreamDevice( | 88 MediaStreamDevice( |
94 MediaStreamType type, | 89 MediaStreamType type, |
95 const std::string& id, | 90 const std::string& id, |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 // in on the browser side and can be used by the renderer to match the | 145 // in on the browser side and can be used by the renderer to match the |
151 // expected browser side settings and avoid unnecessary buffering. | 146 // expected browser side settings and avoid unnecessary buffering. |
152 // See media::AudioParameters for more. | 147 // See media::AudioParameters for more. |
153 int frames_per_buffer; | 148 int frames_per_buffer; |
154 | 149 |
155 // See media::AudioParameters::PlatformEffectsMask. | 150 // See media::AudioParameters::PlatformEffectsMask. |
156 int effects; | 151 int effects; |
157 }; | 152 }; |
158 | 153 |
159 // These below two member variables are valid only when the type of device is | 154 // These below two member variables are valid only when the type of device is |
160 // audio (i.e. IsAudioInputMediaType returns true). | 155 // audio (i.e. IsAudioMediaType returns true). |
161 | 156 |
162 // Contains the device properties of the capture device. | 157 // Contains the device properties of the capture device. |
163 AudioDeviceParameters input; | 158 AudioDeviceParameters input; |
164 | 159 |
165 // If the capture device has an associated output device (e.g. headphones), | 160 // If the capture device has an associated output device (e.g. headphones), |
166 // this will contain the properties for the output device. If no such device | 161 // this will contain the properties for the output device. If no such device |
167 // exists (e.g. webcam w/mic), then the value of this member will be all | 162 // exists (e.g. webcam w/mic), then the value of this member will be all |
168 // zeros. | 163 // zeros. |
169 AudioDeviceParameters matched_output; | 164 AudioDeviceParameters matched_output; |
170 }; | 165 }; |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 | 254 |
260 // Callback used return results of media access requests. | 255 // Callback used return results of media access requests. |
261 typedef base::Callback<void( | 256 typedef base::Callback<void( |
262 const MediaStreamDevices& devices, | 257 const MediaStreamDevices& devices, |
263 content::MediaStreamRequestResult result, | 258 content::MediaStreamRequestResult result, |
264 scoped_ptr<MediaStreamUI> ui)> MediaResponseCallback; | 259 scoped_ptr<MediaStreamUI> ui)> MediaResponseCallback; |
265 | 260 |
266 } // namespace content | 261 } // namespace content |
267 | 262 |
268 #endif // CONTENT_PUBLIC_COMMON_MEDIA_STREAM_REQUEST_H_ | 263 #endif // CONTENT_PUBLIC_COMMON_MEDIA_STREAM_REQUEST_H_ |
OLD | NEW |