本文整理汇总了C++中IAAFHeader::GetDictionary方法的典型用法代码示例。如果您正苦于以下问题:C++ IAAFHeader::GetDictionary方法的具体用法?C++ IAAFHeader::GetDictionary怎么用?C++ IAAFHeader::GetDictionary使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IAAFHeader
的用法示例。
在下文中一共展示了IAAFHeader::GetDictionary方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Create
void EventTest::Create(
aafWChar * pFileName,
aafUID_constref fileKind,
testRawStorageType_t rawStorageType,
aafProductIdentification_constref productID)
{
assert(NULL == _pFile);
// Remove the previous test file if any.
RemoveTestFile(pFileName);
// Create the file
checkResult(CreateTestFile( pFileName, fileKind, rawStorageType, productID, &_pFile ));
_bWritableFile = 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));
// Make a text clip.
CreateEvent();
// cleanup
Close();
}
示例2: createFile
void EnumEssenceDataTest::createFile(const wchar_t *pFileName)
{
// Remove the previous test file if any.
removeTestFile(pFileName);
check(CreateTestFile( pFileName, _fileKind, _rawStorageType, _productInfo, &_pFile ));
_bFileOpen = true;
check(_pFile->GetHeader(&_pHeader));
check(_pHeader->GetDictionary(&_pDictionary));
for (aafUInt32 item = 0; item < _maxMobCount; ++item)
createFileMob(item);
check(_pFile->Save());
cleanupReferences();
}
示例3: ReadAAFFile
static HRESULT ReadAAFFile(aafWChar * pFileName )
{
HRESULT hr = AAFRESULT_SUCCESS;
IAAFFile* pFile = NULL;
IAAFHeader * pHeader = NULL;
IAAFDictionary * pDict = NULL;
aafBoolean_t bFileOpen = kAAFFalse;
try
{
// Open the file
checkResult(AAFFileOpenExistingRead(pFileName, 0, &pFile));
bFileOpen = kAAFTrue;
checkResult (pFile->GetHeader (&pHeader));
assert (pHeader);
checkResult (pHeader->GetDictionary (&pDict));
assert (pDict);
// Read the mob, slots, etc to verify the contents ...
checkResult(verifyContents (pHeader, pDict, kAAFFalse)); //False => NOT minimal testing; i.e. test everything
}//try
catch (HRESULT & rResult)
{
hr = rResult;
}
if (pDict) pDict->Release();
if (pHeader) pHeader->Release();
if (bFileOpen && pFile)
{
stopGap(pFile->Close());
pFile->Release();
}
return hr;
}//ReadAAFFile()
示例4: createFile
void EssenceDataTest::createFile(
wchar_t *pFileName,
aafUID_constref fileKind,
testRawStorageType_t rawStorageType)
{
// Delete the test file if it already exists.
remove(convert(pFileName));
check(CreateTestFile( pFileName, fileKind, rawStorageType, _productInfo, &_pFile ));
_bFileOpen = true;
check(_pFile->GetHeader(&_pHeader));
check(_pHeader->GetDictionary(&_pDictionary));
createFileMob(0); //use unique mobid's (without using cocreate guid()
createFileMob(1); //use unique mobid's (without using cocreate guid()
check(_pFile->Save());
cleanupReferences();
}
示例5: Create
void HTMLClipTest::Create(wchar_t *pFileName, aafProductIdentification_t* pinfo)
{
assert(NULL == _pFile);
// Remove the previous test file if any.
RemoveTestFile(pFileName);
// Create the file
checkResult(AAFFileOpenNewModify(pFileName, 0, pinfo, &_pFile));
_bWritableFile = 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));
// Make a html clip.
CreateHTMLClip();
// cleanup
Close();
}
示例6: ModifyAAFFile
static HRESULT ModifyAAFFile(aafWChar *filename, int level)
{
HRESULT hr = S_OK;
try
{
// Open existing file for modification
IAAFFile *pFile = NULL;
TestProductID.productVersionString = const_cast<aafWChar*>(L"ModifyAAFFile");
checkResult( AAFFileOpenExistingModify(
filename,
0, // modeFlags
&TestProductID,
&pFile) );
cout << "ModifyAAFFile() - appended Identification" << endl;
// Get the header & dictionary
IAAFHeader *pHeader = NULL;
IAAFDictionary *pDictionary = NULL;
checkResult(pFile->GetHeader(&pHeader));
checkResult(pHeader->GetDictionary(&pDictionary));
// Search for Mobs
IAAFMob *pFileMob = NULL;
IEnumAAFMobs *pFileMobIter = NULL;
aafSearchCrit_t criteria;
criteria.searchTag = kAAFByMobKind;
criteria.tags.mobKind = kAAFFileMob; // Search by File Mob
checkResult(pHeader->GetMobs(&criteria, &pFileMobIter));
while (AAFRESULT_SUCCESS == pFileMobIter->NextOne(&pFileMob))
{
if (level == 0)
break;
IAAFEssenceDescriptor *edesc = NULL;
IAAFSourceMob *pSourceMob = NULL;
CR(pFileMob->QueryInterface(IID_IAAFSourceMob, (void **)&pSourceMob));
CR(pSourceMob->GetEssenceDescriptor(&edesc));
// Change the Name property
CR(pFileMob->SetName(L"ModifyAAFFile - modified Name"));
cout << "ModifyAAFFile() - changed FileMob's Name property" << endl;
if (level == 1)
break;
// Change descriptor's properties
IAAFAIFCDescriptor *pAIFCDesc = NULL;
CR(edesc->QueryInterface(IID_IAAFAIFCDescriptor, (void **)&pAIFCDesc));
aafUInt8 AIFCsum[] = {0xa1,0xfc};
CR(pAIFCDesc->SetSummary(sizeof(AIFCsum), AIFCsum));
pAIFCDesc->Release();
edesc->Release();
cout << "ModifyAAFFile() - changed AIFCDescriptor's Summary" << endl;
if (level == 2)
break;
// Change descriptor to new one (overwriting old one)
IAAFClassDef *classDef = NULL;
IAAFFileDescriptor *pFileDesc = NULL;
IAAFWAVEDescriptor *pWAVEDesc = NULL;
IAAFEssenceDescriptor *pNewEdesc = NULL;
CR(pDictionary->LookupClassDef(AUID_AAFWAVEDescriptor, &classDef));
CR(classDef->CreateInstance(IID_IAAFFileDescriptor, (IUnknown **)&pFileDesc));
CR(pFileDesc->QueryInterface(IID_IAAFWAVEDescriptor, (void **)&pWAVEDesc));
CR(pFileDesc->QueryInterface(IID_IAAFEssenceDescriptor, (void **)&pNewEdesc));
aafUInt8 WAVEsum[] = {0x1a,0x1e,0xee,0xee};
CR(pWAVEDesc->SetSummary(sizeof(WAVEsum), WAVEsum));
CR(pSourceMob->SetEssenceDescriptor(pNewEdesc));
pNewEdesc->Release();
pWAVEDesc->Release();
pFileDesc->Release();
classDef->Release();
cout << "ModifyAAFFile() - replaced AIFCDescriptor with WAVEDescriptor" << endl;
if (level == 3)
break;
// Add EssenceData
IAAFEssenceData *pEssenceData = NULL;
IAAFEssenceData2 *pEssenceData2 = NULL;
IAAFPlainEssenceData *pPlainEssenceData = NULL;
aafUInt32 bytesWritten = 0;
aafUInt8 essdata[] = "Zaphod Beeblebrox";
CR(pDictionary->LookupClassDef(AUID_AAFEssenceData, &classDef));
CR(classDef->CreateInstance(IID_IAAFEssenceData, (IUnknown **)&pEssenceData));
CR(pEssenceData->SetFileMob(pSourceMob));
CR(pHeader->AddEssenceData(pEssenceData));
CR(pEssenceData->QueryInterface(IID_IAAFEssenceData2, (void**)&pEssenceData2));
CR(pEssenceData2->GetPlainEssenceData(0, &pPlainEssenceData));
CR(pPlainEssenceData->Write(sizeof(essdata), essdata, &bytesWritten));
pEssenceData->Release();
pEssenceData2->Release();
pPlainEssenceData->Release();
classDef->Release();
//.........这里部分代码省略.........
示例7: 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));
//.........这里部分代码省略.........
示例8: CreateAAFFile
static HRESULT CreateAAFFile(const aafWChar * pFileName, testDataFile_t *dataFile, testType_t testType)
{
IAAFFile* pFile = NULL;
IAAFHeader* pHeader = NULL;
IAAFDictionary* pDictionary = NULL;
IAAFMob* pMob = NULL;
IAAFMasterMob* pMasterMob = NULL;
IAAFEssenceAccess* pEssenceAccess = NULL;
IAAFEssenceFormat* pFormat = NULL;
IAAFEssenceFormat *format = NULL;
IAAFLocator *pLocator = NULL;
aafMobID_t masterMobID;
aafProductIdentification_t ProductInfo;
aafRational_t editRate = {44100, 1};
aafRational_t sampleRate = {44100, 1};
FILE* pWavFile = NULL;
unsigned char dataBuff[4096], *dataPtr;
aafUInt32 dataOffset, dataLen;
aafUInt16 bitsPerSample, numCh;
aafInt32 n, numSpecifiers;
aafUID_t essenceFormatCode, testContainer;
IAAFClassDef *pMasterMobDef = NULL;
IAAFClassDef *pNetworkLocatorDef = NULL;
IAAFDataDef *pSoundDef = NULL;
aafUInt32 samplesWritten, bytesWritten;
// Delete any previous test file before continuing...
char chFileName[1000];
convert(chFileName, sizeof(chFileName), pFileName);
remove(chFileName);
if(dataFile != NULL)
{
// Delete any previous test file before continuing...
char chFileName[1000];
convert(chFileName, sizeof(chFileName), dataFile->dataFilename);
remove(chFileName);
}
aafProductVersion_t v;
v.major = 1;
v.minor = 0;
v.tertiary = 0;
v.patchLevel = 0;
v.type = kAAFVersionUnknown;
ProductInfo.companyName = companyName;
ProductInfo.productName = productName;
ProductInfo.productVersion = &v;
ProductInfo.productVersionString = NULL;
ProductInfo.productID = NIL_UID;
ProductInfo.platform = NULL;
/* Create a new AAF file */
check(AAFFileOpenNewModifyEx (pFileName, &kAAFFileKind_Aaf4KBinary, 0, &ProductInfo, &pFile));
check(pFile->GetHeader(&pHeader));
/* Get the AAF Dictionary from the file */
check(pHeader->GetDictionary(&pDictionary));
/* Lookup class definitions for the objects we want to create. */
check(pDictionary->LookupClassDef(AUID_AAFMasterMob, &pMasterMobDef));
check(pDictionary->LookupClassDef(AUID_AAFNetworkLocator, &pNetworkLocatorDef));
/* Lookup any necessary data definitions. */
check(pDictionary->LookupDataDef(kAAFDataDef_Sound, &pSoundDef));
/* Create a Mastermob */
// Get a Master MOB Interface
check(pMasterMobDef->
CreateInstance(IID_IAAFMasterMob,
(IUnknown **)&pMasterMob));
// Get a Mob interface and set its variables.
check(pMasterMob->QueryInterface(IID_IAAFMob, (void **)&pMob));
check(pMob->GetMobID(&masterMobID));
check(pMob->SetName(L"A Master Mob"));
// Add it to the file
check(pHeader->AddMob(pMob));
if(dataFile != NULL)
{
// Make a locator, and attach it to the EssenceDescriptor
check(pNetworkLocatorDef->
CreateInstance(IID_IAAFLocator,
(IUnknown **)&pLocator));
check(pLocator->SetPath (dataFile->dataFilename));
testContainer = dataFile->dataFormat;
}
else
{
pLocator = NULL;
testContainer = ContainerAAF;
}
// Open the Essence file to be included in this AAF file("Laser.wav")
pWavFile = fopen("Laser.wav", "r");
if (pWavFile)
//.........这里部分代码省略.........
示例9: CreateAAFFile
static HRESULT CreateAAFFile(
aafWChar * pFileName,
aafUID_constref fileKind,
testRawStorageType_t rawStorageType,
aafProductIdentification_constref productID)
{
IAAFFile* pFile = NULL;
IAAFHeader * pHeader = NULL;
IAAFDictionary* pDictionary = NULL;
IAAFDefObject* pDef = NULL;
IAAFContainerDef* pContainerDef = NULL;
bool bFileOpen = false;
HRESULT hr = S_OK;
/* long test;
*/
try
{
// Remove the previous test file if any.
RemoveTestFile(pFileName);
// Create the AAF file
checkResult(CreateTestFile( pFileName, fileKind, rawStorageType, productID, &pFile ));
bFileOpen = true;
// Get the AAF file header.
checkResult(pFile->GetHeader(&pHeader));
// Get the AAF Dictionary so that we can create valid AAF objects.
checkResult(pHeader->GetDictionary(&pDictionary));
CAAFBuiltinDefs defs (pDictionary);
checkResult(defs.cdContainerDef()->
CreateInstance(IID_IAAFContainerDef,
(IUnknown **)&pContainerDef));
checkResult(pContainerDef->QueryInterface (IID_IAAFDefObject,
(void **)&pDef));
checkResult(pContainerDef->Initialize (testUID, sName, sDescription));
checkResult(pDictionary->RegisterContainerDef(pContainerDef));
//
// test Append, Prepend, and enum plugin descriptor using same type def
//
IAAFPluginDescriptorSP pd1;
checkResult (defs.cdPluginDef()->
CreateInstance (IID_IAAFPluginDef,
(IUnknown **)&pd1));
checkResult (pd1->Initialize (kTestPluginDescID1,
L"PluginDesc1",
L"Plugin Descriptor 1 description"));
checkResult(pd1->SetDefinitionObjectID(kTestPluginDescID1));
checkResult (pDictionary->RegisterPluginDef (pd1));
IAAFPluginDescriptorSP pd2;
checkResult (defs.cdPluginDef()->
CreateInstance (IID_IAAFPluginDef,
(IUnknown **)&pd2));
checkResult (pd2->Initialize (kTestPluginDescID2,
L"PluginDesc2",
L"Plugin Descriptor 2 description"));
checkResult(pd2->SetDefinitionObjectID(kTestPluginDescID2));
checkResult (pDictionary->RegisterPluginDef (pd2));
IAAFPluginDescriptorSP pd3;
checkResult (defs.cdPluginDef()->
CreateInstance (IID_IAAFPluginDef,
(IUnknown **)&pd3));
checkResult (pd3->Initialize (kTestPluginDescID3,
L"PluginDesc3",
L"Plugin Descriptor 3 description"));
checkResult(pd3->SetDefinitionObjectID(kTestPluginDescID3));
checkResult (pDictionary->RegisterPluginDef (pd3));
}
catch (HRESULT& rResult)
{
hr = rResult;
}
// Cleanup and return
if (pDef)
pDef->Release();
if (pContainerDef)
pContainerDef->Release();
if (pDictionary)
pDictionary->Release();
if (pHeader)
pHeader->Release();
if (pFile)
{ // Close file
if (bFileOpen)
{
//.........这里部分代码省略.........
示例10: 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;
IAAFSequence *pSequence = 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 number of mobs to force creation of the content storage.
// This is temporary as the content storage should be created by
// the call to OpenNewModify above.
aafNumSlots_t n;
checkResult(pHeader->CountMobs(kAAFAllMob, &n));
// Get the AAF Dictionary so that we can create valid AAF objects.
checkResult(pHeader->GetDictionary(&pDictionary));
// Create a sequence withou attaching it to the file.
checkResult(CreateAAFSequence(pDictionary, &pSequence));
// Test the enumeration methods.
checkResult(TestEnumerator(pSequence));
}
catch (HRESULT& rResult)
{
hr = rResult;
}
// Cleanup and return
if (pSequence)
pSequence->Release();
if (pDictionary)
pDictionary->Release();
if (pHeader)
pHeader->Release();
if (pFile)
{ // Close file
if (bFileOpen)
{
pFile->Save();
pFile->Close();
}
pFile->Release();
}
return hr;
}
示例11: ReadAAFFile
static HRESULT ReadAAFFile(aafWChar * pFileName)
{
IAAFFile * pFile = NULL;
IAAFHeader * pHeader = NULL;
IAAFDictionary* pDictionary = NULL;
IAAFSourceMob* pSourceMob = NULL;
IAAFMob* pMob = NULL;
IAAFEssenceDescriptor* pEssDesc = NULL;
IAAFBWFImportDescriptor* pBWFImportDesc = NULL;
IEnumAAFRIFFChunks* pEnum = NULL;
IAAFRIFFChunk* pRIFFChunk = NULL;
IAAFRIFFChunk* pRIFFChunkTest = NULL;
IEnumAAFMobs* pMobIter = NULL;
aafUInt32 numData, bytesRead, com, testNum;
aafLength_t testRIFFLen;
aafNumSlots_t numMobs;
char Value[sizeof(RIFFChunksmiley)];
char Value2[sizeof(RIFFChunkfrowney)];
HRESULT hr = AAFRESULT_SUCCESS;
wchar_t testString[256];
checkResult(AAFFileOpenExistingRead(pFileName, 0, &pFile));
checkResult( pFile->GetHeader(&pHeader));
// Get the AAF Dictionary so that we can create a fake RIFFChunk to test RemoveUnknownBWFChunks.
checkResult(pHeader->GetDictionary(&pDictionary));
CAAFBuiltinDefs defs (pDictionary);
checkResult(defs.cdRIFFChunk()->CreateInstance(IID_IAAFRIFFChunk,
(IUnknown **)&pRIFFChunkTest));
checkResult(pHeader->CountMobs(kAAFAllMob, &numMobs));
if (1 == numMobs )
{
checkResult(pHeader->GetMobs(NULL, &pMobIter));
checkResult(pMobIter->NextOne(&pMob));
checkResult(pMob->QueryInterface(IID_IAAFSourceMob, (void **)&pSourceMob));
// Back into testing mode
checkResult(pSourceMob->GetEssenceDescriptor(&pEssDesc));
checkResult( pEssDesc->QueryInterface( IID_IAAFBWFImportDescriptor, (void**)&pBWFImportDesc ));
checkResult(pBWFImportDesc->GetFileSecurityReport(&testNum));
checkExpression(testNum==TEST_FileSecurityReport, AAFRESULT_TEST_FAILED);
checkResult(pBWFImportDesc->GetFileSecurityWave(&testNum));
checkExpression(testNum==TEST_FileSecurityWave, AAFRESULT_TEST_FAILED);
checkResult(pBWFImportDesc->GetCodingHistory(testString, sizeof(testString)));
checkExpression(wcscmp(testString, TEST_CodingHistory) == 0, AAFRESULT_TEST_FAILED);
checkResult(pBWFImportDesc->GetBasicData(testString, sizeof(testString)));
checkExpression(wcscmp(testString, TEST_BasicData) == 0, AAFRESULT_TEST_FAILED);
checkResult(pBWFImportDesc->GetStartOfModulation(testString, sizeof(testString)));
checkExpression(wcscmp(testString, TEST_StartOfModulation) == 0, AAFRESULT_TEST_FAILED);
checkResult(pBWFImportDesc->GetQualityEvent(testString, sizeof(testString)));
checkExpression(wcscmp(testString, TEST_QualityEvent) == 0, AAFRESULT_TEST_FAILED);
checkResult(pBWFImportDesc->GetEndOfModulation(testString, sizeof(testString)));
checkExpression(wcscmp(testString, TEST_EndOfModulation) == 0, AAFRESULT_TEST_FAILED);
checkResult(pBWFImportDesc->GetQualityParameter(testString, sizeof(testString)));
checkExpression(wcscmp(testString, TEST_QualityParameter) == 0, AAFRESULT_TEST_FAILED);
checkResult(pBWFImportDesc->GetOperatorComment(testString, sizeof(testString)));
checkExpression(wcscmp(testString, TEST_OperatorComment) == 0, AAFRESULT_TEST_FAILED);
checkResult(pBWFImportDesc->GetCueSheet(testString, sizeof(testString)));
checkExpression(wcscmp(testString, TEST_CueSheet) == 0, AAFRESULT_TEST_FAILED);
checkResult(pBWFImportDesc->CountUnknownBWFChunks(&numData));
checkExpression(2 == numData, AAFRESULT_TEST_FAILED);
checkResult(pBWFImportDesc->GetUnknownBWFChunks(&pEnum));
for(com = 0; com < numData; com++)
{
checkResult(pEnum->NextOne(&pRIFFChunk));
pRIFFChunk->GetLength(&testRIFFLen);
checkExpression(testRIFFLen!=chunkLength /*huh?*/, AAFRESULT_TEST_FAILED);
checkResult(pRIFFChunk->GetLength(&testRIFFLen));
pRIFFChunk->GetChunkID(&testNum);
if (testNum==1){
checkExpression(sizeof(RIFFChunksmiley) == testRIFFLen, AAFRESULT_TEST_FAILED);
checkResult(pRIFFChunk->Read( sizeof(Value), (unsigned char *)Value, &bytesRead));
checkExpression(memcmp(Value, RIFFChunksmiley, sizeof(RIFFChunksmiley)) == 0, AAFRESULT_TEST_FAILED);
}
else if (testNum==2){
checkExpression(sizeof(RIFFChunkfrowney) == testRIFFLen, AAFRESULT_TEST_FAILED);
checkResult(pRIFFChunk->Read( sizeof(Value2), (unsigned char *)Value2, &bytesRead));
checkExpression(memcmp(Value2, RIFFChunkfrowney, sizeof(RIFFChunkfrowney)) == 0, AAFRESULT_TEST_FAILED);
}
pRIFFChunk->Release();
pRIFFChunk = NULL;
}
checkResult(pEnum->Reset());
checkResult(pEnum->NextOne(&pRIFFChunk));
checkExpression((pBWFImportDesc->RemoveUnknownBWFChunkAt(2))==AAFRESULT_BADINDEX, AAFRESULT_TEST_FAILED);
checkResult(pBWFImportDesc->RemoveUnknownBWFChunkAt(0));
checkResult(pBWFImportDesc->CountUnknownBWFChunks(&numData));
checkExpression(1 == numData, AAFRESULT_TEST_FAILED);
pRIFFChunk->Release();
pRIFFChunk = NULL;
pEnum->Release();
pEnum = NULL;
pBWFImportDesc->Release();
//.........这里部分代码省略.........
示例12: ReadAAFFile
static HRESULT ReadAAFFile(aafWChar* pFileName)
{
IAAFFile* pFile = NULL;
IAAFHeader* pHeader = NULL;
IAAFDictionary* pDictionary = NULL;
IEnumAAFOperationDefs *pEffectEnum = NULL;
IEnumAAFOperationDefs *pDegradeEnum = NULL;
IEnumAAFParameterDefs *pParmDefEnum = NULL;
IAAFOperationDef *pOperationDef = NULL;
IAAFParameterDef *pParmDef = NULL;
IAAFDefObject* pDefObject = NULL;
bool bFileOpen = false;
IAAFDataDefSP pReadDataDef;
aafBool readIsTimeWarp;
aafInt32 checkNumInputs;
aafUInt32 checkBypass;
HRESULT hr = S_OK;
wchar_t checkName[256];
aafUID_t checkCat;
aafBool bResult = kAAFFalse;
try
{
// Open the AAF file
checkResult(AAFFileOpenExistingRead(pFileName, 0, &pFile));
bFileOpen = true;
// Get the AAF file header.
checkResult(pFile->GetHeader(&pHeader));
checkResult(pHeader->GetDictionary(&pDictionary));
CAAFBuiltinDefs defs (pDictionary);
checkResult(pDictionary->GetOperationDefs(&pEffectEnum));
checkResult(pEffectEnum->NextOne (&pOperationDef));
checkResult(pOperationDef->GetDataDef(&pReadDataDef));
checkResult(pOperationDef->QueryInterface(IID_IAAFDefObject, (void **) &pDefObject));
checkResult(pDefObject->GetName (checkName, sizeof(checkName)));
checkExpression(wcscmp(checkName, effectNames[0]) == 0, AAFRESULT_TEST_FAILED);
checkResult(pDefObject->GetDescription (checkName, sizeof(checkName)));
checkExpression(wcscmp(checkName, effectDesc[0]) == 0, AAFRESULT_TEST_FAILED);
pDefObject->Release();
pDefObject = NULL;
checkResult(pReadDataDef->IsDataDefOf(defs.ddkAAFPicture(), &bResult));
checkExpression(bResult == kAAFTrue, AAFRESULT_TEST_FAILED);
checkResult(pOperationDef->IsTimeWarp (&readIsTimeWarp));
checkExpression(readIsTimeWarp == kAAFFalse, AAFRESULT_TEST_FAILED);
checkResult(pOperationDef->GetCategory (&checkCat));
checkExpression(memcmp(&checkCat, &TEST_CATEGORY, sizeof(aafUID_t)) == 0, AAFRESULT_TEST_FAILED);
checkResult(pOperationDef->GetBypass (&checkBypass));
checkExpression(checkBypass == TEST_BYPASS, AAFRESULT_TEST_FAILED);
checkResult(pOperationDef->GetNumberInputs (&checkNumInputs));
checkExpression(checkNumInputs == TEST_NUM_INPUTS, AAFRESULT_TEST_FAILED);
checkResult(pOperationDef->GetParameterDefs (&pParmDefEnum));
checkResult(pParmDefEnum->NextOne (&pParmDef));
checkResult(pParmDef->QueryInterface(IID_IAAFDefObject, (void **) &pDefObject));
checkResult(pDefObject->GetName (checkName, sizeof(checkName)));
checkExpression(wcscmp(checkName, TEST_PARAM_NAME) == 0, AAFRESULT_TEST_FAILED);
checkResult(pDefObject->GetDescription (checkName, sizeof(checkName)));
checkExpression(wcscmp(checkName, TEST_PARAM_DESC) == 0, AAFRESULT_TEST_FAILED);
pDefObject->Release();
pDefObject = NULL;
checkResult(pOperationDef->GetDegradeToOperations (&pDegradeEnum));
pOperationDef->Release();
pOperationDef = NULL;
// Check for prepended one first
checkResult(pDegradeEnum->NextOne (&pOperationDef));
checkResult(pOperationDef->QueryInterface(IID_IAAFDefObject, (void **) &pDefObject));
checkResult(pDefObject->GetName (checkName, sizeof(checkName)));
checkExpression(wcscmp(checkName, effectNames[2]) == 0, AAFRESULT_TEST_FAILED);
checkResult(pDefObject->GetDescription (checkName, sizeof(checkName)));
checkExpression(wcscmp(checkName, effectDesc[2]) == 0, AAFRESULT_TEST_FAILED);
pDefObject->Release();
pDefObject = NULL;
pOperationDef->Release();
pOperationDef = NULL;
// Check for appended one second
checkResult(pDegradeEnum->NextOne (&pOperationDef));
checkResult(pOperationDef->QueryInterface(IID_IAAFDefObject, (void **) &pDefObject));
checkResult(pDefObject->GetName (checkName, sizeof(checkName)));
checkExpression(wcscmp(checkName, effectNames[1]) == 0, AAFRESULT_TEST_FAILED);
checkResult(pDefObject->GetDescription (checkName, sizeof(checkName)));
checkExpression(wcscmp(checkName, effectDesc[1]) == 0, AAFRESULT_TEST_FAILED);
pDefObject->Release();
pDefObject = NULL;
pOperationDef->Release();
pOperationDef = NULL;
}
catch (HRESULT& rResult)
{
hr = rResult;
}
//.........这里部分代码省略.........
示例13: 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;
}
示例14: 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));
//.........这里部分代码省略.........
示例15: CreateAAFFile
static HRESULT CreateAAFFile(
aafWChar * pFileName,
aafUID_constref fileKind,
testRawStorageType_t rawStorageType,
aafProductIdentification_constref productID)
{
IAAFFile* pFile = NULL;
IAAFHeader * pHeader = NULL;
IAAFDictionary* pDictionary = NULL;
IAAFOperationDef* pOperationDef = NULL;
IAAFParameterDef* pParamDef = NULL;
IAAFDefObject* pDefObject = NULL;
IAAFOperationGroup *pOperationGroup = NULL;
IAAFMob *pMob = NULL;
IAAFSegment *pSeg = NULL;
IAAFTimelineMobSlot *pSlot = NULL;
IAAFParameter *pParm = NULL;
IAAFVaryingValue *pVaryingValue = NULL;
IAAFSegment *pFiller = NULL;
IAAFComponent *pComponent = NULL;
IAAFSourceClip *pSourceClip = NULL;
IAAFControlPoint *pControlPoint = NULL;
IAAFSourceReference *pSourceRef = NULL;
IAAFInterpolationDef *pInterpDef = NULL;
IAAFPluginManager *pMgr = NULL;
IAAFTypeDef *pTypeDef = NULL;
bool bFileOpen = false;
HRESULT hr = S_OK;
// aafUID_t testInterpDef = kAAFTypeID_Rational;
aafLength_t effectLen = TEST_EFFECT_LEN;
aafUID_t effectID = kTestEffectID;
aafUID_t parmID = kTestParmID;
aafRational_t testLevel1 = kTestLevel1;
aafRational_t testLevel2 = kTestLevel2;
aafRational_t testTime1 = kTestTime1;
aafRational_t testTime2 = kTestTime2;
/* long test;
*/
try
{
// Remove the previous test file if any.
RemoveTestFile(pFileName);
// Create the AAF file
checkResult(CreateTestFile( pFileName, fileKind, rawStorageType, productID, &pFile ));
bFileOpen = true;
// Get the AAF file header.
checkResult(pFile->GetHeader(&pHeader));
// Get the AAF Dictionary so that we can create valid AAF objects.
checkResult(pHeader->GetDictionary(&pDictionary));
CAAFBuiltinDefs defs (pDictionary);
checkResult(defs.cdOperationDef()->
CreateInstance(IID_IAAFOperationDef,
(IUnknown **)&pOperationDef));
checkResult(defs.cdParameterDef()->
CreateInstance(IID_IAAFParameterDef,
(IUnknown **)&pParamDef));
checkResult(pDictionary->LookupTypeDef (kAAFTypeID_Rational, &pTypeDef));
checkResult(pParamDef->Initialize (parmID, TEST_PARAM_NAME, TEST_PARAM_DESC, pTypeDef));
checkResult(AAFGetPluginManager(&pMgr));
checkResult(pMgr->CreatePluginDefinition(LinearInterpolator, pDictionary, &pDefObject));
checkResult(pDefObject->QueryInterface(IID_IAAFInterpolationDef, (void **) &pInterpDef));
pDefObject->Release();
pDefObject = NULL;
checkResult(pOperationDef->Initialize (effectID, TEST_EFFECT_NAME, TEST_EFFECT_DESC));
checkResult(pDictionary->RegisterOperationDef (pOperationDef));
checkResult(pDictionary->RegisterParameterDef (pParamDef));
checkResult(pDictionary->RegisterInterpolationDef (pInterpDef));
checkResult(pOperationDef->SetDataDef (defs.ddkAAFPicture()));
checkResult(pOperationDef->SetIsTimeWarp (kAAFFalse));
checkResult(pOperationDef->SetNumberInputs (TEST_NUM_INPUTS));
checkResult(pOperationDef->SetCategory (TEST_CATEGORY));
checkResult(pOperationDef->AddParameterDef (pParamDef));
checkResult(pOperationDef->SetBypass (TEST_BYPASS));
checkResult(pParamDef->SetDisplayUnits(TEST_PARAM_UNITS));
//Make the first mob
long test;
aafRational_t videoRate = { 2997, 100 };
// Create a Mob
checkResult(defs.cdCompositionMob()->
CreateInstance(IID_IAAFMob,
(IUnknown **)&pMob));
checkResult(pMob->SetName(L"AAFOperationGroupTest"));
// Add some slots
//.........这里部分代码省略.........