本文整理汇总了C++中IAAFDictionary::LookupCodecDef方法的典型用法代码示例。如果您正苦于以下问题:C++ IAAFDictionary::LookupCodecDef方法的具体用法?C++ IAAFDictionary::LookupCodecDef怎么用?C++ IAAFDictionary::LookupCodecDef使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IAAFDictionary
的用法示例。
在下文中一共展示了IAAFDictionary::LookupCodecDef方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ReadAAFFile
static HRESULT ReadAAFFile(aafWChar* pFileName)
{
IAAFFile* pFile = NULL;
IAAFHeader* pHeader = NULL;
IAAFDictionary* pDictionary = NULL;
IAAFCodecDef *pCodec = NULL;
IAAFClassDef *pWaveClassDef=0,*pReturnedClassDef=0;
IAAFDataDef *pDataDef = NULL;
IEnumAAFCodecFlavours *pEnum = NULL;
bool bFileOpen = false;
aafBool testResult;
aafUID_t codecID = kAAFCodecWAVE;
aafUID_t readFlavour, checkFlavour = kAAFNilCodecFlavour;
HRESULT hr = S_OK;
try
{
// Open the AAF file
checkResult(AAFFileOpenExistingRead(pFileName, 0, &pFile));
bFileOpen = true;
// Get the AAF file header.
checkResult(pFile->GetHeader(&pHeader));
checkResult(pHeader->GetDictionary(&pDictionary));
CAAFBuiltinDefs defs (pDictionary);
checkResult(pDictionary->LookupCodecDef(codecID, &pCodec));
checkResult(pCodec->IsEssenceKindSupported (defs.ddkAAFMatte(), &testResult));
checkExpression (testResult == kAAFTrue, AAFRESULT_TEST_FAILED);
checkResult(pCodec->IsEssenceKindSupported (defs.ddkAAFPicture(), &testResult));
checkExpression (testResult == kAAFFalse, AAFRESULT_TEST_FAILED);
checkResult(pCodec->EnumCodecFlavours (&pEnum));
checkResult(pEnum->NextOne (&readFlavour));
checkExpression (memcmp(&readFlavour, &checkFlavour, sizeof(checkFlavour)) == 0,
AAFRESULT_TEST_FAILED);
checkResult(pCodec->AreThereFlavours (&testResult));
checkExpression (kAAFFalse == testResult,
AAFRESULT_TEST_FAILED);
aafUID_t uid = kAAFClassID_WAVEDescriptor;
checkResult(pDictionary->LookupClassDef(uid, &pWaveClassDef));
checkResult(pCodec->GetFileDescriptorClass(&pReturnedClassDef));
// COM interface pointers pReturnedClassDef and pWaveClassDef should be
// equal
checkExpression(AreUnksSame(pReturnedClassDef,pWaveClassDef)==kAAFTrue,
AAFRESULT_TEST_FAILED);
}
catch (HRESULT& rResult)
{
hr = rResult;
}
// Cleanup and return
if (pReturnedClassDef)
pReturnedClassDef->Release();
if (pWaveClassDef)
pWaveClassDef->Release();
if (pEnum)
pEnum->Release();
if (pDataDef)
pDataDef->Release();
if (pCodec)
pCodec->Release();
if (pDictionary)
pDictionary->Release();
if (pHeader)
pHeader->Release();
if (pFile)
{ // Close file
if (bFileOpen)
pFile->Close();
pFile->Release();
}
return hr;
}