Salut,
La lib. DirectShow est la plus performante.
Elle lit tout les formats et est assez simple d'utilisation (COM)
Dans le style :
#include <dshow.h>
// Les interfaces utiles
IGraphBuilder *g_pGraphBuilder;
IMediaControl *g_pMediaControl;
IMediaSeeking *g_pMediaSeeking;
IBaseFilter *g_pSourceCurrent;
IBaseFilter *g_pSourceNext;
IMediaEventEx *g_pEvent;
IVideoWindow *g_pVidWin;
// Le graph DirectShow
CoCreateInstance(CLSID_FilterGraph, NULL, CLSCTX_INPROC, IID_IGraphBuilder,reinterpret_cast<void **>(&g_pGraphBuilder));
// IMediaControl Interface
g_pGraphBuilder->QueryInterface(IID_IMediaControl, reinterpret_cast<void **>(&g_pMediaControl));
// IMediaSeeking Interface
g_pGraphBuilder->QueryInterface(IID_IMediaSeeking, reinterpret_cast<void **>(&g_pMediaSeeking));
// Un rendu Direct
g_pGraphBuilder->RenderFile(pFile, NULL);
g_pMediaControl->Run();
g_pEvent->WaitForCompletion(INFINITE, &evCode);
// Ou avec un dialog perso
if( CreateMediaDialog(pParent, sTitre, cx, cy) ) // CreateDialogIndirectParam
{
g_pGraphBuilder->RenderFile(pFile, NULL);
g_pGraphBuilder->QueryInterface(IID_IVideoWindow, (void **)&g_pVidWin);
// placer l'overlay DirectShow dans la fenêtre principale
g_pVidWin->put_Owner((OAHWND)g_hwndMedia);
// mettre en place la redirection des événements vers la fenêtre principale
g_pEvent->SetNotifyWindow((OAHWND)g_hwndMedia, WM_GRAPHEVENT, 0);
g_pMediaControl->Run();
}
Sinon y'a les AVIStream
Mais beaucoup plus limité
#include <mmsystem.h>
#include <vfw.h>
PAVISTREAM m_pasMovie;
AVISTREAMINFO m_asiMovie;
AVIStreamOpenFromFile(&m_pasMovie, lpszFilename, streamtypeVIDEO, 0, OF_READ,NULL);
// ect ...
bye...