示例#1
0
AAFRESULT STDMETHODCALLTYPE
    ImplAAFTypeDef::pvtGetUInt8Array8Type (
      ImplAAFTypeDef ** ppRawTypeDef)
{
  if (! ppRawTypeDef)
	return AAFRESULT_NULL_PARAM;
  
  ImplAAFDictionarySP pDict;
  AAFRESULT hr = GetDictionary(&pDict);
  if (AAFRESULT_FAILED (hr)) return hr;
  
  return pDict->LookupTypeDef (kAAFTypeID_UInt8Array, ppRawTypeDef);
}
示例#2
0
AAFRESULT STDMETHODCALLTYPE
    ImplAAFPropertyDef::GetTypeDef (
      ImplAAFTypeDef ** ppTypeDef) const
{
  if (! ppTypeDef) return AAFRESULT_NULL_PARAM;

  if (! _cachedType)
	{
	  ImplAAFDictionarySP pDict;
	  AAFRESULT hr;

	  hr = GetDictionary(&pDict);
	  if (AAFRESULT_FAILED (hr)) return hr;
	  ASSERTU (pDict);

	  ImplAAFPropertyDef * pNonConstThis =
		  (ImplAAFPropertyDef *) this;
	  aafUID_t typeId = _Type;

	  ImplAAFTypeDef * tmp = 0;
	  hr = pDict->LookupTypeDef (typeId, &tmp);
	  if (AAFRESULT_FAILED (hr))
		return hr;
	  ASSERTU (tmp);
	  if (!_cachedType) {
		pNonConstThis->_cachedType = tmp;
		_cachedType->AcquireReference();
	  }
	  // If lookup caused this to already be put into the cache, just
	  // throw away the current copy (in tmp)
	  tmp->ReleaseReference ();
	  tmp = 0;
	}
  ASSERTU (ppTypeDef);
  *ppTypeDef = _cachedType;
  ASSERTU (*ppTypeDef);
  (*ppTypeDef)->AcquireReference ();

  return AAFRESULT_SUCCESS;
}
示例#3
0
ImplAAFTypeDef* ImplAAFTypeDefExtEnum::NonRefCountedBaseType () const
{
	if(_baseTypeIsCached)
	{
		return _cachedBaseType;
	}
	else
	{	
		ImplAAFTypeDef* result;
		AAFRESULT hr;
		ImplAAFDictionarySP pDict;
		hr = GetDictionary (&pDict);
		ASSERTU (AAFRESULT_SUCCEEDED(hr));
		ASSERTU (pDict);
		
		hr = pDict->LookupTypeDef (kAAFTypeID_AUID, &result);
		ASSERTU (AAFRESULT_SUCCEEDED(hr));
		ASSERTU (result);
 		((ImplAAFTypeDefExtEnum*)this)->_cachedBaseType = result;
 		((ImplAAFTypeDefExtEnum*)this)->_baseTypeIsCached = true;
		return result;
	}
}
示例#4
0
AAFRESULT STDMETHODCALLTYPE
    ImplAAFSourceMob::AppendEdgecodeSlot (aafRational_t  editrate,
                           aafInt32  slotID,
                          aafFrameOffset_t  startEC,
                           aafFrameLength_t  length64,
                           aafFilmType_t  filmKind,
                           aafEdgeType_t  codeFormat,
                           aafEdgecodeHeader_t  header)
{
	ImplAAFSequenceSP ecSequence;
	ImplAAFEdgecodeSP edgecodeClip;
	aafPosition_t	startPos, zeroPos;
	aafLength_t		length, zeroLen;
	ImplAAFTimelineMobSlotSP newSlot, mobSlot;
	aafEdgecode_t	edge;
	ImplAAFDictionarySP pDictionary;

	// Validate film mobs only, return AAFRESULT_FILM_DESC_ONLY
	zeroPos = 0;
	zeroLen = 0;
	XPROTECT()
	{
		CHECK(GetDictionary(&pDictionary));

		CHECK(pDictionary->GetBuiltinDefs()->cdSequence()->
			  CreateInstance ((ImplAAFObject**) &ecSequence));
		CHECK(ecSequence->Initialize(pDictionary->
									 GetBuiltinDefs()->
									 ddEdgecode()));	

		length = length64;
		startPos = startEC;
		edge.startFrame = startPos;
		edge.filmKind = filmKind;
		edge.codeFormat = codeFormat;
		strncpy((char *)edge.header, (char *)header, 8);
		
		CHECK(pDictionary->GetBuiltinDefs()->cdEdgecode()->
			  CreateInstance ((ImplAAFObject**) &edgecodeClip));
		CHECK(edgecodeClip->Initialize(length, edge));	
		
		
		CHECK(ecSequence->AppendComponent(edgecodeClip));
		

		if (FindSlotBySlotID(slotID, (ImplAAFMobSlot **)&mobSlot)
			== AAFRESULT_SUCCESS)
		{
			CHECK(mobSlot->SetSegment(ecSequence));
		}
		else
		{
		CHECK(AppendNewTimelineSlot(editrate, ecSequence, slotID,
									L"Edgecode", zeroPos, &newSlot));
		}

	} /* XPROTECT */
	XEXCEPT
	{
		
	}
	XEND;

	return (AAFRESULT_SUCCESS);
}
示例#5
0
AAFRESULT STDMETHODCALLTYPE
   ImplAAFSourceMob::AppendTimecodeSlot (aafRational_t editrate,
                           aafInt32 slotID,
						   aafTimecode_t startTC,
                           aafFrameLength_t length64)
{
	
	ImplAAFTimecodeSP tccp;
	ImplAAFSequenceSP aSequ;
	aafFrameLength_t maxLength;
	aafPosition_t	zeroPos;
	aafLength_t		length;
	ImplAAFTimelineMobSlotSP	newSlot, mobSlot;
	aafBool			fullLength = kAAFFalse;
	ImplAAFDictionarySP pDictionary;

	//!!!Validate tape mobs only, return AAFRESULT_TAPE_DESC_ONLY
	if(length64 == FULL_LENGTH)
	  {
		 fullLength = kAAFTrue;
		 length64 = 1;
	  }
	else
	  fullLength = kAAFFalse;
	
	zeroPos = 0;
 	length = length64;

	XPROTECT()
	{
		CHECK(GetDictionary(&pDictionary));
		CHECK(pDictionary->GetBuiltinDefs()->cdTimecode()->
			  CreateInstance ((ImplAAFObject**) &tccp));
		tccp->Initialize(length, &startTC);	

			CHECK(pDictionary->GetBuiltinDefs()->cdSequence()->
				  CreateInstance((ImplAAFObject**) &aSequ));
			CHECK(aSequ->Initialize(pDictionary->
									GetBuiltinDefs()->
									ddTimecode()));

			 
			CHECK(aSequ->AppendComponent(tccp));

 		if (FindSlotBySlotID(slotID, (ImplAAFMobSlot **)&mobSlot)
			== AAFRESULT_SUCCESS)
		{
			CHECK(mobSlot->SetSegment(aSequ));

		} /* FindTimecodeSlot */
		else
		{
			CHECK(AppendNewTimelineSlot(editrate, aSequ, slotID,
										L"Timecode", zeroPos, &newSlot));
		}

		if(fullLength)
		{
			CHECK(PvtTimecodeToOffset(startTC.fps, 24, 0, 0, 0, 
											 startTC.drop, &maxLength));
			{
				length = maxLength;
				CHECK(tccp->SetLength(length) );
				/* NOTE: What if the sequence already existed? */
				CHECK(aSequ->SetLength(length) );
			}
		}

	} /* XPROTECT */
	XEXCEPT
	{
		
	}
	XEND;
									
	return (AAFRESULT_SUCCESS);
}