Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Creates a media source for a hardware capture device.
Syntax
HRESULT MFCreateDeviceSource(
  [in]  IMFAttributes  *pAttributes,
  [out] IMFMediaSource **ppSource
);
Parameters
[in] pAttributes
Pointer to the IMFAttributes interface of an attribute store, which is used to select the device. See Remarks.
[out] ppSource
Receives a pointer to the media source's IMFMediaSource interface. The caller must release the interface.
Return value
If this function succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.
Remarks
For audio capture devices, optionally set one of the following attributes:
| Attribute | Description | 
|---|---|
| MF_DEVSOURCE_ATTRIBUTE_SOURCE_TYPE_AUDCAP_ENDPOINT_ID | Specifies the audio endpoint ID of the audio capture device. | 
| MF_DEVSOURCE_ATTRIBUTE_SOURCE_TYPE_AUDCAP_ROLE | Specifies the device role. If this attribute is set, the function uses the default audio capture device for that device role. Do not combine this attribute with the MF_DEVSOURCE_ATTRIBUTE_SOURCE_TYPE_AUDCAP_ENDPOINT_ID attribute. | 
If neither attribute is specified, the function selects the default audio capture device for the eCommunications role.
For video capture devices, you must set the following attribute:
| Attribute | Description | 
|---|---|
| MF_DEVSOURCE_ATTRIBUTE_SOURCE_TYPE_VIDCAP_SYMBOLIC_LINK | Specifies the symbolic link to the device. | 
Requirements
| Requirement | Value | 
|---|---|
| Minimum supported client | Windows 7 [desktop apps only] | 
| Minimum supported server | Windows Server 2008 R2 [desktop apps only] | 
| Target Platform | Windows | 
| Header | mfidl.h | 
| Library | Mf.lib | 
| DLL | Mf.dll |