ReactOS 0.4.17-dev-966-gf06eace
audiorecord.c File Reference
#include "qcap_private.h"
Include dependency graph for audiorecord.c:

Go to the source code of this file.

Classes

struct  audio_record
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (quartz)
 
static struct audio_record * impl_from_strmbase_filter (struct strmbase_filter *filter)
 
static HRESULT audio_record_source_query_interface (struct strmbase_pin *iface, REFIID iid, void **out)
 
static HRESULT audio_record_source_query_accept (struct strmbase_pin *iface, const AM_MEDIA_TYPE *mt)
 
static HRESULT fill_media_type (struct audio_record *filter, unsigned int index, AM_MEDIA_TYPE *mt)
 
static HRESULT audio_record_source_get_media_type (struct strmbase_pin *iface, unsigned int index, AM_MEDIA_TYPE *mt)
 
static HRESULT WINAPI audio_record_source_DecideBufferSize (struct strmbase_source *iface, IMemAllocator *allocator, ALLOCATOR_PROPERTIES *props)
 
static void audio_record_source_disconnect (struct strmbase_source *iface)
 
static struct audio_record * impl_from_IAMStreamConfig (IAMStreamConfig *iface)
 
static HRESULT WINAPI stream_config_QueryInterface (IAMStreamConfig *iface, REFIID iid, void **out)
 
static ULONG WINAPI stream_config_AddRef (IAMStreamConfig *iface)
 
static ULONG WINAPI stream_config_Release (IAMStreamConfig *iface)
 
static HRESULT WINAPI stream_config_SetFormat (IAMStreamConfig *iface, AM_MEDIA_TYPE *mt)
 
static HRESULT WINAPI stream_config_GetFormat (IAMStreamConfig *iface, AM_MEDIA_TYPE **ret_mt)
 
static HRESULT WINAPI stream_config_GetNumberOfCapabilities (IAMStreamConfig *iface, int *count, int *size)
 
static HRESULT WINAPI stream_config_GetStreamCaps (IAMStreamConfig *iface, int index, AM_MEDIA_TYPE **ret_mt, BYTE *caps)
 
static struct audio_record * impl_from_IAMBufferNegotiation (IAMBufferNegotiation *iface)
 
static HRESULT WINAPI buffer_negotiation_QueryInterface (IAMBufferNegotiation *iface, REFIID iid, void **out)
 
static ULONG WINAPI buffer_negotiation_AddRef (IAMBufferNegotiation *iface)
 
static ULONG WINAPI buffer_negotiation_Release (IAMBufferNegotiation *iface)
 
static HRESULT WINAPI buffer_negotiation_SuggestAllocatorProperties (IAMBufferNegotiation *iface, const ALLOCATOR_PROPERTIES *props)
 
static HRESULT WINAPI buffer_negotiation_GetAllocatorProperties (IAMBufferNegotiation *iface, ALLOCATOR_PROPERTIES *props)
 
static struct audio_record * impl_from_IKsPropertySet (IKsPropertySet *iface)
 
static HRESULT WINAPI property_set_QueryInterface (IKsPropertySet *iface, REFIID iid, void **out)
 
static ULONG WINAPI property_set_AddRef (IKsPropertySet *iface)
 
static ULONG WINAPI property_set_Release (IKsPropertySet *iface)
 
static HRESULT WINAPI property_set_Set (IKsPropertySet *iface, const GUID *set, DWORD id, void *instance, DWORD instance_size, void *data, DWORD size)
 
static HRESULT WINAPI property_set_Get (IKsPropertySet *iface, const GUID *set, DWORD id, void *instance, DWORD instance_size, void *data, DWORD size, DWORD *ret_size)
 
static HRESULT WINAPI property_set_QuerySupported (IKsPropertySet *iface, const GUID *set, DWORD id, DWORD *support)
 
static struct audio_record * impl_from_IPersistPropertyBag (IPersistPropertyBag *iface)
 
static struct strmbase_pin * audio_record_get_pin (struct strmbase_filter *iface, unsigned int index)
 
static void audio_record_destroy (struct strmbase_filter *iface)
 
static HRESULT audio_record_query_interface (struct strmbase_filter *iface, REFIID iid, void **out)
 
static DWORD WINAPI stream_thread (void *arg)
 
static HRESULT audio_record_init_stream (struct strmbase_filter *iface)
 
static HRESULT audio_record_start_stream (struct strmbase_filter *iface, REFERENCE_TIME time)
 
static HRESULT audio_record_stop_stream (struct strmbase_filter *iface)
 
static HRESULT audio_record_cleanup_stream (struct strmbase_filter *iface)
 
static HRESULT audio_record_wait_state (struct strmbase_filter *iface, DWORD timeout)
 
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 *bag, IErrorLog *error_log)
 
static HRESULT WINAPI PPB_Save (IPersistPropertyBag *iface, IPropertyBag *pPropBag, BOOL fClearDirty, BOOL fSaveAllProperties)
 
HRESULT audio_record_create (IUnknown *outer, IUnknown **out)
 

Variables

struct {
   unsigned int   rate
 
   unsigned int   depth
 
   unsigned int   channels
 
} audio_formats []
 
static const struct strmbase_source_ops source_ops
 
static const IAMStreamConfigVtbl stream_config_vtbl
 
static const IAMBufferNegotiationVtbl buffer_negotiation_vtbl
 
static const IKsPropertySetVtbl property_set_vtbl
 
static const struct strmbase_filter_ops filter_ops
 
static const IPersistPropertyBagVtbl PersistPropertyBagVtbl
 

Function Documentation

◆ audio_record_cleanup_stream()

static HRESULT audio_record_cleanup_stream ( struct strmbase_filter *  iface)
static

Definition at line 672 of file audiorecord.c.

673{
675 HRESULT hr;
676
677 if (!filter->source.pin.peer)
678 return S_OK;
679
680 EnterCriticalSection(&filter->state_cs);
681 filter->state = State_Stopped;
682 LeaveCriticalSection(&filter->state_cs);
683 WakeConditionVariable(&filter->state_cv);
684 SetEvent(filter->event);
685
687 CloseHandle(filter->thread);
688 filter->thread = NULL;
689
690 hr = IMemAllocator_Decommit(filter->source.pAllocator);
691 if (hr != S_OK && hr != VFW_E_NOT_COMMITTED)
692 ERR("Failed to decommit allocator, hr %#lx.\n", hr);
693
694 return S_OK;
695}
static struct audio_record * impl_from_strmbase_filter(struct strmbase_filter *filter)
Definition: audiorecord.c:52
#define ERR(fmt,...)
Definition: precomp.h:57
HRESULT hr
Definition: delayimp.cpp:582
#define NULL
Definition: types.h:112
#define CloseHandle
Definition: compat.h:739
VOID WINAPI WakeConditionVariable(PCONDITION_VARIABLE ConditionVariable)
Definition: sync.c:98
#define INFINITE
Definition: serial.h:102
#define S_OK
Definition: intsafe.h:52
Definition: filter.c:165
FILTER_STATE state
Definition: filter.c:177
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
Definition: synch.c:669
#define VFW_E_NOT_COMMITTED
Definition: vfwmsgs.h:56
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)

