本文整理汇总了C++中IAAFDictionary::LookupTypeDef方法的典型用法代码示例。如果您正苦于以下问题:C++ IAAFDictionary::LookupTypeDef方法的具体用法?C++ IAAFDictionary::LookupTypeDef怎么用?C++ IAAFDictionary::LookupTypeDef使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IAAFDictionary
的用法示例。
在下文中一共展示了IAAFDictionary::LookupTypeDef方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CreateAAFFile
//.........这里部分代码省略.........
check(pSeqSceneDesc->AppendComponent(pComp));
pComp->Release();
pComp = NULL;
pEventSceneDesc->Release();
pEventSceneDesc=NULL;
check(pSeqSceneDesc->QueryInterface(IID_IAAFSegment, (void **)&pSegment));
// Create third Comment Marker
check(pCommentMarkerCD->CreateInstance(IID_IAAFEvent,
(IUnknown **)&pEventSceneDesc));
position=250;
check(pEventSceneDesc->SetPosition(position));
check(pEventSceneDesc->SetComment(L"Racer passes finish line"));
check(pEventSceneDesc->QueryInterface(IID_IAAFComponent, (void **)&pComp));
check(pComp->SetDataDef(pDDefSceneDesc));
// Add it to the sequence
check(pSeqSceneDesc->AppendComponent(pComp));
pComp->Release();
pComp = NULL;
pEventSceneDesc->Release();
pEventSceneDesc=NULL;
// Add the event sequence to the event mob slot
// Sequence must have at least one component to ensure event mob slot is valid
check(pSlot->SetSegment(pSegment));
pSegment->Release();
pSegment = NULL;
// Append the event slot to the Master Mob
check(pMob->AppendSlot(pSlot));
// Add the KLV data to the Master Mob
// Register the two KLVKeys
check(pDictionary->LookupTypeDef(kAAFTypeID_UInt8Array,
&pUnknownBaseType));
check(pDictionary->RegisterKLVDataKey(KLVKey_BinaryBlob1,
pUnknownBaseType));
check(pDictionary->LookupTypeDef(kAAFTypeID_Int32,
&pInt32BaseType));
check(pDictionary->RegisterKLVDataKey(KLVKey_Int32_1,
pInt32BaseType));
// Next define new ASCII string data def
// check(pDictionary->RegisterKLVDataKey(KLVKey_ASCIIString1,
// pASCIIStringBaseType));
// Get the KLVData ClassDefinition
check(pDictionary->LookupClassDef(AUID_AAFKLVData,
&pKLVDataCD));
// Create KLVData and append it to Mob
check(pKLVDataCD->CreateInstance(IID_IAAFKLVData,
(IUnknown **)&pKLVData));
check(pKLVData->Initialize(KLVKey_BinaryBlob1,
sizeof(blobData), (aafUInt8 *)blobData));
check(pMob->AppendKLVData(pKLVData));
pKLVData->Release();
pKLVData=NULL;
// Create KLVData and append it to Mob
check(pKLVDataCD->CreateInstance(IID_IAAFKLVData,
(IUnknown **)&pKLVData));
check(pKLVData->Initialize(KLVKey_Int32_1,
sizeof(int32Data), (aafUInt8 *)&int32Data));
示例2: ReadAAFFile
//.........这里部分代码省略.........
checkExpression(aMob->OffsetToMobTimecode(pSegment, NULL, &timecode) == AAFRESULT_NULL_PARAM,
AAFRESULT_TEST_FAILED);
checkExpression(aMob->OffsetToMobTimecode(pSegment, &offset, NULL) == AAFRESULT_NULL_PARAM,
AAFRESULT_TEST_FAILED);
// reinitialize values
timecode.startFrame = 0;
timecode.drop = kAAFTcDrop;
timecode.fps = 24;
// According to IDL this should search for the slot containing the timecode segment
checkResult(aMob->OffsetToMobTimecode(NULL, &offset, &timecode));
checkExpression(timecode.startFrame == (TCstartFrame + offset), AAFRESULT_TEST_FAILED);
checkExpression(timecode.drop == TCdrop, AAFRESULT_TEST_FAILED);
checkExpression(timecode.fps == TCfps, AAFRESULT_TEST_FAILED);
pSegment->Release();
pSegment = NULL;
slot->Release();
slot = NULL;
// Pass in a segment that is not a timecode and make sure it returns correct hr
checkResult(aMob->LookupSlot(1, &slot));
checkResult(slot->GetSegment(&pSegment));
checkExpression(aMob->OffsetToMobTimecode(pSegment, &offset, &timecode) == AAFRESULT_TIMECODE_NOT_FOUND,
AAFRESULT_TEST_FAILED);
pSegment->Release();
pSegment = NULL;
slot->Release();
slot = NULL;
// GetKLVData
checkResult(pDictionary->LookupTypeDef (kAAFTypeID_UInt8Array, &pBaseType));
checkResult(pDictionary->RegisterKLVDataKey(TEST_KLV, pBaseType));
pBaseType->Release();
pBaseType = NULL;
checkResult(aMob->CountKLVData(&numFound));
checkExpression(numFound == 2, AAFRESULT_TEST_FAILED);
checkResult(aMob->GetKLVData(&klvEnum));
checkResult(klvEnum->NextOne(&pKLVData));
checkResult(pKLVData->GetValueBufLen(&bufLen));
checkExpression(sizeof(KLVfrowney) == bufLen, AAFRESULT_TEST_FAILED);
checkResult(pKLVData->GetValue( sizeof(value), (unsigned char *)value, &bytesRead));
checkExpression(memcmp(value, KLVfrowney, sizeof(KLVfrowney)) == 0, AAFRESULT_TEST_FAILED);
checkResult(pKLVData->GetKey(&testKey));
checkExpression(memcmp(&testKey, &TEST_KLV, sizeof(aafUID_t)) == 0, AAFRESULT_TEST_FAILED);
pKLVData->Release();
pKLVData = NULL;
checkResult(klvEnum->NextOne(&pKLVData));
checkResult(pKLVData->GetValueBufLen(&bufLen));
checkExpression(sizeof(KLVsmiley) == bufLen, AAFRESULT_TEST_FAILED);
checkResult(pKLVData->GetValue( sizeof(value), (unsigned char *)value, &bytesRead));
checkExpression(memcmp(value, KLVsmiley, sizeof(KLVsmiley)) == 0, AAFRESULT_TEST_FAILED);
checkResult(pKLVData->GetKey(&testKey));
checkExpression(memcmp(&testKey, &TEST_KLV, sizeof(aafUID_t)) == 0, AAFRESULT_TEST_FAILED);
pKLVData->Release();
pKLVData = NULL;
klvEnum->Release();
klvEnum = NULL;
checkExpression(aMob->GetKLVData(NULL) == AAFRESULT_NULL_PARAM,
示例3: CreateAAFFile
static HRESULT CreateAAFFile(
aafWChar * pFileName,
aafUID_constref fileKind,
testRawStorageType_t rawStorageType,
aafProductIdentification_constref productID)
{
IAAFFile* pFile = NULL;
IAAFHeader * pHeader = NULL;
IAAFDictionary* pDictionary = NULL;
IAAFOperationDef* pOperationDef = NULL;
IAAFParameterDef* pParamDef = NULL;
IAAFDefObject* pDefObject = NULL;
IAAFOperationGroup *pOperationGroup = NULL;
IAAFMob *pMob = NULL;
IAAFSegment *pSeg = NULL;
IAAFTimelineMobSlot *pSlot = NULL;
IAAFParameter *pParm = NULL;
IAAFVaryingValue *pVaryingValue = NULL;
IAAFSegment *pFiller = NULL;
IAAFComponent *pComponent = NULL;
IAAFSourceClip *pSourceClip = NULL;
IAAFControlPoint *pControlPoint = NULL;
IAAFSourceReference *pSourceRef = NULL;
IAAFInterpolationDef *pInterpDef = NULL;
IAAFPluginManager *pMgr = NULL;
IAAFTypeDef *pTypeDef = NULL;
bool bFileOpen = false;
HRESULT hr = S_OK;
// aafUID_t testInterpDef = kAAFTypeID_Rational;
aafLength_t effectLen = TEST_EFFECT_LEN;
aafUID_t effectID = kTestEffectID;
aafUID_t parmID = kTestParmID;
aafRational_t testLevel1 = kTestLevel1;
aafRational_t testLevel2 = kTestLevel2;
aafRational_t testTime1 = kTestTime1;
aafRational_t testTime2 = kTestTime2;
/* long test;
*/
try
{
// Remove the previous test file if any.
RemoveTestFile(pFileName);
// Create the AAF file
checkResult(CreateTestFile( pFileName, fileKind, rawStorageType, productID, &pFile ));
bFileOpen = true;
// Get the AAF file header.
checkResult(pFile->GetHeader(&pHeader));
// Get the AAF Dictionary so that we can create valid AAF objects.
checkResult(pHeader->GetDictionary(&pDictionary));
CAAFBuiltinDefs defs (pDictionary);
checkResult(defs.cdOperationDef()->
CreateInstance(IID_IAAFOperationDef,
(IUnknown **)&pOperationDef));
checkResult(defs.cdParameterDef()->
CreateInstance(IID_IAAFParameterDef,
(IUnknown **)&pParamDef));
checkResult(pDictionary->LookupTypeDef (kAAFTypeID_Rational, &pTypeDef));
checkResult(pParamDef->Initialize (parmID, TEST_PARAM_NAME, TEST_PARAM_DESC, pTypeDef));
checkResult(AAFGetPluginManager(&pMgr));
checkResult(pMgr->CreatePluginDefinition(LinearInterpolator, pDictionary, &pDefObject));
checkResult(pDefObject->QueryInterface(IID_IAAFInterpolationDef, (void **) &pInterpDef));
pDefObject->Release();
pDefObject = NULL;
checkResult(pOperationDef->Initialize (effectID, TEST_EFFECT_NAME, TEST_EFFECT_DESC));
checkResult(pDictionary->RegisterOperationDef (pOperationDef));
checkResult(pDictionary->RegisterParameterDef (pParamDef));
checkResult(pDictionary->RegisterInterpolationDef (pInterpDef));
checkResult(pOperationDef->SetDataDef (defs.ddkAAFPicture()));
checkResult(pOperationDef->SetIsTimeWarp (kAAFFalse));
checkResult(pOperationDef->SetNumberInputs (TEST_NUM_INPUTS));
checkResult(pOperationDef->SetCategory (TEST_CATEGORY));
checkResult(pOperationDef->AddParameterDef (pParamDef));
checkResult(pOperationDef->SetBypass (TEST_BYPASS));
checkResult(pParamDef->SetDisplayUnits(TEST_PARAM_UNITS));
//Make the first mob
long test;
aafRational_t videoRate = { 2997, 100 };
// Create a Mob
checkResult(defs.cdCompositionMob()->
CreateInstance(IID_IAAFMob,
(IUnknown **)&pMob));
checkResult(pMob->SetName(L"AAFOperationGroupTest"));
// Add some slots
//.........这里部分代码省略.........
示例4: CreateAAFFile
//.........这里部分代码省略.........
0,
&newEventSlot));
if(newEventSlot)
newEventSlot->Release();
newEventSlot = NULL;
seg->Release();
seg = NULL;
pComponent->Release();
pComponent = NULL;
event->Release();
event = NULL;
pcdEventConcrete->Release();
pcdEventConcrete = NULL;
pcdEvent->Release();
pcdEvent = NULL;
pcdEventMeta->Release();
pcdEventMeta = NULL;
// Try CountKLVData before any have been attached
numFound = 1;
checkResult(pMob->CountKLVData(&numFound));
checkExpression(numFound == 0, AAFRESULT_TEST_FAILED);
checkExpression(pMob->CountKLVData(NULL) == AAFRESULT_NULL_PARAM,
AAFRESULT_TEST_FAILED);
// AppendKLVData - attach some objects
checkResult(pDictionary->LookupTypeDef (kAAFTypeID_UInt8Array, &pBaseType));
checkResult(pDictionary->RegisterKLVDataKey(TEST_KLV, pBaseType));
pBaseType->Release();
pBaseType = NULL;
checkExpression(pMob->AppendKLVData(NULL) == AAFRESULT_NULL_PARAM,
AAFRESULT_TEST_FAILED);
checkResult(defs.cdKLVData()->
CreateInstance(IID_IAAFKLVData,
(IUnknown **)&pKLVData));
checkResult(pKLVData->Initialize(TEST_KLV, sizeof(KLVfrowney),
(unsigned char *)KLVfrowney));
checkResult(pMob->AppendKLVData(pKLVData));
pKLVData->Release();
pKLVData = NULL;
checkResult(defs.cdKLVData()->
CreateInstance(IID_IAAFKLVData,
(IUnknown **)&pKLVData));
checkResult(pKLVData->Initialize(TEST_KLV, sizeof(KLVfrowney),
(unsigned char *)KLVfrowney));
checkResult(pMob->AppendKLVData(pKLVData));
checkExpression(pMob->AppendKLVData(pKLVData) == AAFRESULT_OBJECT_ALREADY_ATTACHED,
AAFRESULT_TEST_FAILED);
// RemoveKLVData - remove object #2
checkExpression(pMob->RemoveKLVData(NULL) == AAFRESULT_NULL_PARAM,
AAFRESULT_TEST_FAILED);
checkResult(pMob->CountKLVData(&numFound));
checkExpression(numFound == 2, AAFRESULT_TEST_FAILED);
checkResult(pMob->RemoveKLVData(pKLVData));
checkResult(pMob->CountKLVData(&numFound));
checkExpression(numFound == 1, AAFRESULT_TEST_FAILED);