Commit badc77d5 authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

qcap: Support compression filter in ICaptureGraphBuilder2::RenderStream.

parent 466f435a
......@@ -259,37 +259,64 @@ fnCaptureGraphBuilder2_RenderStream(ICaptureGraphBuilder2 * iface,
IBaseFilter *pfRenderer)
{
CaptureGraphImpl *This = impl_from_ICaptureGraphBuilder2(iface);
IPin *pin_in = NULL;
IPin *pin_out = NULL;
IPin *source_out;
IPin *renderer_in;
HRESULT hr;
FIXME("(%p/%p)->(%s, %s, %p, %p, %p) Stub!\n", This, iface,
FIXME("(%p/%p)->(%s, %s, %p, %p, %p) semi-stub!\n", This, iface,
debugstr_guid(pCategory), debugstr_guid(pType),
pSource, pfCompressor, pfRenderer);
if (pfCompressor)
FIXME("Intermediate streams not supported yet\n");
if (!This->mygraph)
{
FIXME("Need a capture graph\n");
return E_UNEXPECTED;
}
if (!pfRenderer)
{
FIXME("pfRenderer == NULL not yet supported\n");
return E_NOTIMPL;
}
ICaptureGraphBuilder2_FindPin(iface, pSource, PINDIR_OUTPUT, pCategory, pType, TRUE, 0, &pin_in);
if (!pin_in)
return E_FAIL;
ICaptureGraphBuilder2_FindPin(iface, (IUnknown*)pfRenderer, PINDIR_INPUT, pCategory, pType, TRUE, 0, &pin_out);
if (!pin_out)
hr = ICaptureGraphBuilder2_FindPin(iface, pSource, PINDIR_OUTPUT, pCategory, pType, TRUE, 0, &source_out);
if (FAILED(hr))
return E_INVALIDARG;
hr = ICaptureGraphBuilder2_FindPin(iface, (IUnknown*)pfRenderer, PINDIR_INPUT, pCategory, pType, TRUE, 0, &renderer_in);
if (FAILED(hr))
{
IPin_Release(pin_in);
return E_FAIL;
IPin_Release(source_out);
return hr;
}
/* Uses 'Intelligent Connect', so Connect, not ConnectDirect here */
hr = IGraphBuilder_Connect(This->mygraph, pin_in, pin_out);
IPin_Release(pin_in);
IPin_Release(pin_out);
if (!pfCompressor)
hr = IGraphBuilder_Connect(This->mygraph, source_out, renderer_in);
else
{
IPin *compressor_in, *compressor_out;
hr = ICaptureGraphBuilder2_FindPin(iface, (IUnknown*)pfCompressor,
PINDIR_INPUT, NULL, NULL, TRUE, 0, &compressor_in);
if (SUCCEEDED(hr))
{
hr = IGraphBuilder_Connect(This->mygraph, source_out, compressor_in);
IPin_Release(compressor_in);
}
if (SUCCEEDED(hr))
{
hr = ICaptureGraphBuilder2_FindPin(iface, (IUnknown*)pfCompressor,
PINDIR_OUTPUT, NULL, NULL, TRUE, 0, &compressor_out);
if (SUCCEEDED(hr))
{
hr = IGraphBuilder_Connect(This->mygraph, compressor_out, renderer_in);
IPin_Release(compressor_out);
}
}
}
IPin_Release(source_out);
IPin_Release(renderer_in);
return hr;
}
......
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