Common/MFUtility.cpp
HRESULT CopyAttribute(IMFAttributes *pSrc, IMFAttributes *pDest, const GUID& key)
{
	PROPVARIANT var;
	PropVariantInit(&var);

	HRESULT hr = S_OK;

	hr = pSrc->GetItem(key, &var);
	if (SUCCEEDED(hr))
	{
		hr = pDest->SetItem(key, var);
	}

	PropVariantClear(&var);
	return hr;
}
/*
Copies a media type attribute from an input media type to an output media type. Useful when setting
up the video sink and where a number of the video sink input attributes need to be duplicated on the
video writer attributes.
*/
Copies a media type attribute from an input media type to an output media type. Useful when setting
up the video sink and where a number of the video sink input attributes need to be duplicated on the
video writer attributes.
Copies a media type attribute from an input media type to an output media type . Useful when setting up the video sink and where a number of the video sink input attributes need to be duplicated on the video writer attributes .
HRESULT CopyAttribute(IMFAttributes *pSrc, IMFAttributes *pDest, const GUID& key)
{
	PROPVARIANT var;
	PropVariantInit(&var);
	HRESULT hr = S_OK;
	hr = pSrc->GetItem(key, &var);
	if (SUCCEEDED(hr))
	{
		hr = pDest->SetItem(key, var);
	}
	PropVariantClear(&var);
	return hr;
}
HRESULT CopyAttribute ( IMFAttributes * pSrc , IMFAttributes * pDest , const GUID & key ) { PROPVARIANT var ; PropVariantInit ( & var ) ; HRESULT hr = S_OK ; hr = pSrc -> GetItem ( key , & var ) ; if ( SUCCEEDED ( hr ) ) { hr = pDest -> SetItem ( key , var ) ; } PropVariantClear ( & var ) ; return hr ; }
Copies a media type attribute from an input media type to an output media type.
Copies a media type attribute from an input media type to an output media type .