OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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_RENDERER_MEDIA_MEDIA_STREAM_CONSTRAINTS_UTIL_VIDEO_SOURCE_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_MEDIA_STREAM_CONSTRAINTS_UTIL_VIDEO_SOURCE_H_ |
6 #define CONTENT_RENDERER_MEDIA_MEDIA_STREAM_CONSTRAINTS_UTIL_VIDEO_SOURCE_H_ | 6 #define CONTENT_RENDERER_MEDIA_MEDIA_STREAM_CONSTRAINTS_UTIL_VIDEO_SOURCE_H_ |
7 | 7 |
8 #include <iosfwd> | 8 #include <iosfwd> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "content/common/content_export.h" | 12 #include "content/common/content_export.h" |
13 #include "content/common/media/media_devices.mojom.h" | 13 #include "content/common/media/media_devices.mojom.h" |
14 #include "media/capture/video_capture_types.h" | 14 #include "media/capture/video_capture_types.h" |
15 | 15 |
16 namespace blink { | 16 namespace blink { |
17 class WebString; | 17 class WebString; |
18 class WebMediaConstraints; | 18 class WebMediaConstraints; |
19 } | 19 } |
20 | 20 |
21 namespace content { | 21 namespace content { |
22 | 22 |
| 23 // Calculates and returns videoKind value for |format|. |
| 24 // See https://w3c.github.io/mediacapture-depth. |
| 25 blink::WebString CONTENT_EXPORT |
| 26 GetVideoKindForFormat(const media::VideoCaptureFormat& format); |
| 27 |
23 struct CONTENT_EXPORT VideoCaptureCapabilities { | 28 struct CONTENT_EXPORT VideoCaptureCapabilities { |
24 VideoCaptureCapabilities(); | 29 VideoCaptureCapabilities(); |
25 VideoCaptureCapabilities(VideoCaptureCapabilities&& other); | 30 VideoCaptureCapabilities(VideoCaptureCapabilities&& other); |
26 ~VideoCaptureCapabilities(); | 31 ~VideoCaptureCapabilities(); |
27 VideoCaptureCapabilities& operator=(VideoCaptureCapabilities&& other); | 32 VideoCaptureCapabilities& operator=(VideoCaptureCapabilities&& other); |
28 | 33 |
29 // Each field is independent of each other. | 34 // Each field is independent of each other. |
30 std::vector<::mojom::VideoInputDeviceCapabilitiesPtr> device_capabilities; | 35 std::vector<::mojom::VideoInputDeviceCapabilitiesPtr> device_capabilities; |
31 std::vector<media::PowerLineFrequency> power_line_capabilities; | 36 std::vector<media::PowerLineFrequency> power_line_capabilities; |
32 }; | 37 }; |
(...skipping 12 matching lines...) Expand all Loading... |
45 const VideoCaptureSourceSettings& other); | 50 const VideoCaptureSourceSettings& other); |
46 VideoCaptureSourceSettings& operator=(VideoCaptureSourceSettings&& other); | 51 VideoCaptureSourceSettings& operator=(VideoCaptureSourceSettings&& other); |
47 | 52 |
48 // Accessors for easier interaction with blink constraint classes. | 53 // Accessors for easier interaction with blink constraint classes. |
49 blink::WebString GetFacingMode() const; | 54 blink::WebString GetFacingMode() const; |
50 long GetPowerLineFrequency() const; | 55 long GetPowerLineFrequency() const; |
51 long GetWidth() const; | 56 long GetWidth() const; |
52 long GetHeight() const; | 57 long GetHeight() const; |
53 double GetFrameRate() const; | 58 double GetFrameRate() const; |
54 blink::WebString GetDeviceId() const; | 59 blink::WebString GetDeviceId() const; |
| 60 blink::WebString GetVideoKind() const; |
55 | 61 |
56 const media::VideoCaptureFormat& format() const { return format_; } | 62 const media::VideoCaptureFormat& format() const { return format_; } |
57 const std::string& device_id() const { return device_id_; } | 63 const std::string& device_id() const { return device_id_; } |
58 ::mojom::FacingMode facing_mode() const { return facing_mode_; } | 64 ::mojom::FacingMode facing_mode() const { return facing_mode_; } |
59 media::PowerLineFrequency power_line_frequency() const { | 65 media::PowerLineFrequency power_line_frequency() const { |
60 return power_line_frequency_; | 66 return power_line_frequency_; |
61 } | 67 } |
62 | 68 |
63 private: | 69 private: |
64 std::string device_id_; | 70 std::string device_id_; |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 // settings that include the device ID, power-line frequency, resolution, and | 152 // settings that include the device ID, power-line frequency, resolution, and |
147 // frame rate, in that order. Note that there is no default facing mode or | 153 // frame rate, in that order. Note that there is no default facing mode or |
148 // aspect ratio. | 154 // aspect ratio. |
149 VideoCaptureSourceSelectionResult CONTENT_EXPORT | 155 VideoCaptureSourceSelectionResult CONTENT_EXPORT |
150 SelectVideoCaptureSourceSettings(const VideoCaptureCapabilities& capabilities, | 156 SelectVideoCaptureSourceSettings(const VideoCaptureCapabilities& capabilities, |
151 const blink::WebMediaConstraints& constraints); | 157 const blink::WebMediaConstraints& constraints); |
152 | 158 |
153 } // namespace content | 159 } // namespace content |
154 | 160 |
155 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_CONSTRAINTS_UTIL_VIDEO_SOURCE_H_ | 161 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_CONSTRAINTS_UTIL_VIDEO_SOURCE_H_ |
OLD | NEW |