◆ audio_record_create()

HRESULT audio_record_create ( IUnknown *  outer,
IUnknown **  out 
)

Definition at line 791 of file audiorecord.c.

792{
793 struct audio_record *object;
794 HRESULT hr;
795
796 if (!(object = calloc(1, sizeof(*object))))
797 return E_OUTOFMEMORY;
798
799 if (!(object->event = CreateEventW(NULL, FALSE, FALSE, NULL)))
800 {
801 free(object);
802 return E_OUTOFMEMORY;
803 }
804
805 if ((hr = fill_media_type(object, 1, &object->format)))
806 {
807 CloseHandle(object->event);
808 free(object);
809 return hr;
810 }
811
812 object->props.cBuffers = -1;
813 object->props.cbBuffer = -1;
814 object->props.cbAlign = -1;
815 object->props.cbPrefix = -1;
816
817 object->IPersistPropertyBag_iface.lpVtbl = &PersistPropertyBagVtbl;
818 strmbase_filter_init(&object->filter, outer, &CLSID_AudioRecord, &filter_ops);
819
820 strmbase_source_init(&object->source, &object->filter, L"Capture", &source_ops);
821 object->IAMBufferNegotiation_iface.lpVtbl = &buffer_negotiation_vtbl;
822 object->IAMStreamConfig_iface.lpVtbl = &stream_config_vtbl;
823 object->IKsPropertySet_iface.lpVtbl = &property_set_vtbl;
824
825 object->state = State_Stopped;
828 object->state_cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": audio_record.state_cs");
829
830 TRACE("Created audio recorder %p.\n", object);
831 *out = &object->filter.IUnknown_inner;
832 return S_OK;
833}
static HRESULT fill_media_type(struct audio_record *filter, unsigned int index, AM_MEDIA_TYPE *mt)
Definition: audiorecord.c:117
static const IAMStreamConfigVtbl stream_config_vtbl
Definition: audiorecord.c:335
static const IKsPropertySetVtbl property_set_vtbl
Definition: audiorecord.c:471
static const IAMBufferNegotiationVtbl buffer_negotiation_vtbl
Definition: audiorecord.c:392
static const struct strmbase_source_ops source_ops
Definition: audiorecord.c:201
static const struct strmbase_filter_ops filter_ops
Definition: audiorecord.c:706
static const IPersistPropertyBagVtbl PersistPropertyBagVtbl
Definition: audiorecord.c:780
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define free
Definition: debug_ros.c:5
#define FALSE
Definition: types.h:117
VOID WINAPI InitializeConditionVariable(PCONDITION_VARIABLE ConditionVariable)
Definition: sync.c:22
BOOL WINAPI InitializeCriticalSectionEx(OUT LPCRITICAL_SECTION lpCriticalSection, IN DWORD dwSpinCount, IN DWORD flags)
Definition: sync.c:107
#define L(x)
Definition: resources.c:13
static IUnknown * outer
Definition: compobj.c:82
#define calloc
Definition: rosglue.h:14
#define TRACE(s)
Definition: solgame.cpp:4
void strmbase_source_init(struct strmbase_source *pin, struct strmbase_filter *filter, const WCHAR *name, const struct strmbase_source_ops *func_table)
Definition: pin.c:765
void strmbase_filter_init(struct strmbase_filter *filter, IUnknown *outer, const CLSID *clsid, const struct strmbase_filter_ops *func_table)
Definition: filter.c:517
HANDLE WINAPI DECLSPEC_HOTPATCH CreateEventW(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL, IN BOOL bManualReset, IN BOOL bInitialState, IN LPCWSTR lpName OPTIONAL)
Definition: synch.c:587
#define DWORD_PTR
Definition: treelist.c:76
wchar_t tm const _CrtWcstime_Writes_and_advances_ptr_ count wchar_t ** out
Definition: wcsftime.cpp:383
#define RTL_CRITICAL_SECTION_FLAG_FORCE_DEBUG_INFO
Definition: winnt_old.h:1156

◆ audio_record_destroy()

static void audio_record_destroy ( struct strmbase_filter *  iface)
static

Definition at line 495 of file audiorecord.c.

496{
498
499 filter->state_cs.DebugInfo->Spare[0] = 0;
500 DeleteCriticalSection(&filter->state_cs);
501 CloseHandle(filter->event);
502 FreeMediaType(&filter->format);
505 free(filter);
506}
void WINAPI FreeMediaType(AM_MEDIA_TYPE *pMediaType)
Definition: mediatype.c:165
void strmbase_filter_cleanup(struct strmbase_filter *filter)
Definition: filter.c:540
void strmbase_source_cleanup(struct strmbase_source *pin)
Definition: pin.c:778
IBaseFilter * filter
Definition: filtergraph.c:75
void WINAPI DeleteCriticalSection(PCRITICAL_SECTION)

◆ audio_record_get_pin()

static struct strmbase_pin * audio_record_get_pin ( struct strmbase_filter *  iface,
unsigned int  index 
)
static

Definition at line 486 of file audiorecord.c.

487{
489
490 if (!index)
491 return &filter->source.pin;
492 return NULL;
493}
GLuint index
Definition: glext.h:6031

◆ audio_record_init_stream()

static HRESULT audio_record_init_stream ( struct strmbase_filter *  iface)
static

Definition at line 624 of file audiorecord.c.

625{
627 HRESULT hr;
628
629 if (!filter->source.pin.peer)
630 return S_OK;
631
632 if (FAILED(hr = IMemAllocator_Commit(filter->source.pAllocator)))
633 ERR("Failed to commit allocator, hr %#lx.\n", hr);
634
635 EnterCriticalSection(&filter->state_cs);
636 filter->state = State_Paused;
637 LeaveCriticalSection(&filter->state_cs);
638
639 filter->thread = CreateThread(NULL, 0, stream_thread, filter, 0, NULL);
640
641 return S_OK;
642}
static DWORD WINAPI stream_thread(void *arg)
Definition: audiorecord.c:521
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
Definition: thread.c:137
#define FAILED(hr)
Definition: intsafe.h:51

