qcap/avico: Store the sink pin inline in the AviCompressor structure.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2019-06-12 18:58:37 -05:00 committed by Alexandre Julliard
parent cec43c1822
commit f2206d3db6
3 changed files with 12 additions and 15 deletions

View File

@ -37,7 +37,7 @@ typedef struct {
BaseFilter filter;
IPersistPropertyBag IPersistPropertyBag_iface;
BaseInputPin *in;
BaseInputPin sink;
BaseOutputPin *out;
DWORD fcc_handler;
@ -183,7 +183,7 @@ static IPin *avi_compressor_get_pin(BaseFilter *iface, unsigned int index)
AVICompressor *filter = impl_from_BaseFilter(iface);
if (index == 0)
return &filter->in->pin.IPin_iface;
return &filter->sink.pin.IPin_iface;
else if (index == 1)
return &filter->out->pin.IPin_iface;
return NULL;
@ -196,8 +196,7 @@ static void avi_compressor_destroy(BaseFilter *iface)
if (filter->hic)
ICClose(filter->hic);
heap_free(filter->videoinfo);
if (filter->in)
BaseInputPinImpl_Release(&filter->in->pin.IPin_iface);
strmbase_sink_cleanup(&filter->sink);
if (filter->out)
BaseOutputPinImpl_Release(&filter->out->pin.IPin_iface);
strmbase_filter_cleanup(&filter->filter);
@ -484,7 +483,7 @@ static HRESULT WINAPI AVICompressorIn_Receive(BaseInputPin *base, IMediaSample *
if((This->driver_flags & VIDCF_TEMPORAL) && !(This->driver_flags & VIDCF_FASTTEMPORALC))
FIXME("Unsupported temporal compression\n");
src_videoinfo = (VIDEOINFOHEADER*)This->in->pin.mtCurrent.pbFormat;
src_videoinfo = (VIDEOINFOHEADER *)This->sink.pin.mtCurrent.pbFormat;
This->videoinfo->bmiHeader.biSizeImage = This->max_frame_size;
res = ICCompress(This->hic, sync_point ? ICCOMPRESS_KEYFRAME : 0, &This->videoinfo->bmiHeader, buf,
&src_videoinfo->bmiHeader, ptr, 0, &comp_flags, This->frame_cnt, 0, 0, NULL, NULL);
@ -572,7 +571,7 @@ static HRESULT WINAPI AVICompressorOut_GetMediaType(BasePin *base, int iPosition
amt->subtype = MEDIASUBTYPE_PCM;
amt->bFixedSizeSamples = FALSE;
amt->bTemporalCompression = (This->driver_flags & VIDCF_TEMPORAL) != 0;
amt->lSampleSize = This->in->pin.mtCurrent.lSampleSize;
amt->lSampleSize = This->sink.pin.mtCurrent.lSampleSize;
amt->formattype = FORMAT_VideoInfo;
amt->pUnk = NULL;
amt->cbFormat = This->videoinfo_size;
@ -633,13 +632,8 @@ IUnknown* WINAPI QCAP_createAVICompressor(IUnknown *outer, HRESULT *phr)
compressor->IPersistPropertyBag_iface.lpVtbl = &PersistPropertyBagVtbl;
in_pin_info.pFilter = &compressor->filter.IBaseFilter_iface;
hres = BaseInputPin_Construct(&AVICompressorInputPinVtbl, sizeof(BaseInputPin), &in_pin_info,
&AVICompressorBaseInputPinVtbl, &compressor->filter.csFilter, NULL, (IPin**)&compressor->in);
if(FAILED(hres)) {
strmbase_filter_cleanup(&compressor->filter);
*phr = hres;
return NULL;
}
strmbase_sink_init(&compressor->sink, &AVICompressorInputPinVtbl, &in_pin_info,
&AVICompressorBaseInputPinVtbl, &compressor->filter.csFilter, NULL);
out_pin_info.pFilter = &compressor->filter.IBaseFilter_iface;
hres = BaseOutputPin_Construct(&AVICompressorOutputPinVtbl, sizeof(BaseOutputPin), &out_pin_info,

View File

@ -1109,7 +1109,7 @@ static const IMemInputPinVtbl MemInputPin_Vtbl =
MemInputPin_ReceiveCanBlock
};
static void strmbase_sink_init(BaseInputPin *pin, const IPinVtbl *vtbl,
void strmbase_sink_init(BaseInputPin *pin, const IPinVtbl *vtbl,
const PIN_INFO *info, const BaseInputPinFuncTable *func_table, CRITICAL_SECTION *cs,
IMemAllocator *allocator)
{
@ -1150,7 +1150,7 @@ HRESULT BaseInputPin_Construct(const IPinVtbl *InputPin_Vtbl, LONG inputpin_size
return S_OK;
}
static void strmbase_sink_cleanup(BaseInputPin *pin)
void strmbase_sink_cleanup(BaseInputPin *pin)
{
FreeMediaType(&pin->pin.mtCurrent);
if (pin->pAllocator)

View File

@ -151,6 +151,9 @@ HRESULT BaseInputPin_Construct(const IPinVtbl *InputPin_Vtbl, LONG inputpin_size
const BaseInputPinFuncTable* pBaseInputFuncsTable,
LPCRITICAL_SECTION pCritSec, IMemAllocator *, IPin ** ppPin);
HRESULT WINAPI BaseInputPin_Destroy(BaseInputPin *This);
void strmbase_sink_init(BaseInputPin *pin, const IPinVtbl *vtbl, const PIN_INFO *info,
const BaseInputPinFuncTable *func_table, CRITICAL_SECTION *cs, IMemAllocator *allocator);
void strmbase_sink_cleanup(BaseInputPin *pin);
typedef struct BaseFilter
{