| 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> |
| 11 #include <memory> | 11 #include <memory> |
| 12 #include <string> | 12 #include <string> |
| 13 #include <vector> | 13 #include <vector> |
| 14 | 14 |
| 15 #include "base/callback_forward.h" | 15 #include "base/callback_forward.h" |
| 16 #include "content/common/content_export.h" | 16 #include "content/common/content_export.h" |
| 17 #include "media/base/audio_parameters.h" | 17 #include "media/base/audio_parameters.h" |
| 18 #include "media/base/video_facing.h" |
| 18 #include "ui/gfx/native_widget_types.h" | 19 #include "ui/gfx/native_widget_types.h" |
| 19 #include "url/gurl.h" | 20 #include "url/gurl.h" |
| 20 | 21 |
| 21 namespace content { | 22 namespace content { |
| 22 | 23 |
| 23 // Types of media streams. | 24 // Types of media streams. |
| 24 enum MediaStreamType { | 25 enum MediaStreamType { |
| 25 MEDIA_NO_SERVICE = 0, | 26 MEDIA_NO_SERVICE = 0, |
| 26 | 27 |
| 27 // A device provided by the operating system (e.g., webcam input). | 28 // A device provided by the operating system (e.g., webcam input). |
| (...skipping 13 matching lines...) Expand all Loading... |
| 41 NUM_MEDIA_TYPES | 42 NUM_MEDIA_TYPES |
| 42 }; | 43 }; |
| 43 | 44 |
| 44 // Types of media stream requests that can be made to the media controller. | 45 // Types of media stream requests that can be made to the media controller. |
| 45 enum MediaStreamRequestType { | 46 enum MediaStreamRequestType { |
| 46 MEDIA_DEVICE_ACCESS = 0, | 47 MEDIA_DEVICE_ACCESS = 0, |
| 47 MEDIA_GENERATE_STREAM, | 48 MEDIA_GENERATE_STREAM, |
| 48 MEDIA_OPEN_DEVICE_PEPPER_ONLY // Only used in requests made by Pepper. | 49 MEDIA_OPEN_DEVICE_PEPPER_ONLY // Only used in requests made by Pepper. |
| 49 }; | 50 }; |
| 50 | 51 |
| 51 // Facing mode for video capture. | |
| 52 enum VideoFacingMode { | |
| 53 MEDIA_VIDEO_FACING_NONE = 0, | |
| 54 MEDIA_VIDEO_FACING_USER, | |
| 55 MEDIA_VIDEO_FACING_ENVIRONMENT, | |
| 56 | |
| 57 NUM_MEDIA_VIDEO_FACING_MODE | |
| 58 }; | |
| 59 | |
| 60 // Elements in this enum should not be deleted or rearranged; the only | 52 // Elements in this enum should not be deleted or rearranged; the only |
| 61 // permitted operation is to add new elements before NUM_MEDIA_REQUEST_RESULTS. | 53 // permitted operation is to add new elements before NUM_MEDIA_REQUEST_RESULTS. |
| 62 enum MediaStreamRequestResult { | 54 enum MediaStreamRequestResult { |
| 63 MEDIA_DEVICE_OK = 0, | 55 MEDIA_DEVICE_OK = 0, |
| 64 MEDIA_DEVICE_PERMISSION_DENIED = 1, | 56 MEDIA_DEVICE_PERMISSION_DENIED = 1, |
| 65 MEDIA_DEVICE_PERMISSION_DISMISSED = 2, | 57 MEDIA_DEVICE_PERMISSION_DISMISSED = 2, |
| 66 MEDIA_DEVICE_INVALID_STATE = 3, | 58 MEDIA_DEVICE_INVALID_STATE = 3, |
| 67 MEDIA_DEVICE_NO_HARDWARE = 4, | 59 MEDIA_DEVICE_NO_HARDWARE = 4, |
| 68 MEDIA_DEVICE_INVALID_SECURITY_ORIGIN = 5, | 60 MEDIA_DEVICE_INVALID_SECURITY_ORIGIN = 5, |
| 69 MEDIA_DEVICE_TAB_CAPTURE_FAILURE = 6, | 61 MEDIA_DEVICE_TAB_CAPTURE_FAILURE = 6, |
| (...skipping 18 matching lines...) Expand all Loading... |
| 88 struct CONTENT_EXPORT MediaStreamDevice { | 80 struct CONTENT_EXPORT MediaStreamDevice { |
| 89 MediaStreamDevice(); | 81 MediaStreamDevice(); |
| 90 | 82 |
| 91 MediaStreamDevice(MediaStreamType type, | 83 MediaStreamDevice(MediaStreamType type, |
| 92 const std::string& id, | 84 const std::string& id, |
| 93 const std::string& name); | 85 const std::string& name); |
| 94 | 86 |
| 95 MediaStreamDevice(MediaStreamType type, | 87 MediaStreamDevice(MediaStreamType type, |
| 96 const std::string& id, | 88 const std::string& id, |
| 97 const std::string& name, | 89 const std::string& name, |
| 90 media::VideoFacingMode facing); |
| 91 |
| 92 MediaStreamDevice(MediaStreamType type, |
| 93 const std::string& id, |
| 94 const std::string& name, |
| 98 int sample_rate, | 95 int sample_rate, |
| 99 int channel_layout, | 96 int channel_layout, |
| 100 int frames_per_buffer); | 97 int frames_per_buffer); |
| 101 | 98 |
| 102 MediaStreamDevice(const MediaStreamDevice& other); | 99 MediaStreamDevice(const MediaStreamDevice& other); |
| 103 | 100 |
| 104 ~MediaStreamDevice(); | 101 ~MediaStreamDevice(); |
| 105 | 102 |
| 106 bool IsEqual(const MediaStreamDevice& second) const; | 103 bool IsEqual(const MediaStreamDevice& second) const; |
| 107 | 104 |
| 108 // The device's type. | 105 // The device's type. |
| 109 MediaStreamType type; | 106 MediaStreamType type; |
| 110 | 107 |
| 111 // The device's unique ID. | 108 // The device's unique ID. |
| 112 std::string id; | 109 std::string id; |
| 113 | 110 |
| 114 // The facing mode for video capture device. | 111 // The facing mode for video capture device. |
| 115 VideoFacingMode video_facing; | 112 media::VideoFacingMode video_facing; |
| 116 | 113 |
| 117 // The device id of a matched output device if any (otherwise empty). | 114 // The device id of a matched output device if any (otherwise empty). |
| 118 // Only applicable to audio devices. | 115 // Only applicable to audio devices. |
| 119 std::string matched_output_device_id; | 116 std::string matched_output_device_id; |
| 120 | 117 |
| 121 // The device's "friendly" name. Not guaranteed to be unique. | 118 // The device's "friendly" name. Not guaranteed to be unique. |
| 122 std::string name; | 119 std::string name; |
| 123 | 120 |
| 124 // Contains properties that match directly with those with the same name | 121 // Contains properties that match directly with those with the same name |
| 125 // in media::AudioParameters. | 122 // in media::AudioParameters. |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 262 | 259 |
| 263 // Callback used return results of media access requests. | 260 // Callback used return results of media access requests. |
| 264 typedef base::Callback<void(const MediaStreamDevices& devices, | 261 typedef base::Callback<void(const MediaStreamDevices& devices, |
| 265 content::MediaStreamRequestResult result, | 262 content::MediaStreamRequestResult result, |
| 266 std::unique_ptr<MediaStreamUI> ui)> | 263 std::unique_ptr<MediaStreamUI> ui)> |
| 267 MediaResponseCallback; | 264 MediaResponseCallback; |
| 268 | 265 |
| 269 } // namespace content | 266 } // namespace content |
| 270 | 267 |
| 271 #endif // CONTENT_PUBLIC_COMMON_MEDIA_STREAM_REQUEST_H_ | 268 #endif // CONTENT_PUBLIC_COMMON_MEDIA_STREAM_REQUEST_H_ |
| OLD | NEW |