本文整理汇总了C++中IAAFMob::AppendNewTimelineSlot方法的典型用法代码示例。如果您正苦于以下问题:C++ IAAFMob::AppendNewTimelineSlot方法的具体用法?C++ IAAFMob::AppendNewTimelineSlot怎么用?C++ IAAFMob::AppendNewTimelineSlot使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IAAFMob
的用法示例。
在下文中一共展示了IAAFMob::AppendNewTimelineSlot方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CreateAAFFile
static HRESULT CreateAAFFile(
aafWChar * pFileName,
aafUID_constref fileKind,
testRawStorageType_t rawStorageType,
aafProductIdentification_constref productID)
{
// IAAFSession* pSession = NULL;
IAAFFile* pFile = NULL;
IAAFHeader* pHeader = NULL;
IAAFDictionary* pDictionary = NULL;
IAAFMob* pMob = NULL;
IAAFMob* pReferencedMob = NULL;
IAAFTimelineMobSlot* newSlot = NULL;
IAAFSegment* seg = NULL;
bool bFileOpen = false;
HRESULT hr = AAFRESULT_SUCCESS;
IAAFComponent* pComponent = NULL;
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 MOB to be referenced
checkResult(defs.cdMasterMob()->
CreateInstance(IID_IAAFMob,
(IUnknown **)&pReferencedMob));
checkResult(pReferencedMob->SetMobID(TEST_referencedMobID));
checkResult(pReferencedMob->SetName(L"AAFSourceClipTest::ReferencedMob"));
// Create a Mob
checkResult(defs.cdCompositionMob()->
CreateInstance(IID_IAAFMob,
(IUnknown **)&pMob));
checkResult(pMob->SetMobID(TEST_MobID));
checkResult(pMob->SetName(L"AAFSourceClipTest"));
// Create a SourceClip
checkResult(defs.cdSourceClip()->
CreateInstance(IID_IAAFSegment,
(IUnknown **)&seg));
checkResult(seg->QueryInterface(IID_IAAFComponent, (void **)&pComponent));
checkResult(pComponent->SetDataDef(defs.ddkAAFPicture()));
pComponent->Release();
pComponent = NULL;
aafRational_t editRate = { 0, 1};
checkResult(pMob->AppendNewTimelineSlot (editRate,
seg,
1,
slotName,
0,
&newSlot));
checkResult(pHeader->AddMob(pMob));
checkResult(pHeader->AddMob(pReferencedMob));
}
catch (HRESULT& rResult)
{
hr = rResult;
}
// Cleanup and return
if (newSlot)
newSlot->Release();
if (pComponent)
pComponent->Release();
if (seg)
seg->Release();
if (pMob)
pMob->Release();
if (pReferencedMob)
pReferencedMob->Release();
if (pDictionary)
pDictionary->Release();
if (pHeader)
pHeader->Release();
if (pFile)
{
if (bFileOpen)
{
pFile->Save();
//.........这里部分代码省略.........
示例2: CreateAAFFile
//.........这里部分代码省略.........
// To test a Transition we need to create a Sequence which will
// a Filler, a transition and another Filler. I know this is not
// very interesting, but it will let us test the Transition
// interface with the least amount of other stuff.
// ------------------------------------------------------------
//
// Create a CompositionMob
checkResult(defs.cdCompositionMob()->
CreateInstance(IID_IAAFCompositionMob,
(IUnknown **)&pCompMob));
checkResult(pCompMob->Initialize(L"Transition Test"));
// Get a MOB interface
checkResult(pCompMob->QueryInterface (IID_IAAFMob, (void **)&pMob));
checkResult(pMob->SetMobID(TEST_MobID));
// Create a Sequence
checkResult(defs.cdSequence()->
CreateInstance(IID_IAAFSequence,
(IUnknown **) &pSequence));
// Get a Segment interface
checkResult(pSequence->QueryInterface(IID_IAAFSegment, (void **)&pSegment));
// Get a component interface and
checkResult(pSequence->QueryInterface(IID_IAAFComponent, (void **)&pComponent));
// set the Data definition for it !
checkResult(pComponent->SetDataDef(defs.ddkAAFPicture()));
// Release the component - because we need to reuse the pointer later
pComponent->Release();
pComponent = NULL;
// Create a new Mob Slot that will contain the sequence
aafRational_t editRate = { 0, 1};
checkResult(pMob->AppendNewTimelineSlot(editRate,
pSegment,
1,
L"Transition",
0,
&pNewSlot));
// Create a Filler
checkResult(defs.cdFiller()->
CreateInstance(IID_IAAFFiller,
(IUnknown **) &pFiller));
// Get a component interface
checkResult(pFiller->QueryInterface(IID_IAAFComponent, (void **) &pComponent));
// Set values for the filler
checkResult(pFiller->Initialize(defs.ddkAAFPicture(), fillerLength));
// append the filler to the sequence
checkResult(pSequence->AppendComponent(pComponent));
// Release the component - because we need to reuse the pointer later
pFiller->Release();
pFiller = NULL;
pComponent->Release();
pComponent = NULL;
checkResult(defs.cdTransition()->
CreateInstance(IID_IAAFTransition,
(IUnknown **)&pTransition));
// Create an empty EffectGroup object !!
checkResult(defs.cdOperationGroup()->
CreateInstance(IID_IAAFOperationGroup,
示例3: ProcessAAFFile
static HRESULT ProcessAAFFile(const aafWChar * pFileName, testType_t testType)
{
IAAFFile * pFile = NULL;
IAAFHeader * pHeader = NULL;
IAAFDictionary* pDictionary = NULL;
IEnumAAFMobs* pMobIter = NULL;
aafNumSlots_t numMobs, numSlots;
aafSearchCrit_t criteria;
aafMobID_t mobID;
aafWChar namebuf[1204];
const aafWChar* slotName = L"A slot in Composition Mob";
IAAFComponent* pComponent = NULL;
IAAFComponent* aComponent = NULL;
IEnumAAFMobSlots* pMobSlotIter = NULL;
IAAFMobSlot* pMobSlot = NULL;
IAAFTimelineMobSlot* newSlot = NULL;
IAAFSegment* seg = NULL;
IAAFSegment* pSegment = NULL;
IAAFMob* pCompMob = NULL;
IAAFMob* pMob = NULL;
aafPosition_t zeroPos = 0;
IAAFSequence* pAudioSequence = NULL;
IAAFSourceClip* pSourceClip = NULL;
aafLength_t duration;
IAAFTimelineMobSlot* pTimelineMobSlot = NULL;
IAAFClassDef *pCompositionMobDef = NULL;
IAAFClassDef *pSequenceDef = NULL;
IAAFClassDef *pSourceClipDef = NULL;
IAAFDataDef *pSoundDef = NULL;
IAAFDataDef *pDataDef = NULL;
// Set the edit rate information
aafRational_t editRate;
editRate.numerator = 48000;
editRate.denominator = 1;
// Set search condition to true
bool lookingForAudio = true;
// Call the routine (from ExportAudioExample) to make the file for processing
check(CreateAAFFile(pwFileName, NULL, testStandardCalls, &pFile));
/* Get the Header and iterate through the Master Mobs in the existing file */
check(pFile->GetHeader(&pHeader));
check(pHeader->GetDictionary(&pDictionary));
/* Lookup class definitions for the objects we want to create. */
check(pDictionary->LookupClassDef(AUID_AAFCompositionMob, &pCompositionMobDef));
check(pDictionary->LookupClassDef(AUID_AAFSequence, &pSequenceDef));
check(pDictionary->LookupClassDef(AUID_AAFSourceClip, &pSourceClipDef));
/* Lookup any necessary data definitions. */
check(pDictionary->LookupDataDef(kAAFDataDef_Sound, &pSoundDef));
// Get the number of master mobs in the existing file (must not be zero)
check(pHeader->CountMobs(kAAFMasterMob, &numMobs));
if (numMobs != 0)
{
printf("Found %d Master Mobs\n", numMobs);
criteria.searchTag = kAAFByMobKind;
criteria.tags.mobKind = kAAFMasterMob;
check(pHeader->GetMobs(&criteria, &pMobIter));
/* Create a Composition Mob */
check(pCompositionMobDef->
CreateInstance(IID_IAAFMob,
(IUnknown **)&pCompMob));
/* Append the Mob to the Header */
check(pHeader->AddMob(pCompMob));
/* Create a TimelineMobSlot with an audio sequence */
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));
//.........这里部分代码省略.........
示例4: CreateAAFFile
//.........这里部分代码省略.........
checkResult(pControlPoint->SetEditHint(kAAFRelativeLeft));
checkResult(pVaryingValue->AddControlPoint(pControlPoint));
pControlPoint->Release();
pControlPoint = NULL;
checkResult(defs.cdControlPoint()->
CreateInstance(IID_IAAFControlPoint,
(IUnknown **)&pControlPoint));
checkResult(pControlPoint->Initialize (pVaryingValue, testTime2, sizeof(testLevel2), (aafDataBuffer_t)&testLevel2));
checkResult(pControlPoint->SetEditHint(kAAFProportional));
checkResult(pVaryingValue->AddControlPoint(pControlPoint));
pControlPoint->Release();
pControlPoint = NULL;
checkResult(pVaryingValue->QueryInterface (IID_IAAFParameter, (void **)&pParm));
checkResult(pOperationGroup->AddParameter (pParm));
checkResult(pOperationGroup->AppendInputSegment (pFiller));
pFiller->Release();
pFiller = NULL;
checkResult(pOperationGroup->SetBypassOverride (1));
checkResult(defs.cdSourceClip()->
CreateInstance(IID_IAAFSourceClip,
(IUnknown **)&pSourceClip));
aafSourceRef_t sourceRef;
sourceRef.sourceID = zeroMobID;
sourceRef.sourceSlotID = 0;
sourceRef.startTime = 0;
checkResult(pSourceClip->Initialize (defs.ddkAAFPicture(), effectLen, sourceRef));
checkResult(pSourceClip->QueryInterface (IID_IAAFSourceReference, (void **)&pSourceRef));
checkResult(pOperationGroup->SetRender (pSourceRef));
checkResult(pOperationGroup->QueryInterface (IID_IAAFSegment, (void **)&pSeg));
checkResult(pMob->AppendNewTimelineSlot (videoRate, pSeg, test+1, slotNames[test], 0, &pSlot));
pSlot->Release();
pSlot = NULL;
pSeg->Release();
pSeg = NULL;
pOperationGroup->Release();
pOperationGroup = NULL;
pParm->Release();
pParm = NULL;
pVaryingValue->Release();
pVaryingValue = NULL;
pComponent->Release();
pComponent = NULL;
pSourceRef->Release();
pSourceRef = NULL;
pSourceClip->Release();
pSourceClip = NULL;
}
// Add the mob to the file.
checkResult(pHeader->AddMob(pMob));
}
catch (HRESULT& rResult)
{
hr = rResult;
}
// Cleanup and return
if(pSourceRef)
示例5: CreateHTMLClip
void HTMLClipTest::CreateHTMLClip()
{
assert(_pHeader && _pDictionary);
HRESULT hr = S_OK;
IAAFMasterMob *pMasterMob = NULL;
IAAFMob *pReferencedMob = NULL;
IAAFHTMLClip *pHTMLClip = NULL;
IAAFSourceReference *pSourceReference = NULL;
IAAFCompositionMob *pCompositionMob = NULL;
IAAFMob *pReferencingMob = NULL;
IAAFSegment *pSegment = NULL;
IAAFTimelineMobSlot *pMobSlot = NULL;
IAAFComponent *pComponent = NULL;
CAAFBuiltinDefs defs (_pDictionary);
try
{
//Make the MOB to be referenced
checkResult(defs.cdMasterMob()->
CreateInstance(IID_IAAFMasterMob,
(IUnknown **)&pMasterMob));
checkResult(pMasterMob->QueryInterface(IID_IAAFMob, (void **)&pReferencedMob));
checkResult(pReferencedMob->GetMobID(&_referencedMobID));
checkResult(pReferencedMob->SetName(L"HTMLClipTest::ReferencedMob"));
// Save the master mob.
checkResult(_pHeader->AddMob(pReferencedMob));
// Use EssenceAccess to write some html essence
// Create a file mob for the html essence.
// Create the corresponding html essence.
// Write some html essence.
// Create a HTMLClip
checkResult(defs.cdHTMLClip()->
CreateInstance(IID_IAAFHTMLClip,
(IUnknown **)&pHTMLClip));
checkResult(pHTMLClip->SetBeginAnchor(const_cast<wchar_t *>(_beginAnchor)));
checkResult(pHTMLClip->SetEndAnchor(const_cast<wchar_t *>(_endAnchor)));
checkResult(pHTMLClip->QueryInterface(IID_IAAFComponent, (void **)&pComponent));
checkResult(pComponent->SetDataDef(defs.ddkAAFPicture()));
pComponent->Release();
pComponent = NULL;
// Initialize the source reference data.
checkResult(pHTMLClip->QueryInterface(IID_IAAFSourceReference, (void **)&pSourceReference));
checkResult(pSourceReference->SetSourceID(_referencedMobID));
checkResult(pSourceReference->SetSourceMobSlotID(0));
// Create a composition mob to hold the html clip.
checkResult(defs.cdCompositionMob()->
CreateInstance(IID_IAAFCompositionMob,
(IUnknown **)&pCompositionMob));
checkResult(pCompositionMob->QueryInterface(IID_IAAFMob, (void **)&pReferencingMob));
checkResult(pReferencingMob->SetName(L"CompositionMob_HTMLClipTest"));
checkResult(pHTMLClip->QueryInterface(IID_IAAFSegment, (void **)&pSegment));
IAAFMobSlot *pSlot = NULL;
aafRational_t editRate = { 0, 1};
checkResult(pReferencingMob->AppendNewTimelineSlot(editRate,
pSegment,
1,
L"HTMLClipTest",
0,
&pMobSlot));
// Save the referencing mob.
checkResult(_pHeader->AddMob(pReferencingMob));
}
catch (HRESULT& rHR)
{
hr = rHR;
// fall through and handle cleanup
}
// Cleanup local references
if (pMobSlot)
{
pMobSlot->Release();
pMobSlot = NULL;
}
if (pComponent)
{
pComponent->Release();
pComponent = NULL;
}
if (pSegment)
{
pSegment->Release();
pSegment = NULL;
}
//.........这里部分代码省略.........
示例6: CreateAAFFile
//.........这里部分代码省略.........
check(pDictionary->LookupClassDef(AUID_AAFTapeDescriptor,
&pCDTapeDescriptor));
check(pDictionary->LookupClassDef(AUID_AAFAIFCDescriptor,
&pCDAIFCDescriptor));
check(pDictionary->LookupClassDef(AUID_AAFNetworkLocator,
&pCDNetworkLocator));
check(pDictionary->LookupClassDef(AUID_AAFMasterMob,
&pCDMasterMob));
check(pDictionary->LookupClassDef(AUID_AAFSourceClip,
&pCDSourceClip));
check(pDictionary->LookupClassDef(AUID_AAFFiller,
&pCDFiller));
check(pDictionary->LookupDataDef(kAAFDataDef_Picture,
&pDdefPicture));
// IMPORTANT: major remodification is from this point onwards...
// sequence creation code pulled out of the subsequent loop.
// Create a Composition Mob
check(pCDCompositionMob->CreateInstance(IID_IAAFMob,
(IUnknown **)&pCompMob));
check(pCDSequence->CreateInstance(IID_IAAFSequence,
(IUnknown **)&pSequence));
check(pSequence->QueryInterface (IID_IAAFSegment, (void **)&seg));
check(pSequence->QueryInterface(IID_IAAFComponent, (void **)&aComponent));
check(aComponent->SetDataDef(pDdefPicture));
aComponent->Release();
aComponent = NULL;
check(pCompMob->QueryInterface (IID_IAAFMob, (void **)&pMob));
check(pMob->AppendNewTimelineSlot(videoRate, seg, i, slotName, 0, &newSlot));
pMob->Release();
pMob = NULL;
newSlot->Release();
newSlot = NULL;
seg->Release();
seg = NULL;
check(pHeader->AddMob(pCompMob));
// now looping around the remainder N times to make N components
for (i=0; i < N; i++) {
//Make the Tape MOB
check(pCDSourceMob->CreateInstance(IID_IAAFSourceMob,
(IUnknown **)&pTapeMob));
check(pCDTapeDescriptor->CreateInstance(IID_IAAFTapeDescriptor,
(IUnknown **)&pTapeDesc));
check(pTapeDesc->QueryInterface (IID_IAAFEssenceDescriptor,
(void **)&aDesc));
check(pTapeMob->SetEssenceDescriptor(aDesc));
aDesc->Release();
aDesc = NULL;
pTapeDesc->Release();
pTapeDesc = NULL;
check(pTapeMob->AppendTimecodeSlot (videoRate, 0, tapeTC, TAPE_LENGTH));
check(pTapeMob->AddNilReference (1,TAPE_LENGTH, pDdefPicture, videoRate));
check(pTapeMob->QueryInterface (IID_IAAFMob, (void **)&pMob));
pTapeMob->Release();
pTapeMob = NULL;
示例7: 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;
IAAFMob *pMob = NULL;
IAAFMob *pMob2 = NULL;
IAAFMob2 *pMobInterface2 = NULL;
IAAFTimelineMobSlot *newSlot = NULL;
IAAFStaticMobSlot *newStaticSlot=NULL;
IAAFEventMobSlot *newEventSlot=NULL;
IAAFSegment *seg = NULL;
IAAFSourceClip *sclp = NULL;
IAAFEvent *event=NULL;
IAAFComponent* pComponent = NULL;
IAAFClassDef *pcdEventMeta=NULL;
IAAFClassDef *pcdEvent=NULL;
IAAFClassDef *pcdEventConcrete=NULL;
HRESULT hr = S_OK;
aafNumSlots_t numMobs;
aafUInt32 bufLen = 0;
aafUInt32 bytesRead = 0;
aafUInt32 numComments = 0;
aafUInt32 numFound = 0;
aafWChar name[500];
aafWChar value[500];
IEnumAAFTaggedValues *enumTaggedVal = NULL;
IAAFTaggedValue *taggedVal = NULL;
IAAFMobSlot *mSlot = NULL;
IAAFFiller *filler = NULL;
IAAFKLVData *pKLVData = NULL;
IAAFTypeDef* pBaseType = NULL;
IAAFSourceReference *pSourceRef = NULL;
IAAFTimecode *pTimecode = NULL;
aafTimecode_t timecode;
int i;
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;
// Create a concrete subclass of Mob
checkResult(defs.cdMasterMob()->
CreateInstance(IID_IAAFMob,
(IUnknown **)&pMob));
checkResult( pMob->QueryInterface(IID_IAAFMob2,(void**)&pMobInterface2));
checkResult(pMob->SetMobID(MOBTestID));
checkExpression(pMob->GetNameBufLen(&bufLen) == AAFRESULT_PROP_NOT_PRESENT, AAFRESULT_TEST_FAILED);
checkExpression(pMob->GetName(name, 0) == AAFRESULT_PROP_NOT_PRESENT, AAFRESULT_TEST_FAILED);
checkExpression(pMob->SetName(NULL) == AAFRESULT_NULL_PARAM, AAFRESULT_TEST_FAILED);
checkResult(pMob->SetName(mobName));
checkResult(pMob->SetCreateTime(creationTimeStamp));
checkResult(pMob->SetModTime(modificationTimeStamp));
// Add some slots
for(test = 1; test < 6; test++)
{
checkResult(defs.cdSourceClip()->
CreateInstance(IID_IAAFSourceClip,
(IUnknown **)&sclp));
checkResult(sclp->QueryInterface(IID_IAAFSourceReference, (void **)&pSourceRef));
checkResult(pSourceRef->SetSourceID(MOBTestID3));
checkResult(sclp->QueryInterface(IID_IAAFComponent, (void **)&pComponent));
checkResult(pComponent->SetDataDef(defs.ddkAAFPicture()));
checkResult(sclp->QueryInterface (IID_IAAFSegment, (void **)&seg));
aafRational_t editRate = { 0, 1};
checkResult(pMob->AppendNewTimelineSlot (editRate,
seg,
test+1,
slotNames[test],
0,
&newSlot));
//.........这里部分代码省略.........
示例8: 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;
IAAFMob *pMob = NULL;
IAAFTimelineMobSlot *newSlot = NULL;
IAAFSegment *seg = NULL;
IAAFSourceClip *sclp = NULL;
IAAFComponent* pComponent = 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;
// Create a concrete subclass of Mob
checkResult(defs.cdMasterMob()->
CreateInstance(IID_IAAFMob,
(IUnknown **)&pMob));
checkResult(pMob->SetMobID(TEST_MobID));
checkResult(pMob->SetName(L"MOBTest"));
// Add some slots
for(test = 0; test < 5; test++)
{
checkResult(defs.cdSourceClip()->
CreateInstance(IID_IAAFSourceClip,
(IUnknown **)&sclp));
checkResult(sclp->QueryInterface(IID_IAAFComponent, (void **)&pComponent));
checkResult(pComponent->SetDataDef(defs.ddkAAFPicture()));
pComponent->Release();
pComponent = NULL;
checkResult(sclp->QueryInterface (IID_IAAFSegment, (void **)&seg));
aafRational_t editRate = { 0, 1};
checkResult(pMob->AppendNewTimelineSlot (editRate,
seg,
test+1,
slotNames[test],
0,
&newSlot));
newSlot->Release();
newSlot = NULL;
seg->Release();
seg = NULL;
sclp->Release();
sclp = NULL;
}
// Add the mob to the file.
checkResult(pHeader->AddMob(pMob));
}
catch (HRESULT& rResult)
{
hr = rResult;
}
// Cleanup and return
if (newSlot)
newSlot->Release();
if (pComponent)
pComponent->Release();
if (seg)
seg->Release();
if (sclp)
sclp->Release();
if (pMob)
pMob->Release();
//.........这里部分代码省略.........
示例9: 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;
IAAFMob *pMob = NULL;
IAAFMob* pRMob = NULL;
IAAFMasterMob* pReferencedMob = NULL;
IAAFCompositionMob* pCompMob = NULL;
IAAFTimelineMobSlot *newSlot = NULL;
IAAFSegment *seg = NULL;
IAAFSourceClip *sclp = 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;
// Create a Composition Mob
checkResult(defs.cdCompositionMob()->
CreateInstance(IID_IAAFCompositionMob,
(IUnknown **)&pCompMob));
checkResult(pCompMob->QueryInterface(IID_IAAFMob, (void **)&pMob));
checkResult(pMob->SetMobID(TEST_MobID));
checkResult(pMob->SetName(L"AAFTaggedValuesTest"));
// append a comment to this mob !!
checkResult(pMob->AppendComment(const_cast<aafWChar*>(TagNames), Comments));
checkResult(pMob->AppendComment(const_cast<aafWChar*>(TagNames), AltComment));
// Create a master mob to be referenced
checkResult(defs.cdMasterMob()->
CreateInstance(IID_IAAFMasterMob,
(IUnknown **)&pReferencedMob));
checkResult(pReferencedMob->QueryInterface(IID_IAAFMob, (void **)&pRMob));
checkResult(pRMob->SetMobID(TEST_referencedMobID));
checkResult(pRMob->SetName(L"AAFTaggedValueTest::ReferencedMob"));
// Add some slots
for(test = 0; test < 5; test++)
{
checkResult(defs.cdSourceClip()->
CreateInstance(IID_IAAFSourceClip,
(IUnknown **)&sclp));
// Set the properties for the SourceClip
sourceRef.sourceID = TEST_referencedMobID;
sourceRef.sourceSlotID = 0;
sourceRef.startTime = 0;
IAAFDataDefSP pDataDef;
checkResult(pDictionary->LookupDataDef(*slotDDefs[test], &pDataDef));
checkResult(sclp->Initialize(pDataDef, slotsLength[test], sourceRef));
checkResult(sclp->QueryInterface (IID_IAAFSegment, (void **)&seg));
aafRational_t editRate = { 0, 1};
checkResult(pMob->AppendNewTimelineSlot (editRate,
seg,
test+1,
slotNames[test],
0,
&newSlot));
newSlot->Release();
newSlot = NULL;
seg->Release();
seg = NULL;
sclp->Release();
sclp = NULL;
}
// Add the mob to the file.
checkResult(pHeader->AddMob(pMob));
checkResult(pHeader->AddMob(pRMob));
}
catch (HRESULT& rResult)
//.........这里部分代码省略.........
示例10: CreateAAFFile
static HRESULT CreateAAFFile(
aafWChar * pFileName,
aafUID_constref fileKind,
testRawStorageType_t rawStorageType,
aafProductIdentification_constref productID)
{
// IAAFSession* pSession = NULL;
IAAFFile* pFile = NULL;
IAAFHeader* pHeader = NULL;
IAAFDictionary* pDictionary = NULL;
IAAFMob* pMob = NULL;
IAAFMob* pReferencedMob = NULL;
IAAFTimelineMobSlot* newSlot = NULL;
IAAFSegment* seg = NULL;
IAAFComponent* pComponent = NULL;
IAAFDescriptiveClip* pDescClip = NULL;
bool bFileOpen = false;
HRESULT hr = AAFRESULT_SUCCESS;
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 MOB to be referenced
checkResult(defs.cdMasterMob()->
CreateInstance(IID_IAAFMob,
(IUnknown **)&pReferencedMob));
checkResult(pReferencedMob->SetMobID(TEST_referencedMobID));
checkResult(pReferencedMob->SetName(L"AAFDescriptiveClipTest::ReferencedMob"));
// Create a Mob
checkResult(defs.cdCompositionMob()->
CreateInstance(IID_IAAFMob,
(IUnknown **)&pMob));
checkResult(pMob->SetMobID(TEST_MobID));
checkResult(pMob->SetName(L"AAFDescriptiveClipTest"));
// Create a DescriptiveClip
checkResult(defs.cdDescriptiveClip()->
CreateInstance(IID_IAAFDescriptiveClip,
(IUnknown **)&pDescClip));
checkResult(pDescClip->QueryInterface(IID_IAAFComponent, (void **)&pComponent));
checkResult(pComponent->SetDataDef(defs.ddkAAFSound()));
pComponent->Release();
pComponent = NULL;
// Set the properties for the SourceClip
//checkResult(pDescClip->SetFade( fadeInLen, fadeInType, fadeOutLen, fadeOutType));
sourceRef.sourceID = TEST_referencedMobID;
sourceRef.sourceSlotID = 0;
sourceRef.startTime = 0;
checkResult(pDescClip->Initialize(defs.ddkAAFSound(), 1000, sourceRef));
// Get described slots - should not be present.
aafUInt32 size = 0;
AAFRESULT hr = pDescClip->CountDescribedSlotIDs( &size );
checkExpression( AAFRESULT_PROP_NOT_PRESENT == hr, AAFRESULT_TEST_FAILED );
// Set/Get single described slot id
aafUInt32 setSingleDescribedSlotID = 0xdeadbeef;
checkResult( pDescClip->AddDescribedSlotID( setSingleDescribedSlotID ) );
aafUInt32 getSingleDescribedSlotID = 0;
checkResult( pDescClip->GetDescribedSlotIDs( 1, &getSingleDescribedSlotID ) );
checkExpression( setSingleDescribedSlotID == getSingleDescribedSlotID, AAFRESULT_TEST_FAILED );
// Clear the ID set for the next test
checkResult( pDescClip->RemoveDescribedSlotID( setSingleDescribedSlotID ) );
// Set the persistent described slots.
for( aafUInt32 i_tid = 0; i_tid < TestDescribedSlotIDsVectorSize; ++i_tid )
{
checkResult( pDescClip->AddDescribedSlotID( TestDescribedSlotIDsVector[i_tid] ) );
}
aafUInt32 getDescribedSlotIDsVector[TestDescribedSlotIDsVectorSize];
checkResult( pDescClip->GetDescribedSlotIDs( TestDescribedSlotIDsVectorSize, getDescribedSlotIDsVector ) );
checkExpression( 0 == memcmp( getDescribedSlotIDsVector, TestDescribedSlotIDsVector, sizeof(TestDescribedSlotIDsVector) ),
AAFRESULT_TEST_FAILED );
checkResult(pDescClip->QueryInterface (IID_IAAFSegment, (void **)&seg));
aafRational_t editRate = { 0, 1};
checkResult(pMob->AppendNewTimelineSlot (editRate,
seg,
1,
slotName,
//.........这里部分代码省略.........
示例11: CreateAAFFile
static HRESULT CreateAAFFile(
aafWChar * pFileName,
aafUID_constref fileKind,
testRawStorageType_t rawStorageType,
aafProductIdentification_constref productID)
{
IAAFFile* pFile = NULL;
IAAFHeader* pHeader = NULL;
IAAFDictionary* pDictionary = NULL;
IAAFMob* pMob = NULL;
IAAFTimelineMobSlot* pMobSlot = NULL;
IAAFSequence* pSequence = NULL;
IAAFSegment* pSegment = NULL;
IAAFComponent* pComponent = NULL;
int i;
HRESULT hr = S_OK;
try
{
// Remove the previous test file if any.
RemoveTestFile(pFileName);
// Create the AAF file
checkResult(CreateTestFile( pFileName, fileKind, rawStorageType, productID, &pFile ));
// 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);
// Create a Composition Mob
checkResult(defs.cdCompositionMob()->
CreateInstance(IID_IAAFMob,
(IUnknown **)&pMob));
checkResult(pMob->SetMobID(TEST_MobID));
checkResult(pMob->SetName(L"EnumAAFDataDefTest"));
// Add mob slot w/ Sequence
checkResult(defs.cdSequence()->
CreateInstance(IID_IAAFSequence,
(IUnknown **)&pSequence));
checkResult(pSequence->Initialize(defs.ddkAAFPicture()));
//
// Add some segments. Need to test failure conditions
// (i.e. starting/ending w/ transition, two trans back
// to bacl).
//
for(i = 0; i < kNumComponents; i++)
{
aafLength_t len = 10;
checkResult(defs.cdFiller()->
CreateInstance(IID_IAAFComponent,
(IUnknown **)&pComponent));
if(i == 0)
{
checkResult(pComponent->SetDataDef(defs.ddkAAFPictureWithMatte()));
}
else
{
checkResult(pComponent->SetDataDef(defs.ddkAAFPicture()));
}
checkResult(pComponent->SetLength(len));
checkResult(pSequence->AppendComponent(pComponent));
pComponent->Release();
pComponent = NULL;
}
checkResult(pSequence->QueryInterface (IID_IAAFSegment, (void **)&pSegment));
aafRational_t editRate = { 0, 1};
checkResult(pMob->AppendNewTimelineSlot(editRate,
pSegment,
1,
L"AAF Test Sequence",
0,
&pMobSlot));
pMobSlot->Release();
pMobSlot = NULL;
pSegment->Release();
pSegment = NULL;
// Add the master mob to the file and cleanup
pHeader->AddMob(pMob);
}
catch (HRESULT& rResult)
{
hr = rResult;
//.........这里部分代码省略.........