本文整理汇总了C++中IAAFMob::GetSlots方法的典型用法代码示例。如果您正苦于以下问题:C++ IAAFMob::GetSlots方法的具体用法?C++ IAAFMob::GetSlots怎么用?C++ IAAFMob::GetSlots使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IAAFMob
的用法示例。
在下文中一共展示了IAAFMob::GetSlots方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ReadAAFFile
static HRESULT ReadAAFFile(aafWChar * pFileName)
{
// IAAFSession * pSession = NULL;
IAAFFile * pFile = NULL;
bool bFileOpen = false;
IAAFHeader * pHeader = NULL;
IAAFDictionary* pDictionary = NULL;
IEnumAAFMobs* pMobIter = NULL;
IEnumAAFMobSlots* pEnum = NULL;
IAAFMob* pMob = NULL;
IAAFMobSlot* pMobSlot = NULL;
IAAFSegment* pSegment = NULL;
IAAFSequence* pSequence = NULL;
IAAFTransition* pTransition = NULL;
IAAFComponent* pComponent = NULL;
IAAFFiller* pFiller = NULL;
IAAFOperationGroup* pOperationGroup = NULL;
IEnumAAFComponents* pCompIter = NULL;
aafLength_t transitionLength;
aafPosition_t cutPoint;
aafNumSlots_t numMobs;
aafUInt32 numComponents = 0;
HRESULT hr = S_OK;
try
{
// Open the file
checkResult(AAFFileOpenExistingRead(pFileName, 0, &pFile));
bFileOpen = true;
// We can't really do anthing in AAF without the header.
checkResult(pFile->GetHeader(&pHeader));
// Get the number of mobs in the file (should be one)
checkResult(pHeader->CountMobs(kAAFAllMob, &numMobs));
checkExpression(1 == numMobs, AAFRESULT_TEST_FAILED);
checkResult(pHeader->GetMobs( NULL, &pMobIter));
while (AAFRESULT_SUCCESS == pMobIter->NextOne(&pMob))
{
checkResult(pMob->GetSlots (&pEnum));
while (AAFRESULT_SUCCESS == pEnum->NextOne (&pMobSlot))
{
checkResult(pMobSlot->GetSegment (&pSegment));
// Check to see if Segment is a Sequence
checkResult(pSegment->QueryInterface(IID_IAAFSequence, (void **) &pSequence));
// It is, so get a Component Iterator
checkResult(pSequence->CountComponents(&numComponents));
// Verify that all 3 components(Filler, Transition, Filler) are present
checkExpression(numComponents == 3, AAFRESULT_TEST_FAILED);
checkResult(pSequence->GetComponents(&pCompIter));
// Now visit each and every one of the components.
while(AAFRESULT_SUCCESS == pCompIter->NextOne(&pComponent))
{
// Find out what kind of segment we have
if ((pComponent->QueryInterface(IID_IAAFTransition, (void **)&pTransition)) == AAFRESULT_SUCCESS)
{
// This is the transition
checkResult(pTransition->GetCutPoint (&cutPoint));
checkResult(pComponent->GetLength(&transitionLength));
checkResult(pTransition->GetOperationGroup(&pOperationGroup));
// Check results !!
checkExpression(cutPoint == 0, AAFRESULT_TEST_FAILED);
checkExpression(transitionLength == 100, AAFRESULT_TEST_FAILED);
pTransition->Release();
pTransition = NULL;
}
else
{
// validate that the other segments are Fillers
checkResult(pComponent->QueryInterface(IID_IAAFFiller, (void **)&pFiller));
pFiller->Release();
pFiller = NULL;
}
pComponent->Release();
pComponent = NULL;
}
pSegment->Release();
pSegment = NULL;
pSequence->Release();
pSequence = NULL;
pCompIter->Release();
pCompIter = NULL;
}
pMob->Release();
pMob = NULL;
}
}
catch (HRESULT& rResult)
{
hr = rResult;
}
// Cleanup and return
if (pTransition)
pTransition->Release();
//.........这里部分代码省略.........
示例2: ReadAAFFile
static HRESULT ReadAAFFile(aafWChar* pFileName)
{
IAAFFile* pFile = NULL;
IAAFHeader* pHeader = NULL;
IAAFDictionary* pDictionary = NULL;
IEnumAAFOperationDefs *pOperationGroupEnum = NULL;
IEnumAAFParameterDefs *pParmDefEnum = NULL;
IAAFOperationDef *pOperationDef = NULL;
IAAFParameterDef *pParmDef = NULL;
IAAFParameter *pParameter = NULL;
IAAFMetaDefinition* pMetaDefinition = NULL;
IAAFSegment* pSeg = NULL;
IAAFOperationGroup* pOperationGroup = NULL;
IEnumAAFMobs *mobIter = NULL;
IAAFMob* pMob = NULL;
IEnumAAFMobSlots *slotIter = NULL;
IAAFMobSlot* pSlot = NULL;
IAAFFiller* pFill = NULL;
IAAFSourceReference *pSourceRef = NULL;
IEnumAAFControlPoints *pEnumCP = NULL;
IAAFControlPoint *pControlPoint = NULL;
IAAFVaryingValue *pVaryingValue = NULL;
IAAFInterpolationDef *pInterpDef = NULL;
IAAFTypeDef *pTypeDef = NULL;
bool bFileOpen = false;
aafBool readIsTimeWarp;
aafUInt32 testNumSources, testNumParam;
HRESULT hr = S_OK;
aafNumSlots_t s;
aafNumSlots_t numSlots;
aafUInt32 readOverride;
aafBool readValidTransition;
aafRational_t testTime;
aafRational_t sampleValue1 = kTestLevel1, sampleValue2 = kTestLevel2, testValue;
aafRational_t checkTime1 = kTestTime1;
aafRational_t checkTime2 = kTestTime2;
aafEditHint_t checkEditHint;
aafUID_t testInterpDef, checkInterpDef = kAAFTypeID_Rational;
try
{
// Open the AAF file
checkResult(AAFFileOpenExistingRead(pFileName, 0, &pFile));
bFileOpen = true;
// Get the AAF file header.
checkResult(pFile->GetHeader(&pHeader));
aafSearchCrit_t criteria;
criteria.searchTag = kAAFNoSearch;
checkResult(pHeader->GetMobs (&criteria, &mobIter));
checkResult(mobIter->NextOne (&pMob));
checkResult(pMob->GetSlots(&slotIter));
checkResult(pMob->CountSlots (&numSlots));
for(s = 0; s < numSlots; s++)
{
checkResult(slotIter->NextOne (&pSlot));
checkResult(pSlot->GetSegment (&pSeg));
checkResult(pSeg->QueryInterface (IID_IAAFOperationGroup, (void **)&pOperationGroup));
pSeg->Release();
pSeg = NULL;
checkResult(pOperationGroup->CountSourceSegments(&testNumSources));
checkExpression(testNumSources == TEST_NUM_INPUTS, AAFRESULT_TEST_FAILED);
checkResult(pOperationGroup->CountParameters(&testNumParam));
checkExpression(testNumSources == 1, AAFRESULT_TEST_FAILED);
checkResult(pOperationGroup->IsATimeWarp (&readIsTimeWarp));
checkExpression(readIsTimeWarp == kAAFFalse, AAFRESULT_TEST_FAILED);
checkResult(pOperationGroup->GetBypassOverride (&readOverride));
checkExpression(readOverride == 1, AAFRESULT_TEST_FAILED);
checkResult(pOperationGroup->IsValidTranOperation (&readValidTransition));
checkExpression(readValidTransition == kAAFFalse, AAFRESULT_TEST_FAILED);
/**/
checkResult(pOperationGroup->GetInputSegmentAt (0, &pSeg));
checkResult(pSeg->QueryInterface(IID_IAAFFiller, (void **) &pFill));
pFill->Release();
pFill = NULL;
/**/
checkResult(pOperationGroup->LookupParameter (kTestParmID, &pParameter));
checkResult(pParameter->QueryInterface(IID_IAAFVaryingValue, (void **) &pVaryingValue));
/*** Check the VaryingValue methods **/
aafUInt32 testLen, bytesRead;
checkResult(pVaryingValue->GetControlPoints(&pEnumCP));
checkResult(pEnumCP->NextOne(&pControlPoint));
checkResult(pControlPoint->GetValueBufLen (&testLen));
checkExpression(testLen == sizeof(sampleValue1), AAFRESULT_TEST_FAILED);
checkResult(pControlPoint->GetValue (sizeof(sampleValue1), (aafDataBuffer_t)&testValue, &bytesRead));
checkExpression(testValue.numerator == sampleValue1.numerator, AAFRESULT_TEST_FAILED);
checkExpression(testValue.denominator == sampleValue1.denominator, AAFRESULT_TEST_FAILED);
checkExpression(bytesRead == sizeof(sampleValue1), AAFRESULT_TEST_FAILED);
checkResult(pControlPoint->GetTime(&testTime));
checkExpression(testTime.numerator == checkTime1.numerator, AAFRESULT_TEST_FAILED);
checkExpression(testTime.denominator == checkTime1.denominator, AAFRESULT_TEST_FAILED);
//.........这里部分代码省略.........
示例3: ReadAAFFile
static HRESULT ReadAAFFile(aafWChar * pFileName)
{
// IAAFSession * pSession = NULL;
IAAFFile * pFile = NULL;
IAAFHeader * pHeader = NULL;
IEnumAAFMobs* pMobIter = NULL;
IAAFMob* pMob = NULL;
IAAFMob* pReferencedMob = NULL;
IEnumAAFMobSlots* pSlotIter = NULL;
IAAFMobSlot* pSlot = NULL;
IAAFSegment* pSegment = NULL;
IAAFSourceClip* pSourceClip = NULL;
bool bFileOpen = false;
aafSearchCrit_t criteria;
aafNumSlots_t numMobs, numSlots;
HRESULT hr = AAFRESULT_SUCCESS;
try
{
// Open the file
checkResult(AAFFileOpenExistingRead(pFileName, 0, &pFile));
bFileOpen = true;
// We can't really do anthing in AAF without the header.
checkResult(pFile->GetHeader(&pHeader));
// Get the number of mobs in the file (should be one)
checkResult(pHeader->CountMobs(kAAFAllMob, &numMobs));
checkExpression(2 == numMobs, AAFRESULT_TEST_FAILED);
// Enumerate over all Composition Mobs
criteria.searchTag = kAAFByMobKind;
criteria.tags.mobKind = kAAFCompMob;
checkResult(pHeader->GetMobs(&criteria, &pMobIter));
while (AAFRESULT_SUCCESS == pMobIter->NextOne(&pMob))
{
checkResult(pMob->CountSlots(&numSlots));
checkExpression(1 == numSlots, AAFRESULT_TEST_FAILED);
checkResult(pMob->GetSlots(&pSlotIter));
while (AAFRESULT_SUCCESS == pSlotIter->NextOne(&pSlot))
{
// The segment should be a source clip...
checkResult(pSlot->GetSegment(&pSegment));
pSegment->Release();
pSegment = NULL;
pSlot->Release();
pSlot = NULL;
}
pMob->Release();
pMob = NULL;
}
}
catch (HRESULT& rResult)
{
hr = rResult;
}
// Cleanup and return
if (pReferencedMob)
pReferencedMob->Release();
if (pSourceClip)
pSourceClip->Release();
if (pSegment)
pSegment->Release();
if (pSlot)
pSlot->Release();
if (pSlotIter)
pSlotIter->Release();
if (pMob)
pMob->Release();
if (pMobIter)
pMobIter->Release();
if (pHeader)
pHeader->Release();
if (pFile)
{
if (bFileOpen)
pFile->Close();
pFile->Release();
}
return hr;
}
示例4: ProcessAAFFile
//.........这里部分代码省略.........
check(pSequenceDef->
CreateInstance(IID_IAAFSequence,
(IUnknown **)&pAudioSequence));
check(pAudioSequence->QueryInterface(IID_IAAFSegment, (void **)&seg));
check(pAudioSequence->QueryInterface(IID_IAAFComponent,
(void **)&aComponent));
check(aComponent->SetDataDef(pSoundDef));
check(pCompMob->AppendNewTimelineSlot(editRate, seg, 1, slotName, zeroPos, &newSlot));
seg->Release();
seg = NULL;
newSlot->Release();
newSlot = NULL;
// This variable is about to be overwritten so we need to release the old interface
aComponent->Release();
aComponent = NULL;
while((AAFRESULT_SUCCESS == pMobIter->NextOne(&pMob)))
{
// Print out information about the Mob
char mobIDstr[256];
char mobName[256];
check(pMob->GetMobID (&mobID));
check(pMob->GetName (namebuf, sizeof(namebuf)));
convert(mobName, sizeof(mobName), namebuf);
MobIDtoString(mobID, mobIDstr);
printf(" MasterMob Name = '%s'\n", mobName);
printf(" (mobID %s)\n", mobIDstr);
// Add a Source Clip for each Master Mob to the audio sequence by iterating
check(pMob->GetSlots(&pMobSlotIter));
/* Iterating through all Mob Slots */
// Get the number of slots
check(pMob->CountSlots(&numSlots));
while (lookingForAudio && (AAFRESULT_SUCCESS == pMobSlotIter->NextOne(&pMobSlot)));
{
/* Check to see if it is an Audio Timeline Mob Slot */
HRESULT hr;
hr=pMobSlot->QueryInterface(IID_IAAFTimelineMobSlot,(void **) &pTimelineMobSlot);
if (SUCCEEDED(hr))
{
printf("Found a timeline mob slot\n");
check(pMobSlot->GetDataDef(&pDataDef));
// Check that we have a sound file by examining its data definition
aafBool bIsSoundKind = kAAFFalse;
check(pDataDef->IsSoundKind(&bIsSoundKind));
if (kAAFTrue == bIsSoundKind)
{
printf("Found a sound file\n");
// We are no longer looking for audio data so set boolean
lookingForAudio = false;
/* Get the information for the new source clip */
check(pMob->GetMobID(&sourceRef.sourceID));
check(pMobSlot->GetSlotID(&sourceRef.sourceSlotID));
check(pTimelineMobSlot->GetOrigin(&sourceRef.startTime));
check(pMobSlot->GetSegment(&pSegment));
示例5: OpenAAFFile
static HRESULT OpenAAFFile(aafWChar * pFileName, bool comp_enable)
{
IAAFFile* pFile = NULL;
IAAFHeader* pHeader = NULL;
IAAFDictionary* pDictionary = NULL;
IAAFMob* pMob = NULL;
IAAFEssenceAccess* pEssenceAccess = NULL;
IEnumAAFMobs* pMobIter = NULL;
aafNumSlots_t numMobs, numSlots;
aafSearchCrit_t criteria;
aafMobID_t mobID;
IAAFDataDef *pPictureDef = NULL;
IAAFMobSlot* pMobSlot = NULL;
// Open an AAF file
check(AAFFileOpenExistingRead (pFileName, 0, &pFile));
check(pFile->GetHeader(&pHeader));
// Open raw video output file
FILE *output;
const char *output_file = comp_enable ? "raw.uyvy" : "raw.mjpeg";
if ((output = fopen(output_file, "wb")) == NULL)
{
perror(output_file);
exit(1);
}
// Get the AAF Dictionary from the file
check(pHeader->GetDictionary(&pDictionary));
/* Lookup any necessary data definitions. */
check(pDictionary->LookupDataDef(kAAFDataDef_Picture, &pPictureDef));
/* Check number of Mobs in file */
check(pHeader->CountMobs(kAAFMasterMob, &numMobs));
if (numMobs == 0)
return 0;
printf("Found %d Master Mobs\n", numMobs);
criteria.searchTag = kAAFByMobKind;
criteria.tags.mobKind = kAAFMasterMob;
check(pHeader->GetMobs(&criteria, &pMobIter));
while (AAFRESULT_SUCCESS == pMobIter->NextOne(&pMob))
{
char mobIDstr[256];
char mobName[256];
aafWChar namebuf[1204];
IAAFTimelineMobSlot* pTimelineMobSlot = NULL;
IAAFDataDef *pDataDef = NULL;
IEnumAAFMobSlots* pMobSlotIter = NULL;
check(pMob->GetMobID (&mobID));
check(pMob->GetName (namebuf, sizeof(namebuf)));
convert(mobName, sizeof(mobName), namebuf);
MobIDtoString(mobID, mobIDstr);
printf(" MasterMob Name = '%s'\n", mobName);
printf(" (mobID %s)\n", mobIDstr);
// Get the number of slots
check(pMob->CountSlots(&numSlots));
// Iterating through all Mob Slots
check(pMob->GetSlots(&pMobSlotIter));
while(AAFRESULT_SUCCESS == pMobSlotIter->NextOne(&pMobSlot))
{
// Check to see if it is a Video Timeline Mob Slot
HRESULT hr;
hr = pMobSlot->QueryInterface(IID_IAAFTimelineMobSlot,(void **) &pTimelineMobSlot);
if (FAILED(hr))
{
pMobSlot->Release();
pMobSlot = NULL;
continue;
}
check(pMobSlot->GetDataDef(&pDataDef));
// Check that we have a picture data def
aafBool bIsPictureKind = kAAFFalse;
check(pDataDef->IsPictureKind(&bIsPictureKind));
if (kAAFTrue != bIsPictureKind)
{
pTimelineMobSlot->Release();
pTimelineMobSlot = NULL;
pDataDef->Release();
pDataDef = NULL;
continue; // skip non-picture data defs
}
aafUInt32 MobSlotID;
IAAFMasterMob* pMasterMob = NULL;
//.........这里部分代码省略.........
示例6: ReadAAFFile
static HRESULT ReadAAFFile(aafWChar* pFileName)
{
IAAFFile* pFile = NULL;
bool bFileOpen = false;
IAAFHeader* pHeader = NULL;
IEnumAAFMobs* pMobIter = NULL;
IAAFMob* pMob = NULL;
IAAFMasterMob* pMasterMob = NULL;
IEnumAAFMobSlots* pSlotIter = NULL;
IAAFMobSlot* pSlot;
aafNumSlots_t numMobs;
aafSearchCrit_t criteria;
IAAFSearchSource* pSearchSource = NULL;
IAAFFindSourceInfo* pSourceInfo = NULL;
IAAFMob* si_mob = NULL; //mob used by SourceInfo intf.
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));
// Validate that there is on one master mob in the test file.
checkResult(pHeader->CountMobs(kAAFMasterMob, &numMobs));
checkExpression(1 == numMobs, AAFRESULT_TEST_FAILED);
// Enumerate over Master MOBs
criteria.searchTag = kAAFByMobKind;
criteria.tags.mobKind = kAAFMasterMob;
checkResult(pHeader->GetMobs(&criteria, &pMobIter));
while (pMobIter && pMobIter->NextOne(&pMob) == AAFRESULT_SUCCESS)
{
aafWChar name[500];
aafNumSlots_t numSlots = 0;
aafMobID_t mobID;
// TODO: Test Master MOB specific methods here
checkResult(pMob->QueryInterface(IID_IAAFMasterMob, (void **) &pMasterMob));
checkResult(pMob->GetName(name, sizeof(name)));
checkExpression(wcscmp(name, MobName) == 0, AAFRESULT_TEST_FAILED);
checkResult(pMob->GetMobID(&mobID));
checkExpression(0 == memcmp(&mobID, &TEST_Master_MobID, sizeof(mobID)), AAFRESULT_TEST_FAILED);
checkResult(pMob->CountSlots(&numSlots));
checkExpression(NumMobSlots == numSlots, AAFRESULT_TEST_FAILED);
//AAFRESULT STDMETHODCALLTYPE
// ImplAAFMasterMob::GetTapeNameBufLen (0,
// aafInt32* pLen)
unsigned long s = 0;
// Enumerate over all MOB slots for this MOB
checkResult(pMob->GetSlots(&pSlotIter));
while (pSlotIter && pSlotIter->NextOne(&pSlot) == AAFRESULT_SUCCESS)
{
aafWChar slotName[500];
aafSlotID_t slotID;
//aafUInt32 bufSize = 0;
// Validate the slot name
checkResult(pSlot->GetName(slotName, sizeof(slotName)));
checkExpression(wcscmp(slotName, slotNames[s]) == 0, AAFRESULT_TEST_FAILED);
// Validate the slot id.
checkResult(pSlot->GetSlotID(&slotID));
checkExpression(slotID == s+1, AAFRESULT_TEST_FAILED);
//Now, do a search source ...............
//Get a search source intf.
checkResult( pMasterMob->QueryInterface(IID_IAAFSearchSource, (void**)&pSearchSource) );
//From the searchsource inft, get a FindSourceINfo intf.
checkResult ( pSearchSource->SearchSource(
slotID,
0,
kAAFTapeMob,
NULL, //don't care about Media Criteria
NULL, //don't care about operation choice
&pSourceInfo));
//This is an important milestone! At this point, we were successful - about getting a pSourceInfo intf.
// so, release the search source intf.
if (pSearchSource)
{
pSearchSource->Release();
pSearchSource=NULL;
}
//NOw, simply test the methods on the (final) SourceInfo intf.
aafRational_t si_editRate = {-1};
//.........这里部分代码省略.........
示例7: OpenEvent
void EventTest::OpenEvent()
{
assert(_pHeader);
HRESULT hr = S_OK;
IAAFMob *pMob = NULL;
IEnumAAFMobSlots *pEnumSlots = NULL;
IAAFMobSlot *pMobSlot = NULL;
IAAFEventMobSlot *pEventMobSlot = NULL;
aafRational_t editRate = {0};
IAAFSegment *pSegment = NULL;
IAAFEvent *pEvent = NULL;
aafPosition_t position;
wchar_t eventComment[128];
try
{
// Get the composition mob that we created to hold the
checkResult(_pHeader->LookupMob(gMobID, &pMob));
// Get the first mob slot and check that it is an event mob slot.
checkResult(pMob->GetSlots(&pEnumSlots));
checkResult(pEnumSlots->NextOne(&pMobSlot));
checkResult(pMobSlot->QueryInterface(IID_IAAFEventMobSlot, (void **)&pEventMobSlot));
checkResult(pEventMobSlot->GetEditRate(&editRate));
checkExpression(0 == memcmp(&editRate, &_editRate, sizeof(editRate)), AAFRESULT_TEST_FAILED);
// Get the event slot's segment and check that it is an event.
checkResult(pMobSlot->GetSegment(&pSegment));
checkResult(pSegment->QueryInterface(IID_IAAFEvent, (void **)&pEvent));
// Now validate the event property values we thought were written to the
// file.
// Validate the position
checkResult(pEvent->GetPosition(&position));
checkExpression(0 == memcmp(&position, &_position, sizeof(position)), AAFRESULT_TEST_FAILED);
// Validate the comment buffer size.
aafUInt32 expectedLen = wcslen(_eventComment) + 1;
aafUInt32 expectedSize = expectedLen * sizeof(wchar_t);
aafUInt32 commentBufSize = 0;
checkResult(pEvent->GetCommentBufLen(&commentBufSize));
checkExpression(commentBufSize == expectedSize, AAFRESULT_TEST_FAILED);
// Validate the event comment.
checkExpression(commentBufSize <= sizeof(eventComment), AAFRESULT_TEST_FAILED);
checkResult(pEvent->GetComment(eventComment, commentBufSize));
checkExpression(0 == memcmp(eventComment, _eventComment, commentBufSize), AAFRESULT_TEST_FAILED);
}
catch (HRESULT& rHR)
{
hr = rHR;
// fall through and handle cleanup
}
// Cleanup local references
if (pEvent)
{
pEvent->Release();
pEvent = NULL;
}
if (pSegment)
{
pSegment->Release();
pSegment = NULL;
}
if (pEventMobSlot)
{
pEventMobSlot->Release();
pEventMobSlot = NULL;
}
if (pMobSlot)
{
pMobSlot->Release();
pMobSlot = NULL;
}
if (pEnumSlots)
{
pEnumSlots->Release();
pEnumSlots = NULL;
}
if (pMob)
{
pMob->Release();
pMob = NULL;
}
// Propogate the error if necessary.
checkResult(hr);
}
示例8: OpenAAFFile
static HRESULT OpenAAFFile(aafWChar * pFileName)
{
IAAFFile* pFile = NULL;
IAAFHeader* pHeader = NULL;
IAAFDictionary* pDictionary = NULL;
IAAFMob* pMob = NULL;
IAAFEssenceAccess* pEssenceAccess = NULL;
IAAFEssenceFormat* pFormat = NULL;
IEnumAAFMobs* pMobIter = NULL;
aafNumSlots_t numMobs, numSlots;
aafSearchCrit_t criteria;
aafMobID_t mobID;
IAAFDataDef *pSoundDef = NULL;
IAAFMobSlot* pMobSlot = NULL;
// Open an AAF file
check(AAFFileOpenExistingRead (pFileName, 0, &pFile));
check(pFile->GetHeader(&pHeader));
// Open raw audio output file
FILE *output;
const char *output_file = "raw.pcm";
if ((output = fopen(output_file, "wb")) == NULL)
{
perror(output_file);
exit(1);
}
// Get the AAF Dictionary from the file
check(pHeader->GetDictionary(&pDictionary));
/* Lookup any necessary data definitions. */
check(pDictionary->LookupDataDef(kAAFDataDef_Sound, &pSoundDef));
/* Check number of Mobs in file */
check(pHeader->CountMobs(kAAFMasterMob, &numMobs));
if (numMobs == 0)
{
printf("No Master Mobs found in AAF file\n");
return 0;
}
printf("Found %d Master Mobs\n", numMobs);
criteria.searchTag = kAAFByMobKind;
criteria.tags.mobKind = kAAFMasterMob;
check(pHeader->GetMobs(&criteria, &pMobIter));
while (AAFRESULT_SUCCESS == pMobIter->NextOne(&pMob))
{
char mobIDstr[256];
aafWChar namebuf[1204];
IAAFTimelineMobSlot* pTimelineMobSlot = NULL;
IAAFDataDef *pDataDef = NULL;
IAAFEssenceFormat *fmtTemplate = NULL;
unsigned char *dataBuff = NULL;
IEnumAAFMobSlots* pMobSlotIter = NULL;
check(pMob->GetMobID (&mobID));
check(pMob->GetName (namebuf, sizeof(namebuf)));
MobIDtoString(mobID, mobIDstr);
printf(" MasterMob Name = '%ls'\n", namebuf);
printf(" (mobID %s)\n", mobIDstr);
// Get the number of slots
check(pMob->CountSlots(&numSlots));
// Iterating through all Mob Slots
check(pMob->GetSlots(&pMobSlotIter));
while(AAFRESULT_SUCCESS == pMobSlotIter->NextOne(&pMobSlot))
{
// Check to see if it is an Audio Timeline Mob Slot
HRESULT hr;
aafUInt32 MobSlotID;
hr=pMobSlot->QueryInterface(IID_IAAFTimelineMobSlot,(void **) &pTimelineMobSlot);
if (SUCCEEDED(hr))
{
check(pMobSlot->GetDataDef(&pDataDef));
// Check that we have a sound file by examining its data definition
aafBool bIsSoundKind = kAAFFalse;
check(pDataDef->IsSoundKind(&bIsSoundKind));
if (kAAFTrue == bIsSoundKind)
{
IAAFMasterMob* pMasterMob = NULL;
// Prepare to get audio data: first get MobSlotID
check(pMobSlot->GetSlotID(&MobSlotID));
// Then get a Master Mob interface
check(pMob->QueryInterface(IID_IAAFMasterMob, (void **)&pMasterMob));
// Open the Essence Data
check(pMasterMob->OpenEssence(MobSlotID,
//.........这里部分代码省略.........
示例9: ReadAAFFile
static HRESULT ReadAAFFile(aafWChar * pFileName)
{
IAAFFile *pFile = NULL;
bool bFileOpen = false;
IAAFHeader *pHeader = NULL;
IEnumAAFMobs *mobIter = NULL;
IAAFMob *aMob = NULL;
IEnumAAFMobSlots *slotIter = NULL;
IAAFMobSlot *slot = NULL;
IAAFSegment *pSeg = NULL;
IAAFSourceClip *pSourceClip = NULL;
IAAFDataDef * pDataDef = 0;
IAAFDefObject * pDefObj = 0;
aafNumSlots_t numMobs, n;
aafSlotID_t s;
aafUInt32 length;
HRESULT hr = S_OK;
aafUID_t readUID, typeUID = kAAFDataDef_Picture;
try
{
// Open the file
checkResult(AAFFileOpenExistingRead(pFileName, 0, &pFile));
bFileOpen = true;
// We can't really do anthing in AAF without the header.
checkResult(pFile->GetHeader(&pHeader));
checkResult(pHeader->CountMobs(kAAFAllMob, &numMobs));
checkExpression(1 == numMobs, AAFRESULT_TEST_FAILED);
aafSearchCrit_t criteria;
criteria.searchTag = kAAFNoSearch;
checkResult(pHeader->GetMobs (&criteria, &mobIter));
for(n = 0; n < numMobs; n++)
{
aafWChar name[500], slotName[500];
aafNumSlots_t numSlots;
aafMobID_t mobID;
aafSlotID_t trackID;
checkResult(mobIter->NextOne (&aMob));
checkResult(aMob->GetName (name, sizeof(name)));
checkResult(aMob->GetMobID (&mobID));
checkResult(aMob->CountSlots (&numSlots));
checkExpression(5 == numSlots, AAFRESULT_TEST_FAILED);
checkResult(aMob->GetSlots(&slotIter));
for(s = 0; s < (aafSlotID_t)numSlots; s++)
{
checkResult(slotIter->NextOne (&slot));
checkResult(slot->GetNameBufLen(&length));
checkResult(slot->GetName (slotName, length));
checkExpression (wcscmp(slotName, slotNames[s]) == 0, AAFRESULT_TEST_FAILED);
checkResult(slot->GetSlotID(&trackID));
checkExpression (trackID == s+1, AAFRESULT_TEST_FAILED);
checkResult(slot->GetPhysicalNum(&trackID));
checkExpression (trackID == s+2, AAFRESULT_TEST_FAILED);
checkResult(slot->GetPhysicalNum(&trackID));
checkResult(slot->GetDataDef(&pDataDef));
checkResult(pDataDef->QueryInterface (IID_IAAFDefObject, (void **)&pDefObj));
checkResult(pDefObj->GetAUID(&readUID));
checkExpression (memcmp(&typeUID, &readUID, sizeof(typeUID)) == 0, AAFRESULT_TEST_FAILED);
checkResult(slot->GetSegment(&pSeg));
checkResult(pSeg->QueryInterface (IID_IAAFSourceClip, (void **)&pSourceClip));
pDataDef->Release();
pDataDef = 0;
pDefObj->Release ();
pDefObj = 0;
pSourceClip->Release();
pSourceClip = NULL;
pSeg->Release();
pSeg = NULL;
slot->Release();
slot = NULL;
}
aMob->Release();
aMob = NULL;
}
}
catch (HRESULT& rResult)
{
hr = rResult;
}
// Cleanup object references
if (slot)
{
slot->Release();
slot = 0;
}
if (pSeg)
{
//.........这里部分代码省略.........
示例10: OpenHTMLClip
void HTMLClipTest::OpenHTMLClip()
{
assert(_pHeader);
HRESULT hr = S_OK;
aafNumSlots_t compositionMobs = 0;
IEnumAAFMobs *pEnumMobs = NULL;
IAAFMob *pReferencingMob = NULL;
IAAFCompositionMob *pCompositionMob = NULL;
aafNumSlots_t mobSlots = 0;
IEnumAAFMobSlots *pEnumSlots = NULL;
IAAFMobSlot *pMobSlot = NULL;
IAAFSegment *pSegment = NULL;
IAAFHTMLClip *pHTMLClip = NULL;
aafUInt32 bufSize = 0;
aafUInt32 actualBufSize = 0;
aafUInt32 actualLength = 0;
wchar_t *pBeginAnchor = NULL;
wchar_t *pEndAnchor = NULL;
IAAFSourceReference *pSourceReference = NULL;
aafMobID_t masterMobID = {0};
IAAFMasterMob *pMasterMob = NULL;
IAAFMob *pReferencedMob = NULL;
try
{
// Get the number of composition mobs in the file (should be one)
checkResult(_pHeader->CountMobs(kAAFCompMob, &compositionMobs));
checkExpression(1 == compositionMobs, AAFRESULT_TEST_FAILED);
// Get the composition mob. There should only be one.
aafSearchCrit_t criteria;
criteria.searchTag = kAAFByMobKind;
criteria.tags.mobKind = kAAFCompMob;
checkResult(_pHeader->GetMobs(&criteria, &pEnumMobs));
checkResult(pEnumMobs->NextOne(&pReferencingMob));
checkResult(pReferencingMob->QueryInterface(IID_IAAFCompositionMob, (void **)&pCompositionMob));
// Get the html clip in the slot. There should be only one.
checkResult(pReferencingMob->CountSlots(&mobSlots));
checkExpression(1 == mobSlots, AAFRESULT_TEST_FAILED);
checkResult(pReferencingMob->GetSlots(&pEnumSlots));
checkResult(pEnumSlots->NextOne(&pMobSlot));
checkResult(pMobSlot->GetSegment(&pSegment));
checkResult(pSegment->QueryInterface(IID_IAAFHTMLClip, (void **)&pHTMLClip));
// Validate the properties...
checkResult(pHTMLClip->GetBeginAnchorBufLen(&bufSize));
actualLength = wcslen(_beginAnchor) + 1;
actualBufSize = actualLength * 2;
checkExpression(bufSize == actualBufSize, AAFRESULT_TEST_FAILED);
pBeginAnchor = new wchar_t[actualLength];
checkExpression(NULL != pBeginAnchor, AAFRESULT_NOMEMORY);
checkResult(pHTMLClip->GetBeginAnchor(pBeginAnchor, actualBufSize));
checkExpression(0 == wcscmp(pBeginAnchor, _beginAnchor), AAFRESULT_TEST_FAILED);
checkResult(pHTMLClip->GetEndAnchorBufLen(&bufSize));
actualLength = wcslen(_endAnchor) + 1;
actualBufSize = actualLength * 2;
checkExpression(bufSize == actualBufSize, AAFRESULT_TEST_FAILED);
pEndAnchor = new wchar_t[actualLength];
checkExpression(NULL != pEndAnchor, AAFRESULT_NOMEMORY);
checkResult(pHTMLClip->GetEndAnchor(pEndAnchor, actualBufSize));
checkExpression(0 == wcscmp(pEndAnchor, _endAnchor), AAFRESULT_TEST_FAILED);
// Attempt to "resolve" the reference and find the master mob.
checkResult(pHTMLClip->QueryInterface(IID_IAAFSourceReference, (void **)&pSourceReference));
checkResult(pSourceReference->GetSourceID(&masterMobID));
checkExpression(0 == memcmp(&masterMobID, &_referencedMobID, sizeof(masterMobID)), AAFRESULT_TEST_FAILED);
checkResult(_pHeader->LookupMob(masterMobID, &pReferencedMob));
checkResult(pReferencedMob->QueryInterface(IID_IAAFMasterMob, (void **)&pMasterMob));
// Use EssenceAccess to read some html essence
// Find the file mob for the html essence.
// Find the corresponding html essence.
// Read some html essence.
}
catch (HRESULT& rHR)
{
hr = rHR;
// fall through and handle cleanup
}
// Cleanup local references
if (pMasterMob)
{
pMasterMob->Release();
pMasterMob = NULL;
}
if (pReferencedMob)
{
pReferencedMob->Release();
pReferencedMob = NULL;
}
if (pSourceReference)
//.........这里部分代码省略.........
示例11: ReadAAFFile
//.........这里部分代码省略.........
checkResult(aMob->GetCreateTime(&created));
checkTimeStampsAreEqual(creationTimeStamp, created);
aafTimeStamp_t modified = { {0,0,0}, {0,0,0,0} };
checkExpression(aMob->GetModTime(NULL) == AAFRESULT_NULL_PARAM, AAFRESULT_TEST_FAILED);
checkResult(aMob->GetModTime(&modified));
checkTimeStampsAreEqual(modificationTimeStamp, modified);
// Check the GetMobInfo data.
memset(&created, 0, sizeof(created));
memset(&modified, 0, sizeof(modified));
checkExpression(aMob->GetMobInfo(NULL, &created,
name, sizeof(name)) == AAFRESULT_NULL_PARAM,
AAFRESULT_TEST_FAILED);
checkExpression(aMob->GetMobInfo(&modified, NULL,
name, sizeof(name)) == AAFRESULT_NULL_PARAM,
AAFRESULT_TEST_FAILED);
checkExpression(aMob->GetMobInfo(&modified, &created,
NULL, sizeof(name)) == AAFRESULT_NULL_PARAM,
AAFRESULT_TEST_FAILED);
checkExpression(aMob->GetMobInfo(&modified, &created,
name, 1) == AAFRESULT_SMALLBUF,
AAFRESULT_TEST_FAILED);
checkResult(aMob->GetMobInfo(&modified, &created, name, sizeof(name)));
checkTimeStampsAreEqual(creationTimeStamp, created);
checkTimeStampsAreEqual(modificationTimeStamp, modified);
checkExpression (wcscmp(mobName, name) == 0, AAFRESULT_TEST_FAILED);
checkExpression(aMob->CountSlots (NULL) == AAFRESULT_NULL_PARAM, AAFRESULT_TEST_FAILED);
checkResult(aMob->CountSlots (&numSlots));
//seven slots made by IAAFMob and one static slot and event slot made throught IAAFMOb2
checkExpression((7+1+1) == numSlots, AAFRESULT_TEST_FAILED);
checkExpression(aMob->GetSlots(NULL) == AAFRESULT_NULL_PARAM, AAFRESULT_TEST_FAILED);
checkResult(aMob->GetSlots(&slotIter));
for(s = 0; s < numSlots; s++)
{
checkResult(slotIter->NextOne (&slot));
checkResult(slot->GetNameBufLen(&bufLen));
checkResult(slot->GetName (slotName, bufLen));
checkResult(slot->GetSlotID(&trackID));
checkExpression (wcscmp(slotName, slotNames[s]) == 0, AAFRESULT_TEST_FAILED);
checkExpression(trackID == (s+1), AAFRESULT_TEST_FAILED);
slot->Release();
slot = NULL;
bufLen = 0;
trackID = 0;
}
slotIter->Release();
slotIter = NULL;
// GetSlotAt
checkExpression(aMob->GetSlotAt(1, NULL) == AAFRESULT_NULL_PARAM,
AAFRESULT_TEST_FAILED);
checkExpression(aMob->GetSlotAt(9, &slot) == AAFRESULT_BADINDEX,
AAFRESULT_TEST_FAILED);
for (s = 0; s < numSlots; ++s)
{
checkResult(aMob->GetSlotAt(s, &slot));
checkResult(slot->GetNameBufLen(&bufLen));
checkResult(slot->GetName(slotName, bufLen));
checkResult(slot->GetSlotID(&trackID));
checkExpression(wcscmp(slotName, slotNames[s]) == 0, AAFRESULT_TEST_FAILED);
checkExpression(trackID == (s+1), AAFRESULT_TEST_FAILED);
示例12: ReadAAFFile
static HRESULT ReadAAFFile(aafWChar * pFileName)
{
IAAFFile *pFile = NULL;
bool bFileOpen = false;
IAAFHeader *pHeader = NULL;
IEnumAAFMobs *mobIter = NULL;
IAAFMob *aMob = NULL;
IEnumAAFMobSlots *slotIter = NULL;
IAAFMobSlot *slot = NULL;
aafNumSlots_t numMobs, n, s;
HRESULT hr = S_OK;
IAAFMobSlot* pArray[2] = { NULL, NULL };
IAAFMobSlot** pArrayDef = pArray;
aafUInt32 resultCount;
IEnumAAFMobSlots *slotClone = NULL;
try
{
// Open the file
checkResult(AAFFileOpenExistingRead(pFileName, 0, &pFile));
bFileOpen = true;
// We can't really do anthing in AAF without the header.
checkResult(pFile->GetHeader(&pHeader));
checkResult(pHeader->CountMobs(kAAFAllMob, &numMobs));
checkExpression(1 == numMobs, AAFRESULT_TEST_FAILED);
aafSearchCrit_t criteria;
criteria.searchTag = kAAFNoSearch;
checkResult(pHeader->GetMobs (&criteria, &mobIter));
for(n = 0; n < numMobs; n++)
{
aafWChar name[500], slotName[500];
aafNumSlots_t numSlots;
aafMobID_t mobID;
aafSlotID_t trackID;
checkResult(mobIter->NextOne (&aMob));
checkResult(aMob->GetName (name, sizeof(name)));
checkResult(aMob->GetMobID (&mobID));
checkResult(aMob->CountSlots (&numSlots));
checkExpression(5 == numSlots, AAFRESULT_TEST_FAILED);
checkResult(aMob->GetSlots(&slotIter));
/* Read and check all elements using NextOne */
for(s = 0; s < numSlots; s++)
{
checkResult(slotIter->NextOne (&slot));
checkResult(slot->GetName (slotName, sizeof(slotName)));
checkResult(slot->GetSlotID(&trackID));
checkExpression (wcscmp(slotName, slotNames[s]) == 0, AAFRESULT_TEST_FAILED);
slot->Release();
slot = NULL;
}
/* Read one past to make sure that it fails */
checkExpression(slotIter->NextOne(&slot) != AAFRESULT_SUCCESS, AAFRESULT_TEST_FAILED);
/* Reset, and check the first element again*/
checkResult(slotIter->Reset());
checkResult(slotIter->NextOne (&slot));
checkResult(slot->GetName (slotName, sizeof(slotName)));
checkResult(slot->GetSlotID(&trackID));
checkExpression (wcscmp(slotName, slotNames[0]) == 0, AAFRESULT_TEST_FAILED);
slot->Release();
slot = NULL;
/* Reset, Skip, and check the second element again*/
checkResult(slotIter->Reset());
checkResult(slotIter->Skip(1));
checkResult(slotIter->NextOne (&slot));
checkResult(slot->GetName (slotName, sizeof(slotName)));
checkResult(slot->GetSlotID(&trackID));
checkExpression (wcscmp(slotName, slotNames[1]) == 0, AAFRESULT_TEST_FAILED);
slot->Release();
slot = NULL;
/* Reset, and read both elements */
checkResult(slotIter->Reset());
checkResult(slotIter->Next (2, (IAAFMobSlot **)&pArray, &resultCount));
checkExpression (resultCount == 2, AAFRESULT_TEST_FAILED);
checkResult(pArrayDef[0]->GetName (slotName, sizeof(slotName)));
checkResult(pArrayDef[0]->GetSlotID(&trackID));
checkExpression (wcscmp(slotName, slotNames[0]) == 0, AAFRESULT_TEST_FAILED);
checkResult(pArrayDef[1]->GetName (slotName, sizeof(slotName)));
checkResult(pArrayDef[1]->GetSlotID(&trackID));
checkExpression (wcscmp(slotName, slotNames[1]) == 0, AAFRESULT_TEST_FAILED);
pArrayDef[0]->Release();
pArrayDef[0] = NULL;
pArrayDef[1]->Release();
pArrayDef[1] = NULL;
/* Clone the enumerator, and read one element */
checkResult(slotIter->Clone(&slotClone));
checkResult(slotClone->Reset());
//.........这里部分代码省略.........
示例13: ReadAAFFile
static HRESULT ReadAAFFile(aafWChar * pFileName)
{
IAAFFile * pFile = NULL;
bool bFileOpen = false;
IAAFHeader * pHeader = NULL;
IEnumAAFMobs *mobIter = NULL;
IAAFMob *aMob = NULL;
IEnumAAFMobSlots *slotIter = NULL;
IEnumAAFTaggedValues* pCommentIterator = NULL;
IAAFTaggedValue* pComment = NULL;
IAAFMobSlot *slot = NULL;
aafNumSlots_t numMobs, n, slt;
aafUInt32 numComments, bytesRead, com;
HRESULT hr = S_OK;
aafWChar tag[64];
aafWChar Value[64];
aafSearchCrit_t criteria;
try
{
// Open the file
checkResult(AAFFileOpenExistingRead(pFileName, 0, &pFile));
bFileOpen = true;
// We can't really do anthing in AAF without the header.
checkResult(pFile->GetHeader(&pHeader));
criteria.searchTag = kAAFByMobKind;
criteria.tags.mobKind = kAAFCompMob;
checkResult(pHeader->CountMobs(kAAFCompMob, &numMobs));
checkExpression(1 == numMobs, AAFRESULT_TEST_FAILED);
checkResult(pHeader->GetMobs (&criteria, &mobIter));
for(n = 0; n < numMobs; n++)
{
aafWChar name[500], slotName[500];
aafNumSlots_t numSlots;
aafMobID_t mobID;
aafSlotID_t trackID;
checkResult(mobIter->NextOne (&aMob));
checkResult(aMob->GetName (name, sizeof(name)));
checkResult(aMob->GetMobID (&mobID));
// Check for comments
checkResult(aMob->CountComments(&numComments));
checkExpression(1 == numComments, AAFRESULT_TEST_FAILED);
checkResult(aMob->GetComments(&pCommentIterator));
for(com = 0; com < numComments; com++)
{
checkResult(pCommentIterator->NextOne(&pComment));
checkResult(pComment->GetName(tag, sizeof(tag)));
checkResult(pComment->GetValue( sizeof(Value), (unsigned char *)Value, &bytesRead));
checkExpression(wcscmp(tag, TagNames)== 0, AAFRESULT_TEST_FAILED);
checkExpression(wcscmp(Value, AltComment)== 0, AAFRESULT_TEST_FAILED);
pComment->Release();
}
pCommentIterator->Release();
checkResult(aMob->CountSlots (&numSlots));
checkExpression(5 == numSlots, AAFRESULT_TEST_FAILED);
checkResult(aMob->GetSlots(&slotIter));
for(slt = 0; slt < numSlots; slt++)
{
checkResult(slotIter->NextOne (&slot));
checkResult(slot->GetName (slotName, sizeof(slotName)));
checkResult(slot->GetSlotID(&trackID));
checkExpression (wcscmp(slotName, slotNames[slt]) == 0, AAFRESULT_TEST_FAILED);
slot->Release();
slot = NULL;
}
aMob->Release();
aMob = NULL;
}
}
catch (HRESULT& rResult)
{
hr = rResult;
}
// Cleanup object references
if (slot)
slot->Release();
if (slotIter)
slotIter->Release();
if (aMob)
aMob->Release();
if (mobIter)
//.........这里部分代码省略.........
示例14: ReadAAFFile
static HRESULT ReadAAFFile(aafWChar * pFileName)
{
// IAAFSession * pSession = NULL;
IAAFFile * pFile = NULL;
IAAFHeader * pHeader = NULL;
IEnumAAFMobs* pMobIter = NULL;
IAAFMob* pMob = NULL;
IAAFMob* pReferencedMob = NULL;
IEnumAAFMobSlots* pSlotIter = NULL;
IAAFMobSlot* pSlot = NULL;
IAAFSegment* pSegment = NULL;
IAAFDescriptiveClip* pDescClip = NULL;
bool bFileOpen = false;
aafSearchCrit_t criteria;
aafNumSlots_t numMobs, numSlots;
HRESULT hr = AAFRESULT_SUCCESS;
try
{
// Open the file
checkResult(AAFFileOpenExistingRead(pFileName, 0, &pFile));
bFileOpen = true;
// We can't really do anthing in AAF without the header.
checkResult(pFile->GetHeader(&pHeader));
// Get the number of mobs in the file (should be one)
checkResult(pHeader->CountMobs(kAAFAllMob, &numMobs));
checkExpression(2 == numMobs, AAFRESULT_TEST_FAILED);
// Enumerate over all Composition Mobs
criteria.searchTag = kAAFByMobKind;
criteria.tags.mobKind = kAAFCompMob;
checkResult(pHeader->GetMobs(&criteria, &pMobIter));
while (AAFRESULT_SUCCESS == pMobIter->NextOne(&pMob))
{
checkResult(pMob->CountSlots(&numSlots));
checkExpression(1 == numSlots, AAFRESULT_TEST_FAILED);
checkResult(pMob->GetSlots(&pSlotIter));
while (AAFRESULT_SUCCESS == pSlotIter->NextOne(&pSlot))
{
// The segment should be a source clip...
checkResult(pSlot->GetSegment(&pSegment));
checkResult(pSegment->QueryInterface(IID_IAAFDescriptiveClip, (void **) &pDescClip));
// Get, and test, the described slots from the marker.
aafUInt32 getDescribedSlotIDsVector[TestDescribedSlotIDsVectorSize];
aafUInt32 getDescribedSlotIDsVectorSize = 0;
checkResult( pDescClip->CountDescribedSlotIDs( &getDescribedSlotIDsVectorSize ) );
checkExpression( TestDescribedSlotIDsVectorSize == getDescribedSlotIDsVectorSize, AAFRESULT_TEST_FAILED );
checkExpression( AAFRESULT_SMALLBUF ==
pDescClip->GetDescribedSlotIDs( getDescribedSlotIDsVectorSize-1, getDescribedSlotIDsVector ),
AAFRESULT_TEST_FAILED );
checkResult( pDescClip->GetDescribedSlotIDs( getDescribedSlotIDsVectorSize, getDescribedSlotIDsVector ) );
checkExpression( 0 == memcmp( getDescribedSlotIDsVector, TestDescribedSlotIDsVector, sizeof(TestDescribedSlotIDsVector) ),
AAFRESULT_TEST_FAILED );
pSlot->Release();
pSlot = NULL;
}
pMob->Release();
pMob = NULL;
}
}
catch (HRESULT& rResult)
{
hr = rResult;
}
// Cleanup and return
if (pReferencedMob)
pReferencedMob->Release();
if (pDescClip)
pDescClip->Release();
if (pSegment)
pSegment->Release();
if (pSlot)
pSlot->Release();
if (pSlotIter)
pSlotIter->Release();
if (pMob)
pMob->Release();
if (pMobIter)
pMobIter->Release();
if (pHeader)
//.........这里部分代码省略.........
示例15: ReadAAFFile
//.........这里部分代码省略.........
checkResult(pArray[1]->IsPictureKind(&testBool));
// checkExpression(testBool == kAAFFalse, AAFRESULT_TEST_FAILED);
pArray[1]->Release();
pArray[1] = NULL;
// /* Read one past to make sure that it fails */
// checkExpression(pEnumDataDef->NextOne(&pDataDef) != AAFRESULT_SUCCESS, AAFRESULT_TEST_FAILED);
/* Clone the enumerator, and read one element */
checkResult(pEnumDataDef->Clone(&pCloneEnum));
checkResult(pCloneEnum->Reset());
checkResult(pCloneEnum->NextOne(&pDataDef));
checkResult(pDataDef->IsPictureKind(&testBool));
// checkExpression(testBool == kAAFTrue, AAFRESULT_TEST_FAILED);
checkResult(pDataDef->IsSoundKind(&testBool));
// checkExpression(testBool == kAAFFalse, AAFRESULT_TEST_FAILED);
pDataDef->Release();
pDataDef = NULL;
pCloneEnum->Release();
pCloneEnum = NULL;
// Enumerate over Composition MOBs
criteria.searchTag = kAAFByMobKind;
criteria.tags.mobKind = kAAFCompMob;
checkResult(pHeader->GetMobs(&criteria, &pMobIter));
CAAFBuiltinDefs defs (pDictionary);
while (pMobIter && pMobIter->NextOne(&pMob) == AAFRESULT_SUCCESS)
{
aafNumSlots_t numSlots = 0;
checkResult(pMob->CountSlots(&numSlots));
checkExpression(1 == numSlots, AAFRESULT_TEST_FAILED);
// Enumerate over all MOB slots for this MOB
checkResult(pMob->GetSlots(&pSlotIter));
while (pSlotIter && pSlotIter->NextOne(&pSlot) == AAFRESULT_SUCCESS)
{
aafUInt32 numCpnts;
checkResult(pSlot->GetSegment(&pSegment));
checkResult(pSegment->QueryInterface(IID_IAAFSequence, (void **) &pSequence));
checkResult(pSequence->CountComponents(&numCpnts));
checkExpression(numCpnts == kNumComponents, AAFRESULT_TEST_FAILED);
checkResult(pSequence->GetComponents(&pCompIter));
numCpnts = 0;
index = 0;
while (pCompIter && pCompIter->NextOne(&pComp) == AAFRESULT_SUCCESS)
{
aafBool testBool;
numCpnts++;
checkResult(pComp->GetDataDef(&pDataDef));
checkResult(pDataDef->IsSoundKind(&testBool));
checkExpression(testBool == kAAFFalse, AAFRESULT_TEST_FAILED);
checkResult(pDataDef->IsMatteKind(&testBool));
checkExpression(testBool == kAAFFalse, AAFRESULT_TEST_FAILED);
if(index == 0) // First segment is Picture with Matte, converts to picture
{
checkResult(pDataDef->IsDataDefOf(defs.ddkAAFPictureWithMatte(),
&testBool));
checkExpression(testBool == kAAFTrue, AAFRESULT_TEST_FAILED);
checkResult(pDataDef->IsPictureKind(&testBool));
checkExpression(testBool == kAAFFalse, AAFRESULT_TEST_FAILED);