本文整理汇总了C++中IAAFSourceMob::QueryInterface方法的典型用法代码示例。如果您正苦于以下问题:C++ IAAFSourceMob::QueryInterface方法的具体用法?C++ IAAFSourceMob::QueryInterface怎么用?C++ IAAFSourceMob::QueryInterface使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IAAFSourceMob
的用法示例。
在下文中一共展示了IAAFSourceMob::QueryInterface方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: createFileMob
void EssenceDataTest::createFileMob(unsigned int mobid_Index)
{
assert(_pFile && _pHeader && _pDictionary);
assert(NULL == _pSourceMob);
assert(NULL == _pMob);
assert(NULL == _pFileDescriptor);
assert(NULL == _pEssenceDescriptor);
assert(NULL == _pSourceMob);
CAAFBuiltinDefs defs (_pDictionary);
// Create a Mob
check(defs.cdSourceMob()->CreateInstance(IID_IAAFSourceMob,
(IUnknown **)&_pSourceMob));
check(_pSourceMob->QueryInterface (IID_IAAFMob, (void **)&_pMob));
check(_pMob->SetMobID(TEST_MobIDs[mobid_Index]));
check(_pMob->SetName(L"EssenceDataTest File Mob"));
// instantiate a concrete subclass of FileDescriptor
check(defs.cdAIFCDescriptor()->
CreateInstance(IID_IAAFFileDescriptor,
(IUnknown **)&_pFileDescriptor));
IAAFAIFCDescriptor* pAIFCDesc = NULL;
check(_pFileDescriptor->QueryInterface (IID_IAAFAIFCDescriptor, (void **)&pAIFCDesc));
check(pAIFCDesc->SetSummary (5, (unsigned char*)"TEST"));
pAIFCDesc->Release();
pAIFCDesc = NULL;
check(_pFileDescriptor->QueryInterface (IID_IAAFEssenceDescriptor,
(void **)&_pEssenceDescriptor));
check(_pSourceMob->SetEssenceDescriptor (_pEssenceDescriptor));
check(_pHeader->AddMob(_pMob));
createEssenceData(_pSourceMob);
// Cleanup instance data for reuse...
_pEssenceDescriptor->Release();
_pEssenceDescriptor = NULL;
_pFileDescriptor->Release();
_pFileDescriptor = NULL;
_pMob->Release();
_pMob = NULL;
_pSourceMob->Release();
_pSourceMob = NULL;
}
示例2: createFileMob
void EnumEssenceDataTest::createFileMob(int itemNumber)
{
assert(_pFile && _pHeader && _pDictionary);
assert(NULL == _pSourceMob);
assert(NULL == _pMob);
assert(NULL == _pFileDescriptor);
assert(NULL == _pEssenceDescriptor);
assert(NULL == _pSourceMob);
// Format the mob name.
wchar_t wcBuffer[512];
char cBuffer[256];
sprintf(cBuffer, "EnumEssenceDataTest File Mob %d", itemNumber);
size_t count = mbstowcs(wcBuffer, cBuffer, strlen(cBuffer) + 1);
if (static_cast<size_t>(-1) == count)
check(AAFRESULT_INTERNAL_ERROR);
CAAFBuiltinDefs defs (_pDictionary);
// Create a Mob
check(defs.cdSourceMob()->
CreateInstance(IID_IAAFSourceMob,
(IUnknown **)&_pSourceMob));
check(_pSourceMob->QueryInterface (IID_IAAFMob, (void **)&_pMob));
check(_pMob->SetMobID(TEST_MobIDs[itemNumber]));
check(_pMob->SetName(wcBuffer));
// Create a concrete subclass of FileDescriptor
check(defs.cdAIFCDescriptor()->
CreateInstance(IID_IAAFFileDescriptor,
(IUnknown **)&_pFileDescriptor));
IAAFAIFCDescriptor* pAIFCDesc = NULL;
check(_pFileDescriptor->QueryInterface (IID_IAAFAIFCDescriptor, (void **)&pAIFCDesc));
check(pAIFCDesc->SetSummary (5, (unsigned char*)"TEST"));
pAIFCDesc->Release();
pAIFCDesc = NULL;
check(_pFileDescriptor->QueryInterface (IID_IAAFEssenceDescriptor,
(void **)&_pEssenceDescriptor));
check(_pSourceMob->SetEssenceDescriptor (_pEssenceDescriptor));
check(_pHeader->AddMob(_pMob));
createEssenceData(_pSourceMob);
// Cleanup instance data for reuse...
_pEssenceDescriptor->Release();
_pEssenceDescriptor = NULL;
_pFileDescriptor->Release();
_pFileDescriptor = NULL;
_pMob->Release();
_pMob = NULL;
_pSourceMob->Release();
_pSourceMob = NULL;
}
示例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;
IAAFMob* pMob = NULL;
IAAFRIFFChunk* pRIFFChunk = NULL;
IAAFRIFFChunk* pRIFFChunk2 = NULL;
IAAFSourceMob* pSourceMob = NULL;
IAAFEssenceDescriptor* pEssDesc = NULL;
IAAFBWFImportDescriptor* pBWFImportDesc = NULL;
aafUInt32 testNum;
HRESULT hr = S_OK;
// 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);
checkResult(defs.cdSourceMob()->
CreateInstance(IID_IAAFSourceMob,
(IUnknown **)&pSourceMob));
pSourceMob->QueryInterface(IID_IAAFMob, (void **)&pMob);
pMob->SetMobID(TEST_MobID);
pMob->SetName(L"BWFImportDescriptorTest");
//Create BWFImportDescriptor to hold the RIFFChunk
checkResult( defs.cdBWFImportDescriptor()->
CreateInstance(IID_IAAFBWFImportDescriptor, (IUnknown **)&pBWFImportDesc));
// Create RIFFChunks and append them to BWFImportDescriptor
checkResult(defs.cdRIFFChunk()->CreateInstance(IID_IAAFRIFFChunk,
(IUnknown **)&pRIFFChunk));
checkResult(defs.cdRIFFChunk()->CreateInstance(IID_IAAFRIFFChunk,
(IUnknown **)&pRIFFChunk2));
checkResult(pBWFImportDesc->AppendUnknownBWFChunk(pRIFFChunk));
checkResult(pBWFImportDesc->AppendUnknownBWFChunk(pRIFFChunk2));
checkExpression(pBWFImportDesc->AppendUnknownBWFChunk(pRIFFChunk)==AAFRESULT_OBJECT_ALREADY_ATTACHED, AAFRESULT_TEST_FAILED);
checkResult(pBWFImportDesc->SetFileSecurityReport(TEST_FileSecurityReport));
checkResult(pBWFImportDesc->SetFileSecurityWave(TEST_FileSecurityWave));
checkResult(pBWFImportDesc->SetCodingHistory(TEST_CodingHistory));
checkResult(pBWFImportDesc->SetBasicData(TEST_BasicData));
checkResult(pBWFImportDesc->SetStartOfModulation(TEST_StartOfModulation));
checkResult(pBWFImportDesc->SetQualityEvent(TEST_QualityEvent));
checkResult(pBWFImportDesc->SetEndOfModulation(TEST_EndOfModulation));
checkResult(pBWFImportDesc->SetQualityParameter(TEST_QualityParameter));
checkResult(pBWFImportDesc->SetOperatorComment(TEST_OperatorComment));
checkResult(pBWFImportDesc->SetCueSheet(TEST_CueSheet));
checkResult( pBWFImportDesc->QueryInterface(IID_IAAFEssenceDescriptor, (void **)&pEssDesc));
checkResult(pSourceMob->SetEssenceDescriptor(pEssDesc));
//Add the MOB to the file
checkResult(pHeader->AddMob(pMob));
testNum = 0;
checkResult(pRIFFChunk->Initialize(chunkID));
checkResult(pRIFFChunk->Write(sizeof(RIFFChunksmiley), (unsigned char *)RIFFChunksmiley, &testNum));
checkExpression(testNum == sizeof(RIFFChunksmiley), AAFRESULT_TEST_FAILED);
testNum = 0;
checkResult(pRIFFChunk2->Initialize(chunkID2));
checkResult(pRIFFChunk2->Write(sizeof(RIFFChunkfrowney), (unsigned char *)RIFFChunkfrowney, &testNum));
checkExpression(testNum == sizeof(RIFFChunkfrowney), AAFRESULT_TEST_FAILED);
pFile->Save();
pEssDesc->Release();
pEssDesc = NULL;
pBWFImportDesc->Release();
pBWFImportDesc = NULL;
pRIFFChunk->Release();
pRIFFChunk = NULL;
pRIFFChunk2->Release();
pRIFFChunk2 = NULL;
pMob->Release();
pMob = NULL;
pSourceMob->Release();
pSourceMob = NULL;
//.........这里部分代码省略.........
示例4: CreateAAFFile
static HRESULT CreateAAFFile(aafWChar *filename, aafUID_constref fileKind)
{
TestProductID.companyName = companyName;
TestProductID.productName = productName;
TestProductID.productVersionString = NULL;
TestProductID.productID = UnitTestProductID;
TestProductID.platform = NULL;
TestProductID.productVersion = &TestVersion;
HRESULT hr = S_OK;
try
{
RemoveTestFile(filename);
// Open new file
IAAFFile *pFile = NULL;
TestProductID.productVersionString = const_cast<aafWChar*>(L"CreateAAFFile");
checkResult( AAFFileOpenNewModifyEx(
filename,
&fileKind,
0,
&TestProductID,
&pFile) );
// Get the header & dictionary
IAAFHeader *pHeader = NULL;
IAAFDictionary *pDictionary = NULL;
checkResult(pFile->GetHeader(&pHeader));
checkResult(pHeader->GetDictionary(&pDictionary));
// Create a MasterMob
IAAFMob *pMob = NULL;
IAAFClassDef *classDef = NULL;
checkResult(pDictionary->LookupClassDef(AUID_AAFMasterMob, &classDef));
checkResult(classDef->CreateInstance(IID_IAAFMob, (IUnknown **)&pMob));
classDef->Release();
checkResult(pMob->SetMobID(TEST_MobID));
checkResult(pMob->SetName(L"CreateAAFFile - MasterMob"));
checkResult(pHeader->AddMob(pMob));
pMob->Release();
// Create a SourceMob
IAAFSourceMob *pSourceMob = NULL;
checkResult(pDictionary->LookupClassDef(AUID_AAFSourceMob, &classDef));
checkResult(classDef->CreateInstance(IID_IAAFSourceMob, (IUnknown **)&pSourceMob));
classDef->Release();
checkResult(pSourceMob->QueryInterface(IID_IAAFMob, (void **)&pMob));
checkResult(pMob->SetMobID(TEST_SourceMobID));
checkResult(pMob->SetName(L"CreateAAFFile - SourceMob"));
IAAFEssenceDescriptor *edesc = NULL;
IAAFAIFCDescriptor *pAIFCDesc = NULL;
checkResult(pDictionary->LookupClassDef(AUID_AAFAIFCDescriptor, &classDef));
checkResult(classDef->CreateInstance(IID_IAAFEssenceDescriptor, (IUnknown **)&edesc));
classDef->Release();
checkResult(edesc->QueryInterface(IID_IAAFAIFCDescriptor, (void **)&pAIFCDesc));
aafUInt8 buf[] = {0x00};
checkResult(pAIFCDesc->SetSummary(sizeof(buf), buf));
checkResult(pSourceMob->SetEssenceDescriptor(edesc));
checkResult(pHeader->AddMob(pMob));
pAIFCDesc->Release();
edesc->Release();
pSourceMob->Release();
pMob->Release();
pDictionary->Release();
pHeader->Release();
// Save & close the file
checkResult(pFile->Save());
checkResult(pFile->Close());
checkResult(pFile->Release());
cout << "CreateAAFFile() - created new file" << endl;
}
catch (HRESULT& rResult)
{
hr = rResult;
cout << "*** CreateAAFFile: caught error hr=0x" << hex << hr << dec << endl;
}
return hr;
}
示例5: CreateAAFFile
static HRESULT CreateAAFFile(
aafWChar * pFileName,
aafUID_constref fileKind,
testRawStorageType_t rawStorageType,
aafProductIdentification_constref productID)
{
// IAAFSession * pSession = NULL;
IAAFFile * pFile = NULL;
bool bFileOpen = false;
IAAFHeader * pHeader = NULL;
IAAFDictionary* pDictionary = NULL;
IAAFSourceMob *pSourceMob = NULL;
IAAFMob *pMob = NULL;
IAAFEssenceDescriptor *edesc = 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
// Create a FileMob
checkResult(defs.cdSourceMob()->
CreateInstance(IID_IAAFSourceMob,
(IUnknown **)&pSourceMob));
checkResult(pSourceMob->QueryInterface (IID_IAAFMob, (void **)&pMob));
checkResult(pMob->SetMobID(TEST_File_MobID));
checkResult(pMob->SetName(L"File Mob"));
// Check the Mob2 usage code implementations.
// Need IAAFMob2 for to do that.
{
IAAFSmartPointer<IAAFMob2> pMobInterface2;
checkResult( pMob->QueryInterface( IID_IAAFMob2, reinterpret_cast<void**>(&pMobInterface2) ) );
checkResult( pMobInterface2->SetUsageCode( kAAFUsage_Template ) );
}
// Create a concrete subclass of FileDescriptor
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));
checkResult(pHeader->AddMob(pMob));
// Reusing local variable so we need to release the inteface.
pMob->Release();
pMob = NULL;
// Create a MasterMob
checkResult(defs.cdMasterMob()->
CreateInstance(IID_IAAFMob,
(IUnknown **)&pMob));
checkResult(pMob->SetMobID(TEST_Master_MobID));
checkResult(pMob->SetName(L"Master Mob"));
// Check the Mob2 usage code implementations.
// Need IAAFMob2 for to do that.
{
IAAFSmartPointer<IAAFMob2> pMobInterface2;
checkResult( pMob->QueryInterface( IID_IAAFMob2, reinterpret_cast<void**>(&pMobInterface2) ) );
checkResult( pMobInterface2->SetUsageCode( kAAFUsage_Template ) );
}
checkResult(pHeader->AddMob(pMob));
// Reusing local variable so we need to release the inteface.
pMob->Release();
pMob = NULL;
// Create a CompositionMob
checkResult(defs.cdCompositionMob()->
CreateInstance(IID_IAAFMob,
(IUnknown **)&pMob));
//.........这里部分代码省略.........
示例6: CreateAAFFile
static HRESULT CreateAAFFile(
aafWChar * pFileName,
aafUID_constref fileKind,
testRawStorageType_t rawStorageType,
aafProductIdentification_constref productID)
{
IAAFFile* pFile = NULL;
IAAFHeader* pHeader = NULL;
IAAFDictionary* pDictionary = NULL;
IAAFSourceMob* pSourceMob = NULL;
IAAFMob* pMob = NULL;
IAAFDataEssenceDescriptor* pDataEssenceDesc = NULL;
IAAFEssenceDescriptor* pEssDesc = NULL;
HRESULT hr = AAFRESULT_SUCCESS;
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));
// Create a source mob
CAAFBuiltinDefs defs (pDictionary);
checkResult(defs.cdSourceMob()->
CreateInstance(IID_IAAFSourceMob,
(IUnknown **)&pSourceMob));
checkResult(pSourceMob->QueryInterface(IID_IAAFMob, (void **)&pMob));
checkResult(pMob->SetMobID(TEST_MobID));
RegisterDataEssenceDescriptorTest( pDictionary );
checkResult(pMob->SetName(L"DataEssenceDescriptorTest"));
checkResult( pDictionary->CreateInstance( TestDataEssenceDescriptorClassID,
IID_IAAFDataEssenceDescriptor,
(IUnknown**)&pDataEssenceDesc ) );
aafUID_t dataEssenceCoding;
memset(&dataEssenceCoding, 0, sizeof(aafUID_t));
checkResult(pDataEssenceDesc->SetDataEssenceCoding(dataEssenceCoding));
checkResult(pDataEssenceDesc->QueryInterface(IID_IAAFEssenceDescriptor, (void **)&pEssDesc));
checkResult(pSourceMob->SetEssenceDescriptor(pEssDesc));
// Add the MOB to the file
checkResult(pHeader->AddMob(pMob));
}
catch (HRESULT& rResult)
{
hr = rResult;
}
// Cleanup and return
if (pEssDesc)
pEssDesc->Release();
if (pDataEssenceDesc)
pDataEssenceDesc->Release();
if (pMob)
pMob->Release();
if (pSourceMob)
pSourceMob->Release();
if (pDictionary)
pDictionary->Release();
if (pHeader)
pHeader->Release();
if (pFile)
{
pFile->Save();
pFile->Close();
pFile->Release();
}
return hr;
}
示例7: 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));
//.........这里部分代码省略.........
示例8: CreateAAFFile
//.........这里部分代码省略.........
// Get the AAF Dictionary so that we can create valid AAF objects.
check(pHeader->GetDictionary(&pDictionary));
check(pDictionary->LookupClassDef(AUID_AAFCompositionMob,
&pCDCompositionMob));
check(pDictionary->LookupClassDef(AUID_AAFSequence,
&pCDSequence));
check(pDictionary->LookupClassDef(AUID_AAFSourceMob,
&pCDSourceMob));
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();
示例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;
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();
//.........这里部分代码省略.........
示例10: CreateAAFFile
static HRESULT CreateAAFFile(
aafWChar * pFileName,
aafUID_constref fileKind,
testRawStorageType_t rawStorageType,
aafProductIdentification_constref productID)
{
IAAFFile* pFile = NULL;
IAAFHeader* pHeader = NULL;
IAAFDictionary* pDictionary = NULL;
IAAFSourceMob* pSourceMob = NULL;
IAAFMob* pMob = NULL;
IAAFTIFFDescriptor* pTIFFDesc = NULL;
IAAFEssenceDescriptor* pEssDesc = NULL;
HRESULT hr = AAFRESULT_SUCCESS;
aafUInt8 summary[512];
aafUInt16 numEntries = 2;
unsigned long nOffset;
#if defined( OS_WINDOWS )
tiffHeader.tiff_byteOrder = TIFF_LITTLEENDIAN;
#else
tiffHeader.tiff_byteOrder = TIFF_BIGENDIAN;
#endif
tiffHeader.tiff_identNumber = TIFF_VERSION;
tiffHeader.tiff_firstIFD = 0;
memcpy(summary, (void *)&tiffHeader, sizeof(tiffHeader));
nOffset = sizeof(tiffHeader);
tagImageWidth.tdir_tag = TIFFTAG_IMAGEWIDTH;
tagImageWidth.tdir_type = TIFF_LONG;
tagImageWidth.tdir_count = 1;
tagImageWidth.tdir_offset = 320;
tagImageLength.tdir_tag = TIFFTAG_IMAGELENGTH;
tagImageLength.tdir_type = TIFF_LONG;
tagImageLength.tdir_count = 1;
tagImageLength.tdir_offset = 640;
// Write IFD data
memcpy(summary+nOffset, &numEntries, sizeof(numEntries));
nOffset += sizeof(numEntries);
memcpy((void *)(summary+nOffset), (void *)&tagImageWidth, sizeof(tagImageWidth));
nOffset += sizeof(tagImageWidth);
memcpy((void *)(summary+nOffset), (void *)&tagImageLength, sizeof(tagImageLength));
nOffset += sizeof(tagImageLength);
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 source 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"TIFFDescriptorTest"));
checkResult(defs.cdTIFFDescriptor()->
CreateInstance(IID_IAAFTIFFDescriptor,
(IUnknown **)&pTIFFDesc));
checkResult(pTIFFDesc->QueryInterface(IID_IAAFEssenceDescriptor, (void **)&pEssDesc));
checkResult(pTIFFDesc->SetIsUniform(kAAFFalse));
checkResult(pTIFFDesc->SetIsContiguous(kAAFTrue));
checkResult(pTIFFDesc->SetLeadingLines((aafInt32)10));
checkResult(pTIFFDesc->SetTrailingLines((aafInt32)20));
checkResult(pTIFFDesc->SetJPEGTableID((aafJPEGTableID_t)0));
checkResult(pTIFFDesc->SetSummary((aafUInt32)nOffset, (aafDataValue_t) summary));
checkResult(pSourceMob->SetEssenceDescriptor(pEssDesc));
// Add the MOB to the file
checkResult(pHeader->AddMob(pMob));
}
catch (HRESULT& rResult)
{
hr = rResult;
}
// Cleanup and return
if (pTIFFDesc)
pTIFFDesc->Release();
if (pDictionary)
pDictionary->Release();
//.........这里部分代码省略.........
示例11: 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;
IAAFMasterMob* pMasterMob = NULL;
IAAFSourceMob* pSrcMob = NULL;
IAAFSourceMob* pTapeMob = NULL;
IAAFEssenceDescriptor* pDesc = NULL;
IAAFMob* pTempMob = NULL;
HRESULT hr = S_OK;
long test;
aafSourceRef_t ref;
IAAFEssenceDescriptor* pEssDesc = NULL;
IAAFTapeDescriptor* pTapeDesc = NULL;
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);
// Create a Master Mob
checkResult(defs.cdMasterMob()->
CreateInstance(IID_IAAFMob,
(IUnknown **)&pMob));
// Set the IAAFMob properties
checkResult(pMob->SetMobID(TEST_Master_MobID));
checkResult(pMob->SetName(MobName));
checkResult(pMob->QueryInterface(IID_IAAFMasterMob, (void **) &pMasterMob));
// Create source mob to associate with our MasterMob.
checkResult(defs.cdSourceMob()->
CreateInstance(IID_IAAFSourceMob,
(IUnknown **)&pTapeMob));
hr = defs.cdTapeDescriptor()->
CreateInstance(IID_IAAFTapeDescriptor,
(IUnknown **)&pTapeDesc);
if (AAFRESULT_SUCCESS == hr)
{
hr = pTapeDesc->QueryInterface(IID_IAAFEssenceDescriptor, (void **)&pEssDesc);
if (AAFRESULT_SUCCESS == hr)
{
hr = pTapeMob->SetEssenceDescriptor(pEssDesc);
if (AAFRESULT_SUCCESS == hr)
{
hr = pTapeDesc->SetTapeManufacturer( Manufacturer );
if (AAFRESULT_SUCCESS == hr )
{
hr = pTapeDesc->SetTapeModel( Model );
if (AAFRESULT_SUCCESS == hr )
{
hr = pTapeDesc->SetTapeFormFactor( FormFactor );
if (AAFRESULT_SUCCESS == hr )
{
hr = pTapeDesc->SetSignalType( VideoSignalType );
if (AAFRESULT_SUCCESS == hr )
{
hr = pTapeDesc->SetTapeFormat( TapeFormat );
if (AAFRESULT_SUCCESS == hr )
hr = pTapeDesc->SetTapeLength( TapeLength );
}
}
}
}
}
pEssDesc->Release();
pEssDesc = NULL;
}
pTapeDesc->Release();
pTapeDesc = NULL;
}
for (test = 0; test < NumMobSlots; test++)
{
IAAFDataDefSP pDataDef;
checkResult (pDictionary->LookupDataDef (*slotDDefs[test], &pDataDef));
checkResult(pTapeMob->AddNilReference (test, TAPE_MOB_LENGTH_ARR[test], pDataDef, slotRates[test]));
}
checkResult(pTapeMob->QueryInterface(IID_IAAFMob, (void **) &pTempMob));
//.........这里部分代码省略.........
示例12: 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;
IAAFRIFFChunk* pRIFFChunk = NULL;
IAAFSourceMob* pSourceMob = NULL;
IAAFEssenceDescriptor* pEssDesc = NULL;
IAAFBWFImportDescriptor* pBWFImportDesc = NULL;
aafUInt32 byteswritten;
aafUInt32 bBytesWrote = 0;
HRESULT hr = S_OK;
// 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);
checkResult(defs.cdSourceMob()->
CreateInstance(IID_IAAFSourceMob,
(IUnknown **)&pSourceMob));
pSourceMob->QueryInterface(IID_IAAFMob, (void **)&pMob);
pMob->SetMobID(TEST_MobID);
pMob->SetName(L"RIFFChunkTest");
//Create BWFImportDescriptor to hold the RIFFChunk
checkResult( defs.cdBWFImportDescriptor()->
CreateInstance(IID_IAAFBWFImportDescriptor, (IUnknown **)&pBWFImportDesc));
// Create RIFFChunk and add it to BWFImportDescriptor
checkResult(defs.cdRIFFChunk()->CreateInstance(IID_IAAFRIFFChunk,
(IUnknown **)&pRIFFChunk));
checkResult(pBWFImportDesc->AppendUnknownBWFChunk(pRIFFChunk));
checkResult( pBWFImportDesc->QueryInterface(IID_IAAFEssenceDescriptor, (void **)&pEssDesc));
checkResult(pSourceMob->SetEssenceDescriptor(pEssDesc));
//Add the MOB to the file
checkResult(pHeader->AddMob(pMob));
bBytesWrote = 0;
checkResult(pRIFFChunk->Initialize(chunkID));
checkResult(pRIFFChunk->Write(sizeof(RIFFChunksmiley), (unsigned char *)RIFFChunksmiley, &bBytesWrote));
byteswritten = bBytesWrote;
bBytesWrote = 0;
checkResult(pRIFFChunk->Write(sizeof(RIFFChunkfrowney), (unsigned char *)RIFFChunkfrowney, &bBytesWrote));
byteswritten += bBytesWrote;
checkExpression(byteswritten == sizeof(RIFFChunksmiley) + sizeof(RIFFChunkfrowney), AAFRESULT_TEST_FAILED);
pFile->Save();
pEssDesc->Release();
pEssDesc = NULL;
pBWFImportDesc->Release();
pBWFImportDesc = NULL;
pRIFFChunk->Release();
pRIFFChunk = NULL;
pMob->Release();
pMob = NULL;
pSourceMob->Release();
pSourceMob = NULL;
pDictionary->Release();
pDictionary = NULL;
pHeader->Release();
pHeader = NULL;
pFile->Close();
pFile->Release();
pFile = NULL;
return hr;
}