本文整理汇总了C++中IAAFEssenceDescriptor::AppendLocator方法的典型用法代码示例。如果您正苦于以下问题:C++ IAAFEssenceDescriptor::AppendLocator方法的具体用法?C++ IAAFEssenceDescriptor::AppendLocator怎么用?C++ IAAFEssenceDescriptor::AppendLocator使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IAAFEssenceDescriptor
的用法示例。
在下文中一共展示了IAAFEssenceDescriptor::AppendLocator方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CreateAAFFile
//.........这里部分代码省略.........
// In order to fit with the specification, it is made wide
char TapeMobNameBuffer[MAX];
sprintf(TapeMobNameBuffer,"Tape Mob %ld",i);
aafWChar TapeMobName[MAX];
mbstowcs(TapeMobName,TapeMobNameBuffer,MAX);
check(pMob->SetName (TapeMobName));
check(pHeader->AddMob(pMob));
check(pMob->GetMobID (&tapeMobID));
pMob->Release();
pMob = NULL;
// Make a FileMob
check(pCDSourceMob->CreateInstance(IID_IAAFSourceMob,
(IUnknown **)&pFileMob));
check(pCDAIFCDescriptor->CreateInstance(IID_IAAFFileDescriptor,
(IUnknown **)&pFileDesc));
check(pFileDesc->QueryInterface (IID_IAAFEssenceDescriptor,
(void **)&aDesc));
check(pFileDesc->QueryInterface (IID_IAAFAIFCDescriptor,
(void **)&pAIFCDesc));
check(pAIFCDesc->SetSummary (5, (unsigned char*)"TEST"));
pAIFCDesc->Release();
pAIFCDesc = NULL;
// Make a locator, and attach it to the EssenceDescriptor
check(pCDNetworkLocator->CreateInstance(IID_IAAFNetworkLocator,
(IUnknown **)&pNetLocator));
check(pNetLocator->QueryInterface (IID_IAAFLocator, (void **)&pLocator));
check(pLocator->SetPath (TEST_PATH));
check(aDesc->AppendLocator(pLocator));
pLocator->Release();
pLocator = NULL;
pNetLocator->Release();
pNetLocator = NULL;
check(pFileMob->SetEssenceDescriptor(aDesc));
aDesc->Release();
aDesc = NULL;
pFileDesc->Release();
pFileDesc = NULL;
sourceRef.sourceID = tapeMobID;
sourceRef.sourceSlotID = 1;
sourceRef.startTime = 0;
check(pFileMob->NewPhysSourceRef (videoRate, 1, pDdefPicture,
sourceRef, fileLen));
check(pFileMob->QueryInterface (IID_IAAFMob, (void **)&pMob));
check(pMob->GetMobID (&fileMobID));
check(pHeader->AddMob(pMob));
pMob->Release();
pMob = NULL;
//Make the Master MOB
check(pCDMasterMob->CreateInstance(IID_IAAFMasterMob,
(IUnknown **)&pMasterMob));
sourceRef.sourceID = fileMobID;
sourceRef.sourceSlotID = 1;
sourceRef.startTime = 0;
check(pMasterMob->NewPhysSourceRef(videoRate, 1, pDdefPicture,
示例2: 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;
IAAFLocator *pLocator = NULL;
IAAFLocator *pLocator2 = NULL;
IAAFSourceMob *pSourceMob = NULL;
IAAFMob *pMob = NULL;
IAAFEssenceDescriptor *edesc = NULL;
IEnumAAFLocators *pEnumLocators = NULL;
aafUInt32 numLocators, numLocators2;
aafUInt32 i;
HRESULT hr = AAFRESULT_SUCCESS,
localhr = AAFRESULT_SUCCESS;
bool bFileOpen = false;
// aafUID_t ddef = kAAFDataDef_Sound;
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
// Create a Mob
checkResult(defs.cdSourceMob()->
CreateInstance(IID_IAAFSourceMob,
(IUnknown **)&pSourceMob));
// Initialize mob properties:
checkResult(pSourceMob->QueryInterface (IID_IAAFMob, (void **)&pMob));
checkResult(pMob->SetMobID(TEST_MobID));
checkResult(pMob->SetName(L"EssenceDescriptorTest"));
// Create the descriptor:
// instantiate a concrete subclass of EssenceDescriptor
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(pSourceMob->SetEssenceDescriptor (edesc));
/* CountLocators() ******************************************/
localhr = AAFRESULT_SUCCESS;
// Verify AAFRESULT_NULL_PARAM is returned
if (edesc->CountLocators(NULL) != AAFRESULT_NULL_PARAM)
localhr = AAFRESULT_TEST_FAILED;
// Verify that there are no locators
if (edesc->CountLocators(&numLocators) != AAFRESULT_SUCCESS)
localhr = AAFRESULT_TEST_FAILED;
if (0 != numLocators)
localhr = AAFRESULT_TEST_FAILED;
if (localhr == AAFRESULT_SUCCESS)
cout<< " CountLocators() ... Passed"<< endl;
else
{
cout<< " CountLocators() ... FAILED"<< endl;
hr = AAFRESULT_TEST_FAILED;
}
/* AppendLocator() ******************************************/
localhr = AAFRESULT_SUCCESS;
// Verify AAFRESULT_NULL_PARAM is returned
if (edesc->AppendLocator(NULL) != AAFRESULT_NULL_PARAM)
localhr = AAFRESULT_TEST_FAILED;
// Append and Count a bunch of Locators
for (i=1; i<=10; i++)
{
// Make a concrete subclass of locator, and attach it to
// the EssenceDescriptor
checkResult(defs.cdNetworkLocator()->
CreateInstance(IID_IAAFLocator,
(IUnknown **)&pLocator));
//.........这里部分代码省略.........
示例3: 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;
IAAFLocator * pLocator = NULL;
IAAFNetworkLocator * pNetLocator = NULL;
IAAFSourceMob *pSourceMob = NULL;
IAAFMob *pMob = NULL;
IAAFEssenceDescriptor *edesc = NULL;
aafUInt32 numLocators;
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 first mob
// 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"SourceMOBTest"));
// Create a concrete subclass of EssenceDescriptor
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;
// Verify that there are no locators
checkResult(edesc->CountLocators(&numLocators));
checkExpression(0 == numLocators, AAFRESULT_TEST_FAILED);
// Make a locator, and attach it to the EssenceDescriptor
checkResult(defs.cdNetworkLocator()->
CreateInstance(IID_IAAFNetworkLocator,
(IUnknown **)&pNetLocator));
checkResult(pNetLocator->QueryInterface (IID_IAAFLocator, (void **)&pLocator));
checkResult(pLocator->SetPath (TEST_PATH));
checkResult(edesc->AppendLocator(pLocator));
checkResult(pSourceMob->SetEssenceDescriptor (edesc));
// Verify that there is now one locator
checkResult(edesc->CountLocators(&numLocators));
checkExpression(1 == numLocators, AAFRESULT_TEST_FAILED);
// Add the source mob into the tree
checkResult(pHeader->AddMob(pMob));
}
catch (HRESULT& rResult)
{
hr = rResult;
}
// cleanup
if (pLocator)
pLocator->Release();
if (pNetLocator)
pNetLocator->Release();
if (edesc)
edesc->Release();
if (pMob)
pMob->Release();
//.........这里部分代码省略.........