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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<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 112<br />

Código fu<strong>en</strong>te <strong>de</strong> la aplicación<br />

//------------------------------------------------------------------------------<br />

// Archivo: PlayWnd.cpp<br />

//<br />

// Descripcion: Reproductor <strong>de</strong> audio y vi<strong>de</strong>o que utiliza las librerias DirectShow<br />

// Pausa, <strong>de</strong>t<strong>en</strong>er, sil<strong>en</strong>cio, y cambio apantalla completa pue<strong>de</strong>n llevarse<br />

// a cabo mediante la barra <strong>de</strong> m<strong>en</strong>us o teclas.<br />

//<br />

//------------------------------------------------------------------------------<br />

#inclu<strong>de</strong> <br />

#inclu<strong>de</strong> <br />

#inclu<strong>de</strong> <br />

#inclu<strong>de</strong> <br />

#inclu<strong>de</strong> <br />

#inclu<strong>de</strong> //Es importante incluir antes <strong>de</strong> las <strong>de</strong>finir los GUIDS <strong>en</strong> "ezuids.h"<br />

// De lo contrario marca el error "error<br />

LNK2001: unresolved external symbol"<br />

#inclu<strong>de</strong> "ezuids.h" // Lo incluí para que reconozca el filtro ezrgb<br />

#inclu<strong>de</strong> "playwnd.h"<br />

//<br />

// Para permitir el registro <strong>de</strong> este grafico <strong>de</strong> filtros se <strong>de</strong>fine REGISTER_FILTERGRAPH.<br />

//<br />

#<strong>de</strong>fine REGISTER_FILTERGRAPH<br />

//<br />

// Variables globales<br />

//<br />

HWND ghApp=0;<br />

HINSTANCE ghInst;<br />

TCHAR g_szFileName[MAX_PATH]={0};<br />

BOOL g_bAudioOnly=FALSE;<br />

LONG g_lVolume=VOLUME_FULL;<br />

DWORD g_dwGraphRegister=0;<br />

PLAYSTATE g_psCurr<strong>en</strong>t=Stopped;<br />

// OJO CLSID CLSID_EZrgb24;<br />

// Interfaces DirectShow<br />

IGraphBuil<strong>de</strong>r *pGB = NULL;<br />

IMediaControl *pMC = NULL;<br />

IMediaEv<strong>en</strong>tEx *pME = NULL;<br />

IVi<strong>de</strong>oWindow *pVW = NULL;<br />

IBasicAudio *pBA = NULL;<br />

IBasicVi<strong>de</strong>o *pBV = NULL;<br />

IMediaSeeking *pMS = NULL;<br />

IBaseFilter *pFX = NULL; // Interfaz para el manejo <strong>de</strong>l nuevo filtro F1<br />

IPin *pOutPin = NULL; //Interfaz <strong>de</strong>l Pin <strong>de</strong> salida<br />

IPin *pInputPin = NULL; //Interfaz <strong>de</strong>l pin <strong>de</strong> <strong>en</strong>trada<br />

ISpecifyPropertyPages *pProp; // Para exponer la pagina propietaria<br />

ICaptureGraphBuil<strong>de</strong>r2 *pBuil<strong>de</strong>r = NULL; //Para la TV<br />

// Función que inicia la reproducción <strong>de</strong>l archivo multimedia<br />

HRESULT PlayMovieInWindow(LPTSTR szFile)<br />

{<br />

WCHAR wFile[MAX_PATH];<br />

HRESULT hr;<br />

IFilterGraph *pGraph = NULL;<br />

//CComPtr pSysDevEnum; // Se añadió al ultimo<br />

pGraph = pGB;

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

Saved successfully!

Ooh no, something went wrong!