ReactOS  0.4.14-dev-384-g5b37caa
audio.c
Go to the documentation of this file.
1 /*
2  * Generic Implementation of strmbase audio classes
3  *
4  * Copyright 2012 Aric Stewart, CodeWeavers
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19  */
20 
21 #define COBJMACROS
22 
23 #include <assert.h>
24 #include "dshow.h"
25 #include "uuids.h"
26 #include "vfwmsgs.h"
27 #include "wine/unicode.h"
28 #include "wine/strmbase.h"
29 
30 
31 static inline BasicAudio *impl_from_IBasicAudio(IBasicAudio *iface)
32 {
33  return CONTAINING_RECORD(iface, BasicAudio, IBasicAudio_iface);
34 }
35 
36 HRESULT WINAPI BasicAudio_Init(BasicAudio *pBasicAudio, const IBasicAudioVtbl *lpVtbl)
37 {
38  pBasicAudio->IBasicAudio_iface.lpVtbl = lpVtbl;
39  BaseDispatch_Init(&pBasicAudio->baseDispatch, &IID_IBasicAudio);
40 
41  return S_OK;
42 }
43 
44 HRESULT WINAPI BasicAudio_Destroy(BasicAudio *pBasicAudio)
45 {
46  return BaseDispatch_Destroy(&pBasicAudio->baseDispatch);
47 }
48 
49 HRESULT WINAPI BasicAudioImpl_GetTypeInfoCount(IBasicAudio *iface, UINT *pctinfo)
50 {
51  BasicAudio *This = impl_from_IBasicAudio(iface);
52 
53  return BaseDispatchImpl_GetTypeInfoCount(&This->baseDispatch, pctinfo);
54 }
55 
56 HRESULT WINAPI BasicAudioImpl_GetTypeInfo(IBasicAudio *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
57 {
58  BasicAudio *This = impl_from_IBasicAudio(iface);
59 
60  return BaseDispatchImpl_GetTypeInfo(&This->baseDispatch, &IID_NULL, iTInfo, lcid, ppTInfo);
61 }
62 
63 HRESULT WINAPI BasicAudioImpl_GetIDsOfNames(IBasicAudio *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
64 {
65  BasicAudio *This = impl_from_IBasicAudio(iface);
66 
67  return BaseDispatchImpl_GetIDsOfNames(&This->baseDispatch, riid, rgszNames, cNames, lcid, rgDispId);
68 }
69 
70 HRESULT WINAPI BasicAudioImpl_Invoke(IBasicAudio *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExepInfo, UINT *puArgErr)
71 {
72  BasicAudio *This = impl_from_IBasicAudio(iface);
73  ITypeInfo *pTypeInfo;
74  HRESULT hr;
75 
76  hr = BaseDispatchImpl_GetTypeInfo(&This->baseDispatch, riid, 1, lcid, &pTypeInfo);
77  if (SUCCEEDED(hr))
78  {
79  hr = ITypeInfo_Invoke(pTypeInfo, &This->IBasicAudio_iface, dispIdMember, wFlags, pDispParams, pVarResult, pExepInfo, puArgErr);
80  ITypeInfo_Release(pTypeInfo);
81  }
82 
83  return hr;
84 }
HRESULT WINAPI BasicAudioImpl_GetTypeInfoCount(IBasicAudio *iface, UINT *pctinfo)
Definition: audio.c:49
HRESULT WINAPI BasicAudio_Init(BasicAudio *pBasicAudio, const IBasicAudioVtbl *lpVtbl)
Definition: audio.c:36
#define REFIID
Definition: guiddef.h:118
HRESULT hr
Definition: shlfolder.c:183
REFIID riid
Definition: precomp.h:44
HRESULT WINAPI BaseDispatch_Init(BaseDispatch *This, REFIID riid)
Definition: dispatch.c:30
DWORD LCID
Definition: nls.h:13
static LPOLESTR
Definition: stg_prop.c:27
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
HRESULT WINAPI BaseDispatchImpl_GetIDsOfNames(BaseDispatch *This, REFIID riid, OLECHAR **rgszNames, UINT cNames, LCID lcid, DISPID *rgdispid)
Definition: dispatch.c:52
static BasicAudio * impl_from_IBasicAudio(IBasicAudio *iface)
Definition: audio.c:31
LONG HRESULT
Definition: typedefs.h:77
#define WINAPI
Definition: msvc.h:8
unsigned short WORD
Definition: ntddk_ex.h:93
HRESULT WINAPI BaseDispatchImpl_GetTypeInfo(BaseDispatch *This, REFIID riid, UINT itinfo, LCID lcid, ITypeInfo **pptinfo)
Definition: dispatch.c:59
HRESULT WINAPI BasicAudio_Destroy(BasicAudio *pBasicAudio)
Definition: audio.c:44
HRESULT WINAPI BaseDispatchImpl_GetTypeInfoCount(BaseDispatch *This, UINT *pctinfo)
Definition: dispatch.c:70
#define IID_NULL
Definition: guiddef.h:98
HRESULT WINAPI BasicAudioImpl_Invoke(IBasicAudio *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExepInfo, UINT *puArgErr)
Definition: audio.c:70
_In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon.h:519
struct stdole::EXCEPINFO EXCEPINFO
static VARIANTARG static DISPID
Definition: ordinal.c:49
#define S_OK
Definition: intsafe.h:59
HRESULT WINAPI BasicAudioImpl_GetTypeInfo(IBasicAudio *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
Definition: audio.c:56
HRESULT WINAPI BaseDispatch_Destroy(BaseDispatch *This)
Definition: dispatch.c:45
unsigned int UINT
Definition: ndis.h:50
HRESULT WINAPI BasicAudioImpl_GetIDsOfNames(IBasicAudio *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
Definition: audio.c:63
struct stdole::DISPPARAMS DISPPARAMS
#define SUCCEEDED(hr)
Definition: intsafe.h:57