28.11.2012 Views

Procesamiento digital de video en tiempo real y - Maestría en ...

Procesamiento digital de video en tiempo real y - Maestría en ...

Procesamiento digital de video en tiempo real y - Maestría en ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Procesami<strong>en</strong>to</strong> <strong>digital</strong> <strong>de</strong> vi<strong>de</strong>o <strong>en</strong> <strong>tiempo</strong> <strong>real</strong> y “vi<strong>de</strong>o wall” con la PC 99<br />

return NOERROR;<br />

} // Transform<br />

//<br />

// Copy<br />

//<br />

// Hace <strong>en</strong> el <strong>de</strong>stino una copia i<strong>de</strong>ntica <strong>de</strong> la fu<strong>en</strong>te Make<br />

//<br />

HRESULT CEZrgb24::Copy(IMediaSample *pSource, IMediaSample *pDest) const<br />

{<br />

// Copia los datos <strong>en</strong> la muestra<br />

BYTE *pSourceBuffer, *pDestBuffer;<br />

long lSourceSize = pSource->GetActualDataL<strong>en</strong>gth();<br />

#if<strong>de</strong>f DEBUG<br />

long lDestSize = pDest->GetSize();<br />

ASSERT(lDestSize >= lSourceSize);<br />

#<strong>en</strong>dif<br />

pSource->GetPointer(&pSourceBuffer);<br />

pDest->GetPointer(&pDestBuffer);<br />

CopyMemory( (PVOID) pDestBuffer,(PVOID) pSourceBuffer,lSourceSize);<br />

// Copia los <strong>tiempo</strong>s <strong>de</strong> la muestra<br />

REFERENCE_TIME TimeStart, TimeEnd;<br />

if (NOERROR == pSource->GetTime(&TimeStart, &TimeEnd)) {<br />

pDest->SetTime(&TimeStart, &TimeEnd);<br />

}<br />

LONGLONG MediaStart, MediaEnd;<br />

if (pSource->GetMediaTime(&MediaStart,&MediaEnd) == NOERROR) {<br />

pDest->SetMediaTime(&MediaStart,&MediaEnd);<br />

}<br />

// Copia los puntos propietarios Sync<br />

HRESULT hr = pSource->IsSyncPoint();<br />

if (hr == S_OK) {<br />

pDest->SetSyncPoint(TRUE);<br />

}<br />

else if (hr == S_FALSE) {<br />

pDest->SetSyncPoint(FALSE);<br />

}<br />

else { // un error inesperado ocurrió...<br />

return E_UNEXPECTED;<br />

}<br />

// Copia el tipo <strong>de</strong> media<br />

AM_MEDIA_TYPE *pMediaType;<br />

pSource->GetMediaType(&pMediaType);<br />

pDest->SetMediaType(pMediaType);<br />

DeleteMediaType(pMediaType);<br />

// Copia las propieda<strong>de</strong>s preroll<br />

hr = pSource->IsPreroll();<br />

if (hr == S_OK) {<br />

pDest->SetPreroll(TRUE);<br />

}<br />

else if (hr == S_FALSE) {<br />

pDest->SetPreroll(FALSE);<br />

}<br />

else { // un error inesperado ocurrió...<br />

return E_UNEXPECTED;<br />

}

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!