-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdirectshow.h
47 lines (44 loc) · 1.22 KB
/
directshow.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/////////////////////////////////////////////////////////////////
//MediaControl 播放类:基于directshow接口的
//播放音视频文件的类
//
//BY yuqinbin
/////////////////////////////////////////////////////////////////
#pragma once
#include "dshow.h"
#define WM_GRAPHNOTIFY WM_USER + 321
class MediaControl
{
public:
MediaControl(void);
~MediaControl(void);
private:
IGraphBuilder *m_pGB;
IMediaControl *m_pMC;
IMediaEventEx *m_pME;
IVideoWindow *m_pVW;
IBasicVideo *m_pBV;
IBasicAudio *m_pBA;
IMediaSeeking *m_pMS;
IMediaPosition *m_pMP;
HWND m_hWindow;
long m_volume;
public:
void DshowInit(void);
void DshowUninit(void);
int DshowCreate(HWND inWindow,TCHAR *strFileName,HWND hNotifyWnd);
BOOL DshowPlay();
BOOL DshowPause();
BOOL DshowStop();
void DshowFitWindow(HWND inWindow);
void DshowInitWindow(HWND inWindow);
BOOL DshowGetMediaEvent(long *lEventCode);
void DshowSetNotifyWindow(HWND hNotifyWnd);
BOOL DshowSetPositions(DWORD dwPos);
LONGLONG DshowGetCurrentPos(DWORD &dwPos);
BOOL DshowGetDuration(DWORD &dwLength);
BOOL DshowSetAudioVolume(long nValue);
long DshowGetAudioVolume();
BOOL DshowGetCurrentPosMESL(LONGLONG & dwPos);
BOOL DshowFullScreen();
};