Commit 2d7b374e authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

qcap/smartteefilter: Store the capture source pin inline in the SmartTeeFilter structure.

parent 17b118a0
...@@ -38,7 +38,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(qcap); ...@@ -38,7 +38,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(qcap);
typedef struct { typedef struct {
BaseFilter filter; BaseFilter filter;
BaseInputPin sink; BaseInputPin sink;
BaseOutputPin *capture; BaseOutputPin capture;
BaseOutputPin *preview; BaseOutputPin *preview;
} SmartTeeFilter; } SmartTeeFilter;
...@@ -125,7 +125,7 @@ static IPin *smart_tee_get_pin(BaseFilter *iface, unsigned int index) ...@@ -125,7 +125,7 @@ static IPin *smart_tee_get_pin(BaseFilter *iface, unsigned int index)
if (index == 0) if (index == 0)
return &filter->sink.pin.IPin_iface; return &filter->sink.pin.IPin_iface;
else if (index == 1) else if (index == 1)
return &filter->capture->pin.IPin_iface; return &filter->capture.pin.IPin_iface;
else if (index == 2) else if (index == 2)
return &filter->preview->pin.IPin_iface; return &filter->preview->pin.IPin_iface;
return NULL; return NULL;
...@@ -136,8 +136,7 @@ static void smart_tee_destroy(BaseFilter *iface) ...@@ -136,8 +136,7 @@ static void smart_tee_destroy(BaseFilter *iface)
SmartTeeFilter *filter = impl_from_BaseFilter(iface); SmartTeeFilter *filter = impl_from_BaseFilter(iface);
strmbase_sink_cleanup(&filter->sink); strmbase_sink_cleanup(&filter->sink);
if (filter->capture) strmbase_source_cleanup(&filter->capture);
BaseOutputPinImpl_Release(&filter->capture->pin.IPin_iface);
if (filter->preview) if (filter->preview)
BaseOutputPinImpl_Release(&filter->preview->pin.IPin_iface); BaseOutputPinImpl_Release(&filter->preview->pin.IPin_iface);
strmbase_filter_cleanup(&filter->filter); strmbase_filter_cleanup(&filter->filter);
...@@ -308,11 +307,11 @@ static HRESULT WINAPI SmartTeeFilterInput_Receive(BaseInputPin *base, IMediaSamp ...@@ -308,11 +307,11 @@ static HRESULT WINAPI SmartTeeFilterInput_Receive(BaseInputPin *base, IMediaSamp
/* FIXME: we should ideally do each of these in a separate thread */ /* FIXME: we should ideally do each of these in a separate thread */
EnterCriticalSection(&This->filter.csFilter); EnterCriticalSection(&This->filter.csFilter);
if (This->capture->pin.pConnectedTo) if (This->capture.pin.pConnectedTo)
hrCapture = copy_sample(inputSample, This->capture->pAllocator, &captureSample); hrCapture = copy_sample(inputSample, This->capture.pAllocator, &captureSample);
LeaveCriticalSection(&This->filter.csFilter); LeaveCriticalSection(&This->filter.csFilter);
if (SUCCEEDED(hrCapture)) if (SUCCEEDED(hrCapture))
hrCapture = BaseOutputPinImpl_Deliver(This->capture, captureSample); hrCapture = BaseOutputPinImpl_Deliver(&This->capture, captureSample);
if (captureSample) if (captureSample)
IMediaSample_Release(captureSample); IMediaSample_Release(captureSample);
...@@ -535,10 +534,8 @@ IUnknown* WINAPI QCAP_createSmartTeeFilter(IUnknown *outer, HRESULT *phr) ...@@ -535,10 +534,8 @@ IUnknown* WINAPI QCAP_createSmartTeeFilter(IUnknown *outer, HRESULT *phr)
goto end; goto end;
capturePinInfo.pFilter = &This->filter.IBaseFilter_iface; capturePinInfo.pFilter = &This->filter.IBaseFilter_iface;
hr = BaseOutputPin_Construct(&SmartTeeFilterCaptureVtbl, sizeof(BaseOutputPin), &capturePinInfo, strmbase_source_init(&This->capture, &SmartTeeFilterCaptureVtbl, &capturePinInfo,
&SmartTeeFilterCaptureFuncs, &This->filter.csFilter, (IPin**)&This->capture); &SmartTeeFilterCaptureFuncs, &This->filter.csFilter);
if (FAILED(hr))
goto end;
previewPinInfo.pFilter = &This->filter.IBaseFilter_iface; previewPinInfo.pFilter = &This->filter.IBaseFilter_iface;
hr = BaseOutputPin_Construct(&SmartTeeFilterPreviewVtbl, sizeof(BaseOutputPin), &previewPinInfo, hr = BaseOutputPin_Construct(&SmartTeeFilterPreviewVtbl, sizeof(BaseOutputPin), &previewPinInfo,
......
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