| 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 <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 // Mirroring of a browser tab. | 31 // Mirroring of a browser tab. |
| 32 MEDIA_TAB_AUDIO_CAPTURE, | 32 MEDIA_TAB_AUDIO_CAPTURE, |
| 33 MEDIA_TAB_VIDEO_CAPTURE, | 33 MEDIA_TAB_VIDEO_CAPTURE, |
| 34 | 34 |
| 35 // Desktop media sources. | 35 // Desktop media sources. |
| 36 MEDIA_DESKTOP_VIDEO_CAPTURE, | 36 MEDIA_DESKTOP_VIDEO_CAPTURE, |
| 37 | 37 |
| 38 // Capture system audio (post-mix loopback stream). | 38 // Capture system audio (post-mix loopback stream). |
| 39 MEDIA_DESKTOP_AUDIO_CAPTURE, | 39 MEDIA_DESKTOP_AUDIO_CAPTURE, |
| 40 | 40 |
| 41 // TODO(guidou): This is used for device enumerations, but it is not a | |
| 42 // media stream type. Remove when handling of renderer-generated enumeration | |
| 43 // requests is removed from MediaStreamManager. See http://crbug.com/648183. | |
| 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, | |
| 54 MEDIA_OPEN_DEVICE_PEPPER_ONLY // Only used in requests made by Pepper. | 48 MEDIA_OPEN_DEVICE_PEPPER_ONLY // Only used in requests made by Pepper. |
| 55 }; | 49 }; |
| 56 | 50 |
| 57 // Facing mode for video capture. | 51 // Facing mode for video capture. |
| 58 enum VideoFacingMode { | 52 enum VideoFacingMode { |
| 59 MEDIA_VIDEO_FACING_NONE = 0, | 53 MEDIA_VIDEO_FACING_NONE = 0, |
| 60 MEDIA_VIDEO_FACING_USER, | 54 MEDIA_VIDEO_FACING_USER, |
| 61 MEDIA_VIDEO_FACING_ENVIRONMENT, | 55 MEDIA_VIDEO_FACING_ENVIRONMENT, |
| 62 | 56 |
| 63 NUM_MEDIA_VIDEO_FACING_MODE | 57 NUM_MEDIA_VIDEO_FACING_MODE |
| (...skipping 30 matching lines...) Expand all Loading... |
| 94 struct CONTENT_EXPORT MediaStreamDevice { | 88 struct CONTENT_EXPORT MediaStreamDevice { |
| 95 MediaStreamDevice(); | 89 MediaStreamDevice(); |
| 96 | 90 |
| 97 MediaStreamDevice(MediaStreamType type, | 91 MediaStreamDevice(MediaStreamType type, |
| 98 const std::string& id, | 92 const std::string& id, |
| 99 const std::string& name); | 93 const std::string& name); |
| 100 | 94 |
| 101 MediaStreamDevice(MediaStreamType type, | 95 MediaStreamDevice(MediaStreamType type, |
| 102 const std::string& id, | 96 const std::string& id, |
| 103 const std::string& name, | 97 const std::string& name, |
| 104 const std::string& group_id); | |
| 105 | |
| 106 MediaStreamDevice(MediaStreamType type, | |
| 107 const std::string& id, | |
| 108 const std::string& name, | |
| 109 const std::string& group_id, | |
| 110 int sample_rate, | 98 int sample_rate, |
| 111 int channel_layout, | 99 int channel_layout, |
| 112 int frames_per_buffer); | 100 int frames_per_buffer); |
| 113 | 101 |
| 114 MediaStreamDevice(const MediaStreamDevice& other); | 102 MediaStreamDevice(const MediaStreamDevice& other); |
| 115 | 103 |
| 116 ~MediaStreamDevice(); | 104 ~MediaStreamDevice(); |
| 117 | 105 |
| 118 bool IsEqual(const MediaStreamDevice& second) const; | 106 bool IsEqual(const MediaStreamDevice& second) const; |
| 119 | 107 |
| 120 // The device's type. | 108 // The device's type. |
| 121 MediaStreamType type; | 109 MediaStreamType type; |
| 122 | 110 |
| 123 // The device's unique ID. | 111 // The device's unique ID. |
| 124 std::string id; | 112 std::string id; |
| 125 | 113 |
| 126 // The facing mode for video capture device. | 114 // The facing mode for video capture device. |
| 127 VideoFacingMode video_facing; | 115 VideoFacingMode video_facing; |
| 128 | 116 |
| 129 // The device id of a matched output device if any (otherwise empty). | 117 // The device id of a matched output device if any (otherwise empty). |
| 130 // Only applicable to audio devices. | 118 // Only applicable to audio devices. |
| 131 std::string matched_output_device_id; | 119 std::string matched_output_device_id; |
| 132 | 120 |
| 133 // The device's "friendly" name. Not guaranteed to be unique. | 121 // The device's "friendly" name. Not guaranteed to be unique. |
| 134 std::string name; | 122 std::string name; |
| 135 | 123 |
| 136 // A unique identifier for the physical device this device is part of. | |
| 137 // Will be hashed before being sent to renderer. | |
| 138 // TODO(maxmorin): Add support for video devices as well. | |
| 139 std::string group_id; | |
| 140 | |
| 141 // Contains properties that match directly with those with the same name | 124 // Contains properties that match directly with those with the same name |
| 142 // in media::AudioParameters. | 125 // in media::AudioParameters. |
| 143 // TODO(ajm): Remove this type and use media::AudioParameters directly. | 126 // TODO(ajm): Remove this type and use media::AudioParameters directly. |
| 144 struct CONTENT_EXPORT AudioDeviceParameters { | 127 struct CONTENT_EXPORT AudioDeviceParameters { |
| 145 AudioDeviceParameters(); | 128 AudioDeviceParameters(); |
| 146 AudioDeviceParameters(int sample_rate, | 129 AudioDeviceParameters(int sample_rate, |
| 147 int channel_layout, | 130 int channel_layout, |
| 148 int frames_per_buffer); | 131 int frames_per_buffer); |
| 149 AudioDeviceParameters(const AudioDeviceParameters& other); | 132 AudioDeviceParameters(const AudioDeviceParameters& other); |
| 150 | 133 |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 | 262 |
| 280 // Callback used return results of media access requests. | 263 // Callback used return results of media access requests. |
| 281 typedef base::Callback<void(const MediaStreamDevices& devices, | 264 typedef base::Callback<void(const MediaStreamDevices& devices, |
| 282 content::MediaStreamRequestResult result, | 265 content::MediaStreamRequestResult result, |
| 283 std::unique_ptr<MediaStreamUI> ui)> | 266 std::unique_ptr<MediaStreamUI> ui)> |
| 284 MediaResponseCallback; | 267 MediaResponseCallback; |
| 285 | 268 |
| 286 } // namespace content | 269 } // namespace content |
| 287 | 270 |
| 288 #endif // CONTENT_PUBLIC_COMMON_MEDIA_STREAM_REQUEST_H_ | 271 #endif // CONTENT_PUBLIC_COMMON_MEDIA_STREAM_REQUEST_H_ |
| OLD | NEW |