◆ audio_record_query_interface()

static HRESULT audio_record_query_interface ( struct strmbase_filter *  iface,
REFIID  iid,
void **  out 
)
static

Definition at line 508 of file audiorecord.c.

509{
511
513 *out = &filter->IPersistPropertyBag_iface;
514 else
515 return E_NOINTERFACE;
516
517 IUnknown_AddRef((IUnknown *)*out);
518 return S_OK;
519}
const GUID IID_IPersistPropertyBag
Definition: proxy.cpp:11
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define E_NOINTERFACE
Definition: winerror.h:3479

◆ audio_record_source_DecideBufferSize()

static HRESULT WINAPI audio_record_source_DecideBufferSize ( struct strmbase_source *  iface,
IMemAllocator *  allocator,
ALLOCATOR_PROPERTIES *  props 
)
static

Definition at line 159 of file audiorecord.c.

161{
162 struct audio_record *filter = impl_from_strmbase_filter(iface->pin.filter);
163 const WAVEFORMATEX *format = (void *)filter->source.pin.mt.pbFormat;
164 ALLOCATOR_PROPERTIES ret_props;
166 HRESULT hr;
167
168 props->cBuffers = (filter->props.cBuffers == -1) ? 4 : filter->props.cBuffers;
169 /* This is the algorithm that native uses. The alignment to an even number
170 * doesn't make much sense, and may be a bug. */
171 if (filter->props.cbBuffer == -1)
172 props->cbBuffer = (format->nAvgBytesPerSec / 2) & ~1;
173 else
174 props->cbBuffer = filter->props.cbBuffer & ~1;
175 if (filter->props.cbAlign == -1 || filter->props.cbAlign == 0)
176 props->cbAlign = 1;
177 else
178 props->cbAlign = filter->props.cbAlign;
179 props->cbPrefix = (filter->props.cbPrefix == -1) ? 0 : filter->props.cbPrefix;
180
181 if (FAILED(hr = IMemAllocator_SetProperties(allocator, props, &ret_props)))
182 return hr;
183
184 if ((ret = waveInOpen(&filter->device, filter->id, format,
186 {
187 ERR("Failed to open device %u, error %u.\n", filter->id, ret);
188 return E_FAIL;
189 }
190
191 return S_OK;
192}
#define E_FAIL
Definition: ddrawi.h:102
return ret
Definition: mutex.c:147
if(dx< 0)
Definition: linetemp.h:194
UINT MMRESULT
Definition: mmsystem.h:964
#define CALLBACK_EVENT
Definition: mmsystem.h:152
#define MMSYSERR_NOERROR
Definition: mmsystem.h:96
struct strmbase_pin pin
Definition: strmbase.h:79
uint32_t DWORD_PTR
Definition: typedefs.h:65
static const WCHAR props[]
Definition: wbemdisp.c:288
MMRESULT WINAPI waveInOpen(HWAVEIN *lphWaveIn, UINT uDeviceID, LPCWAVEFORMATEX lpFormat, DWORD_PTR dwCallback, DWORD_PTR dwInstance, DWORD dwFlags)
Definition: winmm.c:2623

◆ audio_record_source_disconnect()

static void audio_record_source_disconnect ( struct strmbase_source *  iface)
static

Definition at line 194 of file audiorecord.c.

195{
196 struct audio_record *filter = impl_from_strmbase_filter(iface->pin.filter);
197
198 waveInClose(filter->device);
199}
UINT WINAPI waveInClose(HWAVEIN hWaveIn)
Definition: winmm.c:2634

◆ audio_record_source_get_media_type()

static HRESULT audio_record_source_get_media_type ( struct strmbase_pin *  iface,
unsigned int  index,
AM_MEDIA_TYPE *  mt 
)
static

Definition at line 151 of file audiorecord.c.

153{
155
156 return fill_media_type(filter, index, mt);
157}
struct strmbase_filter * filter
Definition: strmbase.h:58

◆ audio_record_source_query_accept()

static HRESULT audio_record_source_query_accept ( struct strmbase_pin *  iface,
const AM_MEDIA_TYPE *  mt 
)
static

Definition at line 74 of file audiorecord.c.

75{
76 if (!IsEqualGUID(&mt->majortype, &MEDIATYPE_Audio))
77 return S_FALSE;
78
79 if (!IsEqualGUID(&mt->formattype, &FORMAT_WaveFormatEx))
80 return S_FALSE;
81
82 return S_OK;
83}
#define S_FALSE
Definition: winerror.h:3451

◆ audio_record_source_query_interface()

static HRESULT audio_record_source_query_interface ( struct strmbase_pin *  iface,
REFIID  iid,
void **  out 
)
static

Definition at line 57 of file audiorecord.c.

58{
60
61 if (IsEqualGUID(iid, &IID_IAMBufferNegotiation))
62 *out = &filter->IAMBufferNegotiation_iface;
63 else if (IsEqualGUID(iid, &IID_IAMStreamConfig))
64 *out = &filter->IAMStreamConfig_iface;
65 else if (IsEqualGUID(iid, &IID_IKsPropertySet))
66 *out = &filter->IKsPropertySet_iface;
67 else
68 return E_NOINTERFACE;
69
70 IUnknown_AddRef((IUnknown *)*out);
71 return S_OK;
72}
const GUID IID_IKsPropertySet
Definition: controlnode.cpp:13

◆ audio_record_start_stream()

static HRESULT audio_record_start_stream ( struct strmbase_filter *  iface,
REFERENCE_TIME  time 
)
static

Definition at line 644 of file audiorecord.c.

645{
647
648 if (!filter->source.pin.peer)
649 return S_OK;
650
651 EnterCriticalSection(&filter->state_cs);
652 filter->state = State_Running;
653 LeaveCriticalSection(&filter->state_cs);
654 WakeConditionVariable(&filter->state_cv);
655 return S_OK;
656}

◆ audio_record_stop_stream()

static HRESULT audio_record_stop_stream ( struct strmbase_filter *  iface)
static

Definition at line 658 of file audiorecord.c.

659{
661
662 if (!filter->source.pin.peer)
663 return S_OK;
664
665 EnterCriticalSection(&filter->state_cs);
666 filter->state = State_Paused;
667 LeaveCriticalSection(&filter->state_cs);
668 SetEvent(filter->event);
669 return S_OK;
670}

◆ audio_record_wait_state()

static HRESULT audio_record_wait_state ( struct strmbase_filter *  iface,
DWORD  timeout 
)
static

Definition at line 697 of file audiorecord.c.

698{
700
701 if (filter->filter.state == State_Paused)
702 return VFW_S_CANT_CUE;
703 return S_OK;
704}
#define VFW_S_CANT_CUE
Definition: vfwmsgs.h:33

◆ buffer_negotiation_AddRef()

static ULONG WINAPI buffer_negotiation_AddRef ( IAMBufferNegotiation *  iface)
static

Definition at line 357 of file audiorecord.c.

358{
360 return IPin_AddRef(&filter->source.pin.IPin_iface);
361}
static struct audio_record * impl_from_IAMBufferNegotiation(IAMBufferNegotiation *iface)
Definition: audiorecord.c:346

◆ buffer_negotiation_GetAllocatorProperties()

static HRESULT WINAPI buffer_negotiation_GetAllocatorProperties ( IAMBufferNegotiation *  iface,
ALLOCATOR_PROPERTIES *  props 
)
static

Definition at line 385 of file audiorecord.c.

387{
388 FIXME("iface %p, props %p, stub!\n", iface, props);
389 return E_NOTIMPL;
390}
#define FIXME(fmt,...)
Definition: precomp.h:53
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ buffer_negotiation_QueryInterface()

static HRESULT WINAPI buffer_negotiation_QueryInterface ( IAMBufferNegotiation *  iface,
REFIID  iid,
void **  out 
)
static

Definition at line 351 of file audiorecord.c.

352{
354 return IPin_QueryInterface(&filter->source.pin.IPin_iface, iid, out);
355}

◆ buffer_negotiation_Release()

static ULONG WINAPI buffer_negotiation_Release ( IAMBufferNegotiation *  iface)
static

Definition at line 363 of file audiorecord.c.

364{
366 return IPin_Release(&filter->source.pin.IPin_iface);
367}

◆ buffer_negotiation_SuggestAllocatorProperties()

static HRESULT WINAPI buffer_negotiation_SuggestAllocatorProperties ( IAMBufferNegotiation *  iface,
const ALLOCATOR_PROPERTIES *  props 
)
static

Definition at line 369 of file audiorecord.c.

371{
373
374 TRACE("filter %p, props %p.\n", filter, props);
375 TRACE("Requested %ld buffers, size %ld, alignment %ld, prefix %ld.\n",
376 props->cBuffers, props->cbBuffer, props->cbAlign, props->cbPrefix);
377
378 EnterCriticalSection(&filter->state_cs);
379 filter->props = *props;
380 LeaveCriticalSection(&filter->state_cs);
381
382 return S_OK;
383}

◆ fill_media_type()

static HRESULT fill_media_type ( struct audio_record *  filter,
unsigned int  index,
AM_MEDIA_TYPE *  mt 
)
static

Definition at line 117 of file audiorecord.c.

118{
120
121 if (index >= 1 + ARRAY_SIZE(audio_formats))
122 return VFW_S_NO_MORE_ITEMS;
123
124 if (!index)
125 return CopyMediaType(mt, &filter->format);
126 --index;
127
128 if (!(format = CoTaskMemAlloc(sizeof(*format))))
129 return E_OUTOFMEMORY;
130
131 memset(format, 0, sizeof(WAVEFORMATEX));
132 format->wFormatTag = WAVE_FORMAT_PCM;
133 format->nChannels = audio_formats[index].channels;
134 format->nSamplesPerSec = audio_formats[index].rate;
135 format->wBitsPerSample = audio_formats[index].depth;
136 format->nBlockAlign = audio_formats[index].channels * audio_formats[index].depth / 8;
137 format->nAvgBytesPerSec = format->nBlockAlign * format->nSamplesPerSec;
138
139 memset(mt, 0, sizeof(AM_MEDIA_TYPE));
140 mt->majortype = MEDIATYPE_Audio;
141 mt->subtype = MEDIASUBTYPE_PCM;
142 mt->bFixedSizeSamples = TRUE;
143 mt->lSampleSize = format->nBlockAlign;
144 mt->formattype = FORMAT_WaveFormatEx;
145 mt->cbFormat = sizeof(WAVEFORMATEX);
146 mt->pbFormat = (BYTE *)format;
147
148 return S_OK;
149}
static const struct @327 audio_formats[]
#define WAVE_FORMAT_PCM
Definition: constants.h:425
#define index(s, c)
Definition: various.h:29
#define ARRAY_SIZE(A)
Definition: main.h:20
#define TRUE
Definition: types.h:120
void *WINAPI CoTaskMemAlloc(SIZE_T size)
Definition: malloc.c:381
#define memset(x, y, z)
Definition: compat.h:39
HRESULT WINAPI CopyMediaType(AM_MEDIA_TYPE *pDest, const AM_MEDIA_TYPE *pSrc)
Definition: mediatype.c:150
#define VFW_S_NO_MORE_ITEMS
Definition: vfwmsgs.h:19
unsigned char BYTE
Definition: xxhash.c:193

Referenced by audio_record_create(), audio_record_source_get_media_type(), and stream_config_GetStreamCaps().

◆ impl_from_IAMBufferNegotiation()

static struct audio_record * impl_from_IAMBufferNegotiation ( IAMBufferNegotiation *  iface)
static

Definition at line 346 of file audiorecord.c.

347{
348 return CONTAINING_RECORD(iface, struct audio_record, IAMBufferNegotiation_iface);
349}
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260

Referenced by buffer_negotiation_AddRef(), buffer_negotiation_QueryInterface(), buffer_negotiation_Release(), and buffer_negotiation_SuggestAllocatorProperties().

◆ impl_from_IAMStreamConfig()

static struct audio_record * impl_from_IAMStreamConfig ( IAMStreamConfig *  iface)
static

◆ impl_from_IKsPropertySet()

static struct audio_record * impl_from_IKsPropertySet ( IKsPropertySet *  iface)
static

Definition at line 401 of file audiorecord.c.

402{
403 return CONTAINING_RECORD(iface, struct audio_record, IKsPropertySet_iface);
404}

Referenced by property_set_AddRef(), property_set_Get(), property_set_QueryInterface(), and property_set_Release().

◆ impl_from_IPersistPropertyBag()

static struct audio_record * impl_from_IPersistPropertyBag ( IPersistPropertyBag *  iface)
static

Definition at line 481 of file audiorecord.c.

482{
483 return CONTAINING_RECORD(iface, struct audio_record, IPersistPropertyBag_iface);
484}

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

◆ impl_from_strmbase_filter()

◆ PPB_AddRef()

static ULONG WINAPI PPB_AddRef ( IPersistPropertyBag *  iface)
static

Definition at line 725 of file audiorecord.c.

726{
728
729 return IUnknown_AddRef(filter->filter.outer_unk);
730}
static struct audio_record * impl_from_IPersistPropertyBag(IPersistPropertyBag *iface)
Definition: audiorecord.c:481

◆ PPB_GetClassID()

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

Definition at line 739 of file audiorecord.c.

740{
742 TRACE("(%p/%p)->(%p)\n", iface, This, pClassID);
743 return IBaseFilter_GetClassID(&This->filter.IBaseFilter_iface, pClassID);
744}

◆ PPB_InitNew()

static HRESULT WINAPI PPB_InitNew ( IPersistPropertyBag *  iface)
static

Definition at line 746 of file audiorecord.c.

747{
749 FIXME("(%p/%p)->(): stub\n", iface, This);
750 return E_NOTIMPL;
751}

◆ PPB_Load()

static HRESULT WINAPI PPB_Load ( IPersistPropertyBag *  iface,
IPropertyBag *  bag,
IErrorLog *  error_log 
)
static

Definition at line 753 of file audiorecord.c.

754{
756 VARIANT var;
757 HRESULT hr;
758
759 TRACE("filter %p, bag %p, error_log %p.\n", filter, bag, error_log);
760
761 V_VT(&var) = VT_I4;
762 if (FAILED(hr = IPropertyBag_Read(bag, L"WaveInID", &var, error_log)))
763 return hr;
764
766 filter->id = V_I4(&var);
768
769 return hr;
770}
@ VT_I4
Definition: compat.h:2298
const char * var
Definition: shader.c:5879
#define V_VT(A)
Definition: oleauto.h:211
#define V_I4(A)
Definition: oleauto.h:247

◆ PPB_QueryInterface()

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

Definition at line 718 of file audiorecord.c.

719{
721
722 return IUnknown_QueryInterface(filter->filter.outer_unk, riid, ppv);
723}
REFIID riid
Definition: atlbase.h:39
REFIID LPVOID * ppv
Definition: atlbase.h:39

◆ PPB_Release()

static ULONG WINAPI PPB_Release ( IPersistPropertyBag *  iface)
static

Definition at line 732 of file audiorecord.c.

733{
735
736 return IUnknown_Release(filter->filter.outer_unk);
737}

◆ PPB_Save()

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

Definition at line 772 of file audiorecord.c.

774{
776 FIXME("(%p/%p)->(%p, %u, %u): stub\n", iface, This, pPropBag, fClearDirty, fSaveAllProperties);
777 return E_NOTIMPL;
778}

◆ property_set_AddRef()

static ULONG WINAPI property_set_AddRef ( IKsPropertySet *  iface)
static

Definition at line 412 of file audiorecord.c.

413{
415 return IPin_AddRef(&filter->source.pin.IPin_iface);
416}
static struct audio_record * impl_from_IKsPropertySet(IKsPropertySet *iface)
Definition: audiorecord.c:401

◆ property_set_Get()

static HRESULT WINAPI property_set_Get ( IKsPropertySet *  iface,
const GUID *  set,
DWORD  id,
void *  instance,
DWORD  instance_size,
void *  data,
DWORD  size,
DWORD *  ret_size 
)
static

Definition at line 432 of file audiorecord.c.

434{
436
437 TRACE("filter %p, set %s, id %lu, instance %p, instance_size %lu, data %p, size %lu, ret_size %p.\n",
438 filter, debugstr_guid(set), id, instance, instance_size, data, size, ret_size);
439
440 if (!IsEqualGUID(set, &AMPROPSETID_Pin))
441 {
442 FIXME("Unknown set %s, returning E_PROP_SET_UNSUPPORTED.\n", debugstr_guid(set));
444 }
445
446 if (id != AMPROPERTY_PIN_CATEGORY)
447 {
448 FIXME("Unknown id %lu, returning E_PROP_ID_UNSUPPORTED.\n", id);
450 }
451
452 if (instance || instance_size)
453 FIXME("Unexpected instance data %p, size %lu.\n", instance, instance_size);
454
455 *ret_size = sizeof(GUID);
456
457 if (size < sizeof(GUID))
458 return E_UNEXPECTED;
459
460 *(GUID *)data = PIN_CATEGORY_CAPTURE;
461 return S_OK;
462}
@ AMPROPERTY_PIN_CATEGORY
Definition: axextend.idl:1160
Definition: _set.h:50
static HINSTANCE instance
Definition: main.c:35
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLsizeiptr size
Definition: glext.h:5919
#define debugstr_guid
Definition: kernel32.h:35
static void ULONG ULONG * ret_size
Definition: time.c:40
#define E_PROP_ID_UNSUPPORTED
Definition: vfwmsgs.h:173
#define E_PROP_SET_UNSUPPORTED
Definition: vfwmsgs.h:176
#define E_UNEXPECTED
Definition: winerror.h:3528

◆ property_set_QueryInterface()

static HRESULT WINAPI property_set_QueryInterface ( IKsPropertySet *  iface,
REFIID  iid,
void **  out 
)
static

Definition at line 406 of file audiorecord.c.

407{
409 return IPin_QueryInterface(&filter->source.pin.IPin_iface, iid, out);
410}

◆ property_set_QuerySupported()

static HRESULT WINAPI property_set_QuerySupported ( IKsPropertySet *  iface,
const GUID *  set,
DWORD  id,
DWORD *  support 
)
static

Definition at line 464 of file audiorecord.c.

466{
467 FIXME("iface %p, set %s, id %lu, support %p, stub!\n", iface, debugstr_guid(set), id, support);
468 return E_NOTIMPL;
469}

◆ property_set_Release()

static ULONG WINAPI property_set_Release ( IKsPropertySet *  iface)
static

Definition at line 418 of file audiorecord.c.

419{
421 return IPin_Release(&filter->source.pin.IPin_iface);
422}

◆ property_set_Set()

static HRESULT WINAPI property_set_Set ( IKsPropertySet *  iface,
const GUID *  set,
DWORD  id,
void *  instance,
DWORD  instance_size,
void *  data,
DWORD  size 
)
static

Definition at line 424 of file audiorecord.c.

426{
427 FIXME("iface %p, set %s, id %lu, instance %p, instance_size %lu, data %p, size %lu, stub!\n",
428 iface, debugstr_guid(set), id, instance, instance_size, data, size);
429 return E_NOTIMPL;
430}

◆ stream_config_AddRef()

static ULONG WINAPI stream_config_AddRef ( IAMStreamConfig *  iface)
static

Definition at line 223 of file audiorecord.c.

224{
226 return IPin_AddRef(&filter->source.pin.IPin_iface);
227}
static struct audio_record * impl_from_IAMStreamConfig(IAMStreamConfig *iface)
Definition: audiorecord.c:212

◆ stream_config_GetFormat()

static HRESULT WINAPI stream_config_GetFormat ( IAMStreamConfig *  iface,
AM_MEDIA_TYPE **  ret_mt 
)
static

Definition at line 259 of file audiorecord.c.

260{
262 AM_MEDIA_TYPE *mt;
263 HRESULT hr;
264
265 TRACE("iface %p, mt %p.\n", iface, ret_mt);
266
267 if (!(mt = CoTaskMemAlloc(sizeof(AM_MEDIA_TYPE))))
268 return E_OUTOFMEMORY;
269
271
272 if ((hr = CopyMediaType(mt, &filter->format)))
273 {
275 CoTaskMemFree(mt);
276 return hr;
277 }
278
280
281 *ret_mt = mt;
282 return S_OK;
283}
void WINAPI CoTaskMemFree(void *ptr)
Definition: malloc.c:389

◆ stream_config_GetNumberOfCapabilities()

static HRESULT WINAPI stream_config_GetNumberOfCapabilities ( IAMStreamConfig *  iface,
int *  count,
int *  size 
)
static

Definition at line 285 of file audiorecord.c.

287{
289
290 TRACE("filter %p, count %p, size %p.\n", filter, count, size);
291
293 *size = sizeof(AUDIO_STREAM_CONFIG_CAPS);
294 return S_OK;
295}
GLuint GLuint GLsizei count
Definition: gl.h:1545

◆ stream_config_GetStreamCaps()

static HRESULT WINAPI stream_config_GetStreamCaps ( IAMStreamConfig *  iface,
int  index,
AM_MEDIA_TYPE **  ret_mt,
BYTE *  caps 
)
static

Definition at line 297 of file audiorecord.c.

299{
301 AUDIO_STREAM_CONFIG_CAPS *audio_caps = (void *)caps;
302 AM_MEDIA_TYPE *mt;
303 HRESULT hr;
304
305 TRACE("filter %p, index %d, ret_mt %p, caps %p.\n", filter, index, ret_mt, caps);
306
307 if (index >= 1 + ARRAY_SIZE(audio_formats))
308 return S_FALSE;
309
310 if (!(mt = CoTaskMemAlloc(sizeof(AM_MEDIA_TYPE))))
311 return E_OUTOFMEMORY;
312
313 if ((hr = fill_media_type(filter, index, mt)) != S_OK)
314 {
315 CoTaskMemFree(mt);
316 return hr;
317 }
318
319 *ret_mt = mt;
320
321 audio_caps->guid = MEDIATYPE_Audio;
322 audio_caps->MinimumChannels = 1;
323 audio_caps->MaximumChannels = 2;
324 audio_caps->ChannelsGranularity = 1;
325 audio_caps->MinimumBitsPerSample = 8;
326 audio_caps->MaximumBitsPerSample = 16;
327 audio_caps->BitsPerSampleGranularity = 8;
328 audio_caps->MinimumSampleFrequency = 11025;
329 audio_caps->MaximumSampleFrequency = 44100;
330 audio_caps->SampleFrequencyGranularity = 11025;
331
332 return S_OK;
333}

◆ stream_config_QueryInterface()

static HRESULT WINAPI stream_config_QueryInterface ( IAMStreamConfig *  iface,
REFIID  iid,
void **  out 
)
static

Definition at line 217 of file audiorecord.c.

218{
220 return IPin_QueryInterface(&filter->source.pin.IPin_iface, iid, out);
221}

◆ stream_config_Release()

static ULONG WINAPI stream_config_Release ( IAMStreamConfig *  iface)
static

Definition at line 229 of file audiorecord.c.

230{
232 return IPin_Release(&filter->source.pin.IPin_iface);
233}

◆ stream_config_SetFormat()

static HRESULT WINAPI stream_config_SetFormat ( IAMStreamConfig *  iface,
AM_MEDIA_TYPE *  mt 
)
static

Definition at line 235 of file audiorecord.c.

236{
238 HRESULT hr;
239
240 TRACE("iface %p, mt %p.\n", iface, mt);
242
243 if (!mt)
244 return E_POINTER;
245
247
248 if ((hr = CopyMediaType(&filter->format, mt)))
249 {
251 return hr;
252 }
253
255
256 return S_OK;
257}
void strmbase_dump_media_type(const AM_MEDIA_TYPE *mt)
Definition: mediatype.c:58
#define E_POINTER
Definition: winerror.h:3480

◆ stream_thread()

static DWORD WINAPI stream_thread ( void *  arg)
static

Definition at line 521 of file audiorecord.c.

522{
523 struct audio_record *filter = arg;
524 const WAVEFORMATEX *format = (void *)filter->source.pin.mt.pbFormat;
525 bool started = false;
527
528 /* FIXME: We should probably queue several buffers instead of just one. */
529
530 EnterCriticalSection(&filter->state_cs);
531
532 for (;;)
533 {
535 WAVEHDR header = {0};
536 HRESULT hr;
537 BYTE *data;
538
539 while (filter->state == State_Paused)
540 SleepConditionVariableCS(&filter->state_cv, &filter->state_cs, INFINITE);
541
542 if (filter->state == State_Stopped)
543 break;
544
545 if (FAILED(hr = IMemAllocator_GetBuffer(filter->source.pAllocator, &sample, NULL, NULL, 0)))
546 {
547 ERR("Failed to get sample, hr %#lx.\n", hr);
548 break;
549 }
550
551 IMediaSample_GetPointer(sample, &data);
552
553 header.lpData = (void *)data;
554 header.dwBufferLength = IMediaSample_GetSize(sample);
555 if ((ret = waveInPrepareHeader(filter->device, &header, sizeof(header))) != MMSYSERR_NOERROR)
556 ERR("Failed to prepare header, error %u.\n", ret);
557
558 if ((ret = waveInAddBuffer(filter->device, &header, sizeof(header))) != MMSYSERR_NOERROR)
559 ERR("Failed to add buffer, error %u.\n", ret);
560
561 if (!started)
562 {
563 if ((ret = waveInStart(filter->device)) != MMSYSERR_NOERROR)
564 ERR("Failed to start, error %u.\n", ret);
565 started = true;
566 }
567
568 while (!(header.dwFlags & WHDR_DONE) && filter->state == State_Running)
569 {
570 LeaveCriticalSection(&filter->state_cs);
571
572 if ((ret = WaitForSingleObject(filter->event, INFINITE)))
573 ERR("Failed to wait, error %u.\n", ret);
574
575 EnterCriticalSection(&filter->state_cs);
576 }
577
578 if (filter->state != State_Running)
579 {
580 TRACE("State is %#x; resetting.\n", filter->state);
581 if ((ret = waveInReset(filter->device)) != MMSYSERR_NOERROR)
582 ERR("Failed to reset, error %u.\n", ret);
583 }
584
585 if ((ret = waveInUnprepareHeader(filter->device, &header, sizeof(header))) != MMSYSERR_NOERROR)
586 ERR("Failed to unprepare header, error %u.\n", ret);
587
588 IMediaSample_SetActualDataLength(sample, header.dwBytesRecorded);
589
590 if (filter->state == State_Running)
591 {
592 REFERENCE_TIME start_pts, end_pts;
593 MMTIME time;
594
595 time.wType = TIME_BYTES;
596 if ((ret = waveInGetPosition(filter->device, &time, sizeof(time))) != MMSYSERR_NOERROR)
597 ERR("Failed to get position, error %u.\n", ret);
598 if (time.wType != TIME_BYTES)
599 ERR("Got unexpected type %#x.\n", time.wType);
600 end_pts = MulDiv(time.u.cb, 10000000, format->nAvgBytesPerSec);
601 start_pts = MulDiv(time.u.cb - header.dwBytesRecorded, 10000000, format->nAvgBytesPerSec);
602 IMediaSample_SetTime(sample, &start_pts, &end_pts);
603
604 TRACE("Sending buffer %p.\n", sample);
605 if (FAILED(hr = IMemInputPin_Receive(filter->source.pMemInputPin, sample)))
606 {
607 ERR("IMemInputPin::Receive() returned %#lx.\n", hr);
608 IMediaSample_Release(sample);
609 break;
610 }
611 }
612
613 IMediaSample_Release(sample);
614 }
615
616 LeaveCriticalSection(&filter->state_cs);
617
618 if (started && (ret = waveInStop(filter->device)) != MMSYSERR_NOERROR)
619 ERR("Failed to stop, error %u.\n", ret);
620
621 return 0;
622}
BOOL WINAPI SleepConditionVariableCS(PCONDITION_VARIABLE ConditionVariable, PCRITICAL_SECTION CriticalSection, DWORD Timeout)
Definition: sync.c:59
LONGLONG REFERENCE_TIME
Definition: dmusicks.h:9
__u16 time
Definition: mkdosfs.c:8
#define TIME_BYTES
Definition: mmsystem.h:30
#define WHDR_DONE
Definition: mmsystem.h:193
INT WINAPI MulDiv(INT nNumber, INT nNumerator, INT nDenominator)
Definition: muldiv.c:25
Definition: wave.c:25
void * arg
Definition: msvc.h:10
UINT WINAPI waveInGetPosition(HWAVEIN hWaveIn, LPMMTIME lpTime, UINT uSize)
Definition: winmm.c:2779
UINT WINAPI waveInAddBuffer(HWAVEIN hWaveIn, WAVEHDR *lpWaveInHdr, UINT uSize)
Definition: winmm.c:2717
UINT WINAPI waveInPrepareHeader(HWAVEIN hWaveIn, WAVEHDR *lpWaveInHdr, UINT uSize)
Definition: winmm.c:2653
UINT WINAPI waveInStop(HWAVEIN hWaveIn)
Definition: winmm.c:2764
UINT WINAPI waveInUnprepareHeader(HWAVEIN hWaveIn, WAVEHDR *lpWaveInHdr, UINT uSize)
Definition: winmm.c:2684
UINT WINAPI waveInReset(HWAVEIN hWaveIn)
Definition: winmm.c:2734
UINT WINAPI waveInStart(HWAVEIN hWaveIn)
Definition: winmm.c:2749

Referenced by audio_record_init_stream().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( quartz  )

Variable Documentation

◆ 

const struct { ... } audio_formats[]
Initial value:
=
{
{44100, 16, 2},
{44100, 16, 1},
{32000, 16, 2},
{32000, 16, 1},
{22050, 16, 2},
{22050, 16, 1},
{11025, 16, 2},
{11025, 16, 1},
{ 8000, 16, 2},
{ 8000, 16, 1},
{44100, 8, 2},
{44100, 8, 1},
{22050, 8, 2},
{22050, 8, 1},
{11025, 8, 2},
{11025, 8, 1},
{ 8000, 8, 2},
{ 8000, 8, 1},
{48000, 16, 2},
{48000, 16, 1},
{96000, 16, 2},
{96000, 16, 1},
}

Referenced by fill_media_type(), stream_config_GetNumberOfCapabilities(), and stream_config_GetStreamCaps().

◆ buffer_negotiation_vtbl

const IAMBufferNegotiationVtbl buffer_negotiation_vtbl
static
Initial value:
=
{
}
static ULONG WINAPI buffer_negotiation_AddRef(IAMBufferNegotiation *iface)
Definition: audiorecord.c:357
static HRESULT WINAPI buffer_negotiation_GetAllocatorProperties(IAMBufferNegotiation *iface, ALLOCATOR_PROPERTIES *props)
Definition: audiorecord.c:385
static ULONG WINAPI buffer_negotiation_Release(IAMBufferNegotiation *iface)
Definition: audiorecord.c:363
static HRESULT WINAPI buffer_negotiation_QueryInterface(IAMBufferNegotiation *iface, REFIID iid, void **out)
Definition: audiorecord.c:351
static HRESULT WINAPI buffer_negotiation_SuggestAllocatorProperties(IAMBufferNegotiation *iface, const ALLOCATOR_PROPERTIES *props)
Definition: audiorecord.c:369

Definition at line 392 of file audiorecord.c.

Referenced by audio_record_create().

◆ channels

◆ depth

Definition at line 88 of file audiorecord.c.

◆ filter_ops

const struct strmbase_filter_ops filter_ops
static
Initial value:
=
{
.filter_get_pin = audio_record_get_pin,
.filter_destroy = audio_record_destroy,
.filter_query_interface = audio_record_query_interface,
.filter_init_stream = audio_record_init_stream,
.filter_start_stream = audio_record_start_stream,
.filter_stop_stream = audio_record_stop_stream,
.filter_cleanup_stream = audio_record_cleanup_stream,
.filter_wait_state = audio_record_wait_state,
}
static HRESULT audio_record_init_stream(struct strmbase_filter *iface)
Definition: audiorecord.c:624
static HRESULT audio_record_wait_state(struct strmbase_filter *iface, DWORD timeout)
Definition: audiorecord.c:697
static HRESULT audio_record_start_stream(struct strmbase_filter *iface, REFERENCE_TIME time)
Definition: audiorecord.c:644
static HRESULT audio_record_cleanup_stream(struct strmbase_filter *iface)
Definition: audiorecord.c:672
static void audio_record_destroy(struct strmbase_filter *iface)
Definition: audiorecord.c:495
static struct strmbase_pin * audio_record_get_pin(struct strmbase_filter *iface, unsigned int index)
Definition: audiorecord.c:486
static HRESULT audio_record_query_interface(struct strmbase_filter *iface, REFIID iid, void **out)
Definition: audiorecord.c:508
static HRESULT audio_record_stop_stream(struct strmbase_filter *iface)
Definition: audiorecord.c:658

Definition at line 706 of file audiorecord.c.

Referenced by audio_record_create().

◆ PersistPropertyBagVtbl

const IPersistPropertyBagVtbl PersistPropertyBagVtbl
static
Initial value:
=
{
}
static HRESULT WINAPI PPB_InitNew(IPersistPropertyBag *iface)
Definition: audiorecord.c:746
static HRESULT WINAPI PPB_GetClassID(IPersistPropertyBag *iface, CLSID *pClassID)
Definition: audiorecord.c:739
static ULONG WINAPI PPB_AddRef(IPersistPropertyBag *iface)
Definition: audiorecord.c:725
static ULONG WINAPI PPB_Release(IPersistPropertyBag *iface)
Definition: audiorecord.c:732
static HRESULT WINAPI PPB_Load(IPersistPropertyBag *iface, IPropertyBag *bag, IErrorLog *error_log)
Definition: audiorecord.c:753
static HRESULT WINAPI PPB_Save(IPersistPropertyBag *iface, IPropertyBag *pPropBag, BOOL fClearDirty, BOOL fSaveAllProperties)
Definition: audiorecord.c:772
static HRESULT WINAPI PPB_QueryInterface(IPersistPropertyBag *iface, REFIID riid, LPVOID *ppv)
Definition: audiorecord.c:718

Definition at line 780 of file audiorecord.c.

Referenced by audio_record_create().

◆ property_set_vtbl

const IKsPropertySetVtbl property_set_vtbl
static
Initial value:
=
{
}
static ULONG WINAPI property_set_AddRef(IKsPropertySet *iface)
Definition: audiorecord.c:412
static HRESULT WINAPI property_set_Get(IKsPropertySet *iface, const GUID *set, DWORD id, void *instance, DWORD instance_size, void *data, DWORD size, DWORD *ret_size)
Definition: audiorecord.c:432
static HRESULT WINAPI property_set_QueryInterface(IKsPropertySet *iface, REFIID iid, void **out)
Definition: audiorecord.c:406
static HRESULT WINAPI property_set_Set(IKsPropertySet *iface, const GUID *set, DWORD id, void *instance, DWORD instance_size, void *data, DWORD size)
Definition: audiorecord.c:424
static HRESULT WINAPI property_set_QuerySupported(IKsPropertySet *iface, const GUID *set, DWORD id, DWORD *support)
Definition: audiorecord.c:464
static ULONG WINAPI property_set_Release(IKsPropertySet *iface)
Definition: audiorecord.c:418

Definition at line 471 of file audiorecord.c.

Referenced by audio_record_create().

◆ rate

◆ source_ops

const struct strmbase_source_ops source_ops
static
Initial value:
=
{
.base.pin_get_media_type = audio_record_source_get_media_type,
.base.pin_query_accept = audio_record_source_query_accept,
.base.pin_query_interface = audio_record_source_query_interface,
.pfnAttemptConnection = BaseOutputPinImpl_AttemptConnection,
.pfnDecideAllocator = BaseOutputPinImpl_DecideAllocator,
.pfnDecideBufferSize = audio_record_source_DecideBufferSize,
.source_disconnect = audio_record_source_disconnect,
}
static HRESULT WINAPI audio_record_source_DecideBufferSize(struct strmbase_source *iface, IMemAllocator *allocator, ALLOCATOR_PROPERTIES *props)
Definition: audiorecord.c:159
static HRESULT audio_record_source_query_interface(struct strmbase_pin *iface, REFIID iid, void **out)
Definition: audiorecord.c:57
static HRESULT audio_record_source_get_media_type(struct strmbase_pin *iface, unsigned int index, AM_MEDIA_TYPE *mt)
Definition: audiorecord.c:151
static void audio_record_source_disconnect(struct strmbase_source *iface)
Definition: audiorecord.c:194
static HRESULT audio_record_source_query_accept(struct strmbase_pin *iface, const AM_MEDIA_TYPE *mt)
Definition: audiorecord.c:74
HRESULT WINAPI BaseOutputPinImpl_DecideAllocator(struct strmbase_source *pin, IMemInputPin *peer, IMemAllocator **allocator)
Definition: pin.c:680
HRESULT WINAPI BaseOutputPinImpl_AttemptConnection(struct strmbase_source *pin, IPin *peer, const AM_MEDIA_TYPE *mt)
Definition: pin.c:710

Definition at line 201 of file audiorecord.c.

Referenced by audio_record_create().

◆ stream_config_vtbl

const IAMStreamConfigVtbl stream_config_vtbl
static
Initial value:
=
{
}
static HRESULT WINAPI stream_config_GetNumberOfCapabilities(IAMStreamConfig *iface, int *count, int *size)
Definition: audiorecord.c:285
static ULONG WINAPI stream_config_AddRef(IAMStreamConfig *iface)
Definition: audiorecord.c:223
static ULONG WINAPI stream_config_Release(IAMStreamConfig *iface)
Definition: audiorecord.c:229
static HRESULT WINAPI stream_config_GetFormat(IAMStreamConfig *iface, AM_MEDIA_TYPE **ret_mt)
Definition: audiorecord.c:259
static HRESULT WINAPI stream_config_GetStreamCaps(IAMStreamConfig *iface, int index, AM_MEDIA_TYPE **ret_mt, BYTE *caps)
Definition: audiorecord.c:297
static HRESULT WINAPI stream_config_SetFormat(IAMStreamConfig *iface, AM_MEDIA_TYPE *mt)
Definition: audiorecord.c:235
static HRESULT WINAPI stream_config_QueryInterface(IAMStreamConfig *iface, REFIID iid, void **out)
Definition: audiorecord.c:217

Definition at line 335 of file audiorecord.c.

Referenced by audio_record_create().