Share via


VideoDeviceController.GetDevicePropertyById 方法

定义

使用具有自定义标头信息的 ID 从捕获设备驱动程序获取 属性的值。 可以使用此方法查询特定于特定相机的属性。

public:
 virtual VideoDeviceControllerGetDevicePropertyResult ^ GetDevicePropertyById(Platform::String ^ propertyId, IReference<unsigned int> ^ maxPropertyValueSize) = GetDevicePropertyById;
VideoDeviceControllerGetDevicePropertyResult GetDevicePropertyById(winrt::hstring const& propertyId, IReference<uint32_t> const& maxPropertyValueSize);
public VideoDeviceControllerGetDevicePropertyResult GetDevicePropertyById(string propertyId, System.Nullable<uint> maxPropertyValueSize);
function getDevicePropertyById(propertyId, maxPropertyValueSize)
Public Function GetDevicePropertyById (propertyId As String, maxPropertyValueSize As Nullable(Of UInteger)) As VideoDeviceControllerGetDevicePropertyResult

参数

propertyId
String

Platform::String

winrt::hstring

要为其检索值的属性的标识符。

maxPropertyValueSize

IReference<UInt32>

Nullable<UInt32>

Windows.Foundation.IReference

IReference<uint32_t>

应分配用于存储操作结果的缓冲区的大小。 如果驱动程序不要求为返回的属性指定大小,请将此值设置为 null。 如果需要大小,并且未提供值,则返回的 VideoDeviceControllerGetDevicePropertyResult 对象的 Status 属性将为 MaxPropertyValueSizeRequired。 如果提供的值太小,无法存储操作结果,则返回 的 Status 对象将为 MaxPropertyValueSizeTooSmall,这意味着可以使用较大的缓冲区大小重试调用。

返回

一个 VideoDeviceControllerGetDevicePropertyResult 对象,该对象包含操作的状态以及返回的属性值(如果成功)。

Windows 要求

设备系列
Windows 10 Creators Update (在 10.0.15063.0 中引入)
API contract
Windows.Foundation.UniversalApiContract (在 v4.0 中引入)

注解

常见的设备属性公开为 VideoDeviceController 类的属性。 其他属性在 KSPROPERTYSETID_ExtendedCameraControl 属性集中定义。 旧属性在 PROPSETID_VIDCAP_CAMERACONTROL 属性集中定义。 有关按 ID 访问相机属性的示例,请参阅 扩展控件和元数据示例

适用于