ReactOS 0.4.16-dev-297-gc569aee
dsoundrender.c File Reference
#include "config.h"
#include "quartz_private.h"
#include "pin.h"
#include "uuids.h"
#include "vfwmsgs.h"
#include "windef.h"
#include "winbase.h"
#include "dshow.h"
#include "evcode.h"
#include "strmif.h"
#include "dsound.h"
#include "amaudio.h"
#include "wine/unicode.h"
#include "wine/debug.h"
Include dependency graph for dsoundrender.c:

Go to the source code of this file.

Classes

struct  DSoundRenderImpl
 
struct  dsoundrender_timer
 

Typedefs

typedef struct DSoundRenderImpl DSoundRenderImpl
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (quartz)
 
static DSoundRenderImplimpl_from_BaseRenderer (BaseRenderer *iface)
 
static DSoundRenderImplimpl_from_IBaseFilter (IBaseFilter *iface)
 
static DSoundRenderImplimpl_from_IBasicAudio (IBasicAudio *iface)
 
static DSoundRenderImplimpl_from_IReferenceClock (IReferenceClock *iface)
 
static DSoundRenderImplimpl_from_IAMDirectSound (IAMDirectSound *iface)
 
static DSoundRenderImplimpl_from_IAMFilterMiscFlags (IAMFilterMiscFlags *iface)
 
static REFERENCE_TIME time_from_pos (DSoundRenderImpl *This, DWORD pos)
 
static DWORD pos_from_time (DSoundRenderImpl *This, REFERENCE_TIME time)
 
static void DSoundRender_UpdatePositions (DSoundRenderImpl *This, DWORD *seqwritepos, DWORD *minwritepos)
 
static HRESULT DSoundRender_GetWritePos (DSoundRenderImpl *This, DWORD *ret_writepos, REFERENCE_TIME write_at, DWORD *pfree, DWORD *skip)
 
static HRESULT DSoundRender_HandleEndOfStream (DSoundRenderImpl *This)
 
static HRESULT DSoundRender_SendSampleData (DSoundRenderImpl *This, REFERENCE_TIME tStart, REFERENCE_TIME tStop, const BYTE *data, DWORD size)
 
static HRESULT WINAPI DSoundRender_ShouldDrawSampleNow (BaseRenderer *This, IMediaSample *pMediaSample, REFERENCE_TIME *pStartTime, REFERENCE_TIME *pEndTime)
 
static HRESULT WINAPI DSoundRender_PrepareReceive (BaseRenderer *iface, IMediaSample *pSample)
 
static HRESULT WINAPI DSoundRender_DoRenderSample (BaseRenderer *iface, IMediaSample *pSample)
 
static HRESULT WINAPI DSoundRender_CheckMediaType (BaseRenderer *iface, const AM_MEDIA_TYPE *pmt)
 
static VOID WINAPI DSoundRender_OnStopStreaming (BaseRenderer *iface)
 
static VOID WINAPI DSoundRender_OnStartStreaming (BaseRenderer *iface)
 
static HRESULT WINAPI DSoundRender_CompleteConnect (BaseRenderer *iface, IPin *pReceivePin)
 
static HRESULT WINAPI DSoundRender_BreakConnect (BaseRenderer *iface)
 
static HRESULT WINAPI DSoundRender_EndOfStream (BaseRenderer *iface)
 
static HRESULT WINAPI DSoundRender_BeginFlush (BaseRenderer *iface)
 
static HRESULT WINAPI DSoundRender_EndFlush (BaseRenderer *iface)
 
HRESULT DSoundRender_create (IUnknown *pUnkOuter, LPVOID *ppv)
 
static HRESULT WINAPI DSoundRender_QueryInterface (IBaseFilter *iface, REFIID riid, LPVOID *ppv)
 
static ULONG WINAPI DSoundRender_Release (IBaseFilter *iface)
 
static HRESULT WINAPI DSoundRender_Pause (IBaseFilter *iface)
 
static HRESULT WINAPI Basicaudio_QueryInterface (IBasicAudio *iface, REFIID riid, LPVOID *ppvObj)
 
static ULONG WINAPI Basicaudio_AddRef (IBasicAudio *iface)
 
static ULONG WINAPI Basicaudio_Release (IBasicAudio *iface)
 
static HRESULT WINAPI Basicaudio_put_Volume (IBasicAudio *iface, LONG lVolume)
 
static HRESULT WINAPI Basicaudio_get_Volume (IBasicAudio *iface, LONG *plVolume)
 
static HRESULT WINAPI Basicaudio_put_Balance (IBasicAudio *iface, LONG lBalance)
 
static HRESULT WINAPI Basicaudio_get_Balance (IBasicAudio *iface, LONG *plBalance)
 
static DWORD WINAPI DSoundAdviseThread (LPVOID lpParam)
 
static HRESULT WINAPI ReferenceClock_QueryInterface (IReferenceClock *iface, REFIID riid, LPVOID *ppvObj)
 
static ULONG WINAPI ReferenceClock_AddRef (IReferenceClock *iface)
 
static ULONG WINAPI ReferenceClock_Release (IReferenceClock *iface)
 
static HRESULT WINAPI ReferenceClock_GetTime (IReferenceClock *iface, REFERENCE_TIME *pTime)
 
static HRESULT WINAPI ReferenceClock_AdviseTime (IReferenceClock *iface, REFERENCE_TIME rtBaseTime, REFERENCE_TIME rtStreamTime, HEVENT hEvent, DWORD_PTR *pdwAdviseCookie)
 
static HRESULT WINAPI ReferenceClock_AdvisePeriodic (IReferenceClock *iface, REFERENCE_TIME rtStartTime, REFERENCE_TIME rtPeriodTime, HSEMAPHORE hSemaphore, DWORD_PTR *pdwAdviseCookie)
 
static HRESULT WINAPI ReferenceClock_Unadvise (IReferenceClock *iface, DWORD_PTR dwAdviseCookie)
 
static HRESULT WINAPI AMDirectSound_QueryInterface (IAMDirectSound *iface, REFIID riid, LPVOID *ppvObj)
 
static ULONG WINAPI AMDirectSound_AddRef (IAMDirectSound *iface)
 
static ULONG WINAPI AMDirectSound_Release (IAMDirectSound *iface)
 
static HRESULT WINAPI AMDirectSound_GetDirectSoundInterface (IAMDirectSound *iface, IDirectSound **ds)
 
static HRESULT WINAPI AMDirectSound_GetPrimaryBufferInterface (IAMDirectSound *iface, IDirectSoundBuffer **buf)
 
static HRESULT WINAPI AMDirectSound_GetSecondaryBufferInterface (IAMDirectSound *iface, IDirectSoundBuffer **buf)
 
static HRESULT WINAPI AMDirectSound_ReleaseDirectSoundInterface (IAMDirectSound *iface, IDirectSound *ds)
 
static HRESULT WINAPI AMDirectSound_ReleasePrimaryBufferInterface (IAMDirectSound *iface, IDirectSoundBuffer *buf)
 
static HRESULT WINAPI AMDirectSound_ReleaseSecondaryBufferInterface (IAMDirectSound *iface, IDirectSoundBuffer *buf)
 
static HRESULT WINAPI AMDirectSound_SetFocusWindow (IAMDirectSound *iface, HWND hwnd, BOOL bgaudible)
 
static HRESULT WINAPI AMDirectSound_GetFocusWindow (IAMDirectSound *iface, HWND *hwnd, BOOL *bgaudible)
 
