- Posts: 8
- Joined: Wed Sep 02, 2020 5:22 pm
- Real Name: Brendan Bolles
- Code: Select all
HRESULT result = S_OK;
IBlackmagicRawConstants* constants;
result = codec->QueryInterface(IID_IBlackmagicRawConstants, (void**)&constants);
codec is of type IBlackmagicRaw* here.
And then you can query the constants object for ranges and stuff. This is a piece I use for reading ranges and value lists from attributes in my player project:
- Code: Select all
HRESULT BrawDecoder2::updateClipProcessingAttribute(BlackmagicRawClipProcessingAttribute sdkAttribute, BrawProcessingAttribute* attribute)
{
VARIANT valueMin;
VARIANT valueMax;
HRESULT result = S_OK;
BOOL isReadOnly;
BSTR cameraType;
clip->GetCameraType(&cameraType);
// First try to get attribute range
result = constants->GetClipProcessingAttributeRange(cameraType, sdkAttribute, &valueMin, &valueMax, &isReadOnly);
if (result == S_OK)
{
attribute->updateValueRange(valueMin, valueMax, isReadOnly);
}
// If range query fails, attribute uses value list, so retrieve that
if (result == E_INVALIDARG)
{
std::vector<VARIANT> variantList;
UINT variantListLen;
result = constants->GetClipProcessingAttributeList(cameraType, sdkAttribute, nullptr, &variantListLen, &isReadOnly);
if (result == S_OK)
{
variantList.resize(variantListLen);
result = constants->GetClipProcessingAttributeList(cameraType, sdkAttribute, &variantList[0], &variantListLen, &isReadOnly);
if (result == S_OK)
attribute->updateValueList(&variantList[0], variantListLen, isReadOnly);
}
}
// Finally retrieve actual values
processingAttrs->GetClipAttribute(sdkAttribute, &attribute->value);
return S_OK;
}