本文整理汇总了C++中CAAFBuiltinDefs::cdEssenceData方法的典型用法代码示例。如果您正苦于以下问题:C++ CAAFBuiltinDefs::cdEssenceData方法的具体用法?C++ CAAFBuiltinDefs::cdEssenceData怎么用?C++ CAAFBuiltinDefs::cdEssenceData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CAAFBuiltinDefs
的用法示例。
在下文中一共展示了CAAFBuiltinDefs::cdEssenceData方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Test_CreateEssenceData
// Create a SourceMob with the specified ID and name,
// then create an EssenceData object associating it
// with the new SourceMob.
static void Test_CreateEssenceData(
CAAFBuiltinDefs& defs,
IAAFHeader* pHeader,
const aafMobID_t& mobID,
aafCharacter_constptr mobName,
IAAFEssenceData** pResult)
{
IAAFSourceMobSP pSourceMob;
IAAFMobSP pMob;
IAAFEssenceDescriptorSP pEssenceDesciptor;
IAAFEssenceDataSP pEssenceData;
// Create a Mob
CheckResult(defs.cdSourceMob()->CreateInstance(IID_IAAFSourceMob,
(IUnknown **)&pSourceMob));
CheckResult(pSourceMob->QueryInterface(IID_IAAFMob, (void **)&pMob));
CheckResult(pMob->SetMobID(mobID));
CheckResult(pMob->SetName(mobName));
// Create a concrete subclass of EssenceDescriptor
CheckResult(defs.cdAIFCDescriptor()->CreateInstance(IID_IAAFEssenceDescriptor,
(IUnknown **)&pEssenceDesciptor));
IAAFAIFCDescriptor* pAIFCDesc = NULL;
CheckResult(pEssenceDesciptor->QueryInterface (IID_IAAFAIFCDescriptor, (void **)&pAIFCDesc));
CheckResult(pAIFCDesc->SetSummary (5, (unsigned char*)"TEST"));
pAIFCDesc->Release();
pAIFCDesc = NULL;
CheckResult(pSourceMob->SetEssenceDescriptor (pEssenceDesciptor));
CheckResult(pHeader->AddMob(pMob));
// Attempt to create an AAFEssenceData.
CheckResult(defs.cdEssenceData()->CreateInstance(IID_IAAFEssenceData,
(IUnknown **)&pEssenceData));
CheckResult(pEssenceData->SetFileMob(pSourceMob));
CheckResult(pHeader->AddEssenceData(pEssenceData));
*pResult = pEssenceData;
(*pResult)->AddRef();
}
示例2: createEssenceData
void EnumEssenceDataTest::createEssenceData(IAAFSourceMob *pSourceMob)
{
assert(_pFile && _pHeader && _pDictionary);
assert(pSourceMob);
assert(NULL == _pEssenceData);
CAAFBuiltinDefs defs (_pDictionary);
// Attempt to create an AAFEssenceData.
check(defs.cdEssenceData()->
CreateInstance(IID_IAAFEssenceData,
(IUnknown **)&_pEssenceData));
check(_pEssenceData->SetFileMob(pSourceMob));
check(_pHeader->AddEssenceData(_pEssenceData));
_pEssenceData->Release();
_pEssenceData = NULL;
}
示例3: createEssenceData
void EssenceDataTest::createEssenceData(IAAFSourceMob *pSourceMob)
{
assert(_pFile && _pHeader && _pDictionary);
assert(pSourceMob);
assert(NULL == _pEssenceData);
CAAFBuiltinDefs defs (_pDictionary);
// Attempt to create an AAFEssenceData.
IAAFEssenceData* pRawEssenceData = NULL;
check(defs.cdEssenceData()->
CreateInstance(IID_IAAFEssenceData,
(IUnknown **)&pRawEssenceData));
check(pRawEssenceData->SetFileMob(pSourceMob));
check(_pHeader->AddEssenceData(pRawEssenceData));
IAAFEssenceData2* pEssenceData2 = NULL;
check(pRawEssenceData->QueryInterface(IID_IAAFEssenceData2, (void**)&pEssenceData2));
check(pEssenceData2->GetPlainEssenceData(0, &_pEssenceData));
// Set essence element key
IAAFKLVEssenceDataParameters* pParameters = NULL;
check(_pEssenceData->QueryInterface(IID_IAAFKLVEssenceDataParameters, (void **)&pParameters));
AAFRESULT hr = pParameters->SetEssenceElementKey(_essenceElementKey);
checkExpression(AAFRESULT_SUCCEEDED(hr) || hr == AAFRESULT_OPERATION_NOT_PERMITTED,
AAFRESULT_TEST_FAILED);
aafUID_t key;
hr = pParameters->GetEssenceElementKey(&key);
checkExpression(AAFRESULT_SUCCEEDED(hr) || hr == AAFRESULT_OPERATION_NOT_PERMITTED,
AAFRESULT_TEST_FAILED);
checkExpression(AAFRESULT_FAILED(hr) || key == _essenceElementKey,
AAFRESULT_TEST_FAILED);
writeEssenceData(_pEssenceData, (aafDataBuffer_t)_smiley, sizeof(_smiley));
writeEssenceData(_pEssenceData, (aafDataBuffer_t)_frowney, sizeof(_frowney));
// Read back the data before saving and/or closing the file
check(_pEssenceData->SetPosition(0));
aafPosition_t dataPosition = 0;
check(_pEssenceData->GetPosition(&dataPosition));
checkExpression(dataPosition == 0, AAFRESULT_TEST_FAILED);
// Validate the current essence size.
aafLength_t essenceSize = 0;
aafLength_t expectedEssenceSize = sizeof(_smiley) + sizeof(_frowney);
check(_pEssenceData->GetSize(&essenceSize));
checkExpression(essenceSize == expectedEssenceSize, AAFRESULT_TEST_FAILED);
readEssenceData(_pEssenceData, (aafDataBuffer_t)_smiley, sizeof(_smiley));
readEssenceData(_pEssenceData, (aafDataBuffer_t)_frowney, sizeof(_frowney));
pParameters->Release();
pParameters = NULL;
pRawEssenceData->Release();
pRawEssenceData = NULL;
pEssenceData2->Release();
pEssenceData2 = NULL;
_pEssenceData->Release();
_pEssenceData = NULL;
}