Commit 690afb42 authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

strmbase: Rename csFilter to filter_cs.

parent 6fdfacb5
......@@ -1039,9 +1039,9 @@ static HRESULT testfilter_wait_state(struct strmbase_filter *iface, DWORD timeou
struct testfilter *filter = impl_from_BaseFilter(iface);
HRESULT hr;
LeaveCriticalSection(&filter->filter.csFilter);
LeaveCriticalSection(&filter->filter.filter_cs);
WaitForSingleObject(filter->wait_state_event, timeout);
EnterCriticalSection(&filter->filter.csFilter);
EnterCriticalSection(&filter->filter.filter_cs);
hr = filter->wait_state_hr;
......@@ -2470,10 +2470,10 @@ static void test_set_state(void)
ok(WaitForSingleObject(thread, 100) == WAIT_TIMEOUT, "SetState returned prematurely.\n");
EnterCriticalSection(&source.filter.csFilter);
EnterCriticalSection(&source.filter.filter_cs);
source.wait_state_hr = S_OK;
SetEvent(source.wait_state_event);
LeaveCriticalSection(&source.filter.csFilter);
LeaveCriticalSection(&source.filter.filter_cs);
ok(!WaitForSingleObject(thread, 2000), "Wait timed out.\n");
CloseHandle(thread);
......
......@@ -582,7 +582,7 @@ static HRESULT WINAPI dmo_wrapper_filter_Init(IDMOWrapperFilter *iface, REFCLSID
FALSE, &sinks[0].pin.IPin_iface);
}
EnterCriticalSection(&filter->filter.csFilter);
EnterCriticalSection(&filter->filter.filter_cs);
filter->dmo = unk;
filter->sink_count = input_count;
......@@ -591,7 +591,7 @@ static HRESULT WINAPI dmo_wrapper_filter_Init(IDMOWrapperFilter *iface, REFCLSID
filter->sources = sources;
filter->buffers = buffers;
LeaveCriticalSection(&filter->filter.csFilter);
LeaveCriticalSection(&filter->filter.filter_cs);
IMediaObject_Release(dmo);
......
......@@ -109,14 +109,14 @@ static HRESULT file_writer_sink_eos(struct strmbase_sink *iface)
{
struct file_writer *filter = impl_from_strmbase_pin(&iface->pin);
EnterCriticalSection(&filter->filter.csFilter);
EnterCriticalSection(&filter->filter.filter_cs);
if (filter->filter.state == State_Running)
deliver_ec_complete(filter);
else
filter->eos = TRUE;
LeaveCriticalSection(&filter->filter.csFilter);
LeaveCriticalSection(&filter->filter.filter_cs);
return S_OK;
}
......
......@@ -93,7 +93,7 @@ static HRESULT sink_get_media_type(struct strmbase_pin *base,
TRACE("(%p)->(%d, %p)\n", This, iPosition, amt);
if (iPosition)
return S_FALSE;
EnterCriticalSection(&This->filter.csFilter);
EnterCriticalSection(&This->filter.filter_cs);
if (This->sink.pin.peer)
{
CopyMediaType(amt, &This->sink.pin.mt);
......@@ -101,7 +101,7 @@ static HRESULT sink_get_media_type(struct strmbase_pin *base,
}
else
hr = S_FALSE;
LeaveCriticalSection(&This->filter.csFilter);
LeaveCriticalSection(&This->filter.filter_cs);
return hr;
}
......@@ -211,19 +211,19 @@ static HRESULT WINAPI SmartTeeFilterInput_Receive(struct strmbase_sink *base, IM
* that's possible. */
/* FIXME: we should ideally do each of these in a separate thread */
EnterCriticalSection(&This->filter.csFilter);
EnterCriticalSection(&This->filter.filter_cs);
if (This->capture.pin.peer)
hrCapture = copy_sample(inputSample, This->capture.pAllocator, &captureSample);
LeaveCriticalSection(&This->filter.csFilter);
LeaveCriticalSection(&This->filter.filter_cs);
if (SUCCEEDED(hrCapture) && This->capture.pMemInputPin)
hrCapture = IMemInputPin_Receive(This->capture.pMemInputPin, captureSample);
if (captureSample)
IMediaSample_Release(captureSample);
EnterCriticalSection(&This->filter.csFilter);
EnterCriticalSection(&This->filter.filter_cs);
if (This->preview.pin.peer)
hrPreview = copy_sample(inputSample, This->preview.pAllocator, &previewSample);
LeaveCriticalSection(&This->filter.csFilter);
LeaveCriticalSection(&This->filter.filter_cs);
/* No timestamps on preview stream: */
if (SUCCEEDED(hrPreview))
hrPreview = IMediaSample_SetTime(previewSample, NULL, NULL);
......@@ -259,7 +259,7 @@ static HRESULT source_get_media_type(struct strmbase_pin *iface,
SmartTeeFilter *filter = impl_from_strmbase_pin(iface);
HRESULT hr = S_OK;
EnterCriticalSection(&filter->filter.csFilter);
EnterCriticalSection(&filter->filter.filter_cs);
if (!filter->sink.pin.peer)
hr = VFW_E_NOT_CONNECTED;
......@@ -268,7 +268,7 @@ static HRESULT source_get_media_type(struct strmbase_pin *iface,
else
hr = VFW_S_NO_MORE_ITEMS;
LeaveCriticalSection(&filter->filter.csFilter);
LeaveCriticalSection(&filter->filter.filter_cs);
return hr;
}
......
......@@ -346,7 +346,7 @@ static HRESULT WINAPI AMStreamConfig_GetFormat(IAMStreamConfig *iface, AM_MEDIA_
if (!(*mt = CoTaskMemAlloc(sizeof(**mt))))
return E_OUTOFMEMORY;
EnterCriticalSection(&filter->filter.csFilter);
EnterCriticalSection(&filter->filter.filter_cs);
if (filter->source.pin.peer)
{
......@@ -367,7 +367,7 @@ static HRESULT WINAPI AMStreamConfig_GetFormat(IAMStreamConfig *iface, AM_MEDIA_
}
}
LeaveCriticalSection(&filter->filter.csFilter);
LeaveCriticalSection(&filter->filter.filter_cs);
if (SUCCEEDED(hr))
strmbase_dump_media_type(*mt);
......
......@@ -140,7 +140,7 @@ static void SampleGrabber_callback(struct sample_grabber *This, IMediaSample *sa
if (size >= 0 && SUCCEEDED(IMediaSample_GetPointer(sample, &data))) {
if (!data)
size = 0;
EnterCriticalSection(&This->filter.csFilter);
EnterCriticalSection(&This->filter.filter_cs);
if (This->bufferLen != size) {
CoTaskMemFree(This->bufferData);
This->bufferData = size ? CoTaskMemAlloc(size) : NULL;
......@@ -148,7 +148,7 @@ static void SampleGrabber_callback(struct sample_grabber *This, IMediaSample *sa
}
if (size)
CopyMemory(This->bufferData, data, size);
LeaveCriticalSection(&This->filter.csFilter);
LeaveCriticalSection(&This->filter.filter_cs);
}
}
if (!This->grabberIface)
......@@ -261,14 +261,14 @@ SampleGrabber_ISampleGrabber_SetBufferSamples(ISampleGrabber *iface, BOOL buffer
{
struct sample_grabber *This = impl_from_ISampleGrabber(iface);
TRACE("(%p)->(%u)\n", This, bufferEm);
EnterCriticalSection(&This->filter.csFilter);
EnterCriticalSection(&This->filter.filter_cs);
if (bufferEm) {
if (This->bufferLen < 0)
This->bufferLen = 0;
}
else
This->bufferLen = -1;
LeaveCriticalSection(&This->filter.csFilter);
LeaveCriticalSection(&This->filter.filter_cs);
return S_OK;
}
......@@ -281,7 +281,7 @@ SampleGrabber_ISampleGrabber_GetCurrentBuffer(ISampleGrabber *iface, LONG *bufSi
TRACE("(%p)->(%p, %p)\n", This, bufSize, buffer);
if (!bufSize)
return E_POINTER;
EnterCriticalSection(&This->filter.csFilter);
EnterCriticalSection(&This->filter.filter_cs);
if (!This->sink.pin.peer)
ret = VFW_E_NOT_CONNECTED;
else if (This->bufferLen < 0)
......@@ -297,7 +297,7 @@ SampleGrabber_ISampleGrabber_GetCurrentBuffer(ISampleGrabber *iface, LONG *bufSi
}
*bufSize = This->bufferLen;
}
LeaveCriticalSection(&This->filter.csFilter);
LeaveCriticalSection(&This->filter.filter_cs);
return ret;
}
......
......@@ -1304,18 +1304,18 @@ static HRESULT WINAPI VMR9FilterConfig_SetNumberOfStreams(IVMRFilterConfig9 *ifa
return E_INVALIDARG;
}
EnterCriticalSection(&filter->renderer.filter.csFilter);
EnterCriticalSection(&filter->renderer.filter.filter_cs);
if (filter->stream_count)
{
LeaveCriticalSection(&filter->renderer.filter.csFilter);
LeaveCriticalSection(&filter->renderer.filter.filter_cs);
WARN("Stream count is already set; returning VFW_E_WRONG_STATE.\n");
return VFW_E_WRONG_STATE;
}
filter->stream_count = count;
LeaveCriticalSection(&filter->renderer.filter.csFilter);
LeaveCriticalSection(&filter->renderer.filter.filter_cs);
return S_OK;
}
......@@ -1325,17 +1325,17 @@ static HRESULT WINAPI VMR9FilterConfig_GetNumberOfStreams(IVMRFilterConfig9 *ifa
TRACE("filter %p, count %p.\n", filter, count);
EnterCriticalSection(&filter->renderer.filter.csFilter);
EnterCriticalSection(&filter->renderer.filter.filter_cs);
if (!filter->stream_count)
{
LeaveCriticalSection(&filter->renderer.filter.csFilter);
LeaveCriticalSection(&filter->renderer.filter.filter_cs);
return VFW_E_VMR_NOT_IN_MIXER_MODE;
}
*count = filter->stream_count;
LeaveCriticalSection(&filter->renderer.filter.csFilter);
LeaveCriticalSection(&filter->renderer.filter.filter_cs);
return S_OK;
}
......@@ -1362,10 +1362,10 @@ static HRESULT WINAPI VMR9FilterConfig_SetRenderingMode(IVMRFilterConfig9 *iface
TRACE("(%p/%p)->(%u)\n", iface, This, mode);
EnterCriticalSection(&This->renderer.filter.csFilter);
EnterCriticalSection(&This->renderer.filter.filter_cs);
if (This->mode)
{
LeaveCriticalSection(&This->renderer.filter.csFilter);
LeaveCriticalSection(&This->renderer.filter.filter_cs);
return VFW_E_WRONG_STATE;
}
......@@ -1400,7 +1400,7 @@ static HRESULT WINAPI VMR9FilterConfig_SetRenderingMode(IVMRFilterConfig9 *iface
case VMR9Mode_Renderless:
break;
default:
LeaveCriticalSection(&This->renderer.filter.csFilter);
LeaveCriticalSection(&This->renderer.filter.filter_cs);
return E_INVALIDARG;
}
......@@ -1408,7 +1408,7 @@ static HRESULT WINAPI VMR9FilterConfig_SetRenderingMode(IVMRFilterConfig9 *iface
video_window_cleanup(&This->window);
This->mode = mode;
LeaveCriticalSection(&This->renderer.filter.csFilter);
LeaveCriticalSection(&This->renderer.filter.filter_cs);
return hr;
}
......@@ -1507,14 +1507,14 @@ static HRESULT WINAPI VMR7WindowlessControl_SetVideoPosition(IVMRWindowlessContr
TRACE("(%p/%p)->(%p, %p)\n", iface, This, source, dest);
EnterCriticalSection(&This->renderer.filter.csFilter);
EnterCriticalSection(&This->renderer.filter.filter_cs);
if (source)
This->window.src = *source;
if (dest)
This->window.dst = *dest;
LeaveCriticalSection(&This->renderer.filter.csFilter);
LeaveCriticalSection(&This->renderer.filter.filter_cs);
return S_OK;
}
......@@ -1705,14 +1705,14 @@ static HRESULT WINAPI VMR9WindowlessControl_SetVideoPosition(IVMRWindowlessContr
TRACE("filter %p, src %s, dst %s.\n", filter, wine_dbgstr_rect(src), wine_dbgstr_rect(dst));
EnterCriticalSection(&filter->renderer.filter.csFilter);
EnterCriticalSection(&filter->renderer.filter.filter_cs);
if (src)
filter->window.src = *src;
if (dst)
filter->window.dst = *dst;
LeaveCriticalSection(&filter->renderer.filter.csFilter);
LeaveCriticalSection(&filter->renderer.filter.filter_cs);
return S_OK;
}
......@@ -1738,9 +1738,9 @@ static HRESULT WINAPI VMR9WindowlessControl_GetAspectRatioMode(IVMRWindowlessCon
TRACE("filter %p, mode %p.\n", filter, mode);
EnterCriticalSection(&filter->renderer.filter.csFilter);
EnterCriticalSection(&filter->renderer.filter.filter_cs);
*mode = filter->aspect_mode;
LeaveCriticalSection(&filter->renderer.filter.csFilter);
LeaveCriticalSection(&filter->renderer.filter.filter_cs);
return S_OK;
}
......@@ -1750,9 +1750,9 @@ static HRESULT WINAPI VMR9WindowlessControl_SetAspectRatioMode(IVMRWindowlessCon
TRACE("filter %p, mode %u.\n", filter, mode);
EnterCriticalSection(&filter->renderer.filter.csFilter);
EnterCriticalSection(&filter->renderer.filter.filter_cs);
filter->aspect_mode = mode;
LeaveCriticalSection(&filter->renderer.filter.csFilter);
LeaveCriticalSection(&filter->renderer.filter.filter_cs);
return S_OK;
}
......@@ -1769,11 +1769,11 @@ static HRESULT WINAPI VMR9WindowlessControl_SetVideoClippingWindow(IVMRWindowles
return E_INVALIDARG;
}
EnterCriticalSection(&filter->renderer.filter.csFilter);
EnterCriticalSection(&filter->renderer.filter.filter_cs);
if (filter->renderer.sink.pin.peer)
{
LeaveCriticalSection(&filter->renderer.filter.csFilter);
LeaveCriticalSection(&filter->renderer.filter.filter_cs);
WARN("Attempt to set the clipping window while connected; returning VFW_E_WRONG_STATE.\n");
return VFW_E_WRONG_STATE;
}
......@@ -1782,7 +1782,7 @@ static HRESULT WINAPI VMR9WindowlessControl_SetVideoClippingWindow(IVMRWindowles
hr = IVMRFilterConfig9_SetNumberOfStreams(&filter->IVMRFilterConfig9_iface, 4);
LeaveCriticalSection(&filter->renderer.filter.csFilter);
LeaveCriticalSection(&filter->renderer.filter.filter_cs);
return hr;
}
......@@ -1793,24 +1793,24 @@ static HRESULT WINAPI VMR9WindowlessControl_RepaintVideo(IVMRWindowlessControl9
FIXME("(%p/%p)->(...) semi-stub\n", iface, This);
EnterCriticalSection(&This->renderer.filter.csFilter);
EnterCriticalSection(&This->renderer.filter.filter_cs);
if (hwnd != This->clipping_window)
{
ERR("Not handling changing windows yet!!!\n");
LeaveCriticalSection(&This->renderer.filter.csFilter);
LeaveCriticalSection(&This->renderer.filter.filter_cs);
return S_OK;
}
if (!This->allocator_d3d9_dev)
{
ERR("No d3d9 device!\n");
LeaveCriticalSection(&This->renderer.filter.csFilter);
LeaveCriticalSection(&This->renderer.filter.filter_cs);
return VFW_E_WRONG_STATE;
}
/* Windowless extension */
hr = IDirect3DDevice9_Present(This->allocator_d3d9_dev, NULL, NULL, NULL, NULL);
LeaveCriticalSection(&This->renderer.filter.csFilter);
LeaveCriticalSection(&This->renderer.filter.filter_cs);
return hr;
}
......@@ -1990,20 +1990,20 @@ static HRESULT WINAPI VMR9SurfaceAllocatorNotify_AdviseSurfaceAllocator(
TRACE("filter %p, cookie %#Ix, allocator %p.\n", filter, cookie, allocator);
EnterCriticalSection(&filter->renderer.filter.csFilter);
EnterCriticalSection(&filter->renderer.filter.filter_cs);
filter->cookie = cookie;
if (filter->renderer.sink.pin.peer)
{
LeaveCriticalSection(&filter->renderer.filter.csFilter);
LeaveCriticalSection(&filter->renderer.filter.filter_cs);
WARN("Attempt to set allocator while connected; returning VFW_E_WRONG_STATE.\n");
return VFW_E_WRONG_STATE;
}
if (FAILED(IVMRSurfaceAllocator9_QueryInterface(allocator, &IID_IVMRImagePresenter9, (void **)&presenter)))
{
LeaveCriticalSection(&filter->renderer.filter.csFilter);
LeaveCriticalSection(&filter->renderer.filter.filter_cs);
return E_NOINTERFACE;
}
......@@ -2016,7 +2016,7 @@ static HRESULT WINAPI VMR9SurfaceAllocatorNotify_AdviseSurfaceAllocator(
filter->presenter = presenter;
IVMRSurfaceAllocator9_AddRef(allocator);
LeaveCriticalSection(&filter->renderer.filter.csFilter);
LeaveCriticalSection(&filter->renderer.filter.filter_cs);
return S_OK;
}
......@@ -2274,9 +2274,9 @@ static HRESULT WINAPI mixer_control9_SetMixingPrefs(IVMRMixerControl9 *iface, DW
FIXME("filter %p, flags %#x, stub!\n", filter, flags);
EnterCriticalSection(&filter->renderer.filter.csFilter);
EnterCriticalSection(&filter->renderer.filter.filter_cs);
filter->mixing_prefs = flags;
LeaveCriticalSection(&filter->renderer.filter.csFilter);
LeaveCriticalSection(&filter->renderer.filter.filter_cs);
return S_OK;
}
......@@ -2286,9 +2286,9 @@ static HRESULT WINAPI mixer_control9_GetMixingPrefs(IVMRMixerControl9 *iface, DW
FIXME("filter %p, flags %p, stub!\n", filter, flags);
EnterCriticalSection(&filter->renderer.filter.csFilter);
EnterCriticalSection(&filter->renderer.filter.filter_cs);
*flags = filter->mixing_prefs;
LeaveCriticalSection(&filter->renderer.filter.csFilter);
LeaveCriticalSection(&filter->renderer.filter.filter_cs);
return S_OK;
}
......@@ -2428,9 +2428,9 @@ static HRESULT WINAPI aspect_ratio_control9_GetAspectRatioMode(IVMRAspectRatioCo
TRACE("filter %p, mode %p.\n", filter, mode);
EnterCriticalSection(&filter->renderer.filter.csFilter);
EnterCriticalSection(&filter->renderer.filter.filter_cs);
*mode = filter->aspect_mode;
LeaveCriticalSection(&filter->renderer.filter.csFilter);
LeaveCriticalSection(&filter->renderer.filter.filter_cs);
return S_OK;
}
......@@ -2440,9 +2440,9 @@ static HRESULT WINAPI aspect_ratio_control9_SetAspectRatioMode(IVMRAspectRatioCo
TRACE("filter %p, mode %u.\n", filter, mode);
EnterCriticalSection(&filter->renderer.filter.csFilter);
EnterCriticalSection(&filter->renderer.filter.filter_cs);
filter->aspect_mode = mode;
LeaveCriticalSection(&filter->renderer.filter.csFilter);
LeaveCriticalSection(&filter->renderer.filter.filter_cs);
return S_OK;
}
......
......@@ -307,7 +307,7 @@ static HRESULT WINAPI filter_Stop(IBaseFilter *iface)
TRACE("filter %p %s.\n", filter, debugstr_w(filter->name));
EnterCriticalSection(&filter->csFilter);
EnterCriticalSection(&filter->filter_cs);
if (filter->state == State_Running && filter->ops->filter_stop_stream)
hr = filter->ops->filter_stop_stream(filter);
......@@ -316,7 +316,7 @@ static HRESULT WINAPI filter_Stop(IBaseFilter *iface)
if (SUCCEEDED(hr))
filter->state = State_Stopped;
LeaveCriticalSection(&filter->csFilter);
LeaveCriticalSection(&filter->filter_cs);
return hr;
}
......@@ -328,7 +328,7 @@ static HRESULT WINAPI filter_Pause(IBaseFilter *iface)
TRACE("filter %p %s.\n", filter, debugstr_w(filter->name));
EnterCriticalSection(&filter->csFilter);
EnterCriticalSection(&filter->filter_cs);
if (filter->state == State_Stopped && filter->ops->filter_init_stream)
hr = filter->ops->filter_init_stream(filter);
......@@ -337,7 +337,7 @@ static HRESULT WINAPI filter_Pause(IBaseFilter *iface)
if (SUCCEEDED(hr))
filter->state = State_Paused;
LeaveCriticalSection(&filter->csFilter);
LeaveCriticalSection(&filter->filter_cs);
return hr;
}
......@@ -349,7 +349,7 @@ static HRESULT WINAPI filter_Run(IBaseFilter *iface, REFERENCE_TIME start)
TRACE("filter %p %s, start %s.\n", filter, debugstr_w(filter->name), debugstr_time(start));
EnterCriticalSection(&filter->csFilter);
EnterCriticalSection(&filter->filter_cs);
if (filter->state == State_Stopped && filter->ops->filter_init_stream)
hr = filter->ops->filter_init_stream(filter);
......@@ -358,7 +358,7 @@ static HRESULT WINAPI filter_Run(IBaseFilter *iface, REFERENCE_TIME start)
if (SUCCEEDED(hr))
filter->state = State_Running;
LeaveCriticalSection(&filter->csFilter);
LeaveCriticalSection(&filter->filter_cs);
return hr;
}
......@@ -370,13 +370,13 @@ static HRESULT WINAPI filter_GetState(IBaseFilter *iface, DWORD timeout, FILTER_
TRACE("filter %p %s, timeout %u, state %p.\n", filter, debugstr_w(filter->name), timeout, state);
EnterCriticalSection(&filter->csFilter);
EnterCriticalSection(&filter->filter_cs);
if (filter->ops->filter_wait_state)
hr = filter->ops->filter_wait_state(filter, timeout);
*state = filter->state;
LeaveCriticalSection(&filter->csFilter);
LeaveCriticalSection(&filter->filter_cs);
return hr;
}
......@@ -387,7 +387,7 @@ static HRESULT WINAPI filter_SetSyncSource(IBaseFilter *iface, IReferenceClock *
TRACE("filter %p %s, clock %p.\n", filter, debugstr_w(filter->name), clock);
EnterCriticalSection(&filter->csFilter);
EnterCriticalSection(&filter->filter_cs);
if (filter->clock)
IReferenceClock_Release(filter->clock);
......@@ -395,7 +395,7 @@ static HRESULT WINAPI filter_SetSyncSource(IBaseFilter *iface, IReferenceClock *
if (filter->clock)
IReferenceClock_AddRef(filter->clock);
LeaveCriticalSection(&filter->csFilter);
LeaveCriticalSection(&filter->filter_cs);
return S_OK;
}
......@@ -406,13 +406,13 @@ static HRESULT WINAPI filter_GetSyncSource(IBaseFilter *iface, IReferenceClock *
TRACE("filter %p %s, clock %p.\n", filter, debugstr_w(filter->name), clock);
EnterCriticalSection(&filter->csFilter);
EnterCriticalSection(&filter->filter_cs);
*clock = filter->clock;
if (filter->clock)
IReferenceClock_AddRef(filter->clock);
LeaveCriticalSection(&filter->csFilter);
LeaveCriticalSection(&filter->filter_cs);
return S_OK;
}
......@@ -467,7 +467,7 @@ static HRESULT WINAPI filter_JoinFilterGraph(IBaseFilter *iface, IFilterGraph *g
TRACE("filter %p %s, graph %p, name %s.\n", filter, debugstr_w(filter->name), graph, debugstr_w(name));
EnterCriticalSection(&filter->csFilter);
EnterCriticalSection(&filter->filter_cs);
if (name)
lstrcpynW(filter->name, name, ARRAY_SIZE(filter->name));
......@@ -476,7 +476,7 @@ static HRESULT WINAPI filter_JoinFilterGraph(IBaseFilter *iface, IFilterGraph *g
/* The graph references us, so we cannot also reference the graph. */
filter->graph = graph;
LeaveCriticalSection(&filter->csFilter);
LeaveCriticalSection(&filter->filter_cs);
return S_OK;
}
......@@ -524,9 +524,9 @@ void strmbase_filter_init(struct strmbase_filter *filter, IUnknown *outer,
filter->outer_unk = outer ? outer : &filter->IUnknown_inner;
filter->refcount = 1;
InitializeCriticalSection(&filter->csFilter);
if (filter->csFilter.DebugInfo != (RTL_CRITICAL_SECTION_DEBUG *)-1)
filter->csFilter.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": strmbase_filter.csFilter");
InitializeCriticalSection(&filter->filter_cs);
if (filter->filter_cs.DebugInfo != (RTL_CRITICAL_SECTION_DEBUG *)-1)
filter->filter_cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": strmbase_filter.filter_cs");
filter->clsid = *clsid;
filter->pin_version = 1;
filter->ops = ops;
......@@ -538,7 +538,7 @@ void strmbase_filter_cleanup(struct strmbase_filter *filter)
IReferenceClock_Release(filter->clock);
filter->IBaseFilter_iface.lpVtbl = NULL;
if (filter->csFilter.DebugInfo != (RTL_CRITICAL_SECTION_DEBUG *)-1)
filter->csFilter.DebugInfo->Spare[0] = 0;
DeleteCriticalSection(&filter->csFilter);
if (filter->filter_cs.DebugInfo != (RTL_CRITICAL_SECTION_DEBUG *)-1)
filter->filter_cs.DebugInfo->Spare[0] = 0;
DeleteCriticalSection(&filter->filter_cs);
}
......@@ -308,7 +308,7 @@ static HRESULT WINAPI pin_ConnectedTo(IPin * iface, IPin ** ppPin)
TRACE("pin %p %s:%s, peer %p.\n", This, debugstr_w(This->filter->name), debugstr_w(This->name), ppPin);
EnterCriticalSection(&This->filter->csFilter);
EnterCriticalSection(&This->filter->filter_cs);
{
if (This->peer)
{
......@@ -322,7 +322,7 @@ static HRESULT WINAPI pin_ConnectedTo(IPin * iface, IPin ** ppPin)
*ppPin = NULL;
}
}
LeaveCriticalSection(&This->filter->csFilter);
LeaveCriticalSection(&This->filter->filter_cs);
return hr;
}
......@@ -334,7 +334,7 @@ static HRESULT WINAPI pin_ConnectionMediaType(IPin *iface, AM_MEDIA_TYPE *pmt)
TRACE("pin %p %s:%s, pmt %p.\n", This, debugstr_w(This->filter->name), debugstr_w(This->name), pmt);
EnterCriticalSection(&This->filter->csFilter);
EnterCriticalSection(&This->filter->filter_cs);
{
if (This->peer)
{
......@@ -348,7 +348,7 @@ static HRESULT WINAPI pin_ConnectionMediaType(IPin *iface, AM_MEDIA_TYPE *pmt)
hr = VFW_E_NOT_CONNECTED;
}
}
LeaveCriticalSection(&This->filter->csFilter);
LeaveCriticalSection(&This->filter->filter_cs);
return hr;
}
......@@ -489,18 +489,18 @@ static HRESULT WINAPI source_Connect(IPin *iface, IPin *peer, const AM_MEDIA_TYP
return VFW_E_INVALID_DIRECTION;
}
EnterCriticalSection(&pin->pin.filter->csFilter);
EnterCriticalSection(&pin->pin.filter->filter_cs);
if (pin->pin.peer)
{
LeaveCriticalSection(&pin->pin.filter->csFilter);
LeaveCriticalSection(&pin->pin.filter->filter_cs);
WARN("Pin is already connected, returning VFW_E_ALREADY_CONNECTED.\n");
return VFW_E_ALREADY_CONNECTED;
}
if (pin->pin.filter->state != State_Stopped)
{
LeaveCriticalSection(&pin->pin.filter->csFilter);
LeaveCriticalSection(&pin->pin.filter->filter_cs);
WARN("Filter is not stopped; returning VFW_E_NOT_STOPPED.\n");
return VFW_E_NOT_STOPPED;
}
......@@ -512,7 +512,7 @@ static HRESULT WINAPI source_Connect(IPin *iface, IPin *peer, const AM_MEDIA_TYP
&& !IsEqualGUID(&mt->formattype, &GUID_NULL))
{
hr = pin->pFuncsTable->pfnAttemptConnection(pin, peer, mt);
LeaveCriticalSection(&pin->pin.filter->csFilter);
LeaveCriticalSection(&pin->pin.filter->filter_cs);
return hr;
}
......@@ -524,7 +524,7 @@ static HRESULT WINAPI source_Connect(IPin *iface, IPin *peer, const AM_MEDIA_TYP
if (compare_media_types(mt, &candidate)
&& pin->pFuncsTable->pfnAttemptConnection(pin, peer, &candidate) == S_OK)
{
LeaveCriticalSection(&pin->pin.filter->csFilter);
LeaveCriticalSection(&pin->pin.filter->filter_cs);
FreeMediaType(&candidate);
return S_OK;
}
......@@ -539,7 +539,7 @@ static HRESULT WINAPI source_Connect(IPin *iface, IPin *peer, const AM_MEDIA_TYP
if (compare_media_types(mt, candidate_ptr)
&& pin->pFuncsTable->pfnAttemptConnection(pin, peer, candidate_ptr) == S_OK)
{
LeaveCriticalSection(&pin->pin.filter->csFilter);
LeaveCriticalSection(&pin->pin.filter->filter_cs);
DeleteMediaType(candidate_ptr);
IEnumMediaTypes_Release(enummt);
return S_OK;
......@@ -550,7 +550,7 @@ static HRESULT WINAPI source_Connect(IPin *iface, IPin *peer, const AM_MEDIA_TYP
IEnumMediaTypes_Release(enummt);
}
LeaveCriticalSection(&pin->pin.filter->csFilter);
LeaveCriticalSection(&pin->pin.filter->filter_cs);
return VFW_E_NO_ACCEPTABLE_TYPES;
}
......@@ -572,11 +572,11 @@ static HRESULT WINAPI source_Disconnect(IPin *iface)
TRACE("pin %p %s:%s.\n", This, debugstr_w(This->pin.filter->name), debugstr_w(This->pin.name));
EnterCriticalSection(&This->pin.filter->csFilter);
EnterCriticalSection(&This->pin.filter->filter_cs);
{
if (This->pin.filter->state != State_Stopped)
{
LeaveCriticalSection(&This->pin.filter->csFilter);
LeaveCriticalSection(&This->pin.filter->filter_cs);
WARN("Filter is not stopped; returning VFW_E_NOT_STOPPED.\n");
return VFW_E_NOT_STOPPED;
}
......@@ -607,7 +607,7 @@ static HRESULT WINAPI source_Disconnect(IPin *iface)
else
hr = S_FALSE;
}
LeaveCriticalSection(&This->pin.filter->csFilter);
LeaveCriticalSection(&This->pin.filter->filter_cs);
return hr;
}
......@@ -836,11 +836,11 @@ static HRESULT WINAPI sink_ReceiveConnection(IPin *iface, IPin *pReceivePin, con
if (!pmt)
return E_POINTER;
EnterCriticalSection(&This->pin.filter->csFilter);
EnterCriticalSection(&This->pin.filter->filter_cs);
{
if (This->pin.filter->state != State_Stopped)
{
LeaveCriticalSection(&This->pin.filter->csFilter);
LeaveCriticalSection(&This->pin.filter->filter_cs);
WARN("Filter is not stopped; returning VFW_E_NOT_STOPPED.\n");
return VFW_E_NOT_STOPPED;
}
......@@ -873,7 +873,7 @@ static HRESULT WINAPI sink_ReceiveConnection(IPin *iface, IPin *pReceivePin, con
IPin_AddRef(pReceivePin);
}
}
LeaveCriticalSection(&This->pin.filter->csFilter);
LeaveCriticalSection(&This->pin.filter->filter_cs);
return hr;
}
......@@ -885,11 +885,11 @@ static HRESULT WINAPI sink_Disconnect(IPin *iface)
TRACE("pin %p %s:%s.\n", pin, debugstr_w(pin->pin.filter->name), debugstr_w(pin->pin.name));
EnterCriticalSection(&pin->pin.filter->csFilter);
EnterCriticalSection(&pin->pin.filter->filter_cs);
if (pin->pin.filter->state != State_Stopped)
{
LeaveCriticalSection(&pin->pin.filter->csFilter);
LeaveCriticalSection(&pin->pin.filter->filter_cs);
WARN("Filter is not stopped; returning VFW_E_NOT_STOPPED.\n");
return VFW_E_NOT_STOPPED;
}
......@@ -914,7 +914,7 @@ static HRESULT WINAPI sink_Disconnect(IPin *iface)
else
hr = S_FALSE;
LeaveCriticalSection(&pin->pin.filter->csFilter);
LeaveCriticalSection(&pin->pin.filter->filter_cs);
return hr;
}
......@@ -934,10 +934,10 @@ static HRESULT WINAPI sink_EndOfStream(IPin *iface)
if (This->pFuncsTable->sink_eos)
return This->pFuncsTable->sink_eos(This);
EnterCriticalSection(&This->pin.filter->csFilter);
EnterCriticalSection(&This->pin.filter->filter_cs);
if (This->flushing)
hr = S_FALSE;
LeaveCriticalSection(&This->pin.filter->csFilter);
LeaveCriticalSection(&This->pin.filter->filter_cs);
if (hr == S_OK)
hr = SendFurther(This, deliver_endofstream, NULL);
......@@ -956,7 +956,7 @@ static HRESULT WINAPI sink_BeginFlush(IPin *iface)
TRACE("pin %p %s:%s.\n", pin, debugstr_w(pin->pin.filter->name), debugstr_w(pin->pin.name));
EnterCriticalSection(&pin->pin.filter->csFilter);
EnterCriticalSection(&pin->pin.filter->filter_cs);
pin->flushing = TRUE;
......@@ -965,7 +965,7 @@ static HRESULT WINAPI sink_BeginFlush(IPin *iface)
else
hr = SendFurther(pin, deliver_beginflush, NULL);
LeaveCriticalSection(&pin->pin.filter->csFilter);
LeaveCriticalSection(&pin->pin.filter->filter_cs);
return hr;
}
......@@ -982,7 +982,7 @@ static HRESULT WINAPI sink_EndFlush(IPin * iface)
TRACE("pin %p %s:%s.\n", pin, debugstr_w(pin->pin.filter->name), debugstr_w(pin->pin.name));
EnterCriticalSection(&pin->pin.filter->csFilter);
EnterCriticalSection(&pin->pin.filter->filter_cs);
pin->flushing = FALSE;
......@@ -991,7 +991,7 @@ static HRESULT WINAPI sink_EndFlush(IPin * iface)
else
hr = SendFurther(pin, deliver_endflush, NULL);
LeaveCriticalSection(&pin->pin.filter->csFilter);
LeaveCriticalSection(&pin->pin.filter->filter_cs);
return hr;
}
......
......@@ -634,16 +634,16 @@ static gboolean event_src(GstPad *pad, GstObject *parent, GstEvent *event)
ret = gst_base_src_perform_seek(This, event);
break;
case GST_EVENT_FLUSH_START:
EnterCriticalSection(&This->filter.csFilter);
EnterCriticalSection(&This->filter.filter_cs);
if (This->reader)
IAsyncReader_BeginFlush(This->reader);
LeaveCriticalSection(&This->filter.csFilter);
LeaveCriticalSection(&This->filter.filter_cs);
break;
case GST_EVENT_FLUSH_STOP:
EnterCriticalSection(&This->filter.csFilter);
EnterCriticalSection(&This->filter.filter_cs);
if (This->reader)
IAsyncReader_EndFlush(This->reader);
LeaveCriticalSection(&This->filter.csFilter);
LeaveCriticalSection(&This->filter.filter_cs);
break;
case GST_EVENT_QOS:
case GST_EVENT_RECONFIGURE:
......@@ -1264,7 +1264,7 @@ static gboolean activate_push(GstPad *pad, gboolean activate)
{
struct parser *This = gst_pad_get_element_private(pad);
EnterCriticalSection(&This->filter.csFilter);
EnterCriticalSection(&This->filter.filter_cs);
if (!activate) {
TRACE("Deactivating\n");
if (!This->initial)
......@@ -1285,7 +1285,7 @@ static gboolean activate_push(GstPad *pad, gboolean activate)
else
This->push_thread = CreateThread(NULL, 0, push_data, This, 0, NULL);
}
LeaveCriticalSection(&This->filter.csFilter);
LeaveCriticalSection(&This->filter.filter_cs);
return TRUE;
}
......
......@@ -126,7 +126,7 @@ struct strmbase_filter
IUnknown IUnknown_inner;
IUnknown *outer_unk;
LONG refcount;
CRITICAL_SECTION csFilter;
CRITICAL_SECTION filter_cs;
FILTER_STATE state;
IReferenceClock *clock;
......
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