1 /* DirectShow Media Detector object (QEDIT.DLL)
3 * Copyright 2008 Google (Lei Zhang)
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20 #include "qedit_private.h"
21 #include "wine/debug.h"
23 WINE_DEFAULT_DEBUG_CHANNEL(qedit
);
25 typedef struct MediaDetImpl
{
26 const IMediaDetVtbl
*MediaDet_Vtbl
;
30 static ULONG WINAPI
MediaDet_AddRef(IMediaDet
* iface
)
32 MediaDetImpl
*This
= (MediaDetImpl
*)iface
;
33 ULONG refCount
= InterlockedIncrement(&This
->refCount
);
34 TRACE("(%p)->() AddRef from %d\n", This
, refCount
- 1);
38 static ULONG WINAPI
MediaDet_Release(IMediaDet
* iface
)
40 MediaDetImpl
*This
= (MediaDetImpl
*)iface
;
41 ULONG refCount
= InterlockedDecrement(&This
->refCount
);
42 TRACE("(%p)->() Release from %d\n", This
, refCount
+ 1);
53 static HRESULT WINAPI
MediaDet_QueryInterface(IMediaDet
* iface
, REFIID riid
,
56 MediaDetImpl
*This
= (MediaDetImpl
*)iface
;
57 TRACE("(%p)->(%s %p)\n", This
, debugstr_guid(riid
), ppvObject
);
59 if (IsEqualIID(riid
, &IID_IUnknown
) ||
60 IsEqualIID(riid
, &IID_IMediaDet
)) {
61 MediaDet_AddRef(iface
);
66 WARN("(%p, %s,%p): not found\n", This
, debugstr_guid(riid
), ppvObject
);
70 static HRESULT WINAPI
MediaDet_get_Filter(IMediaDet
* iface
, IUnknown
**pVal
)
72 MediaDetImpl
*This
= (MediaDetImpl
*)iface
;
73 FIXME("(%p)->(%p)\n", This
, pVal
);
77 static HRESULT WINAPI
MediaDet_put_Filter(IMediaDet
* iface
, IUnknown
*newVal
)
79 MediaDetImpl
*This
= (MediaDetImpl
*)iface
;
80 FIXME("(%p)->(%p)\n", This
, newVal
);
84 static HRESULT WINAPI
MediaDet_get_OutputStreams(IMediaDet
* iface
, long *pVal
)
86 MediaDetImpl
*This
= (MediaDetImpl
*)iface
;
87 FIXME("(%p)->(%p)\n", This
, pVal
);
91 static HRESULT WINAPI
MediaDet_get_CurrentStream(IMediaDet
* iface
, long *pVal
)
93 MediaDetImpl
*This
= (MediaDetImpl
*)iface
;
94 FIXME("(%p)->(%p)\n", This
, pVal
);
98 static HRESULT WINAPI
MediaDet_put_CurrentStream(IMediaDet
* iface
, long newVal
)
100 MediaDetImpl
*This
= (MediaDetImpl
*)iface
;
101 FIXME("(%p)->(%ld)\n", This
, newVal
);
105 static HRESULT WINAPI
MediaDet_get_StreamType(IMediaDet
* iface
, GUID
*pVal
)
107 MediaDetImpl
*This
= (MediaDetImpl
*)iface
;
108 FIXME("(%p)->(%p)\n", This
, debugstr_guid(pVal
));
112 static HRESULT WINAPI
MediaDet_get_StreamTypeB(IMediaDet
* iface
, BSTR
*pVal
)
114 MediaDetImpl
*This
= (MediaDetImpl
*)iface
;
115 FIXME("(%p)->(%p)\n", This
, pVal
);
119 static HRESULT WINAPI
MediaDet_get_StreamLength(IMediaDet
* iface
, double *pVal
)
121 MediaDetImpl
*This
= (MediaDetImpl
*)iface
;
122 FIXME("(%p)->(%p)\n", This
, pVal
);
126 static HRESULT WINAPI
MediaDet_get_Filename(IMediaDet
* iface
, BSTR
*pVal
)
128 MediaDetImpl
*This
= (MediaDetImpl
*)iface
;
129 FIXME("(%p)->(%p)\n", This
, pVal
);
133 static HRESULT WINAPI
MediaDet_put_Filename(IMediaDet
* iface
, BSTR newVal
)
135 MediaDetImpl
*This
= (MediaDetImpl
*)iface
;
136 FIXME("(%p)->(%p)\n", This
, newVal
);
140 static HRESULT WINAPI
MediaDet_GetBitmapBits(IMediaDet
* iface
,
142 long *pBufferSize
, char *pBuffer
,
143 long Width
, long Height
)
145 MediaDetImpl
*This
= (MediaDetImpl
*)iface
;
146 FIXME("(%p)->(%f %p %p %ld %ld)\n", This
, StreamTime
, pBufferSize
, pBuffer
,
151 static HRESULT WINAPI
MediaDet_WriteBitmapBits(IMediaDet
* iface
,
152 double StreamTime
, long Width
,
153 long Height
, BSTR Filename
)
155 MediaDetImpl
*This
= (MediaDetImpl
*)iface
;
156 FIXME("(%p)->(%f %ld %ld %p)\n", This
, StreamTime
, Width
, Height
, Filename
);
160 static HRESULT WINAPI
MediaDet_get_StreamMediaType(IMediaDet
* iface
,
163 MediaDetImpl
*This
= (MediaDetImpl
*)iface
;
164 FIXME("(%p)->(%p)\n", This
, pVal
);
168 static HRESULT WINAPI
MediaDet_GetSampleGrabber(IMediaDet
* iface
,
169 ISampleGrabber
**ppVal
)
171 MediaDetImpl
*This
= (MediaDetImpl
*)iface
;
172 FIXME("(%p)->(%p)\n", This
, ppVal
);
176 static HRESULT WINAPI
MediaDet_get_FrameRate(IMediaDet
* iface
, double *pVal
)
178 MediaDetImpl
*This
= (MediaDetImpl
*)iface
;
179 FIXME("(%p)->(%p)\n", This
, pVal
);
183 static HRESULT WINAPI
MediaDet_EnterBitmapGrabMode(IMediaDet
* iface
,
186 MediaDetImpl
*This
= (MediaDetImpl
*)iface
;
187 FIXME("(%p)->(%f)\n", This
, SeekTime
);
191 static const IMediaDetVtbl IMediaDet_VTable
=
193 MediaDet_QueryInterface
,
198 MediaDet_get_OutputStreams
,
199 MediaDet_get_CurrentStream
,
200 MediaDet_put_CurrentStream
,
201 MediaDet_get_StreamType
,
202 MediaDet_get_StreamTypeB
,
203 MediaDet_get_StreamLength
,
204 MediaDet_get_Filename
,
205 MediaDet_put_Filename
,
206 MediaDet_GetBitmapBits
,
207 MediaDet_WriteBitmapBits
,
208 MediaDet_get_StreamMediaType
,
209 MediaDet_GetSampleGrabber
,
210 MediaDet_get_FrameRate
,
211 MediaDet_EnterBitmapGrabMode
,
214 HRESULT
MediaDet_create(IUnknown
* pUnkOuter
, LPVOID
* ppv
) {
215 MediaDetImpl
* obj
= NULL
;
217 TRACE("(%p,%p)\n", ppv
, pUnkOuter
);
220 return CLASS_E_NOAGGREGATION
;
222 obj
= CoTaskMemAlloc(sizeof(MediaDetImpl
));
225 return E_OUTOFMEMORY
;
227 ZeroMemory(obj
, sizeof(MediaDetImpl
));
230 obj
->MediaDet_Vtbl
= &IMediaDet_VTable
;