Add missing cast.
[wine] / dlls / quartz / fgraph.h
1 #ifndef WINE_DSHOW_FGRAPH_H
2 #define WINE_DSHOW_FGRAPH_H
3
4 /*
5                 implements CLSID_FilterGraph.
6
7         - At least, the following interfaces should be implemented:
8
9         IUnknown
10                 + IPersist
11                 + IDispatch
12                 + IFilterGraph - IGraphBuilder - IFilterGraph2
13                 + IGraphVersion
14                 + IGraphConfig
15                 + IDispatch - IMediaControl
16                 + IPersist - IMediaFilter
17                 + IDispatch - IMediaEvent - IMediaEventEx
18                 + IMediaEventSink
19                 + IDispatch - IMediaPosition
20                 + IMediaSeeking
21                 + IDispatch - IBasicVideo[2] (pass to a renderer)
22                 + IDispatch - IBasicAudio (pass to a renderer)
23                 + IDispatch - IVideoWindow  (pass to a renderer)
24         (following interfaces are not implemented)
25                 + IMarshal
26                 + IFilterMapper2 - IFilterMapper3
27                 FIXME - Are there any missing interfaces???
28  */
29
30 #include "iunk.h"
31 #include "complist.h"
32
33
34 typedef struct FG_IPersistImpl
35 {
36         ICOM_VFIELD(IPersist);
37 } FG_IPersistImpl;
38
39 typedef struct FG_IDispatchImpl
40 {
41         ICOM_VFIELD(IDispatch);
42 } FG_IDispatchImpl;
43
44 typedef struct FG_IFilterGraph2Impl
45 {
46         ICOM_VFIELD(IFilterGraph2);
47 } FG_IFilterGraph2Impl;
48
49 typedef struct FG_IGraphVersionImpl
50 {
51         ICOM_VFIELD(IGraphVersion);
52 } FG_IGraphVersionImpl;
53
54 typedef struct FG_IGraphConfigImpl
55 {
56         ICOM_VFIELD(IGraphConfig);
57 } FG_IGraphConfigImpl;
58
59 typedef struct FG_IMediaControlImpl
60 {
61         ICOM_VFIELD(IMediaControl);
62 } FG_IMediaControlImpl;
63
64 typedef struct FG_IMediaFilterImpl
65 {
66         ICOM_VFIELD(IMediaFilter);
67 } FG_IMediaFilterImpl;
68
69 typedef struct FG_IMediaEventImpl
70 {
71         ICOM_VFIELD(IMediaEventEx);
72 } FG_IMediaEventImpl;
73
74 typedef struct FG_IMediaEventSinkImpl
75 {
76         ICOM_VFIELD(IMediaEventSink);
77 } FG_IMediaEventSinkImpl;
78
79 typedef struct FG_IMediaPositionImpl
80 {
81         ICOM_VFIELD(IMediaPosition);
82 } FG_IMediaPositionImpl;
83
84 typedef struct FG_IMediaSeekingImpl
85 {
86         ICOM_VFIELD(IMediaSeeking);
87 } FG_IMediaSeekingImpl;
88
89 typedef struct FG_IBasicVideoImpl
90 {
91         ICOM_VFIELD(IBasicVideo2);
92 } FG_IBasicVideoImpl;
93
94 typedef struct FG_IBasicAudioImpl
95 {
96         ICOM_VFIELD(IBasicAudio);
97 } FG_IBasicAudioImpl;
98
99 typedef struct FG_IVideoWindowImpl
100 {
101         ICOM_VFIELD(IVideoWindow);
102 } FG_IVideoWindowImpl;
103
104 typedef struct FilterGraph_MEDIAEVENT   FilterGraph_MEDIAEVENT;
105
106 typedef struct CFilterGraph
107 {
108         QUARTZ_IUnkImpl unk;
109         FG_IPersistImpl persist;
110         FG_IDispatchImpl        disp;
111         FG_IFilterGraph2Impl    fgraph;
112         FG_IGraphVersionImpl    graphversion;
113         FG_IGraphConfigImpl     grphconf;
114         FG_IMediaControlImpl    mediacontrol;
115         FG_IMediaFilterImpl     mediafilter;
116         FG_IMediaEventImpl      mediaevent;
117         FG_IMediaEventSinkImpl  mediaeventsink;
118         FG_IMediaPositionImpl   mediaposition;
119         FG_IMediaSeekingImpl    mediaseeking;
120         FG_IBasicVideoImpl      basvid;
121         FG_IBasicAudioImpl      basaud;
122         FG_IVideoWindowImpl     vidwin;
123
124         /* IDispatch fields. */
125         /* IFilterGraph2 fields. */
126         QUARTZ_CompList*        m_pFilterList;
127         /* IGraphVersion fields. */
128         LONG    m_lGraphVersion;
129         /* IMediaControl fields. */
130         /* IMediaFilter fields. */
131         CRITICAL_SECTION        m_csGraphState;
132         FILTER_STATE    m_stateGraph; /* must NOT accessed directly! */
133         CRITICAL_SECTION        m_csClock;
134         IReferenceClock*        m_pClock;
135         /* IMediaEvent fields. */
136         HANDLE  m_hMediaEvent;
137         CRITICAL_SECTION        m_csMediaEvents;
138         FilterGraph_MEDIAEVENT* m_pMediaEvents;
139         ULONG   m_cbMediaEventsPut;
140         ULONG   m_cbMediaEventsGet;
141         ULONG   m_cbMediaEventsMax;
142         HWND    m_hwndEventNotify;
143         long    m_lEventNotifyMsg;
144         LONG_PTR        m_lEventNotifyParam;
145         long    m_lEventNotifyFlags;
146         /* IMediaEventSink fields. */
147         /* IMediaPosition fields. */
148         /* IMediaSeeking fields. */
149         /* IBasicVideo2 fields. */
150         /* IBasicAudio fields. */
151         /* IVideoWindow fields. */
152 } CFilterGraph;
153
154 #define CFilterGraph_THIS(iface,member)         CFilterGraph*   This = ((CFilterGraph*)(((char*)iface)-offsetof(CFilterGraph,member)))
155 #define CFilterGraph_IPersist(th)               ((IPersist*)&((th)->persist))
156 #define CFilterGraph_IDispatch(th)              ((IDispatch*)&((th)->disp))
157 #define CFilterGraph_IFilterGraph2(th)          ((IFilterGraph2*)&((th)->fgraph))
158 #define CFilterGraph_IMediaControl(th)          ((IMediaControl*)&((th)->mediacontrol))
159 #define CFilterGraph_IMediaFilter(th)           ((IMediaFilter*)&((th)->mediafilter))
160 #define CFilterGraph_IMediaEventEx(th)          ((IMediaEventEx*)&((th)->mediaevent))
161 #define CFilterGraph_IMediaEventSink(th)                ((IMediaEventSink*)&((th)->mediaeventsink))
162
163 HRESULT QUARTZ_CreateFilterGraph(IUnknown* punkOuter,void** ppobj);
164
165 HRESULT CFilterGraph_InitIPersist( CFilterGraph* pfg );
166 void CFilterGraph_UninitIPersist( CFilterGraph* pfg );
167 HRESULT CFilterGraph_InitIDispatch( CFilterGraph* pfg );
168 void CFilterGraph_UninitIDispatch( CFilterGraph* pfg );
169 HRESULT CFilterGraph_InitIFilterGraph2( CFilterGraph* pfg );
170 void CFilterGraph_UninitIFilterGraph2( CFilterGraph* pfg );
171 HRESULT CFilterGraph_InitIGraphVersion( CFilterGraph* pfg );
172 void CFilterGraph_UninitIGraphVersion( CFilterGraph* pfg );
173 HRESULT CFilterGraph_InitIGraphConfig( CFilterGraph* pfg );
174 void CFilterGraph_UninitIGraphConfig( CFilterGraph* pfg );
175 HRESULT CFilterGraph_InitIMediaControl( CFilterGraph* pfg );
176 void CFilterGraph_UninitIMediaControl( CFilterGraph* pfg );
177 HRESULT CFilterGraph_InitIMediaFilter( CFilterGraph* pfg );
178 void CFilterGraph_UninitIMediaFilter( CFilterGraph* pfg );
179 HRESULT CFilterGraph_InitIMediaEventEx( CFilterGraph* pfg );
180 void CFilterGraph_UninitIMediaEventEx( CFilterGraph* pfg );
181 HRESULT CFilterGraph_InitIMediaEventSink( CFilterGraph* pfg );
182 void CFilterGraph_UninitIMediaEventSink( CFilterGraph* pfg );
183 HRESULT CFilterGraph_InitIMediaPosition( CFilterGraph* pfg );
184 void CFilterGraph_UninitIMediaPosition( CFilterGraph* pfg );
185 HRESULT CFilterGraph_InitIMediaSeeking( CFilterGraph* pfg );
186 void CFilterGraph_UninitIMediaSeeking( CFilterGraph* pfg );
187 HRESULT CFilterGraph_InitIBasicVideo2( CFilterGraph* pfg );
188 void CFilterGraph_UninitIBasicVideo2( CFilterGraph* pfg );
189 HRESULT CFilterGraph_InitIBasicAudio( CFilterGraph* pfg );
190 void CFilterGraph_UninitIBasicAudio( CFilterGraph* pfg );
191 HRESULT CFilterGraph_InitIVideoWindow( CFilterGraph* pfg );
192 void CFilterGraph_UninitIVideoWindow( CFilterGraph* pfg );
193
194
195 #endif  /* WINE_DSHOW_FGRAPH_H */