Commit 914ad66c authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

strmbase: Move run_event to the strmbase_renderer structure.

parent bcfa8f41
......@@ -29,7 +29,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(qedit);
struct null_renderer
{
struct strmbase_renderer renderer;
HANDLE run_event;
};
static struct null_renderer *impl_from_strmbase_renderer(struct strmbase_renderer *iface)
......@@ -43,7 +42,7 @@ static HRESULT WINAPI NullRenderer_DoRenderSample(struct strmbase_renderer *ifac
if (filter->renderer.filter.state == State_Paused)
{
const HANDLE events[2] = {filter->run_event, filter->renderer.flush_event};
const HANDLE events[2] = {filter->renderer.run_event, filter->renderer.flush_event};
SetEvent(filter->renderer.state_event);
WaitForMultipleObjects(2, events, FALSE, INFINITE);
......@@ -62,7 +61,6 @@ static void null_renderer_destroy(struct strmbase_renderer *iface)
{
struct null_renderer *filter = impl_from_strmbase_renderer(iface);
CloseHandle(filter->run_event);
strmbase_renderer_cleanup(&filter->renderer);
free(filter);
}
......@@ -70,13 +68,13 @@ static void null_renderer_destroy(struct strmbase_renderer *iface)
static void null_renderer_start_stream(struct strmbase_renderer *iface)
{
struct null_renderer *filter = impl_from_strmbase_renderer(iface);
SetEvent(filter->run_event);
SetEvent(filter->renderer.run_event);
}
static void null_renderer_stop_stream(struct strmbase_renderer *iface)
{
struct null_renderer *filter = impl_from_strmbase_renderer(iface);
ResetEvent(filter->run_event);
ResetEvent(filter->renderer.run_event);
}
static const struct strmbase_renderer_ops renderer_ops =
......@@ -96,7 +94,6 @@ HRESULT null_renderer_create(IUnknown *outer, IUnknown **out)
return E_OUTOFMEMORY;
strmbase_renderer_init(&object->renderer, outer, &CLSID_NullRenderer, L"In", &renderer_ops);
object->run_event = CreateEventW(NULL, TRUE, FALSE, NULL);
TRACE("Created null renderer %p.\n", object);
*out = &object->renderer.filter.IUnknown_inner;
......
......@@ -48,8 +48,6 @@ struct video_renderer
LONG FullScreenMode;
DWORD saved_style;
HANDLE run_event;
};
static inline struct video_renderer *impl_from_video_window(struct video_window *iface)
......@@ -106,7 +104,7 @@ static HRESULT WINAPI VideoRenderer_DoRenderSample(struct strmbase_renderer *ifa
if (filter->renderer.filter.state == State_Paused)
{
const HANDLE events[2] = {filter->run_event, filter->renderer.flush_event};
const HANDLE events[2] = {filter->renderer.run_event, filter->renderer.flush_event};
SetEvent(filter->renderer.state_event);
LeaveCriticalSection(&filter->renderer.filter.stream_cs);
......@@ -140,7 +138,6 @@ static void video_renderer_destroy(struct strmbase_renderer *iface)
struct video_renderer *filter = impl_from_strmbase_renderer(iface);
video_window_cleanup(&filter->window);
CloseHandle(filter->run_event);
strmbase_renderer_cleanup(&filter->renderer);
free(filter);
......@@ -179,7 +176,7 @@ static void video_renderer_start_stream(struct strmbase_renderer *iface)
{
struct video_renderer *filter = impl_from_strmbase_renderer(iface);
SetEvent(filter->run_event);
SetEvent(filter->renderer.run_event);
}
static void video_renderer_stop_stream(struct strmbase_renderer *iface)
......@@ -192,7 +189,7 @@ static void video_renderer_stop_stream(struct strmbase_renderer *iface)
/* Black it out */
RedrawWindow(This->window.hwnd, NULL, NULL, RDW_INVALIDATE | RDW_ERASE);
ResetEvent(This->run_event);
ResetEvent(This->renderer.run_event);
}
static void video_renderer_init_stream(struct strmbase_renderer *iface)
......@@ -519,8 +516,6 @@ HRESULT video_renderer_create(IUnknown *outer, IUnknown **out)
return hr;
}
object->run_event = CreateEventW(NULL, TRUE, FALSE, NULL);
TRACE("Created video renderer %p.\n", object);
*out = &object->renderer.filter.IUnknown_inner;
return S_OK;
......
......@@ -108,8 +108,6 @@ struct quartz_vmr
LONG VideoWidth;
LONG VideoHeight;
VMR9AspectRatioMode aspect_mode;
HANDLE run_event;
};
static inline BOOL is_vmr9(const struct quartz_vmr *filter)
......@@ -211,7 +209,7 @@ static inline struct quartz_vmr *impl_from_IBaseFilter(IBaseFilter *iface)
static HRESULT WINAPI VMR9_DoRenderSample(struct strmbase_renderer *iface, IMediaSample *sample)
{
struct quartz_vmr *filter = impl_from_IBaseFilter(&iface->filter.IBaseFilter_iface);
const HANDLE events[2] = {filter->run_event, filter->renderer.flush_event};
const HANDLE events[2] = {filter->renderer.run_event, filter->renderer.flush_event};
unsigned int data_size, width, depth, src_pitch;
const BITMAPINFOHEADER *bitmap_header;
REFERENCE_TIME start_time, end_time;
......@@ -486,7 +484,7 @@ static void vmr_start_stream(struct strmbase_renderer *iface)
struct quartz_vmr *filter = impl_from_IBaseFilter(&iface->filter.IBaseFilter_iface);
IVMRImagePresenter9_StartPresenting(filter->presenter, filter->cookie);
SetEvent(filter->run_event);
SetEvent(filter->renderer.run_event);
}
static void vmr_stop_stream(struct strmbase_renderer *iface)
......@@ -497,7 +495,7 @@ static void vmr_stop_stream(struct strmbase_renderer *iface)
if (This->renderer.filter.state == State_Running)
IVMRImagePresenter9_StopPresenting(This->presenter, This->cookie);
ResetEvent(This->run_event);
ResetEvent(This->renderer.run_event);
}
static HRESULT vmr_connect(struct strmbase_renderer *iface, const AM_MEDIA_TYPE *mt)
......@@ -585,7 +583,6 @@ static void vmr_destroy(struct strmbase_renderer *iface)
filter->allocator_d3d9_dev = NULL;
}
CloseHandle(filter->run_event);
FreeLibrary(filter->hD3d9);
strmbase_renderer_cleanup(&filter->renderer);
if (!filter->IVMRSurfaceAllocatorNotify9_refcount)
......@@ -2610,8 +2607,6 @@ static HRESULT vmr_create(IUnknown *outer, IUnknown **out, const CLSID *clsid)
return hr;
}
object->run_event = CreateEventW(NULL, TRUE, FALSE, NULL);
object->mixing_prefs = MixerPref9_NoDecimation | MixerPref9_ARAdjustXorY
| MixerPref9_BiLinearFiltering | MixerPref9_RenderTargetRGB;
......
......@@ -554,6 +554,7 @@ void strmbase_renderer_cleanup(struct strmbase_renderer *filter)
CloseHandle(filter->state_event);
CloseHandle(filter->advise_event);
CloseHandle(filter->run_event);
CloseHandle(filter->flush_event);
strmbase_filter_cleanup(&filter->filter);
}
......@@ -573,5 +574,6 @@ void strmbase_renderer_init(struct strmbase_renderer *filter, IUnknown *outer,
filter->state_event = CreateEventW(NULL, TRUE, TRUE, NULL);
filter->advise_event = CreateEventW(NULL, FALSE, FALSE, NULL);
filter->run_event = CreateEventW(NULL, TRUE, FALSE, NULL);
filter->flush_event = CreateEventW(NULL, TRUE, TRUE, NULL);
}
......@@ -286,6 +286,9 @@ struct strmbase_renderer
/* Signaled when the sample presentation time occurs. The streaming thread
* waits for this event in Receive() if applicable. */
HANDLE advise_event;
/* Signaled when the filter is running. The streaming thread waits for this
* event in Receive() while paused. */
HANDLE run_event;
/* Signaled when a flush or state change occurs, i.e. anything that needs
* to immediately unblock the streaming thread. */
HANDLE flush_event;
......
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