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