static HRESULT WINAPI AMFilterMiscFlags_QueryInterface (IAMFilterMiscFlags *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI AMFilterMiscFlags_AddRef (IAMFilterMiscFlags *iface)
 
static ULONG WINAPI AMFilterMiscFlags_Release (IAMFilterMiscFlags *iface)
 
static ULONG WINAPI AMFilterMiscFlags_GetMiscFlags (IAMFilterMiscFlags *iface)
 

Variables

static const REFERENCE_TIME DSoundRenderer_Max_Fill = 150 * 10000
 
static const IBaseFilterVtbl DSoundRender_Vtbl
 
static const IBasicAudioVtbl IBasicAudio_Vtbl
 
static const IReferenceClockVtbl IReferenceClock_Vtbl
 
static const IAMDirectSoundVtbl IAMDirectSound_Vtbl
 
static const IAMFilterMiscFlagsVtbl IAMFilterMiscFlags_Vtbl
 
static const BaseRendererFuncTable BaseFuncTable
 
static LONG cookie_counter = 1
 

Typedef Documentation

◆ DSoundRenderImpl

Function Documentation

◆ AMDirectSound_AddRef()

static ULONG WINAPI AMDirectSound_AddRef ( IAMDirectSound *  iface)
static

Definition at line 1176 of file dsoundrender.c.

1177{
1179
1180 TRACE("(%p/%p)->()\n", This, iface);
1181
1182 return BaseFilterImpl_AddRef(&This->renderer.filter.IBaseFilter_iface);
1183}
static DSoundRenderImpl * impl_from_IAMDirectSound(IAMDirectSound *iface)
Definition: dsoundrender.c:98
#define TRACE(s)
Definition: solgame.cpp:4
ULONG WINAPI BaseFilterImpl_AddRef(IBaseFilter *iface)
Definition: filter.c:54

◆ AMDirectSound_GetDirectSoundInterface()

static HRESULT WINAPI AMDirectSound_GetDirectSoundInterface ( IAMDirectSound *  iface,
IDirectSound **  ds 
)
static

Definition at line 1195 of file dsoundrender.c.

1196{
1198
1199 FIXME("(%p/%p)->(%p): stub\n", This, iface, ds);
1200
1201 return E_NOTIMPL;
1202}
#define FIXME(fmt,...)
Definition: precomp.h:53
#define E_NOTIMPL
Definition: ddrawi.h:99
#define ds
Definition: i386-dis.c:443

◆ AMDirectSound_GetFocusWindow()

static HRESULT WINAPI AMDirectSound_GetFocusWindow ( IAMDirectSound *  iface,
HWND hwnd,
BOOL bgaudible 
)
static

Definition at line 1258 of file dsoundrender.c.

1259{
1261
1262 FIXME("(%p/%p)->(%p,%p): stub\n", This, iface, hwnd, bgaudible);
1263
1264 return E_NOTIMPL;
1265}
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023

◆ AMDirectSound_GetPrimaryBufferInterface()

static HRESULT WINAPI AMDirectSound_GetPrimaryBufferInterface ( IAMDirectSound *  iface,
IDirectSoundBuffer **  buf 
)
static

Definition at line 1204 of file dsoundrender.c.

1205{
1207
1208 FIXME("(%p/%p)->(%p): stub\n", This, iface, buf);
1209
1210 return E_NOTIMPL;
1211}
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751

◆ AMDirectSound_GetSecondaryBufferInterface()

static HRESULT WINAPI AMDirectSound_GetSecondaryBufferInterface ( IAMDirectSound *  iface,
IDirectSoundBuffer **  buf 
)
static

Definition at line 1213 of file dsoundrender.c.

1214{
1216
1217 FIXME("(%p/%p)->(%p): stub\n", This, iface, buf);
1218
1219 return E_NOTIMPL;
1220}

◆ AMDirectSound_QueryInterface()

static HRESULT WINAPI AMDirectSound_QueryInterface ( IAMDirectSound *  iface,
REFIID  riid,
LPVOID ppvObj 
)
static

Definition at line 1165 of file dsoundrender.c.

1168{
1170
1171 TRACE("(%p/%p)->(%s, %p)\n", This, iface, debugstr_guid(riid), ppvObj);
1172
1173 return DSoundRender_QueryInterface(&This->renderer.filter.IBaseFilter_iface, riid, ppvObj);
1174}
static HRESULT WINAPI DSoundRender_QueryInterface(IBaseFilter *iface, REFIID riid, LPVOID *ppv)
Definition: dsoundrender.c:685
REFIID riid
Definition: atlbase.h:39
#define debugstr_guid
Definition: kernel32.h:35

◆ AMDirectSound_Release()

static ULONG WINAPI AMDirectSound_Release ( IAMDirectSound *  iface)
static

Definition at line 1185 of file dsoundrender.c.

1186{
1188
1189 TRACE("(%p/%p)->()\n", This, iface);
1190
1191 return DSoundRender_Release(&This->renderer.filter.IBaseFilter_iface);
1192}
static ULONG WINAPI DSoundRender_Release(IBaseFilter *iface)
Definition: dsoundrender.c:720

◆ AMDirectSound_ReleaseDirectSoundInterface()

static HRESULT WINAPI AMDirectSound_ReleaseDirectSoundInterface ( IAMDirectSound *  iface,
IDirectSound *  ds 
)
static

Definition at line 1222 of file dsoundrender.c.

1223{
1225
1226 FIXME("(%p/%p)->(%p): stub\n", This, iface, ds);
1227
1228 return E_NOTIMPL;
1229}

◆ AMDirectSound_ReleasePrimaryBufferInterface()

static HRESULT WINAPI AMDirectSound_ReleasePrimaryBufferInterface ( IAMDirectSound *  iface,
IDirectSoundBuffer *  buf 
)
static

Definition at line 1231 of file dsoundrender.c.

1232{
1234
1235 FIXME("(%p/%p)->(%p): stub\n", This, iface, buf);
1236
1237 return E_NOTIMPL;
1238}

◆ AMDirectSound_ReleaseSecondaryBufferInterface()

static HRESULT WINAPI AMDirectSound_ReleaseSecondaryBufferInterface ( IAMDirectSound *  iface,
IDirectSoundBuffer *  buf 
)
static

Definition at line 1240 of file dsoundrender.c.

1241{
1243
1244 FIXME("(%p/%p)->(%p): stub\n", This, iface, buf);
1245
1246 return E_NOTIMPL;
1247}

◆ AMDirectSound_SetFocusWindow()

static HRESULT WINAPI AMDirectSound_SetFocusWindow ( IAMDirectSound *  iface,
HWND  hwnd,
BOOL  bgaudible 
)
static

Definition at line 1249 of file dsoundrender.c.

1250{
1252
1253 FIXME("(%p/%p)->(%p,%d): stub\n", This, iface, hwnd, bgaudible);
1254
1255 return E_NOTIMPL;
1256}

◆ AMFilterMiscFlags_AddRef()

static ULONG WINAPI AMFilterMiscFlags_AddRef ( IAMFilterMiscFlags iface)
static

Definition at line 1287 of file dsoundrender.c.

1287 {
1289 return IBaseFilter_AddRef(&This->renderer.filter.IBaseFilter_iface);
1290}
static DSoundRenderImpl * impl_from_IAMFilterMiscFlags(IAMFilterMiscFlags *iface)
Definition: dsoundrender.c:103

◆ AMFilterMiscFlags_GetMiscFlags()

static ULONG WINAPI AMFilterMiscFlags_GetMiscFlags ( IAMFilterMiscFlags iface)
static

Definition at line 1297 of file dsoundrender.c.

1297 {
1299}
@ AM_FILTER_MISC_FLAGS_IS_RENDERER
Definition: axextend.idl:1239

◆ AMFilterMiscFlags_QueryInterface()

static HRESULT WINAPI AMFilterMiscFlags_QueryInterface ( IAMFilterMiscFlags iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 1282 of file dsoundrender.c.

1282 {
1284 return IBaseFilter_QueryInterface(&This->renderer.filter.IBaseFilter_iface, riid, ppv);
1285}
REFIID LPVOID * ppv
Definition: atlbase.h:39

◆ AMFilterMiscFlags_Release()

static ULONG WINAPI AMFilterMiscFlags_Release ( IAMFilterMiscFlags iface)
static

Definition at line 1292 of file dsoundrender.c.

1292 {
1294 return IBaseFilter_Release(&This->renderer.filter.IBaseFilter_iface);
1295}

◆ Basicaudio_AddRef()

static ULONG WINAPI Basicaudio_AddRef ( IBasicAudio *  iface)
static

Definition at line 814 of file dsoundrender.c.

814 {
816
817 TRACE("(%p/%p)->()\n", This, iface);
818
819 return BaseFilterImpl_AddRef(&This->renderer.filter.IBaseFilter_iface);
820}
static DSoundRenderImpl * impl_from_IBasicAudio(IBasicAudio *iface)
Definition: dsoundrender.c:88

◆ Basicaudio_get_Balance()

static HRESULT WINAPI Basicaudio_get_Balance ( IBasicAudio *  iface,
LONG plBalance 
)
static

Definition at line 880 of file dsoundrender.c.

881 {
883
884 TRACE("(%p/%p)->(%p)\n", This, iface, plBalance);
885
886 if (!plBalance)
887 return E_POINTER;
888
889 *plBalance = This->pan;
890 return S_OK;
891}
#define S_OK
Definition: intsafe.h:52
#define E_POINTER
Definition: winerror.h:2365

◆ Basicaudio_get_Volume()

static HRESULT WINAPI Basicaudio_get_Volume ( IBasicAudio *  iface,
LONG plVolume 
)
static

Definition at line 849 of file dsoundrender.c.

850 {
852
853 TRACE("(%p/%p)->(%p)\n", This, iface, plVolume);
854
855 if (!plVolume)
856 return E_POINTER;
857
858 *plVolume = This->volume;
859 return S_OK;
860}

◆ Basicaudio_put_Balance()

static HRESULT WINAPI Basicaudio_put_Balance ( IBasicAudio *  iface,
LONG  lBalance 
)
static

Definition at line 862 of file dsoundrender.c.

863 {
865
866 TRACE("(%p/%p)->(%d)\n", This, iface, lBalance);
867
868 if (lBalance < DSBPAN_LEFT || lBalance > DSBPAN_RIGHT)
869 return E_INVALIDARG;
870
871 if (This->dsbuffer) {
872 if (FAILED(IDirectSoundBuffer_SetPan(This->dsbuffer, lBalance)))
873 return E_FAIL;
874 }
875
876 This->pan = lBalance;
877 return S_OK;
878}
#define E_INVALIDARG
Definition: ddrawi.h:101
#define E_FAIL
Definition: ddrawi.h:102
#define IDirectSoundBuffer_SetPan(p, a)
Definition: dsound.h:589
#define DSBPAN_RIGHT
Definition: dsound.h:228
#define FAILED(hr)
Definition: intsafe.h:51

◆ Basicaudio_put_Volume()

static HRESULT WINAPI Basicaudio_put_Volume ( IBasicAudio *  iface,
LONG  lVolume 
)
static

Definition at line 831 of file dsoundrender.c.

832 {
834
835 TRACE("(%p/%p)->(%d)\n", This, iface, lVolume);
836
837 if (lVolume > DSBVOLUME_MAX || lVolume < DSBVOLUME_MIN)
838 return E_INVALIDARG;
839
840 if (This->dsbuffer) {
841 if (FAILED(IDirectSoundBuffer_SetVolume(This->dsbuffer, lVolume)))
842 return E_FAIL;
843 }
844
845 This->volume = lVolume;
846 return S_OK;
847}
#define DSBVOLUME_MAX
Definition: dsound.h:229
#define DSBVOLUME_MIN
Definition: dsound.h:230
#define IDirectSoundBuffer_SetVolume(p, a)
Definition: dsound.h:588

◆ Basicaudio_QueryInterface()

static HRESULT WINAPI Basicaudio_QueryInterface ( IBasicAudio *  iface,
REFIID  riid,
LPVOID ppvObj 
)
static

Definition at line 804 of file dsoundrender.c.

806 {
808
809 TRACE("(%p/%p)->(%s, %p)\n", This, iface, debugstr_guid(riid), ppvObj);
810
811 return DSoundRender_QueryInterface(&This->renderer.filter.IBaseFilter_iface, riid, ppvObj);
812}

◆ Basicaudio_Release()

static ULONG WINAPI Basicaudio_Release ( IBasicAudio *  iface)
static

Definition at line 822 of file dsoundrender.c.

822 {
824
825 TRACE("(%p/%p)->()\n", This, iface);
826
827 return DSoundRender_Release(&This->renderer.filter.IBaseFilter_iface);
828}

◆ DSoundAdviseThread()

static DWORD WINAPI DSoundAdviseThread ( LPVOID  lpParam)
static

Definition at line 917 of file dsoundrender.c.

917 {
918 DSoundRenderImpl *This = lpParam;
919 struct dsoundrender_timer head = {NULL};
920 MSG msg;
921
922 TRACE("(%p): Main Loop\n", This);
923
925 SetEvent(This->thread_wait);
926
927 while (1)
928 {
929 HRESULT hr;
930 REFERENCE_TIME curtime = 0;
931 BOOL ret;
932 struct dsoundrender_timer *prev = &head, *cur;
933
934 hr = IReferenceClock_GetTime(&This->IReferenceClock_iface, &curtime);
935 if (SUCCEEDED(hr)) {
936 TRACE("Time: %s\n", wine_dbgstr_longlong(curtime));
937 while (prev->next) {
938 cur = prev->next;
939 if (cur->start > curtime) {
940 TRACE("Skipping %p\n", cur);
941 prev = cur;
942 } else if (cur->periodicity) {
943 while (cur->start <= curtime) {
944 cur->start += cur->periodicity;
945 ReleaseSemaphore(cur->handle, 1, NULL);
946 }
947 prev = cur;
948 } else {
949 struct dsoundrender_timer *next = cur->next;
950 TRACE("Firing %p %s < %s\n", cur, wine_dbgstr_longlong(cur->start), wine_dbgstr_longlong(curtime));
951 SetEvent(cur->handle);
953 prev->next = next;
954 }
955 }
956 }
957 if (!head.next)
959 else
961 while (ret) {
962 switch (LOWORD(msg.message) - WM_APP) {
963 case 0: TRACE("Exiting\n"); return 0;
964 case 1:
965 case 2: {
966 struct dsoundrender_timer *t = (struct dsoundrender_timer *)msg.wParam;
967 if (LOWORD(msg.message) - WM_APP == 1)
968 TRACE("Adding one-shot timer %p\n", t);
969 else
970 TRACE("Adding periodic timer %p\n", t);
971 t->next = head.next;
972 head.next = t;
973 break;
974 }
975 case 3:
976 prev = &head;
977 while (prev->next) {
978 cur = prev->next;
979 if (cur->cookie == msg.wParam) {
980 struct dsoundrender_timer *next = cur->next;
982 prev->next = next;
983 break;
984 }
985 prev = cur;
986 }
987 break;
988 }
990 }
992 }
993 return 0;
994}
struct outqueuenode * head
Definition: adnsresfilter.c:66
#define msg(x)
Definition: auth_time.c:54
#define NULL
Definition: types.h:112
#define GetProcessHeap()
Definition: compat.h:736
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
static __inline const char * wine_dbgstr_longlong(ULONGLONG ll)
Definition: compat.h:49
#define HeapFree(x, y, z)
Definition: compat.h:735
#define IReferenceClock_GetTime(p, a)
Definition: dmusicc.h:754
LONGLONG REFERENCE_TIME
Definition: dmusicks.h:9
#define WM_APP
Definition: eventvwr.h:73
unsigned int BOOL
Definition: ntddk_ex.h:94
FxCollectionEntry * cur
GLdouble GLdouble t
Definition: gl.h:2047
#define SUCCEEDED(hr)
Definition: intsafe.h:50
if(dx< 0)
Definition: linetemp.h:194
#define LOWORD(l)
Definition: pedump.c:82
static unsigned __int64 next
Definition: rand_nt.c:6
HRESULT hr
Definition: shlfolder.c:183
struct dsoundrender_timer * next
Definition: dsoundrender.c:909
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
Definition: synch.c:733
BOOL WINAPI DECLSPEC_HOTPATCH ReleaseSemaphore(IN HANDLE hSemaphore, IN LONG lReleaseCount, IN LPLONG lpPreviousCount)
Definition: synch.c:542
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1829
int ret
BOOL WINAPI GetMessageW(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT)
DWORD WINAPI MsgWaitForMultipleObjects(_In_ DWORD nCount, _In_reads_opt_(nCount) CONST HANDLE *pHandles, _In_ BOOL fWaitAll, _In_ DWORD dwMilliseconds, _In_ DWORD dwWakeMask)
BOOL WINAPI PeekMessageW(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT, _In_ UINT)
#define PM_REMOVE
Definition: winuser.h:1199
#define QS_POSTMESSAGE
Definition: winuser.h:880
#define WM_USER
Definition: winuser.h:1898
#define PM_NOREMOVE
Definition: winuser.h:1198

Referenced by ReferenceClock_AdvisePeriodic(), and ReferenceClock_AdviseTime().

◆ DSoundRender_BeginFlush()

static HRESULT WINAPI DSoundRender_BeginFlush ( BaseRenderer iface)
static

Definition at line 560 of file dsoundrender.c.

561{
563
564 TRACE("\n");
566 SetEvent(This->blocked);
567
568 return S_OK;
569}
static DSoundRenderImpl * impl_from_BaseRenderer(BaseRenderer *iface)
Definition: dsoundrender.c:78
HRESULT WINAPI BaseRendererImpl_BeginFlush(BaseRenderer *iface)
Definition: renderer.c:590

◆ DSoundRender_BreakConnect()

static HRESULT WINAPI DSoundRender_BreakConnect ( BaseRenderer iface)
static

Definition at line 521 of file dsoundrender.c.

522{
524
525 TRACE("(%p)->()\n", iface);
526
527 if (This->threadid) {
528 PostThreadMessageW(This->threadid, WM_APP, 0, 0);
529 LeaveCriticalSection(This->renderer.pInputPin->pin.pCritSec);
530 WaitForSingleObject(This->advisethread, INFINITE);
531 EnterCriticalSection(This->renderer.pInputPin->pin.pCritSec);
532 CloseHandle(This->advisethread);
533 }
534 if (This->dsbuffer)
536 This->dsbuffer = NULL;
537
538 return S_OK;
539}
#define CloseHandle
Definition: compat.h:739
#define INFINITE
Definition: serial.h:102
#define IDirectSoundBuffer_Release(p)
Definition: dsound.h:574
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
BOOL WINAPI PostThreadMessageW(_In_ DWORD, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

◆ DSoundRender_CheckMediaType()

static HRESULT WINAPI DSoundRender_CheckMediaType ( BaseRenderer iface,
const AM_MEDIA_TYPE pmt 
)
static

Definition at line 416 of file dsoundrender.c.

417{
419
420 if (!IsEqualIID(&pmt->majortype, &MEDIATYPE_Audio))
421 return S_FALSE;
422
423 format = (WAVEFORMATEX*)pmt->pbFormat;
424 TRACE("Format = %p\n", format);
425 TRACE("wFormatTag = %x %x\n", format->wFormatTag, WAVE_FORMAT_PCM);
426 TRACE("nChannels = %d\n", format->nChannels);
427 TRACE("nSamplesPerSec = %d\n", format->nSamplesPerSec);
428 TRACE("nAvgBytesPerSec = %d\n", format->nAvgBytesPerSec);
429 TRACE("nBlockAlign = %d\n", format->nBlockAlign);
430 TRACE("wBitsPerSample = %d\n", format->wBitsPerSample);
431
432 if (!IsEqualIID(&pmt->subtype, &MEDIASUBTYPE_PCM))
433 return S_FALSE;
434
435 return S_OK;
436}
#define WAVE_FORMAT_PCM
Definition: constants.h:425
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95
Definition: format.c:58
#define S_FALSE
Definition: winerror.h:2357

◆ DSoundRender_CompleteConnect()

static HRESULT WINAPI DSoundRender_CompleteConnect ( BaseRenderer iface,
IPin pReceivePin 
)
static

Definition at line 467 of file dsoundrender.c.

468{
470 const AM_MEDIA_TYPE * pmt = &This->renderer.pInputPin->pin.mtCurrent;
471 HRESULT hr = S_OK;
473 DSBUFFERDESC buf_desc;
474
475 TRACE("(%p)->(%p)\n", This, pReceivePin);
477
478 TRACE("MajorType %s\n", debugstr_guid(&pmt->majortype));
479 TRACE("SubType %s\n", debugstr_guid(&pmt->subtype));
480 TRACE("Format %s\n", debugstr_guid(&pmt->formattype));
481 TRACE("Size %d\n", pmt->cbFormat);
482
483 format = (WAVEFORMATEX*)pmt->pbFormat;
484
485 This->buf_size = format->nAvgBytesPerSec;
486
487 memset(&buf_desc,0,sizeof(DSBUFFERDESC));
488 buf_desc.dwSize = sizeof(DSBUFFERDESC);
492 buf_desc.dwBufferBytes = This->buf_size;
493 buf_desc.lpwfxFormat = format;
494 hr = IDirectSound8_CreateSoundBuffer(This->dsound, &buf_desc, &This->dsbuffer, NULL);
495 This->writepos = This->buf_size;
496 if (FAILED(hr))
497 ERR("Can't create sound buffer (%x)\n", hr);
498
499 if (SUCCEEDED(hr))
500 {
501 hr = IDirectSoundBuffer_SetVolume(This->dsbuffer, This->volume);
502 if (FAILED(hr))
503 ERR("Can't set volume to %d (%x)\n", This->volume, hr);
504
505 hr = IDirectSoundBuffer_SetPan(This->dsbuffer, This->pan);
506 if (FAILED(hr))
507 ERR("Can't set pan to %d (%x)\n", This->pan, hr);
508 hr = S_OK;
509 }
510
512 {
513 if (This->dsbuffer)
515 This->dsbuffer = NULL;
516 }
517
518 return hr;
519}
#define ERR(fmt,...)
Definition: precomp.h:57
#define IDirectSound8_CreateSoundBuffer(p, a, b, c)
Definition: dsound.h:509
struct _DSBUFFERDESC DSBUFFERDESC
#define DSBCAPS_GLOBALFOCUS
Definition: dsound.h:219
#define DSBCAPS_CTRLVOLUME
Definition: dsound.h:213
#define DSBCAPS_GETCURRENTPOSITION2
Definition: dsound.h:220
#define DSBCAPS_CTRLPAN
Definition: dsound.h:212
#define DSBCAPS_CTRLFREQUENCY
Definition: dsound.h:211
void dump_AM_MEDIA_TYPE(const AM_MEDIA_TYPE *pmt)
Definition: enummedia.c:38
#define memset(x, y, z)
Definition: compat.h:39
DWORD dwSize
Definition: dsound.h:288
DWORD dwFlags
Definition: dsound.h:289
DWORD dwBufferBytes
Definition: dsound.h:290
LPWAVEFORMATEX lpwfxFormat
Definition: dsound.h:292
#define VFW_E_ALREADY_CONNECTED
Definition: vfwmsgs.h:43

◆ DSoundRender_create()

HRESULT DSoundRender_create ( IUnknown pUnkOuter,
LPVOID ppv 
)

Definition at line 618 of file dsoundrender.c.

619{
620 HRESULT hr;
621 DSoundRenderImpl * pDSoundRender;
622
623 TRACE("(%p, %p)\n", pUnkOuter, ppv);
624
625 *ppv = NULL;
626
627 if (pUnkOuter)
629
630 pDSoundRender = CoTaskMemAlloc(sizeof(DSoundRenderImpl));
631 if (!pDSoundRender)
632 return E_OUTOFMEMORY;
633 ZeroMemory(pDSoundRender, sizeof(DSoundRenderImpl));
634
635 hr = BaseRenderer_Init(&pDSoundRender->renderer, &DSoundRender_Vtbl, (IUnknown*)pDSoundRender, &CLSID_DSoundRender, (DWORD_PTR)(__FILE__ ": DSoundRenderImpl.csFilter"), &BaseFuncTable);
636
638 pDSoundRender->IReferenceClock_iface.lpVtbl = &IReferenceClock_Vtbl;
639 pDSoundRender->IAMDirectSound_iface.lpVtbl = &IAMDirectSound_Vtbl;
640 pDSoundRender->IAMFilterMiscFlags_iface.lpVtbl = &IAMFilterMiscFlags_Vtbl;
641
642 if (SUCCEEDED(hr))
643 {
644 hr = DirectSoundCreate8(NULL, &pDSoundRender->dsound, NULL);
645 if (FAILED(hr))
646 ERR("Cannot create Direct Sound object (%x)\n", hr);
647 else
649 if (SUCCEEDED(hr)) {
650 IDirectSoundBuffer *buf;
651 DSBUFFERDESC buf_desc;
652 memset(&buf_desc,0,sizeof(DSBUFFERDESC));
653 buf_desc.dwSize = sizeof(DSBUFFERDESC);
655 hr = IDirectSound8_CreateSoundBuffer(pDSoundRender->dsound, &buf_desc, &buf, NULL);
656 if (SUCCEEDED(hr)) {
659 }
660 hr = S_OK;
661 }
662 }
663
664 if (SUCCEEDED(hr))
665 {
666 pDSoundRender->blocked = CreateEventW(NULL, TRUE, TRUE, NULL);
667
668 if (!pDSoundRender->blocked || FAILED(hr))
669 {
670 IBaseFilter_Release(&pDSoundRender->renderer.filter.IBaseFilter_iface);
672 }
673
674 *ppv = pDSoundRender;
675 }
676 else
677 {
679 CoTaskMemFree(pDSoundRender);
680 }
681
682 return hr;
683}
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
HRESULT WINAPI DirectSoundCreate8(LPCGUID lpcGUID, LPDIRECTSOUND8 *ppDS, IUnknown *pUnkOuter)
Definition: directsound.c:504
#define TRUE
Definition: types.h:120
static const IAMFilterMiscFlagsVtbl IAMFilterMiscFlags_Vtbl
Definition: dsoundrender.c:50
static const IAMDirectSoundVtbl IAMDirectSound_Vtbl
Definition: dsoundrender.c:49
static const IBaseFilterVtbl DSoundRender_Vtbl
Definition: dsoundrender.c:46
static const BaseRendererFuncTable BaseFuncTable
Definition: dsoundrender.c:596
static const IReferenceClockVtbl IReferenceClock_Vtbl
Definition: dsoundrender.c:48
static const IBasicAudioVtbl IBasicAudio_Vtbl
Definition: dsoundrender.c:47
#define DSSCL_PRIORITY
Definition: dsound.h:248
#define IDirectSoundBuffer_Play(p, a, b, c)
Definition: dsound.h:585
#define DSBPLAY_LOOPING
Definition: dsound.h:189
#define DSBCAPS_PRIMARYBUFFER
Definition: dsound.h:206
#define IDirectSound8_SetCooperativeLevel(p, a, b)
Definition: dsound.h:512
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:442
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
Definition: ifs.c:426
HRESULT WINAPI BasicAudio_Init(BasicAudio *pBasicAudio, const IBasicAudioVtbl *lpVtbl)
Definition: audio.c:36
ULONG WINAPI BaseRendererImpl_Release(IBaseFilter *iface)
Definition: renderer.c:296
HRESULT WINAPI BaseRenderer_Init(BaseRenderer *This, const IBaseFilterVtbl *Vtbl, IUnknown *pUnkOuter, const CLSID *pClsid, DWORD_PTR DebugInfo, const BaseRendererFuncTable *pBaseFuncsTable)
Definition: renderer.c:241
IBaseFilter IBaseFilter_iface
Definition: strmbase.h:163
BaseFilter filter
Definition: strmbase.h:580
IAMFilterMiscFlags IAMFilterMiscFlags_iface
Definition: dsoundrender.c:59
IReferenceClock IReferenceClock_iface
Definition: dsoundrender.c:57
IDirectSound8 * dsound
Definition: dsoundrender.c:61
BasicAudio basicAudio
Definition: dsoundrender.c:55
IAMDirectSound IAMDirectSound_iface
Definition: dsoundrender.c:58
BaseRenderer renderer
Definition: dsoundrender.c:54
HANDLE WINAPI DECLSPEC_HOTPATCH CreateEventW(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL, IN BOOL bManualReset, IN BOOL bInitialState, IN LPCWSTR lpName OPTIONAL)
Definition: synch.c:651
uint32_t DWORD_PTR
Definition: typedefs.h:65
#define ZeroMemory
Definition: winbase.h:1737
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
#define CLASS_E_NOAGGREGATION
Definition: winerror.h:2662
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92
HWND WINAPI GetDesktopWindow(void)
Definition: window.c:628

◆ DSoundRender_DoRenderSample()

static HRESULT WINAPI DSoundRender_DoRenderSample ( BaseRenderer iface,
IMediaSample pSample 
)
static

Definition at line 359 of file dsoundrender.c.

360{
362 LPBYTE pbSrcStream = NULL;
363 LONG cbSrcStream = 0;
364 REFERENCE_TIME tStart, tStop;
365 HRESULT hr;
366
367 TRACE("%p %p\n", iface, pSample);
368
369 /* Slightly incorrect, Pause completes when a frame is received so we should signal
370 * pause completion here, but for sound playing a single frame doesn't make sense
371 */
372
373 hr = IMediaSample_GetPointer(pSample, &pbSrcStream);
374 if (FAILED(hr))
375 {
376 ERR("Cannot get pointer to sample data (%x)\n", hr);
377 return hr;
378 }
379
380 hr = IMediaSample_GetTime(pSample, &tStart, &tStop);
381 if (FAILED(hr)) {
382 ERR("Cannot get sample time (%x)\n", hr);
383 tStart = tStop = -1;
384 }
385
386 IMediaSample_IsDiscontinuity(pSample);
387
388 if (IMediaSample_IsPreroll(pSample) == S_OK)
389 {
390 TRACE("Preroll!\n");
391 return S_OK;
392 }
393
394 cbSrcStream = IMediaSample_GetActualDataLength(pSample);
395 TRACE("Sample data ptr = %p, size = %d\n", pbSrcStream, cbSrcStream);
396
397 hr = DSoundRender_SendSampleData(This, tStart, tStop, pbSrcStream, cbSrcStream);
398 if (This->renderer.filter.state == State_Running && This->renderer.filter.pClock && tStart >= 0) {
399 REFERENCE_TIME jitter, now = 0;
400 Quality q;
401 IReferenceClock_GetTime(This->renderer.filter.pClock, &now);
402 jitter = now - This->renderer.filter.rtStreamStart - tStart;
403 if (jitter <= -DSoundRenderer_Max_Fill)
404 jitter += DSoundRenderer_Max_Fill;
405 else if (jitter < 0)
406 jitter = 0;
407 q.Type = (jitter > 0 ? Famine : Flood);
408 q.Proportion = 1000;
409 q.Late = jitter;
410 q.TimeStamp = tStart;
411 IQualityControl_Notify((IQualityControl *)This->renderer.qcimpl, (IBaseFilter*)This, q);
412 }
413 return hr;
414}
static const REFERENCE_TIME DSoundRenderer_Max_Fill
Definition: dsoundrender.c:44
static HRESULT DSoundRender_SendSampleData(DSoundRenderImpl *This, REFERENCE_TIME tStart, REFERENCE_TIME tStop, const BYTE *data, DWORD size)
Definition: dsoundrender.c:264
time_t now
Definition: finger.c:65
GLdouble GLdouble GLdouble GLdouble q
Definition: gl.h:2063
long LONG
Definition: pedump.c:60
unsigned char * LPBYTE
Definition: typedefs.h:53

◆ DSoundRender_EndFlush()

static HRESULT WINAPI DSoundRender_EndFlush ( BaseRenderer iface)
static

Definition at line 571 of file dsoundrender.c.

572{
574
575 TRACE("\n");
576
578 if (This->renderer.filter.state != State_Stopped)
579 ResetEvent(This->blocked);
580
581 if (This->dsbuffer)
582 {
584 DWORD size;
585
586 /* Force a reset */
588 memset(buffer, 0, size);
590 This->writepos = This->buf_size;
591 }
592
593 return S_OK;
594}
#define IDirectSoundBuffer_Unlock(p, a, b, c, d)
Definition: dsound.h:592
#define DSBLOCK_ENTIREBUFFER
Definition: dsound.h:204
#define IDirectSoundBuffer_Lock(p, a, b, c, d, e, f, g)
Definition: dsound.h:584
unsigned long DWORD
Definition: ntddk_ex.h:95
GLsizeiptr size
Definition: glext.h:5919
GLuint buffer
Definition: glext.h:5915
HRESULT WINAPI BaseRendererImpl_EndFlush(BaseRenderer *iface)
Definition: renderer.c:599
BOOL WINAPI DECLSPEC_HOTPATCH ResetEvent(IN HANDLE hEvent)
Definition: synch.c:714

◆ DSoundRender_EndOfStream()

static HRESULT WINAPI DSoundRender_EndOfStream ( BaseRenderer iface)
static

Definition at line 541 of file dsoundrender.c.

542{
544 HRESULT hr;
545
546 TRACE("(%p)->()\n",iface);
547
549 if (hr != S_OK)
550 {
551 ERR("%08x\n", hr);
552 return hr;
553 }
554
556
557 return hr;
558}
static HRESULT DSoundRender_HandleEndOfStream(DSoundRenderImpl *This)
Definition: dsoundrender.c:243
HRESULT WINAPI BaseRendererImpl_EndOfStream(BaseRenderer *iface)
Definition: renderer.c:567

◆ DSoundRender_GetWritePos()

static HRESULT DSoundRender_GetWritePos ( DSoundRenderImpl This,
DWORD ret_writepos,
REFERENCE_TIME  write_at,
DWORD pfree,
DWORD skip 
)
static

Definition at line 161 of file dsoundrender.c.

162{
163 WAVEFORMATEX *wfx = (WAVEFORMATEX*)This->renderer.pInputPin->pin.mtCurrent.pbFormat;
164 DWORD writepos, min_writepos, playpos;
165 REFERENCE_TIME max_lag = 50 * 10000;
166 REFERENCE_TIME min_lag = 25 * 10000;
167 REFERENCE_TIME cur, writepos_t, delta_t;
168
169 DSoundRender_UpdatePositions(This, &writepos, &min_writepos);
170 playpos = This->last_playpos;
171 if (This->renderer.filter.pClock == &This->IReferenceClock_iface) {
172 max_lag = min_lag;
173 cur = This->play_time + time_from_pos(This, playpos);
174 cur -= This->renderer.filter.rtStreamStart;
175 } else if (This->renderer.filter.pClock) {
176 IReferenceClock_GetTime(This->renderer.filter.pClock, &cur);
177 cur -= This->renderer.filter.rtStreamStart;
178 } else
179 write_at = -1;
180
181 if (writepos == min_writepos)
182 max_lag = 0;
183
184 *skip = 0;
185 if (write_at < 0) {
186 *ret_writepos = writepos;
187 goto end;
188 }
189
190 if (writepos >= playpos)
191 writepos_t = cur + time_from_pos(This, writepos - playpos);
192 else
193 writepos_t = cur + time_from_pos(This, This->buf_size + writepos - playpos);
194
195 /* write_at: Starting time of sample */
196 /* cur: current time of play position */
197 /* writepos_t: current time of our pointer play position */
198 delta_t = write_at - writepos_t;
199 if (delta_t >= -max_lag && delta_t <= max_lag) {
200 TRACE("Continuing from old position\n");
201 *ret_writepos = writepos;
202 } else if (delta_t < 0) {
203 REFERENCE_TIME past, min_writepos_t;
204 WARN("Delta too big %i/%i, overwriting old data or even skipping\n", (int)delta_t / 10000, (int)max_lag / 10000);
205 if (min_writepos >= playpos)
206 min_writepos_t = cur + time_from_pos(This, min_writepos - playpos);
207 else
208 min_writepos_t = cur + time_from_pos(This, This->buf_size - playpos + min_writepos);
209 past = min_writepos_t - write_at;
210 if (past >= 0) {
211 DWORD skipbytes = pos_from_time(This, past);
212 WARN("Skipping %u bytes\n", skipbytes);
213 *skip = skipbytes;
214 *ret_writepos = min_writepos;
215 } else {
216 DWORD aheadbytes = pos_from_time(This, -past);
217 WARN("Advancing %u bytes\n", aheadbytes);
218 *ret_writepos = (min_writepos + aheadbytes) % This->buf_size;
219 }
220 } else /* delta_t > 0 */ {
221 DWORD aheadbytes;
222 WARN("Delta too big %i/%i, too far ahead\n", (int)delta_t / 10000, (int)max_lag / 10000);
223 aheadbytes = pos_from_time(This, delta_t);
224 WARN("Advancing %u bytes\n", aheadbytes);
225 if (delta_t >= DSoundRenderer_Max_Fill)
226 return S_FALSE;
227 *ret_writepos = (min_writepos + aheadbytes) % This->buf_size;
228 }
229end:
230 if (playpos > *ret_writepos)
231 *pfree = playpos - *ret_writepos;
232 else if (playpos == *ret_writepos)
233 *pfree = This->buf_size - wfx->nBlockAlign;
234 else
235 *pfree = This->buf_size + playpos - *ret_writepos;
236 if (time_from_pos(This, This->buf_size - *pfree) >= DSoundRenderer_Max_Fill) {
237 TRACE("Blocked: too full %i / %i\n", (int)(time_from_pos(This, This->buf_size - *pfree)/10000), (int)(DSoundRenderer_Max_Fill / 10000));
238 return S_FALSE;
239 }
240 return S_OK;
241}
#define skip(...)
Definition: atltest.h:64
#define WARN(fmt,...)
Definition: precomp.h:61
static void DSoundRender_UpdatePositions(DSoundRenderImpl *This, DWORD *seqwritepos, DWORD *minwritepos)
Definition: dsoundrender.c:124
static REFERENCE_TIME time_from_pos(DSoundRenderImpl *This, DWORD pos)
Definition: dsoundrender.c:108
static DWORD pos_from_time(DSoundRenderImpl *This, REFERENCE_TIME time)
Definition: dsoundrender.c:115
GLuint GLuint end
Definition: gl.h:1545

Referenced by DSoundRender_SendSampleData().

◆ DSoundRender_HandleEndOfStream()

static HRESULT DSoundRender_HandleEndOfStream ( DSoundRenderImpl This)
static

Definition at line 243 of file dsoundrender.c.

244{
245 while (This->renderer.filter.state == State_Running)
246 {
247 DWORD pos1, pos2;
248 DSoundRender_UpdatePositions(This, &pos1, &pos2);
249 if (pos1 == pos2)
250 break;
251
252 This->in_loop = 1;
253 LeaveCriticalSection(&This->renderer.filter.csFilter);
254 LeaveCriticalSection(&This->renderer.csRenderLock);
255 WaitForSingleObject(This->blocked, 10);
256 EnterCriticalSection(&This->renderer.csRenderLock);
257 EnterCriticalSection(&This->renderer.filter.csFilter);
258 This->in_loop = 0;
259 }
260
261 return S_OK;
262}

Referenced by DSoundRender_EndOfStream().

◆ DSoundRender_OnStartStreaming()

static VOID WINAPI DSoundRender_OnStartStreaming ( BaseRenderer iface)
static

Definition at line 449 of file dsoundrender.c.

450{
452
453 TRACE("(%p)\n", This);
454
455 if (This->renderer.pInputPin->pin.pConnectedTo)
456 {
457 if (This->renderer.filter.state == State_Paused)
458 {
459 /* Unblock our thread, state changing from paused to running doesn't need a reset for state change */
460 SetEvent(This->blocked);
461 }
463 ResetEvent(This->blocked);
464 }
465}

◆ DSoundRender_OnStopStreaming()

static VOID WINAPI DSoundRender_OnStopStreaming ( BaseRenderer iface)
static

Definition at line 438 of file dsoundrender.c.

439{
441
442 TRACE("(%p/%p)->()\n", This, iface);
443
444 IDirectSoundBuffer_Stop(This->dsbuffer);
445 This->writepos = This->buf_size;
446 SetEvent(This->blocked);
447}
#define IDirectSoundBuffer_Stop(p)
Definition: dsound.h:591

◆ DSoundRender_Pause()

static HRESULT WINAPI DSoundRender_Pause ( IBaseFilter iface)
static

Definition at line 754 of file dsoundrender.c.

755{
756 HRESULT hr = S_OK;
758
759 TRACE("(%p/%p)->()\n", This, iface);
760
761 EnterCriticalSection(&This->renderer.csRenderLock);
762 if (This->renderer.filter.state != State_Paused)
763 {
764 if (This->renderer.filter.state == State_Stopped)
765 {
766 if (This->renderer.pInputPin->pin.pConnectedTo)
767 ResetEvent(This->renderer.evComplete);
768 This->renderer.pInputPin->end_of_stream = 0;
769 }
770
771 hr = IDirectSoundBuffer_Stop(This->dsbuffer);
772 if (SUCCEEDED(hr))
773 This->renderer.filter.state = State_Paused;
774
775 ResetEvent(This->blocked);
776 ResetEvent(This->renderer.RenderEvent);
777 }
778 ResetEvent(This->renderer.ThreadSignal);
779 LeaveCriticalSection(&This->renderer.csRenderLock);
780
781 return hr;
782}

◆ DSoundRender_PrepareReceive()

static HRESULT WINAPI DSoundRender_PrepareReceive ( BaseRenderer iface,
IMediaSample pSample 
)
static

Definition at line 324 of file dsoundrender.c.

325{
327 HRESULT hr;
328 AM_MEDIA_TYPE *amt;
329
330 if (IMediaSample_GetMediaType(pSample, &amt) == S_OK)
331 {
332 AM_MEDIA_TYPE *orig = &This->renderer.pInputPin->pin.mtCurrent;
333 WAVEFORMATEX *origfmt = (WAVEFORMATEX *)orig->pbFormat;
334 WAVEFORMATEX *newfmt = (WAVEFORMATEX *)amt->pbFormat;
335
336 if (origfmt->wFormatTag == newfmt->wFormatTag &&
337 origfmt->nChannels == newfmt->nChannels &&
338 origfmt->nBlockAlign == newfmt->nBlockAlign &&
339 origfmt->wBitsPerSample == newfmt->wBitsPerSample &&
340 origfmt->cbSize == newfmt->cbSize)
341 {
342 if (origfmt->nSamplesPerSec != newfmt->nSamplesPerSec)
343 {
345 newfmt->nSamplesPerSec);
346 if (FAILED(hr))
348 FreeMediaType(orig);
349 CopyMediaType(orig, amt);
350 IMediaSample_SetMediaType(pSample, NULL);
351 }
352 }
353 else
355 }
356 return S_OK;
357}
#define IDirectSoundBuffer_SetFrequency(p, a)
Definition: dsound.h:590
static void FreeMediaType(AM_MEDIA_TYPE *pMediaType)
Definition: filtergraph.c:692
static HRESULT CopyMediaType(AM_MEDIA_TYPE *pDest, const AM_MEDIA_TYPE *pSrc)
Definition: filtergraph.c:706
WORD wBitsPerSample
Definition: audioclient.idl:45
DWORD nSamplesPerSec
Definition: audioclient.idl:42
#define VFW_E_TYPE_NOT_ACCEPTED
Definition: vfwmsgs.h:81

◆ DSoundRender_QueryInterface()

static HRESULT WINAPI DSoundRender_QueryInterface ( IBaseFilter iface,
REFIID  riid,
LPVOID ppv 
)
static

Definition at line 685 of file dsoundrender.c.

686{
688 TRACE("(%p, %p)->(%s, %p)\n", This, iface, qzdebugstr_guid(riid), ppv);
689
690 *ppv = NULL;
691
692 if (IsEqualIID(riid, &IID_IBasicAudio))
693 *ppv = &This->basicAudio.IBasicAudio_iface;
694 else if (IsEqualIID(riid, &IID_IReferenceClock))
695 *ppv = &This->IReferenceClock_iface;
696 else if (IsEqualIID(riid, &IID_IAMDirectSound))
697 *ppv = &This->IAMDirectSound_iface;
698 else if (IsEqualIID(riid, &IID_IAMFilterMiscFlags))
699 *ppv = &This->IAMFilterMiscFlags_iface;
700 else
701 {
702 HRESULT hr;
704 if (SUCCEEDED(hr))
705 return hr;
706 }
707
708 if (*ppv)
709 {
710 IUnknown_AddRef((IUnknown *)(*ppv));
711 return S_OK;
712 }
713
714 if (!IsEqualIID(riid, &IID_IPin) && !IsEqualIID(riid, &IID_IVideoWindow))
715 FIXME("No interface for %s!\n", qzdebugstr_guid(riid));
716
717 return E_NOINTERFACE;
718}
static DSoundRenderImpl * impl_from_IBaseFilter(IBaseFilter *iface)
Definition: dsoundrender.c:83
const char * qzdebugstr_guid(const GUID *id)
Definition: main.c:279
const GUID IID_IPin
Definition: pincontrol.cpp:15
HRESULT WINAPI BaseRendererImpl_QueryInterface(IBaseFilter *iface, REFIID riid, LPVOID *ppv)
Definition: renderer.c:280
#define E_NOINTERFACE
Definition: winerror.h:2364

Referenced by AMDirectSound_QueryInterface(), Basicaudio_QueryInterface(), and ReferenceClock_QueryInterface().

◆ DSoundRender_Release()

static ULONG WINAPI DSoundRender_Release ( IBaseFilter iface)
static

Definition at line 720 of file dsoundrender.c.

721{
723 ULONG refCount = BaseRendererImpl_Release(iface);
724
725 TRACE("(%p)->() Release from %d\n", This, refCount + 1);
726
727 if (!refCount)
728 {
729 if (This->threadid) {
730 PostThreadMessageW(This->threadid, WM_APP, 0, 0);
731 WaitForSingleObject(This->advisethread, INFINITE);
732 CloseHandle(This->advisethread);
733 }
734
735 if (This->dsbuffer)
737 This->dsbuffer = NULL;
738 if (This->dsound)
740 This->dsound = NULL;
741
742 BasicAudio_Destroy(&This->basicAudio);
743 CloseHandle(This->blocked);
744
745 TRACE("Destroying Audio Renderer\n");
747
748 return 0;
749 }
750 else
751 return refCount;
752}
#define IDirectSound8_Release(p)
Definition: dsound.h:507
HRESULT WINAPI BasicAudio_Destroy(BasicAudio *pBasicAudio)
Definition: audio.c:44
uint32_t ULONG
Definition: typedefs.h:59

Referenced by AMDirectSound_Release(), Basicaudio_Release(), and ReferenceClock_Release().

◆ DSoundRender_SendSampleData()

static HRESULT DSoundRender_SendSampleData ( DSoundRenderImpl This,
REFERENCE_TIME  tStart,
REFERENCE_TIME  tStop,
const BYTE data,
DWORD  size 
)
static

Definition at line 264 of file dsoundrender.c.

265{
266 HRESULT hr;
267
268 while (size && This->renderer.filter.state != State_Stopped) {
269 DWORD writepos, skip = 0, free, size1, size2, ret;
270 BYTE *buf1, *buf2;
271
272 if (This->renderer.filter.state == State_Running)
273 hr = DSoundRender_GetWritePos(This, &writepos, tStart, &free, &skip);
274 else
275 hr = S_FALSE;
276
277 if (hr != S_OK) {
278 This->in_loop = 1;
279 LeaveCriticalSection(&This->renderer.csRenderLock);
280 ret = WaitForSingleObject(This->blocked, 10);
281 EnterCriticalSection(&This->renderer.csRenderLock);
282 This->in_loop = 0;
283 if (This->renderer.pInputPin->flushing ||
284 This->renderer.filter.state == State_Stopped) {
285 return This->renderer.filter.state == State_Paused ? S_OK : VFW_E_WRONG_STATE;
286 }
287 if (ret != WAIT_TIMEOUT)
288 ERR("%x\n", ret);
289 continue;
290 }
291 tStart = -1;
292
293 if (skip)
294 FIXME("Sample dropped %u of %u bytes\n", skip, size);
295 if (skip >= size)
296 return S_OK;
297 data += skip;
298 size -= skip;
299
300 hr = IDirectSoundBuffer_Lock(This->dsbuffer, writepos, min(free, size), (void**)&buf1, &size1, (void**)&buf2, &size2, 0);
301 if (hr != DS_OK) {
302 ERR("Unable to lock sound buffer! (%x)\n", hr);
303 break;
304 }
305 memcpy(buf1, data, size1);
306 if (size2)
307 memcpy(buf2, data+size1, size2);
308 IDirectSoundBuffer_Unlock(This->dsbuffer, buf1, size1, buf2, size2);
309 This->writepos = (writepos + size1 + size2) % This->buf_size;
310 TRACE("Wrote %u bytes at %u, next at %u - (%u/%u)\n", size1+size2, writepos, This->writepos, free, size);
311 data += size1 + size2;
312 size -= size1 + size2;
313 }
314 return S_OK;
315}
#define WAIT_TIMEOUT
Definition: dderror.h:14
#define free
Definition: debug_ros.c:5
static HRESULT DSoundRender_GetWritePos(DSoundRenderImpl *This, DWORD *ret_writepos, REFERENCE_TIME write_at, DWORD *pfree, DWORD *skip)
Definition: dsoundrender.c:161
#define DS_OK
Definition: dsound.h:116
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define min(a, b)
Definition: monoChain.cc:55
#define VFW_E_WRONG_STATE
Definition: vfwmsgs.h:78
unsigned char BYTE
Definition: xxhash.c:193

Referenced by DSoundRender_DoRenderSample().

◆ DSoundRender_ShouldDrawSampleNow()

static HRESULT WINAPI DSoundRender_ShouldDrawSampleNow ( BaseRenderer This,
IMediaSample pMediaSample,
REFERENCE_TIME pStartTime,
REFERENCE_TIME pEndTime 
)
static

Definition at line 317 of file dsoundrender.c.

318{
319 /* We time ourselves do not use the base renderers timing */
320 return S_OK;
321}

◆ DSoundRender_UpdatePositions()

static void DSoundRender_UpdatePositions ( DSoundRenderImpl This,
DWORD seqwritepos,
DWORD minwritepos 
)
static

Definition at line 124 of file dsoundrender.c.

124 {
125 WAVEFORMATEX *wfx = (WAVEFORMATEX*)This->renderer.pInputPin->pin.mtCurrent.pbFormat;
126 BYTE *buf1, *buf2;
127 DWORD size1, size2, playpos, writepos, old_writepos, old_playpos, adv;
128 BOOL writepos_set = This->writepos < This->buf_size;
129
130 /* Update position and zero */
131 old_writepos = This->writepos;
132 old_playpos = This->last_playpos;
133 if (old_writepos <= old_playpos)
134 old_writepos += This->buf_size;
135
136 IDirectSoundBuffer_GetCurrentPosition(This->dsbuffer, &playpos, &writepos);
137 if (old_playpos > playpos) {
138 adv = This->buf_size + playpos - old_playpos;
139 This->play_time += time_from_pos(This, This->buf_size);
140 } else
141 adv = playpos - old_playpos;
142 This->last_playpos = playpos;
143 if (adv) {
144 TRACE("Moving from %u to %u: clearing %u bytes\n", old_playpos, playpos, adv);
145 IDirectSoundBuffer_Lock(This->dsbuffer, old_playpos, adv, (void**)&buf1, &size1, (void**)&buf2, &size2, 0);
146 memset(buf1, wfx->wBitsPerSample == 8 ? 128 : 0, size1);
147 memset(buf2, wfx->wBitsPerSample == 8 ? 128 : 0, size2);
148 IDirectSoundBuffer_Unlock(This->dsbuffer, buf1, size1, buf2, size2);
149 }
150 *minwritepos = writepos;
151 if (!writepos_set || old_writepos < writepos) {
152 if (writepos_set) {
153 This->writepos = This->buf_size;
154 FIXME("Underrun of data occurred!\n");
155 }
156 *seqwritepos = writepos;
157 } else
158 *seqwritepos = This->writepos;
159}
#define IDirectSoundBuffer_GetCurrentPosition(p, a, b)
Definition: dsound.h:577

Referenced by DSoundRender_GetWritePos(), DSoundRender_HandleEndOfStream(), and ReferenceClock_GetTime().

◆ impl_from_BaseRenderer()

◆ impl_from_IAMDirectSound()

◆ impl_from_IAMFilterMiscFlags()

static DSoundRenderImpl * impl_from_IAMFilterMiscFlags ( IAMFilterMiscFlags iface)
inlinestatic

Definition at line 103 of file dsoundrender.c.

104{
105 return CONTAINING_RECORD(iface, DSoundRenderImpl, IAMFilterMiscFlags_iface);
106}

Referenced by AMFilterMiscFlags_AddRef(), AMFilterMiscFlags_QueryInterface(), and AMFilterMiscFlags_Release().

◆ impl_from_IBaseFilter()

static DSoundRenderImpl * impl_from_IBaseFilter ( IBaseFilter iface)
inlinestatic

Definition at line 83 of file dsoundrender.c.

84{
85 return CONTAINING_RECORD(iface, DSoundRenderImpl, renderer.filter.IBaseFilter_iface);
86}

Referenced by DSoundRender_QueryInterface(), and DSoundRender_Release().

◆ impl_from_IBasicAudio()

static DSoundRenderImpl * impl_from_IBasicAudio ( IBasicAudio *  iface)
inlinestatic

◆ impl_from_IReferenceClock()

static DSoundRenderImpl * impl_from_IReferenceClock ( IReferenceClock iface)
inlinestatic

◆ pos_from_time()

static DWORD pos_from_time ( DSoundRenderImpl This,
REFERENCE_TIME  time 
)
static

Definition at line 115 of file dsoundrender.c.

115 {
116 WAVEFORMATEX *wfx = (WAVEFORMATEX*)This->renderer.pInputPin->pin.mtCurrent.pbFormat;
118 ret *= wfx->nAvgBytesPerSec;
119 ret /= 10000000;
120 ret -= ret % wfx->nBlockAlign;
121 return ret;
122}
__u16 time
Definition: mkdosfs.c:8
DWORD nAvgBytesPerSec
Definition: audioclient.idl:43

Referenced by DSoundRender_GetWritePos().

◆ ReferenceClock_AddRef()

static ULONG WINAPI ReferenceClock_AddRef ( IReferenceClock iface)
static

Definition at line 1008 of file dsoundrender.c.

1009{
1011
1012 TRACE("(%p/%p)->()\n", This, iface);
1013
1014 return BaseFilterImpl_AddRef(&This->renderer.filter.IBaseFilter_iface);
1015}
static DSoundRenderImpl * impl_from_IReferenceClock(IReferenceClock *iface)
Definition: dsoundrender.c:93

◆ ReferenceClock_AdvisePeriodic()

static HRESULT WINAPI ReferenceClock_AdvisePeriodic ( IReferenceClock iface,
REFERENCE_TIME  rtStartTime,
REFERENCE_TIME  rtPeriodTime,
HSEMAPHORE  hSemaphore,
DWORD_PTR pdwAdviseCookie 
)
static

Definition at line 1103 of file dsoundrender.c.

1108{
1110 struct dsoundrender_timer *t;
1111
1112 TRACE("(%p/%p)->(%s, %s, %p, %p)\n", This, iface, wine_dbgstr_longlong(rtStartTime), wine_dbgstr_longlong(rtPeriodTime), (void*)hSemaphore, pdwAdviseCookie);
1113
1114 if (rtStartTime <= 0 || rtPeriodTime <= 0)
1115 return E_INVALIDARG;
1116
1117 if (!pdwAdviseCookie)
1118 return E_POINTER;
1119
1120 EnterCriticalSection(&This->renderer.filter.csFilter);
1121 if (!This->threadid && This->dsbuffer) {
1122 This->thread_wait = CreateEventW(0, 0, 0, 0);
1123 This->advisethread = CreateThread(NULL, 0, DSoundAdviseThread, This, 0, &This->threadid);
1124 WaitForSingleObject(This->thread_wait, INFINITE);
1125 CloseHandle(This->thread_wait);
1126 }
1127 LeaveCriticalSection(&This->renderer.filter.csFilter);
1128
1129 t = HeapAlloc(GetProcessHeap(), 0, sizeof(*t));
1130 t->next = NULL;
1131 t->start = rtStartTime;
1132 t->periodicity = rtPeriodTime;
1133 t->handle = (HANDLE)hSemaphore;
1135 PostThreadMessageW(This->threadid, WM_APP+1, (WPARAM)t, 0);
1136 *pdwAdviseCookie = t->cookie;
1137
1138 return S_OK;
1139}
#define InterlockedIncrement
Definition: armddk.h:53
static DWORD WINAPI DSoundAdviseThread(LPVOID lpParam)
Definition: dsoundrender.c:917
static LONG cookie_counter
Definition: dsoundrender.c:915
#define HeapAlloc
Definition: compat.h:733
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
PVOID HANDLE
Definition: typedefs.h:73
UINT_PTR WPARAM
Definition: windef.h:207

◆ ReferenceClock_AdviseTime()

static HRESULT WINAPI ReferenceClock_AdviseTime ( IReferenceClock iface,
REFERENCE_TIME  rtBaseTime,
REFERENCE_TIME  rtStreamTime,
HEVENT  hEvent,
DWORD_PTR pdwAdviseCookie 
)
static

Definition at line 1059 of file dsoundrender.c.

1064{
1066 REFERENCE_TIME when = rtBaseTime + rtStreamTime;
1067 REFERENCE_TIME future;
1068 TRACE("(%p/%p)->(%s, %s, %p, %p)\n", This, iface, wine_dbgstr_longlong(rtBaseTime), wine_dbgstr_longlong(rtStreamTime), (void*)hEvent, pdwAdviseCookie);
1069
1070 if (when <= 0)
1071 return E_INVALIDARG;
1072
1073 if (!pdwAdviseCookie)
1074 return E_POINTER;
1075
1076 EnterCriticalSection(&This->renderer.filter.csFilter);
1077 future = when - This->play_time;
1078 if (!This->threadid && This->dsbuffer) {
1079 This->thread_wait = CreateEventW(0, 0, 0, 0);
1080 This->advisethread = CreateThread(NULL, 0, DSoundAdviseThread, This, 0, &This->threadid);
1081 WaitForSingleObject(This->thread_wait, INFINITE);
1082 CloseHandle(This->thread_wait);
1083 }
1084 LeaveCriticalSection(&This->renderer.filter.csFilter);
1085 /* If it's in the past or the next millisecond, trigger immediately */
1086 if (future <= 10000) {
1088 *pdwAdviseCookie = 0;
1089 } else {
1090 struct dsoundrender_timer *t = HeapAlloc(GetProcessHeap(), 0, sizeof(*t));
1091 t->next = NULL;
1092 t->start = when;
1093 t->periodicity = 0;
1094 t->handle = (HANDLE)hEvent;
1096 PostThreadMessageW(This->threadid, WM_APP+1, (WPARAM)t, 0);
1097 *pdwAdviseCookie = t->cookie;
1098 }
1099
1100 return S_OK;
1101}
static HANDLE hEvent
Definition: comm.c:54

◆ ReferenceClock_GetTime()

static HRESULT WINAPI ReferenceClock_GetTime ( IReferenceClock iface,
REFERENCE_TIME pTime 
)
static

Definition at line 1027 of file dsoundrender.c.

1029{
1031 HRESULT hr = E_FAIL;
1032
1033 TRACE("(%p/%p)->(%p)\n", This, iface, pTime);
1034 if (!pTime)
1035 return E_POINTER;
1036
1037 if (This->dsbuffer) {
1038 DWORD writepos1, writepos2;
1039 EnterCriticalSection(&This->renderer.filter.csFilter);
1040 DSoundRender_UpdatePositions(This, &writepos1, &writepos2);
1041 if (This->renderer.pInputPin && This->renderer.pInputPin->pin.mtCurrent.pbFormat)
1042 {
1043 *pTime = This->play_time + time_from_pos(This, This->last_playpos);
1044 hr = S_OK;
1045 }
1046 else
1047 {
1048 ERR("pInputPin Disconnected\n");
1049 hr = E_FAIL;
1050 }
1051 LeaveCriticalSection(&This->renderer.filter.csFilter);
1052 }
1053 if (FAILED(hr))
1054 WARN("Could not get reference time (%x)!\n", hr);
1055
1056 return hr;
1057}
_In_ PCCERT_CONTEXT _In_opt_ LPFILETIME pTime
Definition: wincrypt.h:4837

◆ ReferenceClock_QueryInterface()

static HRESULT WINAPI ReferenceClock_QueryInterface ( IReferenceClock iface,
REFIID  riid,
LPVOID ppvObj 
)
static

Definition at line 997 of file dsoundrender.c.

1000{
1002
1003 TRACE("(%p/%p)->(%s, %p)\n", This, iface, debugstr_guid(riid), ppvObj);
1004
1005 return DSoundRender_QueryInterface(&This->renderer.filter.IBaseFilter_iface, riid, ppvObj);
1006}

◆ ReferenceClock_Release()

static ULONG WINAPI ReferenceClock_Release ( IReferenceClock iface)
static

Definition at line 1017 of file dsoundrender.c.

1018{
1020
1021 TRACE("(%p/%p)->()\n", This, iface);
1022
1023 return DSoundRender_Release(&This->renderer.filter.IBaseFilter_iface);
1024}

◆ ReferenceClock_Unadvise()

static HRESULT WINAPI ReferenceClock_Unadvise ( IReferenceClock iface,
DWORD_PTR  dwAdviseCookie 
)
static

Definition at line 1141 of file dsoundrender.c.

1143{
1145
1146 TRACE("(%p/%p)->(%p)\n", This, iface, (void*)dwAdviseCookie);
1147 if (!This->advisethread || !dwAdviseCookie)
1148 return S_FALSE;
1149 PostThreadMessageW(This->threadid, WM_APP+3, dwAdviseCookie, 0);
1150 return S_OK;
1151}

◆ time_from_pos()

static REFERENCE_TIME time_from_pos ( DSoundRenderImpl This,
DWORD  pos 
)
static

Definition at line 108 of file dsoundrender.c.

108 {
109 WAVEFORMATEX *wfx = (WAVEFORMATEX*)This->renderer.pInputPin->pin.mtCurrent.pbFormat;
110 REFERENCE_TIME ret = 10000000;
111 ret = ret * pos / wfx->nAvgBytesPerSec;
112 return ret;
113}

Referenced by DSoundRender_GetWritePos(), DSoundRender_UpdatePositions(), and ReferenceClock_GetTime().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( quartz  )

Variable Documentation

◆ BaseFuncTable

const BaseRendererFuncTable BaseFuncTable
static
Initial value:
= {
}
static HRESULT WINAPI DSoundRender_PrepareReceive(BaseRenderer *iface, IMediaSample *pSample)
Definition: dsoundrender.c:324
static HRESULT WINAPI DSoundRender_BeginFlush(BaseRenderer *iface)
Definition: dsoundrender.c:560
static HRESULT WINAPI DSoundRender_EndOfStream(BaseRenderer *iface)
Definition: dsoundrender.c:541
static HRESULT WINAPI DSoundRender_ShouldDrawSampleNow(BaseRenderer *This, IMediaSample *pMediaSample, REFERENCE_TIME *pStartTime, REFERENCE_TIME *pEndTime)
Definition: dsoundrender.c:317
static HRESULT WINAPI DSoundRender_CompleteConnect(BaseRenderer *iface, IPin *pReceivePin)
Definition: dsoundrender.c:467
static VOID WINAPI DSoundRender_OnStopStreaming(BaseRenderer *iface)
Definition: dsoundrender.c:438
static HRESULT WINAPI DSoundRender_DoRenderSample(BaseRenderer *iface, IMediaSample *pSample)
Definition: dsoundrender.c:359
static HRESULT WINAPI DSoundRender_CheckMediaType(BaseRenderer *iface, const AM_MEDIA_TYPE *pmt)
Definition: dsoundrender.c:416
static HRESULT WINAPI DSoundRender_EndFlush(BaseRenderer *iface)
Definition: dsoundrender.c:571
static VOID WINAPI DSoundRender_OnStartStreaming(BaseRenderer *iface)
Definition: dsoundrender.c:449
static HRESULT WINAPI DSoundRender_BreakConnect(BaseRenderer *iface)
Definition: dsoundrender.c:521

Definition at line 596 of file dsoundrender.c.

Referenced by DSoundRender_create().

◆ cookie_counter

LONG cookie_counter = 1
static

Definition at line 915 of file dsoundrender.c.

Referenced by ReferenceClock_AdvisePeriodic(), and ReferenceClock_AdviseTime().

◆ DSoundRender_Vtbl

static const IBaseFilterVtbl DSoundRender_Vtbl
static
Initial value:
=
{
}
static HRESULT WINAPI DSoundRender_Pause(IBaseFilter *iface)
Definition: dsoundrender.c:754
HRESULT WINAPI BaseRendererImpl_SetSyncSource(IBaseFilter *iface, IReferenceClock *clock)
Definition: renderer.c:537
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 BaseRendererImpl_Stop(IBaseFilter *iface)
Definition: renderer.c:440
HRESULT WINAPI BaseRendererImpl_FindPin(IBaseFilter *iface, LPCWSTR Id, IPin **ppPin)
Definition: renderer.c:421
HRESULT WINAPI BaseRendererImpl_Run(IBaseFilter *iface, REFERENCE_TIME tStart)
Definition: renderer.c:461
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 BaseRendererImpl_GetState(IBaseFilter *iface, DWORD dwMilliSecsTimeout, FILTER_STATE *pState)
Definition: renderer.c:550
HRESULT WINAPI BaseFilterImpl_EnumPins(IBaseFilter *iface, IEnumPins **ppEnum)
Definition: filter.c:135

Definition at line 46 of file dsoundrender.c.

Referenced by DSoundRender_create().

◆ DSoundRenderer_Max_Fill

const REFERENCE_TIME DSoundRenderer_Max_Fill = 150 * 10000
static

Definition at line 44 of file dsoundrender.c.

Referenced by DSoundRender_DoRenderSample(), and DSoundRender_GetWritePos().

◆ IAMDirectSound_Vtbl

static const IAMDirectSoundVtbl IAMDirectSound_Vtbl
static
Initial value:
=
{
}
static ULONG WINAPI AMDirectSound_AddRef(IAMDirectSound *iface)
static HRESULT WINAPI AMDirectSound_GetPrimaryBufferInterface(IAMDirectSound *iface, IDirectSoundBuffer **buf)
static HRESULT WINAPI AMDirectSound_GetFocusWindow(IAMDirectSound *iface, HWND *hwnd, BOOL *bgaudible)
static ULONG WINAPI AMDirectSound_Release(IAMDirectSound *iface)
static HRESULT WINAPI AMDirectSound_ReleasePrimaryBufferInterface(IAMDirectSound *iface, IDirectSoundBuffer *buf)
static HRESULT WINAPI AMDirectSound_ReleaseSecondaryBufferInterface(IAMDirectSound *iface, IDirectSoundBuffer *buf)
static HRESULT WINAPI AMDirectSound_ReleaseDirectSoundInterface(IAMDirectSound *iface, IDirectSound *ds)
static HRESULT WINAPI AMDirectSound_GetDirectSoundInterface(IAMDirectSound *iface, IDirectSound **ds)
static HRESULT WINAPI AMDirectSound_GetSecondaryBufferInterface(IAMDirectSound *iface, IDirectSoundBuffer **buf)
static HRESULT WINAPI AMDirectSound_SetFocusWindow(IAMDirectSound *iface, HWND hwnd, BOOL bgaudible)
static HRESULT WINAPI AMDirectSound_QueryInterface(IAMDirectSound *iface, REFIID riid, LPVOID *ppvObj)

Definition at line 49 of file dsoundrender.c.

Referenced by DSoundRender_create().

◆ IAMFilterMiscFlags_Vtbl

static const IAMFilterMiscFlagsVtbl IAMFilterMiscFlags_Vtbl
static
Initial value:
= {
}
static ULONG WINAPI AMFilterMiscFlags_Release(IAMFilterMiscFlags *iface)
static HRESULT WINAPI AMFilterMiscFlags_QueryInterface(IAMFilterMiscFlags *iface, REFIID riid, void **ppv)
static ULONG WINAPI AMFilterMiscFlags_GetMiscFlags(IAMFilterMiscFlags *iface)
static ULONG WINAPI AMFilterMiscFlags_AddRef(IAMFilterMiscFlags *iface)

Definition at line 50 of file dsoundrender.c.

Referenced by DSoundRender_create().

◆ IBasicAudio_Vtbl

static const IBasicAudioVtbl IBasicAudio_Vtbl
static
Initial value:
=
{
}
static HRESULT WINAPI Basicaudio_get_Balance(IBasicAudio *iface, LONG *plBalance)
Definition: dsoundrender.c:880
static HRESULT WINAPI Basicaudio_QueryInterface(IBasicAudio *iface, REFIID riid, LPVOID *ppvObj)
Definition: dsoundrender.c:804
static HRESULT WINAPI Basicaudio_put_Volume(IBasicAudio *iface, LONG lVolume)
Definition: dsoundrender.c:831
static ULONG WINAPI Basicaudio_Release(IBasicAudio *iface)
Definition: dsoundrender.c:822
static HRESULT WINAPI Basicaudio_put_Balance(IBasicAudio *iface, LONG lBalance)
Definition: dsoundrender.c:862
static ULONG WINAPI Basicaudio_AddRef(IBasicAudio *iface)
Definition: dsoundrender.c:814
static HRESULT WINAPI Basicaudio_get_Volume(IBasicAudio *iface, LONG *plVolume)
Definition: dsoundrender.c:849
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
HRESULT WINAPI BasicAudioImpl_GetTypeInfo(IBasicAudio *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
Definition: audio.c:56
HRESULT WINAPI BasicAudioImpl_GetIDsOfNames(IBasicAudio *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
Definition: audio.c:63
HRESULT WINAPI BasicAudioImpl_GetTypeInfoCount(IBasicAudio *iface, UINT *pctinfo)
Definition: audio.c:49

Definition at line 47 of file dsoundrender.c.

Referenced by DSoundRender_create().

◆ IReferenceClock_Vtbl

static const IReferenceClockVtbl IReferenceClock_Vtbl
static
Initial value:
=
{
}
static ULONG WINAPI ReferenceClock_AddRef(IReferenceClock *iface)
static HRESULT WINAPI ReferenceClock_AdviseTime(IReferenceClock *iface, REFERENCE_TIME rtBaseTime, REFERENCE_TIME rtStreamTime, HEVENT hEvent, DWORD_PTR *pdwAdviseCookie)
static HRESULT WINAPI ReferenceClock_QueryInterface(IReferenceClock *iface, REFIID riid, LPVOID *ppvObj)
Definition: dsoundrender.c:997
static HRESULT WINAPI ReferenceClock_GetTime(IReferenceClock *iface, REFERENCE_TIME *pTime)
static HRESULT WINAPI ReferenceClock_Unadvise(IReferenceClock *iface, DWORD_PTR dwAdviseCookie)
static HRESULT WINAPI ReferenceClock_AdvisePeriodic(IReferenceClock *iface, REFERENCE_TIME rtStartTime, REFERENCE_TIME rtPeriodTime, HSEMAPHORE hSemaphore, DWORD_PTR *pdwAdviseCookie)
static ULONG WINAPI ReferenceClock_Release(IReferenceClock *iface)

Definition at line 48 of file dsoundrender.c.

Referenced by DSoundRender_create().