DirectShow - NULL Rendering Example | |||
| |||
이것만 이해하면 DirectShow의 절반은 이해 한 셈이다. #include <dshow.h> #pragma comment(lib, "strmiids.lib") // #pragma comment(lib, "quartz.lib") // usually not required if not using AMGetErrorText function void main(void) { // Initialize the COM Library HRESULT hr = CoInitialize(NULL); if (FAILED(hr)) { AfxMessageBox( "ERROR - Could not initialize COM library"); return; } // Create the filter graph manager and query for interfaces. IGraphBuilder *pGraph = NULL; hr = CoCreateInstance( CLSID_FilterGraph, NULL, CLSCTX_INPROC_SERVER, IID_IGraphBuilder, (void **)&pGraph); if (FAILED(hr)) { AfxMessageBox( "ERROR - Could not create the Filter Graph Manager."); return; } IMediaControl *pControl = NULL; IMediaEvent *pEvent = NULL; hr = pGraph->QueryInterface( IID_IMediaControl, (void **)&pControl); hr = pGraph->QueryInterface( IID_IMediaEvent, (void **)&pEvent); // Build the graph. hr = pGraph->RenderFile( L"D:RESMP3POPPet Shop BoysPet Shop Boys - I wouldn't normally do this kind of thing.mp3", NULL); if (SUCCEEDED(hr)) { // Run the graph. hr = pControl->Run(); if (SUCCEEDED(hr)) { // Wait for completion. long evCode; pEvent->WaitForCompletion( INFINITE, &evCode); // Note: Do not use INFINITE in a real application, because it an block indefinitely. } } pControl->Release(); pEvent->Release(); pGraph->Release(); CoUninitialize(); } Tags: ATL DirectShow DirectX MFC WIN32 윈도우즈 | |||
| |||
| |||
Login for comment |
SIMILAR POSTS 모달리스 다이얼로그의 종료 버튼을 클릭했을 때 종료가 안될때... |
OTHER POSTS IN THE SAME CATEGORY 어떤 파라메터가 넘어왔는지 알아내는 함수 |