Skip to content

Instantly share code, notes, and snippets.

@toya33
Created April 20, 2015 14:41
Show Gist options
  • Save toya33/51b9e00f2ba98495c1a6 to your computer and use it in GitHub Desktop.
Save toya33/51b9e00f2ba98495c1a6 to your computer and use it in GitHub Desktop.
// DirectShowTest_1.cpp : コンソール アプリケーションのエントリ ポイントを定義します。
//
#include "stdafx.h"
#include <dshow.h>
#define FILENAME L"D:\\sample\\CIMG0145.AVI"
int _tmain(int argc, _TCHAR* argv[])
{
IGraphBuilder *pGraphBuilder;
IMediaControl *pMediaControl;
CoInitialize(NULL);
CoCreateInstance(CLSID_FilterGraph,
NULL,
CLSCTX_INPROC,
IID_IGraphBuilder,
(LPVOID *)&pGraphBuilder);
pGraphBuilder->QueryInterface(IID_IMediaControl,
(LPVOID *)&pMediaControl);
pMediaControl->RenderFile(FILENAME);
pMediaControl->Run();
MessageBox(NULL,
"Block Execution" ,
"Block",
MB_OK);
pMediaControl->Release();
pGraphBuilder->Release();
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment