Piotr Caban : qcap: Support compression filter in ICaptureGraphBuilder2:: RenderStream.
Alexandre Julliard
julliard at winehq.org
Wed Nov 20 13:38:56 CST 2013
Module: wine
Branch: master
Commit: badc77d522f64112f7e7bc6f7d5d07da058d553c
URL: http://source.winehq.org/git/wine.git/?a=commit;h=badc77d522f64112f7e7bc6f7d5d07da058d553c
Author: Piotr Caban <piotr at codeweavers.com>
Date: Wed Nov 20 12:00:07 2013 +0100
qcap: Support compression filter in ICaptureGraphBuilder2::RenderStream.
---
dlls/qcap/capturegraph.c | 59 +++++++++++++++++++++++++++++++++------------
1 files changed, 43 insertions(+), 16 deletions(-)
diff --git a/dlls/qcap/capturegraph.c b/dlls/qcap/capturegraph.c
index 7cec77e..a852b61 100644
--- a/dlls/qcap/capturegraph.c
+++ b/dlls/qcap/capturegraph.c
@@ -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;
}
More information about the wine-cvs
mailing list