ReactOS 0.4.15-dev-8127-g6338913
audiorecord.c File Reference
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "wtypes.h"
#include "wingdi.h"
#include "winuser.h"
#include "dshow.h"
#include "qcap_main.h"
#include "wine/debug.h"
Include dependency graph for audiorecord.c:

Go to the source code of this file.

Classes

struct  AudioRecord
 

Macros

#define COBJMACROS
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (qcap)
 
static AudioRecordimpl_from_IUnknown (IUnknown *iface)
 
static AudioRecordimpl_from_BaseFilter (BaseFilter *filter)
 
static AudioRecordimpl_from_IBaseFilter (IBaseFilter *iface)
 
static AudioRecordimpl_from_IPersistPropertyBag (IPersistPropertyBag *iface)
 
static HRESULT WINAPI Unknown_QueryInterface (IUnknown *iface, REFIID riid, LPVOID *ppv)
 
static ULONG WINAPI Unknown_AddRef (IUnknown *iface)
 
static ULONG WINAPI Unknown_Release (IUnknown *iface)
 
static HRESULT WINAPI AudioRecord_QueryInterface (IBaseFilter *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI AudioRecord_AddRef (IBaseFilter *iface)
 
static ULONG WINAPI AudioRecord_Release (IBaseFilter *iface)
 
static HRESULT WINAPI AudioRecord_Stop (IBaseFilter *iface)
 
static HRESULT WINAPI AudioRecord_Pause (IBaseFilter *iface)
 
static HRESULT WINAPI AudioRecord_Run (IBaseFilter *iface, REFERENCE_TIME tStart)
 
static HRESULT WINAPI AudioRecord_FindPin (IBaseFilter *iface, LPCWSTR Id, IPin **ppPin)
 
static IPin *WINAPI AudioRecord_GetPin (BaseFilter *iface, int pos)
 
static LONG WINAPI AudioRecord_GetPinCount (BaseFilter *iface)
 
static HRESULT WINAPI PPB_QueryInterface (IPersistPropertyBag *iface, REFIID riid, LPVOID *ppv)
 
static ULONG WINAPI PPB_AddRef (IPersistPropertyBag *iface)
 
static ULONG WINAPI PPB_Release (IPersistPropertyBag *iface)
 
static HRESULT WINAPI PPB_GetClassID (IPersistPropertyBag *iface, CLSID *pClassID)
 
static HRESULT WINAPI PPB_InitNew (IPersistPropertyBag *iface)
 
static HRESULT WINAPI PPB_Load (IPersistPropertyBag *iface, IPropertyBag *pPropBag, IErrorLog *pErrorLog)
 
static HRESULT WINAPI PPB_Save (IPersistPropertyBag *iface, IPropertyBag *pPropBag, BOOL fClearDirty, BOOL fSaveAllProperties)
 
IUnknown *WINAPI QCAP_createAudioCaptureFilter (IUnknown *outer, HRESULT *phr)
 

Variables

static const IUnknownVtbl UnknownVtbl
 
static const IBaseFilterVtbl AudioRecordVtbl
 
static const BaseFilterFuncTable AudioRecordFuncs
 
static const IPersistPropertyBagVtbl PersistPropertyBagVtbl
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 22 of file audiorecord.c.

Function Documentation

◆ AudioRecord_AddRef()

static ULONG WINAPI AudioRecord_AddRef ( IBaseFilter iface)
static

Definition at line 122 of file audiorecord.c.

123{
125 return IUnknown_AddRef(This->outerUnknown);
126}
static AudioRecord * impl_from_IBaseFilter(IBaseFilter *iface)
Definition: audiorecord.c:55

◆ AudioRecord_FindPin()

static HRESULT WINAPI AudioRecord_FindPin ( IBaseFilter iface,
LPCWSTR  Id,
IPin **  ppPin 
)
static

Definition at line 155 of file audiorecord.c.

156{
158 FIXME("(%p)->(%s, %p): stub\n", This, debugstr_w(Id), ppPin);
159 return E_NOTIMPL;
160}
DWORD Id
#define FIXME(fmt,...)
Definition: debug.h:114
#define E_NOTIMPL
Definition: ddrawi.h:99
#define debugstr_w
Definition: kernel32.h:32

◆ AudioRecord_GetPin()

static IPin *WINAPI AudioRecord_GetPin ( BaseFilter iface,
int  pos 
)
static

Definition at line 180 of file audiorecord.c.

181{
183 FIXME("(%p, %d): stub\n", This, pos);
184 return NULL;
185}
static AudioRecord * impl_from_BaseFilter(BaseFilter *filter)
Definition: audiorecord.c:50
#define NULL
Definition: types.h:112

◆ AudioRecord_GetPinCount()

static LONG WINAPI AudioRecord_GetPinCount ( BaseFilter iface)
static

Definition at line 187 of file audiorecord.c.

188{
190 FIXME("(%p): stub\n", This);
191 return 0;
192}

◆ AudioRecord_Pause()

static HRESULT WINAPI AudioRecord_Pause ( IBaseFilter iface)
static

Definition at line 141 of file audiorecord.c.

142{
144 FIXME("(%p): stub\n", This);
145 return E_NOTIMPL;
146}

◆ AudioRecord_QueryInterface()

static HRESULT WINAPI AudioRecord_QueryInterface ( IBaseFilter iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 116 of file audiorecord.c.

117{
119 return IUnknown_QueryInterface(This->outerUnknown, riid, ppv);
120}
REFIID riid
Definition: atlbase.h:39
REFIID LPVOID * ppv
Definition: atlbase.h:39

◆ AudioRecord_Release()

static ULONG WINAPI AudioRecord_Release ( IBaseFilter iface)
static

Definition at line 128 of file audiorecord.c.

129{
131 return IUnknown_Release(This->outerUnknown);
132}

◆ AudioRecord_Run()

static HRESULT WINAPI AudioRecord_Run ( IBaseFilter iface,
REFERENCE_TIME  tStart 
)
static

Definition at line 148 of file audiorecord.c.

149{
151 FIXME("(%p, %s): stub\n", This, wine_dbgstr_longlong(tStart));
152 return E_NOTIMPL;
153}
static __inline const char * wine_dbgstr_longlong(ULONGLONG ll)
Definition: compat.h:49

◆ AudioRecord_Stop()

static HRESULT WINAPI AudioRecord_Stop ( IBaseFilter iface)
static

Definition at line 134 of file audiorecord.c.

135{
137 FIXME("(%p): stub\n", This);
138 return E_NOTIMPL;
139}

◆ impl_from_BaseFilter()

static AudioRecord * impl_from_BaseFilter ( BaseFilter filter)
inlinestatic

Definition at line 50 of file audiorecord.c.

51{
53}
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
Definition: glext.h:7005
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260

Referenced by AudioRecord_GetPin(), AudioRecord_GetPinCount(), and impl_from_IBaseFilter().

◆ impl_from_IBaseFilter()

static AudioRecord * impl_from_IBaseFilter ( IBaseFilter iface)
inlinestatic

◆ impl_from_IPersistPropertyBag()

static AudioRecord * impl_from_IPersistPropertyBag ( IPersistPropertyBag iface)
inlinestatic

Definition at line 61 of file audiorecord.c.

62{
63 return CONTAINING_RECORD(iface, AudioRecord, IPersistPropertyBag_iface);
64}

Referenced by PPB_AddRef(), PPB_GetClassID(), PPB_InitNew(), PPB_Load(), PPB_QueryInterface(), PPB_Release(), and PPB_Save().

◆ impl_from_IUnknown()

static AudioRecord * impl_from_IUnknown ( IUnknown iface)
inlinestatic

Definition at line 45 of file audiorecord.c.

46{
47 return CONTAINING_RECORD(iface, AudioRecord, IUnknown_iface);
48}

Referenced by Unknown_AddRef(), Unknown_QueryInterface(), and Unknown_Release().

◆ PPB_AddRef()

static ULONG WINAPI PPB_AddRef ( IPersistPropertyBag iface)
static

Definition at line 205 of file audiorecord.c.

206{
208 return IUnknown_AddRef(This->outerUnknown);
209}
static AudioRecord * impl_from_IPersistPropertyBag(IPersistPropertyBag *iface)
Definition: audiorecord.c:61

◆ PPB_GetClassID()

static HRESULT WINAPI PPB_GetClassID ( IPersistPropertyBag iface,
CLSID pClassID 
)
static

Definition at line 217 of file audiorecord.c.

218{
220 TRACE("(%p/%p)->(%p)\n", iface, This, pClassID);
221 return IBaseFilter_GetClassID(&This->filter.IBaseFilter_iface, pClassID);
222}
#define TRACE(s)
Definition: solgame.cpp:4

◆ PPB_InitNew()

static HRESULT WINAPI PPB_InitNew ( IPersistPropertyBag iface)
static

Definition at line 224 of file audiorecord.c.

225{
227 FIXME("(%p/%p)->(): stub\n", iface, This);
228 return E_NOTIMPL;
229}

◆ PPB_Load()

static HRESULT WINAPI PPB_Load ( IPersistPropertyBag iface,
IPropertyBag pPropBag,
IErrorLog pErrorLog 
)
static

Definition at line 231 of file audiorecord.c.

233{
235 HRESULT hr;
236 VARIANT var;
237 static const WCHAR WaveInIDW[] = {'W','a','v','e','I','n','I','D',0};
238
239 TRACE("(%p/%p)->(%p, %p)\n", iface, This, pPropBag, pErrorLog);
240
241 V_VT(&var) = VT_I4;
242 hr = IPropertyBag_Read(pPropBag, WaveInIDW, &var, pErrorLog);
243 if (SUCCEEDED(hr))
244 {
245 FIXME("FIXME: implement opening waveIn device %d\n", V_I4(&var));
246 }
247
248 return hr;
249}
@ VT_I4
Definition: compat.h:2298
#define SUCCEEDED(hr)
Definition: intsafe.h:50
const char * var
Definition: shader.c:5666
#define V_VT(A)
Definition: oleauto.h:211
#define V_I4(A)
Definition: oleauto.h:247
HRESULT hr
Definition: shlfolder.c:183
__wchar_t WCHAR
Definition: xmlstorage.h:180

◆ PPB_QueryInterface()

static HRESULT WINAPI PPB_QueryInterface ( IPersistPropertyBag iface,
REFIID  riid,
LPVOID ppv 
)
static

Definition at line 199 of file audiorecord.c.

200{
202 return IUnknown_QueryInterface(This->outerUnknown, riid, ppv);
203}

◆ PPB_Release()

static ULONG WINAPI PPB_Release ( IPersistPropertyBag iface)
static

Definition at line 211 of file audiorecord.c.

212{
214 return IUnknown_Release(This->outerUnknown);
215}

◆ PPB_Save()

static HRESULT WINAPI PPB_Save ( IPersistPropertyBag iface,
IPropertyBag pPropBag,
BOOL  fClearDirty,
BOOL  fSaveAllProperties 
)
static

Definition at line 251 of file audiorecord.c.

253{
255 FIXME("(%p/%p)->(%p, %u, %u): stub\n", iface, This, pPropBag, fClearDirty, fSaveAllProperties);
256 return E_NOTIMPL;
257}

◆ QCAP_createAudioCaptureFilter()

IUnknown *WINAPI QCAP_createAudioCaptureFilter ( IUnknown outer,
HRESULT phr 
)

Definition at line 270 of file audiorecord.c.

271{
272 HRESULT hr;
274
275 FIXME("(%p, %p): the entire CLSID_AudioRecord implementation is just stubs\n", outer, phr);
276
277 This = CoTaskMemAlloc(sizeof(*This));
278 if (This == NULL) {
280 goto end;
281 }
282 memset(This, 0, sizeof(*This));
283 This->IUnknown_iface.lpVtbl = &UnknownVtbl;
284 This->IPersistPropertyBag_iface.lpVtbl = &PersistPropertyBagVtbl;
285 if (outer)
286 This->outerUnknown = outer;
287 else
288 This->outerUnknown = &This->IUnknown_iface;
289
290 hr = BaseFilter_Init(&This->filter, &AudioRecordVtbl, &CLSID_AudioRecord,
291 (DWORD_PTR)(__FILE__ ": AudioRecord.csFilter"), &AudioRecordFuncs);
292
293end:
294 *phr = hr;
295 if (SUCCEEDED(hr)) {
296 return (IUnknown*)&This->filter.IBaseFilter_iface;
297 } else {
298 if (This)
299 IBaseFilter_Release(&This->filter.IBaseFilter_iface);
300 return NULL;
301 }
302}
static const IUnknownVtbl UnknownVtbl
Definition: audiorecord.c:110
static const BaseFilterFuncTable AudioRecordFuncs
Definition: audiorecord.c:194
static const IBaseFilterVtbl AudioRecordVtbl
Definition: audiorecord.c:162
static const IPersistPropertyBagVtbl PersistPropertyBagVtbl
Definition: audiorecord.c:259
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
GLuint GLuint end
Definition: gl.h:1545
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
Definition: ifs.c:426
#define memset(x, y, z)
Definition: compat.h:39
HRESULT WINAPI BaseFilter_Init(BaseFilter *This, const IBaseFilterVtbl *Vtbl, const CLSID *pClsid, DWORD_PTR DebugInfo, const BaseFilterFuncTable *pBaseFuncsTable)
Definition: filter.c:196
uint32_t DWORD_PTR
Definition: typedefs.h:65

◆ Unknown_AddRef()

static ULONG WINAPI Unknown_AddRef ( IUnknown iface)
static

Definition at line 93 of file audiorecord.c.

94{
96 return BaseFilterImpl_AddRef(&This->filter.IBaseFilter_iface);
97}
static AudioRecord * impl_from_IUnknown(IUnknown *iface)
Definition: audiorecord.c:45
ULONG WINAPI BaseFilterImpl_AddRef(IBaseFilter *iface)
Definition: filter.c:54

◆ Unknown_QueryInterface()

static HRESULT WINAPI Unknown_QueryInterface ( IUnknown iface,
REFIID  riid,
LPVOID ppv 
)
static

Definition at line 66 of file audiorecord.c.

67{
70 TRACE("(%p)->(IID_IUnknown, %p)\n", This, ppv);
71 *ppv = &This->filter.IBaseFilter_iface;
72 } else if (IsEqualIID(riid, &IID_IPersist)) {
73 TRACE("(%p)->(IID_IPersist, %p)\n", This, ppv);
74 *ppv = &This->filter.IBaseFilter_iface;
75 } else if (IsEqualIID(riid, &IID_IMediaFilter)) {
76 TRACE("(%p)->(IID_IMediaFilter, %p)\n", This, ppv);
77 *ppv = &This->filter.IBaseFilter_iface;
78 } else if (IsEqualIID(riid, &IID_IBaseFilter)) {
79 TRACE("(%p)->(IID_IBaseFilter, %p)\n", This, ppv);
80 *ppv = &This->filter.IBaseFilter_iface;
82 TRACE("(%p)->(IID_IPersistPropertyBag, %p)\n", This, ppv);
83 *ppv = &This->IPersistPropertyBag_iface;
84 } else {
85 FIXME("(%p): no interface for %s\n", This, debugstr_guid(riid));
86 *ppv = NULL;
87 return E_NOINTERFACE;
88 }
89 IUnknown_AddRef((IUnknown*)*ppv);
90 return S_OK;
91}
const GUID IID_IUnknown
const GUID IID_IBaseFilter
#define S_OK
Definition: intsafe.h:52
#define debugstr_guid
Definition: kernel32.h:35
const GUID IID_IPersist
Definition: proxy.cpp:14
const GUID IID_IPersistPropertyBag
Definition: proxy.cpp:11
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95
#define E_NOINTERFACE
Definition: winerror.h:2364

◆ Unknown_Release()

static ULONG WINAPI Unknown_Release ( IUnknown iface)
static

Definition at line 99 of file audiorecord.c.

100{
102 ULONG ref = BaseFilterImpl_Release(&This->filter.IBaseFilter_iface);
103 TRACE("(%p/%p)->() ref=%d\n", iface, This, ref);
104 if (!ref) {
106 }
107 return ref;
108}
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:442
ULONG WINAPI BaseFilterImpl_Release(IBaseFilter *iface)
Definition: filter.c:64
Definition: send.c:48
uint32_t ULONG
Definition: typedefs.h:59

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( qcap  )

Variable Documentation

◆ AudioRecordFuncs

const BaseFilterFuncTable AudioRecordFuncs
static
Initial value:
= {
}
static LONG WINAPI AudioRecord_GetPinCount(BaseFilter *iface)
Definition: audiorecord.c:187
static IPin *WINAPI AudioRecord_GetPin(BaseFilter *iface, int pos)
Definition: audiorecord.c:180

Definition at line 194 of file audiorecord.c.

Referenced by QCAP_createAudioCaptureFilter().

◆ AudioRecordVtbl

const IBaseFilterVtbl AudioRecordVtbl
static
Initial value:
= {
}
static HRESULT WINAPI AudioRecord_Run(IBaseFilter *iface, REFERENCE_TIME tStart)
Definition: audiorecord.c:148
static ULONG WINAPI AudioRecord_AddRef(IBaseFilter *iface)
Definition: audiorecord.c:122
static HRESULT WINAPI AudioRecord_FindPin(IBaseFilter *iface, LPCWSTR Id, IPin **ppPin)
Definition: audiorecord.c:155
static ULONG WINAPI AudioRecord_Release(IBaseFilter *iface)
Definition: audiorecord.c:128
static HRESULT WINAPI AudioRecord_Pause(IBaseFilter *iface)
Definition: audiorecord.c:141
static HRESULT WINAPI AudioRecord_QueryInterface(IBaseFilter *iface, REFIID riid, void **ppv)
Definition: audiorecord.c:116
static HRESULT WINAPI AudioRecord_Stop(IBaseFilter *iface)
Definition: audiorecord.c:134
HRESULT WINAPI BaseFilterImpl_SetSyncSource(IBaseFilter *iface, IReferenceClock *pClock)
Definition: filter.c:101
HRESULT WINAPI BaseFilterImpl_GetClassID(IBaseFilter *iface, CLSID *pClsid)
Definition: filter.c:77
HRESULT WINAPI BaseFilterImpl_QueryFilterInfo(IBaseFilter *iface, FILTER_INFO *pInfo)
Definition: filter.c:145
HRESULT WINAPI BaseFilterImpl_GetState(IBaseFilter *iface, DWORD dwMilliSecsTimeout, FILTER_STATE *pState)
Definition: filter.c:87
HRESULT WINAPI BaseFilterImpl_JoinFilterGraph(IBaseFilter *iface, IFilterGraph *pGraph, LPCWSTR pName)
Definition: filter.c:159
HRESULT WINAPI BaseFilterImpl_QueryVendorInfo(IBaseFilter *iface, LPWSTR *pVendorInfo)
Definition: filter.c:178
HRESULT WINAPI BaseFilterImpl_GetSyncSource(IBaseFilter *iface, IReferenceClock **ppClock)
Definition: filter.c:119
HRESULT WINAPI BaseFilterImpl_EnumPins(IBaseFilter *iface, IEnumPins **ppEnum)
Definition: filter.c:135

Definition at line 162 of file audiorecord.c.

Referenced by QCAP_createAudioCaptureFilter().

◆ PersistPropertyBagVtbl

const IPersistPropertyBagVtbl PersistPropertyBagVtbl
static
Initial value:
=
{
}
static HRESULT WINAPI PPB_InitNew(IPersistPropertyBag *iface)
Definition: audiorecord.c:224
static HRESULT WINAPI PPB_GetClassID(IPersistPropertyBag *iface, CLSID *pClassID)
Definition: audiorecord.c:217
static HRESULT WINAPI PPB_Load(IPersistPropertyBag *iface, IPropertyBag *pPropBag, IErrorLog *pErrorLog)
Definition: audiorecord.c:231
static ULONG WINAPI PPB_AddRef(IPersistPropertyBag *iface)
Definition: audiorecord.c:205
static ULONG WINAPI PPB_Release(IPersistPropertyBag *iface)
Definition: audiorecord.c:211
static HRESULT WINAPI PPB_Save(IPersistPropertyBag *iface, IPropertyBag *pPropBag, BOOL fClearDirty, BOOL fSaveAllProperties)
Definition: audiorecord.c:251
static HRESULT WINAPI PPB_QueryInterface(IPersistPropertyBag *iface, REFIID riid, LPVOID *ppv)
Definition: audiorecord.c:199

Definition at line 259 of file audiorecord.c.

Referenced by QCAP_createAudioCaptureFilter().

◆ UnknownVtbl

const IUnknownVtbl UnknownVtbl
static
Initial value:
= {
}
static ULONG WINAPI Unknown_AddRef(IUnknown *iface)
Definition: audiorecord.c:93
static HRESULT WINAPI Unknown_QueryInterface(IUnknown *iface, REFIID riid, LPVOID *ppv)
Definition: audiorecord.c:66
static ULONG WINAPI Unknown_Release(IUnknown *iface)
Definition: audiorecord.c:99

Definition at line 110 of file audiorecord.c.

Referenced by QCAP_createAudioCaptureFilter().