Commit b12ac596 authored by Gijs Vermeulen's avatar Gijs Vermeulen Committed by Alexandre Julliard

amstream: Get rid of the IDirectDrawStreamSampleImpl typedef.

parent 1b95c1b5
...@@ -952,21 +952,22 @@ HRESULT ddraw_stream_create(IUnknown *outer, void **out) ...@@ -952,21 +952,22 @@ HRESULT ddraw_stream_create(IUnknown *outer, void **out)
return S_OK; return S_OK;
} }
typedef struct { struct ddraw_sample
{
IDirectDrawStreamSample IDirectDrawStreamSample_iface; IDirectDrawStreamSample IDirectDrawStreamSample_iface;
LONG ref; LONG ref;
IMediaStream *parent; IMediaStream *parent;
IDirectDrawSurface *surface; IDirectDrawSurface *surface;
RECT rect; RECT rect;
} IDirectDrawStreamSampleImpl; };
static inline IDirectDrawStreamSampleImpl *impl_from_IDirectDrawStreamSample(IDirectDrawStreamSample *iface) static inline struct ddraw_sample *impl_from_IDirectDrawStreamSample(IDirectDrawStreamSample *iface)
{ {
return CONTAINING_RECORD(iface, IDirectDrawStreamSampleImpl, IDirectDrawStreamSample_iface); return CONTAINING_RECORD(iface, struct ddraw_sample, IDirectDrawStreamSample_iface);
} }
/*** IUnknown methods ***/ /*** IUnknown methods ***/
static HRESULT WINAPI IDirectDrawStreamSampleImpl_QueryInterface(IDirectDrawStreamSample *iface, static HRESULT WINAPI ddraw_sample_QueryInterface(IDirectDrawStreamSample *iface,
REFIID riid, void **ret_iface) REFIID riid, void **ret_iface)
{ {
TRACE("(%p)->(%s,%p)\n", iface, debugstr_guid(riid), ret_iface); TRACE("(%p)->(%s,%p)\n", iface, debugstr_guid(riid), ret_iface);
...@@ -986,43 +987,43 @@ static HRESULT WINAPI IDirectDrawStreamSampleImpl_QueryInterface(IDirectDrawStre ...@@ -986,43 +987,43 @@ static HRESULT WINAPI IDirectDrawStreamSampleImpl_QueryInterface(IDirectDrawStre
return E_NOINTERFACE; return E_NOINTERFACE;
} }
static ULONG WINAPI IDirectDrawStreamSampleImpl_AddRef(IDirectDrawStreamSample *iface) static ULONG WINAPI ddraw_sample_AddRef(IDirectDrawStreamSample *iface)
{ {
IDirectDrawStreamSampleImpl *This = impl_from_IDirectDrawStreamSample(iface); struct ddraw_sample *sample = impl_from_IDirectDrawStreamSample(iface);
ULONG ref = InterlockedIncrement(&This->ref); ULONG ref = InterlockedIncrement(&sample->ref);
TRACE("(%p)->(): new ref = %u\n", iface, ref); TRACE("(%p)->(): new ref = %u\n", iface, ref);
return ref; return ref;
} }
static ULONG WINAPI IDirectDrawStreamSampleImpl_Release(IDirectDrawStreamSample *iface) static ULONG WINAPI ddraw_sample_Release(IDirectDrawStreamSample *iface)
{ {
IDirectDrawStreamSampleImpl *This = impl_from_IDirectDrawStreamSample(iface); struct ddraw_sample *sample = impl_from_IDirectDrawStreamSample(iface);
ULONG ref = InterlockedDecrement(&This->ref); ULONG ref = InterlockedDecrement(&sample->ref);
TRACE("(%p)->(): new ref = %u\n", iface, ref); TRACE("(%p)->(): new ref = %u\n", iface, ref);
if (!ref) if (!ref)
{ {
if (This->surface) if (sample->surface)
IDirectDrawSurface_Release(This->surface); IDirectDrawSurface_Release(sample->surface);
IMediaStream_Release(This->parent); IMediaStream_Release(sample->parent);
HeapFree(GetProcessHeap(), 0, This); HeapFree(GetProcessHeap(), 0, sample);
} }
return ref; return ref;
} }
/*** IStreamSample methods ***/ /*** IStreamSample methods ***/
static HRESULT WINAPI IDirectDrawStreamSampleImpl_GetMediaStream(IDirectDrawStreamSample *iface, IMediaStream **media_stream) static HRESULT WINAPI ddraw_sample_GetMediaStream(IDirectDrawStreamSample *iface, IMediaStream **media_stream)
{ {
FIXME("(%p)->(%p): stub\n", iface, media_stream); FIXME("(%p)->(%p): stub\n", iface, media_stream);
return E_NOTIMPL; return E_NOTIMPL;
} }
static HRESULT WINAPI IDirectDrawStreamSampleImpl_GetSampleTimes(IDirectDrawStreamSample *iface, STREAM_TIME *start_time, static HRESULT WINAPI ddraw_sample_GetSampleTimes(IDirectDrawStreamSample *iface, STREAM_TIME *start_time,
STREAM_TIME *end_time, STREAM_TIME *current_time) STREAM_TIME *end_time, STREAM_TIME *current_time)
{ {
FIXME("(%p)->(%p,%p,%p): stub\n", iface, start_time, end_time, current_time); FIXME("(%p)->(%p,%p,%p): stub\n", iface, start_time, end_time, current_time);
...@@ -1030,7 +1031,7 @@ static HRESULT WINAPI IDirectDrawStreamSampleImpl_GetSampleTimes(IDirectDrawStre ...@@ -1030,7 +1031,7 @@ static HRESULT WINAPI IDirectDrawStreamSampleImpl_GetSampleTimes(IDirectDrawStre
return E_NOTIMPL; return E_NOTIMPL;
} }
static HRESULT WINAPI IDirectDrawStreamSampleImpl_SetSampleTimes(IDirectDrawStreamSample *iface, const STREAM_TIME *start_time, static HRESULT WINAPI ddraw_sample_SetSampleTimes(IDirectDrawStreamSample *iface, const STREAM_TIME *start_time,
const STREAM_TIME *end_time) const STREAM_TIME *end_time)
{ {
FIXME("(%p)->(%p,%p): stub\n", iface, start_time, end_time); FIXME("(%p)->(%p,%p): stub\n", iface, start_time, end_time);
...@@ -1038,7 +1039,7 @@ static HRESULT WINAPI IDirectDrawStreamSampleImpl_SetSampleTimes(IDirectDrawStre ...@@ -1038,7 +1039,7 @@ static HRESULT WINAPI IDirectDrawStreamSampleImpl_SetSampleTimes(IDirectDrawStre
return E_NOTIMPL; return E_NOTIMPL;
} }
static HRESULT WINAPI IDirectDrawStreamSampleImpl_Update(IDirectDrawStreamSample *iface, DWORD flags, HANDLE event, static HRESULT WINAPI ddraw_sample_Update(IDirectDrawStreamSample *iface, DWORD flags, HANDLE event,
PAPCFUNC func_APC, DWORD APC_data) PAPCFUNC func_APC, DWORD APC_data)
{ {
FIXME("(%p)->(%x,%p,%p,%u): stub\n", iface, flags, event, func_APC, APC_data); FIXME("(%p)->(%x,%p,%p,%u): stub\n", iface, flags, event, func_APC, APC_data);
...@@ -1046,7 +1047,7 @@ static HRESULT WINAPI IDirectDrawStreamSampleImpl_Update(IDirectDrawStreamSample ...@@ -1046,7 +1047,7 @@ static HRESULT WINAPI IDirectDrawStreamSampleImpl_Update(IDirectDrawStreamSample
return S_OK; return S_OK;
} }
static HRESULT WINAPI IDirectDrawStreamSampleImpl_CompletionStatus(IDirectDrawStreamSample *iface, DWORD flags, DWORD milliseconds) static HRESULT WINAPI ddraw_sample_CompletionStatus(IDirectDrawStreamSample *iface, DWORD flags, DWORD milliseconds)
{ {
FIXME("(%p)->(%x,%u): stub\n", iface, flags, milliseconds); FIXME("(%p)->(%x,%u): stub\n", iface, flags, milliseconds);
...@@ -1054,27 +1055,27 @@ static HRESULT WINAPI IDirectDrawStreamSampleImpl_CompletionStatus(IDirectDrawSt ...@@ -1054,27 +1055,27 @@ static HRESULT WINAPI IDirectDrawStreamSampleImpl_CompletionStatus(IDirectDrawSt
} }
/*** IDirectDrawStreamSample methods ***/ /*** IDirectDrawStreamSample methods ***/
static HRESULT WINAPI IDirectDrawStreamSampleImpl_GetSurface(IDirectDrawStreamSample *iface, IDirectDrawSurface **ddraw_surface, static HRESULT WINAPI ddraw_sample_GetSurface(IDirectDrawStreamSample *iface, IDirectDrawSurface **ddraw_surface,
RECT *rect) RECT *rect)
{ {
IDirectDrawStreamSampleImpl *This = impl_from_IDirectDrawStreamSample(iface); struct ddraw_sample *sample = impl_from_IDirectDrawStreamSample(iface);
TRACE("(%p)->(%p,%p)\n", iface, ddraw_surface, rect); TRACE("(%p)->(%p,%p)\n", iface, ddraw_surface, rect);
if (ddraw_surface) if (ddraw_surface)
{ {
*ddraw_surface = This->surface; *ddraw_surface = sample->surface;
if (*ddraw_surface) if (*ddraw_surface)
IDirectDrawSurface_AddRef(*ddraw_surface); IDirectDrawSurface_AddRef(*ddraw_surface);
} }
if (rect) if (rect)
*rect = This->rect; *rect = sample->rect;
return S_OK; return S_OK;
} }
static HRESULT WINAPI IDirectDrawStreamSampleImpl_SetRect(IDirectDrawStreamSample *iface, const RECT *rect) static HRESULT WINAPI ddraw_sample_SetRect(IDirectDrawStreamSample *iface, const RECT *rect)
{ {
FIXME("(%p)->(%p): stub\n", iface, rect); FIXME("(%p)->(%p): stub\n", iface, rect);
...@@ -1084,24 +1085,24 @@ static HRESULT WINAPI IDirectDrawStreamSampleImpl_SetRect(IDirectDrawStreamSampl ...@@ -1084,24 +1085,24 @@ static HRESULT WINAPI IDirectDrawStreamSampleImpl_SetRect(IDirectDrawStreamSampl
static const struct IDirectDrawStreamSampleVtbl DirectDrawStreamSample_Vtbl = static const struct IDirectDrawStreamSampleVtbl DirectDrawStreamSample_Vtbl =
{ {
/*** IUnknown methods ***/ /*** IUnknown methods ***/
IDirectDrawStreamSampleImpl_QueryInterface, ddraw_sample_QueryInterface,
IDirectDrawStreamSampleImpl_AddRef, ddraw_sample_AddRef,
IDirectDrawStreamSampleImpl_Release, ddraw_sample_Release,
/*** IStreamSample methods ***/ /*** IStreamSample methods ***/
IDirectDrawStreamSampleImpl_GetMediaStream, ddraw_sample_GetMediaStream,
IDirectDrawStreamSampleImpl_GetSampleTimes, ddraw_sample_GetSampleTimes,
IDirectDrawStreamSampleImpl_SetSampleTimes, ddraw_sample_SetSampleTimes,
IDirectDrawStreamSampleImpl_Update, ddraw_sample_Update,
IDirectDrawStreamSampleImpl_CompletionStatus, ddraw_sample_CompletionStatus,
/*** IDirectDrawStreamSample methods ***/ /*** IDirectDrawStreamSample methods ***/
IDirectDrawStreamSampleImpl_GetSurface, ddraw_sample_GetSurface,
IDirectDrawStreamSampleImpl_SetRect ddraw_sample_SetRect
}; };
static HRESULT ddrawstreamsample_create(IDirectDrawMediaStream *parent, IDirectDrawSurface *surface, static HRESULT ddrawstreamsample_create(IDirectDrawMediaStream *parent, IDirectDrawSurface *surface,
const RECT *rect, IDirectDrawStreamSample **ddraw_stream_sample) const RECT *rect, IDirectDrawStreamSample **ddraw_stream_sample)
{ {
IDirectDrawStreamSampleImpl *object; struct ddraw_sample *object;
HRESULT hr; HRESULT hr;
TRACE("(%p)\n", ddraw_stream_sample); TRACE("(%p)\n", ddraw_stream_sample);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment