本文整理汇总了C++中IAAFHeader::AddEssenceData方法的典型用法代码示例。如果您正苦于以下问题:C++ IAAFHeader::AddEssenceData方法的具体用法?C++ IAAFHeader::AddEssenceData怎么用?C++ IAAFHeader::AddEssenceData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IAAFHeader
的用法示例。
在下文中一共展示了IAAFHeader::AddEssenceData方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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;
}
示例2: ModifyAAFFile
static HRESULT ModifyAAFFile(aafWChar *filename, int level)
{
HRESULT hr = S_OK;
try
{
// Open existing file for modification
IAAFFile *pFile = NULL;
TestProductID.productVersionString = const_cast<aafWChar*>(L"ModifyAAFFile");
checkResult( AAFFileOpenExistingModify(
filename,
0, // modeFlags
&TestProductID,
&pFile) );
cout << "ModifyAAFFile() - appended Identification" << endl;
// Get the header & dictionary
IAAFHeader *pHeader = NULL;
IAAFDictionary *pDictionary = NULL;
checkResult(pFile->GetHeader(&pHeader));
checkResult(pHeader->GetDictionary(&pDictionary));
// Search for Mobs
IAAFMob *pFileMob = NULL;
IEnumAAFMobs *pFileMobIter = NULL;
aafSearchCrit_t criteria;
criteria.searchTag = kAAFByMobKind;
criteria.tags.mobKind = kAAFFileMob; // Search by File Mob
checkResult(pHeader->GetMobs(&criteria, &pFileMobIter));
while (AAFRESULT_SUCCESS == pFileMobIter->NextOne(&pFileMob))
{
if (level == 0)
break;
IAAFEssenceDescriptor *edesc = NULL;
IAAFSourceMob *pSourceMob = NULL;
CR(pFileMob->QueryInterface(IID_IAAFSourceMob, (void **)&pSourceMob));
CR(pSourceMob->GetEssenceDescriptor(&edesc));
// Change the Name property
CR(pFileMob->SetName(L"ModifyAAFFile - modified Name"));
cout << "ModifyAAFFile() - changed FileMob's Name property" << endl;
if (level == 1)
break;
// Change descriptor's properties
IAAFAIFCDescriptor *pAIFCDesc = NULL;
CR(edesc->QueryInterface(IID_IAAFAIFCDescriptor, (void **)&pAIFCDesc));
aafUInt8 AIFCsum[] = {0xa1,0xfc};
CR(pAIFCDesc->SetSummary(sizeof(AIFCsum), AIFCsum));
pAIFCDesc->Release();
edesc->Release();
cout << "ModifyAAFFile() - changed AIFCDescriptor's Summary" << endl;
if (level == 2)
break;
// Change descriptor to new one (overwriting old one)
IAAFClassDef *classDef = NULL;
IAAFFileDescriptor *pFileDesc = NULL;
IAAFWAVEDescriptor *pWAVEDesc = NULL;
IAAFEssenceDescriptor *pNewEdesc = NULL;
CR(pDictionary->LookupClassDef(AUID_AAFWAVEDescriptor, &classDef));
CR(classDef->CreateInstance(IID_IAAFFileDescriptor, (IUnknown **)&pFileDesc));
CR(pFileDesc->QueryInterface(IID_IAAFWAVEDescriptor, (void **)&pWAVEDesc));
CR(pFileDesc->QueryInterface(IID_IAAFEssenceDescriptor, (void **)&pNewEdesc));
aafUInt8 WAVEsum[] = {0x1a,0x1e,0xee,0xee};
CR(pWAVEDesc->SetSummary(sizeof(WAVEsum), WAVEsum));
CR(pSourceMob->SetEssenceDescriptor(pNewEdesc));
pNewEdesc->Release();
pWAVEDesc->Release();
pFileDesc->Release();
classDef->Release();
cout << "ModifyAAFFile() - replaced AIFCDescriptor with WAVEDescriptor" << endl;
if (level == 3)
break;
// Add EssenceData
IAAFEssenceData *pEssenceData = NULL;
IAAFEssenceData2 *pEssenceData2 = NULL;
IAAFPlainEssenceData *pPlainEssenceData = NULL;
aafUInt32 bytesWritten = 0;
aafUInt8 essdata[] = "Zaphod Beeblebrox";
CR(pDictionary->LookupClassDef(AUID_AAFEssenceData, &classDef));
CR(classDef->CreateInstance(IID_IAAFEssenceData, (IUnknown **)&pEssenceData));
CR(pEssenceData->SetFileMob(pSourceMob));
CR(pHeader->AddEssenceData(pEssenceData));
CR(pEssenceData->QueryInterface(IID_IAAFEssenceData2, (void**)&pEssenceData2));
CR(pEssenceData2->GetPlainEssenceData(0, &pPlainEssenceData));
CR(pPlainEssenceData->Write(sizeof(essdata), essdata, &bytesWritten));
pEssenceData->Release();
pEssenceData2->Release();
pPlainEssenceData->Release();
classDef->Release();
//.........这里部分代码省略.........
示例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;
}