本文整理汇总了C++中IAAFDictionary::LookupContainerDef方法的典型用法代码示例。如果您正苦于以下问题:C++ IAAFDictionary::LookupContainerDef方法的具体用法?C++ IAAFDictionary::LookupContainerDef怎么用?C++ IAAFDictionary::LookupContainerDef使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IAAFDictionary
的用法示例。
在下文中一共展示了IAAFDictionary::LookupContainerDef方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CreateAAFFile
static HRESULT CreateAAFFile(
aafWChar * pFileName,
aafUID_constref fileKind,
testRawStorageType_t rawStorageType,
aafProductIdentification_constref productID)
{
IAAFFile * pFile = NULL;
bool bFileOpen = false;
IAAFHeader * pHeader = NULL;
IAAFDictionary* pDictionary = NULL;
IAAFContainerDef* pContainer = NULL;
IAAFSourceMob *pSourceMob = NULL;
IAAFMob *pMob = NULL;
IAAFEssenceDescriptor *edesc = NULL;
IAAFFileDescriptor *pFileDesc = NULL;
IAAFFileDescriptor2 *pFileDesc2 = NULL;
HRESULT hr = S_OK;
try
{
// Remove the previous test file if any.
RemoveTestFile(pFileName);
// Create the file
checkResult(CreateTestFile( pFileName, fileKind, rawStorageType, productID, &pFile ));
bFileOpen = true;
// We can't really do anthing in AAF without the header.
checkResult(pFile->GetHeader(&pHeader));
// Get the AAF Dictionary so that we can create valid AAF objects.
checkResult(pHeader->GetDictionary(&pDictionary));
CAAFBuiltinDefs defs (pDictionary);
//Make the first mob
long test;
aafRational_t audioRate = { 44100, 1 };
// Create a Mob
checkResult(defs.cdSourceMob()->
CreateInstance(IID_IAAFSourceMob,
(IUnknown **)&pSourceMob));
checkResult(pSourceMob->QueryInterface (IID_IAAFMob, (void **)&pMob));
checkResult(pMob->SetMobID(TEST_MobID));
checkResult(pMob->SetName(L"FileDescriptorTest"));
// Add some slots
for(test = 0; test < 2; test++)
{
checkResult(pSourceMob->AddNilReference (test+1, 0, defs.ddkAAFSound(), audioRate));
}
// Create a concrete subclass of FileDescriptor
checkResult(defs.cdAIFCDescriptor()->
CreateInstance(IID_IAAFEssenceDescriptor,
(IUnknown **)&edesc));
IAAFAIFCDescriptor* pAIFCDesc = NULL;
checkResult(edesc->QueryInterface (IID_IAAFAIFCDescriptor, (void **)&pAIFCDesc));
checkResult(pAIFCDesc->SetSummary (5, (unsigned char*)"TEST"));
pAIFCDesc->Release();
pAIFCDesc = NULL;
checkResult(edesc->QueryInterface(IID_IAAFFileDescriptor, (void **) &pFileDesc));
checkResult(pFileDesc->SetSampleRate (checkSampleRate));
checkResult(pDictionary->LookupContainerDef(checkContainer, &pContainer));
checkResult(pFileDesc->SetContainerFormat (pContainer));
pContainer->Release();
pContainer = NULL;
checkResult(pFileDesc->SetLength (checkLength));
checkResult(pFileDesc->QueryInterface(IID_IAAFFileDescriptor2, (void **)&pFileDesc2));
checkResult(pFileDesc2->SetLinkedSlotID (checkLinkedSlotID));
// checkResult(pFileDesc->SetIsInContainer (kAAFTrue));
checkResult(pSourceMob->SetEssenceDescriptor (edesc));
checkResult(pHeader->AddMob(pMob));
}
catch (HRESULT& rResult)
{
hr = rResult;
}
if (pFileDesc)
pFileDesc->Release();
if (pFileDesc2)
pFileDesc2->Release();
if (edesc)
edesc->Release();
if (pMob)
pMob->Release();
//.........这里部分代码省略.........