当前位置: 首页>>代码示例>>C++>>正文


C++ IAAFHeader::EnumEssenceData方法代码示例

本文整理汇总了C++中IAAFHeader::EnumEssenceData方法的典型用法代码示例。如果您正苦于以下问题:C++ IAAFHeader::EnumEssenceData方法的具体用法?C++ IAAFHeader::EnumEssenceData怎么用?C++ IAAFHeader::EnumEssenceData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IAAFHeader的用法示例。


在下文中一共展示了IAAFHeader::EnumEssenceData方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: openEssenceData

void EnumEssenceDataTest::openEssenceData()
{
  assert(_pFile && _pHeader);
  assert(NULL == _pEnumEssenceData);
  assert(NULL == _pEssenceData);
  assert(NULL == _pSourceMob);

  aafUInt32 essenceDataCount = 0;
  check(_pHeader->CountEssenceData(&essenceDataCount));
  if (_maxMobCount != essenceDataCount)
    check(AAFRESULT_TEST_FAILED);
 
  check(_pHeader->EnumEssenceData(&_pEnumEssenceData));
  for (aafUInt32 item = 0; item < essenceDataCount; ++item)
  {
    check(_pEnumEssenceData->NextOne(&_pEssenceData));

    // Make sure that the essence data still references
    // a valid mob.
    check(_pEssenceData->GetFileMob(&_pSourceMob));

    _pSourceMob->Release();
    _pSourceMob = NULL;

    _pEssenceData->Release();
    _pEssenceData = NULL;
  }


  _pEnumEssenceData->Release();
  _pEnumEssenceData = NULL;
}
开发者ID:mcanthony,项目名称:aaf,代码行数:32,代码来源:CEnumAAFEssenceDataTest.cpp

示例2: openEssenceData

void EssenceDataTest::openEssenceData()
{
  assert(_pFile && _pHeader);
  assert(NULL == _pEnumEssenceData);
  assert(NULL == _pEssenceData);
  assert(NULL == _pSourceMob);

  
  check(_pHeader->EnumEssenceData(&_pEnumEssenceData));
  IAAFEssenceData* pNextEssenceData = NULL;
  while (AAFRESULT_SUCCESS == (_hr = _pEnumEssenceData->NextOne(&pNextEssenceData)))
  {
    IAAFEssenceData2* pEssenceData2 = NULL;
    check(pNextEssenceData->QueryInterface(IID_IAAFEssenceData2, (void**)&pEssenceData2));
    check(pEssenceData2->GetPlainEssenceData(0, &_pEssenceData));

    // Validate essence element key
    IAAFKLVEssenceDataParameters* pParameters = NULL;
    check(_pEssenceData->QueryInterface(IID_IAAFKLVEssenceDataParameters, (void **)&pParameters));
    aafUID_t key;
    AAFRESULT hr = pParameters->GetEssenceElementKey(&key);
    checkExpression(AAFRESULT_SUCCEEDED(hr) || hr == AAFRESULT_OPERATION_NOT_PERMITTED,
                    AAFRESULT_TEST_FAILED);
    checkExpression(AAFRESULT_FAILED(hr) || key == _essenceElementKey,
                    AAFRESULT_TEST_FAILED);

    // Validate the essence.
    // Validate the current essence size.
    aafLength_t essenceSize = 0;
    aafLength_t expectedEssenceSize = sizeof(_smiley) + sizeof(_frowney);
    check(_pEssenceData->GetSize(&essenceSize));
    checkExpression(essenceSize == expectedEssenceSize, AAFRESULT_TEST_FAILED);

    // Validate that the correct data can be read back.
    readEssenceData(_pEssenceData, (aafDataBuffer_t)_smiley, sizeof(_smiley));
    readEssenceData(_pEssenceData, (aafDataBuffer_t)_frowney, sizeof(_frowney));

    // Make sure that the essence data still references
    // a valid mob.
    check(_pEssenceData->GetFileMob(&_pSourceMob));

    _pSourceMob->Release();
    _pSourceMob = NULL;

    pParameters->Release();
    pParameters = NULL;

    _pEssenceData->Release();
    _pEssenceData = NULL;

    pEssenceData2->Release();
    pEssenceData2 = NULL;

    pNextEssenceData->Release();
    pNextEssenceData = NULL;
  }

  // It is ok to run out of objects.
  checkExpression (AAFRESULT_NO_MORE_OBJECTS == _hr, _hr);
  _hr = AAFRESULT_SUCCESS;

  _pEnumEssenceData->Release();
  _pEnumEssenceData = NULL;
}
开发者ID:mcanthony,项目名称:aaf,代码行数:64,代码来源:CAAFEssenceDataTest.cpp


注:本文中的IAAFHeader::EnumEssenceData方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。