2001-08-15 21:26:52 +02:00
|
|
|
/*
|
2001-10-14 18:13:14 +02:00
|
|
|
* Implementation of IFilterGraph and related interfaces
|
|
|
|
* + IGraphVersion, IGraphConfig
|
2001-08-15 21:26:52 +02:00
|
|
|
*
|
2001-09-26 00:37:04 +02:00
|
|
|
* FIXME - create a thread to process some methods correctly.
|
|
|
|
*
|
|
|
|
* FIXME - ReconnectEx
|
|
|
|
* FIXME - process Pause/Stop asynchronously and notify when completed.
|
|
|
|
*
|
2001-08-15 21:26:52 +02:00
|
|
|
*
|
|
|
|
* hidenori@a2.ctktv.ne.jp
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
|
|
|
#include "windef.h"
|
|
|
|
#include "winbase.h"
|
|
|
|
#include "wingdi.h"
|
2001-09-17 22:04:28 +02:00
|
|
|
#include "winuser.h"
|
2001-08-15 21:26:52 +02:00
|
|
|
#include "winerror.h"
|
|
|
|
#include "strmif.h"
|
2001-08-22 20:06:00 +02:00
|
|
|
#include "control.h"
|
2001-08-15 21:26:52 +02:00
|
|
|
#include "uuids.h"
|
2001-09-07 21:46:49 +02:00
|
|
|
#include "vfwmsgs.h"
|
2001-09-26 00:37:04 +02:00
|
|
|
#include "evcode.h"
|
2001-08-15 21:26:52 +02:00
|
|
|
|
|
|
|
#include "debugtools.h"
|
|
|
|
DEFAULT_DEBUG_CHANNEL(quartz);
|
|
|
|
|
|
|
|
#include "quartz_private.h"
|
|
|
|
#include "fgraph.h"
|
2001-09-07 21:46:49 +02:00
|
|
|
#include "enumunk.h"
|
2001-09-26 00:37:04 +02:00
|
|
|
#include "sysclock.h"
|
2001-09-07 21:46:49 +02:00
|
|
|
|
|
|
|
|
|
|
|
static HRESULT CFilterGraph_DisconnectAllPins( IBaseFilter* pFilter )
|
|
|
|
{
|
|
|
|
IEnumPins* pEnum = NULL;
|
|
|
|
IPin* pPin;
|
|
|
|
IPin* pConnTo;
|
|
|
|
ULONG cFetched;
|
|
|
|
HRESULT hr;
|
|
|
|
|
|
|
|
hr = IBaseFilter_EnumPins( pFilter, &pEnum );
|
|
|
|
if ( FAILED(hr) )
|
|
|
|
return hr;
|
|
|
|
if ( pEnum == NULL )
|
|
|
|
return E_FAIL;
|
|
|
|
|
|
|
|
while ( 1 )
|
|
|
|
{
|
|
|
|
pPin = NULL;
|
|
|
|
cFetched = 0;
|
|
|
|
hr = IEnumPins_Next( pEnum, 1, &pPin, &cFetched );
|
|
|
|
if ( FAILED(hr) )
|
|
|
|
break;
|
|
|
|
if ( hr != NOERROR || pPin == NULL || cFetched != 1 )
|
|
|
|
{
|
|
|
|
hr = NOERROR;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
pConnTo = NULL;
|
|
|
|
hr = IPin_ConnectedTo(pPin,&pConnTo);
|
|
|
|
if ( hr == NOERROR && pConnTo != NULL )
|
|
|
|
{
|
|
|
|
IPin_Disconnect(pPin);
|
|
|
|
IPin_Disconnect(pConnTo);
|
|
|
|
IPin_Release(pConnTo);
|
|
|
|
}
|
|
|
|
|
|
|
|
IPin_Release( pPin );
|
|
|
|
}
|
|
|
|
|
|
|
|
IEnumPins_Release( pEnum );
|
|
|
|
|
|
|
|
return hr;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-10-01 22:53:58 +02:00
|
|
|
static HRESULT CFilterGraph_GraphChanged( CFilterGraph* This )
|
|
|
|
{
|
|
|
|
/* IDistributorNotify_NotifyGraphChange() */
|
|
|
|
|
|
|
|
IMediaEventSink_Notify(CFilterGraph_IMediaEventSink(This),
|
|
|
|
EC_GRAPH_CHANGED, 0, 0);
|
|
|
|
This->m_lGraphVersion ++;
|
|
|
|
|
|
|
|
return NOERROR;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-10-14 18:13:14 +02:00
|
|
|
/***************************************************************************
|
|
|
|
*
|
|
|
|
* CFilterGraph::IFilterGraph2 methods
|
|
|
|
*
|
|
|
|
*/
|
2001-08-15 21:26:52 +02:00
|
|
|
|
|
|
|
static HRESULT WINAPI
|
|
|
|
IFilterGraph2_fnQueryInterface(IFilterGraph2* iface,REFIID riid,void** ppobj)
|
|
|
|
{
|
|
|
|
CFilterGraph_THIS(iface,fgraph);
|
|
|
|
|
|
|
|
TRACE("(%p)->()\n",This);
|
|
|
|
|
2001-08-22 20:06:00 +02:00
|
|
|
return IUnknown_QueryInterface(This->unk.punkControl,riid,ppobj);
|
2001-08-15 21:26:52 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI
|
|
|
|
IFilterGraph2_fnAddRef(IFilterGraph2* iface)
|
|
|
|
{
|
|
|
|
CFilterGraph_THIS(iface,fgraph);
|
|
|
|
|
|
|
|
TRACE("(%p)->()\n",This);
|
|
|
|
|
2001-08-22 20:06:00 +02:00
|
|
|
return IUnknown_AddRef(This->unk.punkControl);
|
2001-08-15 21:26:52 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI
|
|
|
|
IFilterGraph2_fnRelease(IFilterGraph2* iface)
|
|
|
|
{
|
|
|
|
CFilterGraph_THIS(iface,fgraph);
|
|
|
|
|
|
|
|
TRACE("(%p)->()\n",This);
|
|
|
|
|
2001-08-22 20:06:00 +02:00
|
|
|
return IUnknown_Release(This->unk.punkControl);
|
2001-08-15 21:26:52 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI
|
|
|
|
IFilterGraph2_fnAddFilter(IFilterGraph2* iface,IBaseFilter* pFilter, LPCWSTR pName)
|
|
|
|
{
|
|
|
|
CFilterGraph_THIS(iface,fgraph);
|
2001-09-26 00:37:04 +02:00
|
|
|
FILTER_STATE fs;
|
2001-09-07 21:46:49 +02:00
|
|
|
FILTER_INFO info;
|
|
|
|
HRESULT hr;
|
|
|
|
HRESULT hrSucceeded = S_OK;
|
|
|
|
QUARTZ_CompListItem* pItem;
|
|
|
|
int i,iLen;
|
|
|
|
|
|
|
|
TRACE( "(%p)->(%p,%s)\n",This,pFilter,debugstr_w(pName) );
|
|
|
|
|
|
|
|
QUARTZ_CompList_Lock( This->m_pFilterList );
|
|
|
|
|
2001-09-26 00:37:04 +02:00
|
|
|
hr = IMediaFilter_GetState(CFilterGraph_IMediaFilter(This),0,&fs);
|
|
|
|
if ( hr == VFW_S_STATE_INTERMEDIATE )
|
|
|
|
hr = VFW_E_STATE_CHANGED;
|
|
|
|
if ( fs != State_Stopped )
|
|
|
|
hr = VFW_E_NOT_STOPPED;
|
|
|
|
if ( FAILED(hr) )
|
|
|
|
goto end;
|
|
|
|
|
|
|
|
TRACE( "(%p) search the specified name.\n",This );
|
|
|
|
|
2001-09-07 21:46:49 +02:00
|
|
|
if ( pName != NULL )
|
|
|
|
{
|
|
|
|
pItem = QUARTZ_CompList_SearchData(
|
|
|
|
This->m_pFilterList,
|
2001-10-14 18:13:14 +02:00
|
|
|
pName, sizeof(WCHAR)*(lstrlenW(pName)+1) );
|
2001-09-07 21:46:49 +02:00
|
|
|
if ( pItem == NULL )
|
|
|
|
goto name_ok;
|
|
|
|
|
|
|
|
hrSucceeded = VFW_S_DUPLICATE_NAME;
|
|
|
|
|
2001-10-14 18:13:14 +02:00
|
|
|
iLen = lstrlenW(pName);
|
2001-09-07 21:46:49 +02:00
|
|
|
if ( iLen > 32 )
|
|
|
|
iLen = 32;
|
|
|
|
memcpy( info.achName, pName, sizeof(WCHAR)*iLen );
|
|
|
|
info.achName[iLen] = 0;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
ZeroMemory( &info, sizeof(info) );
|
|
|
|
hr = IBaseFilter_QueryFilterInfo( pFilter, &info );
|
|
|
|
if ( FAILED(hr) )
|
|
|
|
goto end;
|
|
|
|
|
2001-10-14 18:13:14 +02:00
|
|
|
iLen = lstrlenW(info.achName);
|
2001-09-07 21:46:49 +02:00
|
|
|
pItem = QUARTZ_CompList_SearchData(
|
|
|
|
This->m_pFilterList,
|
|
|
|
info.achName, sizeof(WCHAR)*(iLen+1) );
|
|
|
|
if ( pItem == NULL )
|
|
|
|
{
|
|
|
|
pName = info.achName;
|
|
|
|
goto name_ok;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* generate modified names for this filter.. */
|
2001-10-14 18:13:14 +02:00
|
|
|
iLen = lstrlenW(info.achName);
|
2001-09-07 21:46:49 +02:00
|
|
|
if ( iLen > 32 )
|
|
|
|
iLen = 32;
|
|
|
|
info.achName[iLen++] = ' ';
|
|
|
|
|
|
|
|
for ( i = 0; i <= 99; i++ )
|
|
|
|
{
|
|
|
|
info.achName[iLen+0] = (i%10) + '0';
|
|
|
|
info.achName[iLen+1] = ((i/10)%10) + '0';
|
|
|
|
info.achName[iLen+2] = 0;
|
|
|
|
pItem = QUARTZ_CompList_SearchData(
|
|
|
|
This->m_pFilterList,
|
|
|
|
info.achName, sizeof(WCHAR)*(iLen+3) );
|
|
|
|
if ( pItem == NULL )
|
|
|
|
{
|
|
|
|
pName = info.achName;
|
|
|
|
goto name_ok;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
hr = ( pName == NULL ) ? E_FAIL : VFW_E_DUPLICATE_NAME;
|
|
|
|
goto end;
|
|
|
|
|
|
|
|
name_ok:
|
2001-09-26 00:37:04 +02:00
|
|
|
TRACE( "(%p) add this filter.\n",This );
|
|
|
|
|
2001-09-07 21:46:49 +02:00
|
|
|
/* register this filter. */
|
|
|
|
hr = QUARTZ_CompList_AddComp(
|
|
|
|
This->m_pFilterList, (IUnknown*)pFilter,
|
2001-10-14 18:13:14 +02:00
|
|
|
pName, sizeof(WCHAR)*(lstrlenW(pName)+1) );
|
2001-09-07 21:46:49 +02:00
|
|
|
if ( FAILED(hr) )
|
|
|
|
goto end;
|
|
|
|
|
|
|
|
hr = IBaseFilter_JoinFilterGraph(pFilter,(IFilterGraph*)iface,pName);
|
2001-09-26 00:37:04 +02:00
|
|
|
if ( SUCCEEDED(hr) )
|
|
|
|
{
|
|
|
|
EnterCriticalSection( &This->m_csClock );
|
|
|
|
hr = IBaseFilter_SetSyncSource( pFilter, This->m_pClock );
|
|
|
|
LeaveCriticalSection( &This->m_csClock );
|
|
|
|
}
|
2001-09-07 21:46:49 +02:00
|
|
|
if ( FAILED(hr) )
|
|
|
|
{
|
2001-09-26 00:37:04 +02:00
|
|
|
IBaseFilter_JoinFilterGraph(pFilter,NULL,pName);
|
2001-09-07 21:46:49 +02:00
|
|
|
QUARTZ_CompList_RemoveComp(
|
|
|
|
This->m_pFilterList,(IUnknown*)pFilter);
|
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
|
2001-10-01 22:53:58 +02:00
|
|
|
hr = CFilterGraph_GraphChanged(This);
|
|
|
|
if ( FAILED(hr) )
|
|
|
|
goto end;
|
2001-09-07 21:46:49 +02:00
|
|
|
|
|
|
|
hr = hrSucceeded;
|
|
|
|
end:
|
|
|
|
QUARTZ_CompList_Unlock( This->m_pFilterList );
|
|
|
|
|
2001-09-26 00:37:04 +02:00
|
|
|
TRACE( "(%p) return %08lx\n", This, hr );
|
|
|
|
|
2001-09-07 21:46:49 +02:00
|
|
|
return hr;
|
2001-08-15 21:26:52 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI
|
|
|
|
IFilterGraph2_fnRemoveFilter(IFilterGraph2* iface,IBaseFilter* pFilter)
|
|
|
|
{
|
|
|
|
CFilterGraph_THIS(iface,fgraph);
|
2001-09-07 21:46:49 +02:00
|
|
|
QUARTZ_CompListItem* pItem;
|
2001-09-26 00:37:04 +02:00
|
|
|
FILTER_STATE fs;
|
2001-09-07 21:46:49 +02:00
|
|
|
HRESULT hr = NOERROR;
|
2001-08-15 21:26:52 +02:00
|
|
|
|
2001-09-07 21:46:49 +02:00
|
|
|
TRACE( "(%p)->(%p)\n",This,pFilter );
|
|
|
|
|
|
|
|
QUARTZ_CompList_Lock( This->m_pFilterList );
|
|
|
|
|
2001-09-26 00:37:04 +02:00
|
|
|
hr = IMediaFilter_GetState(CFilterGraph_IMediaFilter(This),0,&fs);
|
|
|
|
if ( hr == VFW_S_STATE_INTERMEDIATE )
|
|
|
|
hr = VFW_E_STATE_CHANGED;
|
|
|
|
if ( fs != State_Stopped )
|
|
|
|
hr = VFW_E_NOT_STOPPED;
|
|
|
|
if ( FAILED(hr) )
|
|
|
|
goto end;
|
|
|
|
|
|
|
|
hr = S_FALSE; /* FIXME? */
|
2001-09-07 21:46:49 +02:00
|
|
|
pItem = QUARTZ_CompList_SearchComp(
|
|
|
|
This->m_pFilterList, (IUnknown*)pFilter );
|
|
|
|
if ( pItem != NULL )
|
|
|
|
{
|
|
|
|
CFilterGraph_DisconnectAllPins(pFilter);
|
2001-09-26 00:37:04 +02:00
|
|
|
IBaseFilter_SetSyncSource( pFilter, NULL );
|
2001-09-07 21:46:49 +02:00
|
|
|
hr = IBaseFilter_JoinFilterGraph(
|
|
|
|
pFilter, NULL, QUARTZ_CompList_GetDataPtr(pItem) );
|
|
|
|
QUARTZ_CompList_RemoveComp(
|
|
|
|
This->m_pFilterList, (IUnknown*)pFilter );
|
|
|
|
}
|
|
|
|
|
2001-10-01 22:53:58 +02:00
|
|
|
hr = CFilterGraph_GraphChanged(This);
|
|
|
|
if ( FAILED(hr) )
|
|
|
|
goto end;
|
2001-09-07 21:46:49 +02:00
|
|
|
|
2001-09-26 00:37:04 +02:00
|
|
|
end:;
|
2001-09-07 21:46:49 +02:00
|
|
|
QUARTZ_CompList_Unlock( This->m_pFilterList );
|
|
|
|
|
|
|
|
return hr;
|
2001-08-15 21:26:52 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI
|
|
|
|
IFilterGraph2_fnEnumFilters(IFilterGraph2* iface,IEnumFilters** ppEnum)
|
|
|
|
{
|
|
|
|
CFilterGraph_THIS(iface,fgraph);
|
2001-09-07 21:46:49 +02:00
|
|
|
HRESULT hr;
|
2001-08-15 21:26:52 +02:00
|
|
|
|
2001-09-07 21:46:49 +02:00
|
|
|
TRACE( "(%p)->(%p)\n",This,ppEnum );
|
|
|
|
|
|
|
|
QUARTZ_CompList_Lock( This->m_pFilterList );
|
|
|
|
|
|
|
|
hr = QUARTZ_CreateEnumUnknown(
|
|
|
|
&IID_IEnumFilters, (void**)ppEnum, This->m_pFilterList );
|
|
|
|
|
|
|
|
QUARTZ_CompList_Unlock( This->m_pFilterList );
|
|
|
|
|
|
|
|
return hr;
|
2001-08-15 21:26:52 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI
|
|
|
|
IFilterGraph2_fnFindFilterByName(IFilterGraph2* iface,LPCWSTR pName,IBaseFilter** ppFilter)
|
|
|
|
{
|
|
|
|
CFilterGraph_THIS(iface,fgraph);
|
2001-09-07 21:46:49 +02:00
|
|
|
QUARTZ_CompListItem* pItem;
|
|
|
|
HRESULT hr = E_FAIL;
|
2001-08-15 21:26:52 +02:00
|
|
|
|
2001-09-07 21:46:49 +02:00
|
|
|
TRACE( "(%p)->(%s,%p)\n",This,debugstr_w(pName),ppFilter );
|
|
|
|
|
|
|
|
if ( ppFilter == NULL )
|
|
|
|
return E_POINTER;
|
|
|
|
*ppFilter = NULL;
|
|
|
|
|
|
|
|
QUARTZ_CompList_Lock( This->m_pFilterList );
|
|
|
|
|
|
|
|
pItem = QUARTZ_CompList_SearchData(
|
|
|
|
This->m_pFilterList,
|
2001-10-14 18:13:14 +02:00
|
|
|
pName, sizeof(WCHAR)*(lstrlenW(pName)+1) );
|
2001-09-07 21:46:49 +02:00
|
|
|
if ( pItem != NULL )
|
|
|
|
{
|
|
|
|
*ppFilter = (IBaseFilter*)QUARTZ_CompList_GetItemPtr(pItem);
|
|
|
|
hr = NOERROR;
|
|
|
|
}
|
|
|
|
|
|
|
|
QUARTZ_CompList_Unlock( This->m_pFilterList );
|
|
|
|
|
|
|
|
return hr;
|
2001-08-15 21:26:52 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI
|
|
|
|
IFilterGraph2_fnConnectDirect(IFilterGraph2* iface,IPin* pOut,IPin* pIn,const AM_MEDIA_TYPE* pmt)
|
|
|
|
{
|
|
|
|
CFilterGraph_THIS(iface,fgraph);
|
2001-09-07 21:46:49 +02:00
|
|
|
IPin* pConnTo;
|
|
|
|
PIN_INFO infoIn;
|
|
|
|
PIN_INFO infoOut;
|
|
|
|
FILTER_INFO finfoIn;
|
|
|
|
FILTER_INFO finfoOut;
|
2001-10-14 18:13:14 +02:00
|
|
|
FILTER_STATE fs;
|
2001-09-07 21:46:49 +02:00
|
|
|
HRESULT hr;
|
|
|
|
|
|
|
|
TRACE( "(%p)->(%p,%p,%p)\n",This,pOut,pIn,pmt );
|
|
|
|
|
|
|
|
infoIn.pFilter = NULL;
|
|
|
|
infoOut.pFilter = NULL;
|
|
|
|
finfoIn.pGraph = NULL;
|
|
|
|
finfoOut.pGraph = NULL;
|
|
|
|
|
|
|
|
QUARTZ_CompList_Lock( This->m_pFilterList );
|
|
|
|
|
2001-10-14 18:13:14 +02:00
|
|
|
hr = IMediaFilter_GetState(CFilterGraph_IMediaFilter(This),0,&fs);
|
|
|
|
if ( hr == VFW_S_STATE_INTERMEDIATE )
|
|
|
|
hr = VFW_E_STATE_CHANGED;
|
|
|
|
if ( fs != State_Stopped )
|
|
|
|
hr = VFW_E_NOT_STOPPED;
|
|
|
|
if ( FAILED(hr) )
|
|
|
|
goto end;
|
|
|
|
|
2001-09-07 21:46:49 +02:00
|
|
|
hr = IPin_QueryPinInfo(pIn,&infoIn);
|
|
|
|
if ( FAILED(hr) )
|
|
|
|
goto end;
|
|
|
|
hr = IPin_QueryPinInfo(pOut,&infoOut);
|
|
|
|
if ( FAILED(hr) )
|
|
|
|
goto end;
|
|
|
|
if ( infoIn.pFilter == NULL || infoOut.pFilter == NULL ||
|
|
|
|
infoIn.dir != PINDIR_INPUT || infoOut.dir != PINDIR_OUTPUT )
|
|
|
|
{
|
|
|
|
hr = E_FAIL;
|
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
|
|
|
|
hr = IBaseFilter_QueryFilterInfo(infoIn.pFilter,&finfoIn);
|
|
|
|
if ( FAILED(hr) )
|
|
|
|
goto end;
|
|
|
|
hr = IBaseFilter_QueryFilterInfo(infoOut.pFilter,&finfoOut);
|
|
|
|
if ( FAILED(hr) )
|
|
|
|
goto end;
|
|
|
|
if ( finfoIn.pGraph != ((IFilterGraph*)iface) ||
|
|
|
|
finfoOut.pGraph != ((IFilterGraph*)iface) )
|
|
|
|
{
|
|
|
|
hr = E_FAIL;
|
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
|
|
|
|
pConnTo = NULL;
|
|
|
|
hr = IPin_ConnectedTo(pIn,&pConnTo);
|
2001-09-26 00:37:04 +02:00
|
|
|
if ( hr == NOERROR && pConnTo != NULL )
|
2001-09-07 21:46:49 +02:00
|
|
|
{
|
|
|
|
IPin_Release(pConnTo);
|
2001-09-26 00:37:04 +02:00
|
|
|
hr = VFW_E_ALREADY_CONNECTED;
|
2001-09-07 21:46:49 +02:00
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
|
|
|
|
pConnTo = NULL;
|
|
|
|
hr = IPin_ConnectedTo(pOut,&pConnTo);
|
2001-09-26 00:37:04 +02:00
|
|
|
if ( hr == NOERROR && pConnTo != NULL )
|
2001-09-07 21:46:49 +02:00
|
|
|
{
|
|
|
|
IPin_Release(pConnTo);
|
2001-09-26 00:37:04 +02:00
|
|
|
hr = VFW_E_ALREADY_CONNECTED;
|
2001-09-07 21:46:49 +02:00
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
|
2001-09-26 00:37:04 +02:00
|
|
|
TRACE("(%p) try to connect %p<->%p\n",This,pIn,pOut);
|
2001-09-07 21:46:49 +02:00
|
|
|
hr = IPin_Connect(pOut,pIn,pmt);
|
|
|
|
if ( FAILED(hr) )
|
|
|
|
{
|
2001-09-26 00:37:04 +02:00
|
|
|
TRACE("(%p)->Connect(%p,%p) hr = %08lx\n",pOut,pIn,pmt,hr);
|
|
|
|
IPin_Disconnect(pOut);
|
2001-09-07 21:46:49 +02:00
|
|
|
IPin_Disconnect(pIn);
|
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
|
2001-10-01 22:53:58 +02:00
|
|
|
hr = CFilterGraph_GraphChanged(This);
|
|
|
|
if ( FAILED(hr) )
|
|
|
|
goto end;
|
2001-09-07 21:46:49 +02:00
|
|
|
|
|
|
|
end:
|
|
|
|
QUARTZ_CompList_Unlock( This->m_pFilterList );
|
|
|
|
|
|
|
|
if ( infoIn.pFilter != NULL )
|
|
|
|
IBaseFilter_Release(infoIn.pFilter);
|
|
|
|
if ( infoOut.pFilter != NULL )
|
|
|
|
IBaseFilter_Release(infoOut.pFilter);
|
|
|
|
if ( finfoIn.pGraph != NULL )
|
|
|
|
IFilterGraph_Release(finfoIn.pGraph);
|
|
|
|
if ( finfoOut.pGraph != NULL )
|
|
|
|
IFilterGraph_Release(finfoOut.pGraph);
|
|
|
|
|
|
|
|
return hr;
|
2001-08-15 21:26:52 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI
|
|
|
|
IFilterGraph2_fnReconnect(IFilterGraph2* iface,IPin* pPin)
|
|
|
|
{
|
|
|
|
CFilterGraph_THIS(iface,fgraph);
|
|
|
|
|
2001-09-26 00:37:04 +02:00
|
|
|
TRACE( "(%p)->(%p)\n",This,pPin );
|
2001-09-07 21:46:49 +02:00
|
|
|
|
2001-09-26 00:37:04 +02:00
|
|
|
return IFilterGraph2_ReconnectEx(iface,pPin,NULL);
|
2001-08-15 21:26:52 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI
|
|
|
|
IFilterGraph2_fnDisconnect(IFilterGraph2* iface,IPin* pPin)
|
|
|
|
{
|
|
|
|
CFilterGraph_THIS(iface,fgraph);
|
2001-09-26 00:37:04 +02:00
|
|
|
IPin* pConnTo;
|
|
|
|
HRESULT hr;
|
|
|
|
|
|
|
|
TRACE( "(%p)->(%p)\n",This,pPin );
|
|
|
|
|
|
|
|
QUARTZ_CompList_Lock( This->m_pFilterList );
|
2001-08-15 21:26:52 +02:00
|
|
|
|
2001-09-26 00:37:04 +02:00
|
|
|
pConnTo = NULL;
|
|
|
|
hr = IPin_ConnectedTo(pPin,&pConnTo);
|
|
|
|
if ( hr == NOERROR && pConnTo != NULL )
|
|
|
|
{
|
|
|
|
IPin_Disconnect(pConnTo);
|
|
|
|
IPin_Release(pConnTo);
|
|
|
|
}
|
|
|
|
hr = IPin_Disconnect(pPin);
|
2001-10-01 22:53:58 +02:00
|
|
|
if ( FAILED(hr) )
|
|
|
|
goto end;
|
2001-09-07 21:46:49 +02:00
|
|
|
|
2001-10-01 22:53:58 +02:00
|
|
|
hr = CFilterGraph_GraphChanged(This);
|
|
|
|
if ( FAILED(hr) )
|
|
|
|
goto end;
|
2001-09-07 21:46:49 +02:00
|
|
|
|
2001-10-01 22:53:58 +02:00
|
|
|
end:
|
2001-09-26 00:37:04 +02:00
|
|
|
QUARTZ_CompList_Unlock( This->m_pFilterList );
|
|
|
|
|
|
|
|
return hr;
|
2001-08-15 21:26:52 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI
|
|
|
|
IFilterGraph2_fnSetDefaultSyncSource(IFilterGraph2* iface)
|
|
|
|
{
|
|
|
|
CFilterGraph_THIS(iface,fgraph);
|
2001-09-26 00:37:04 +02:00
|
|
|
IUnknown* punk;
|
|
|
|
IReferenceClock* pClock;
|
|
|
|
HRESULT hr;
|
2001-08-15 21:26:52 +02:00
|
|
|
|
|
|
|
FIXME( "(%p)->() stub!\n", This );
|
2001-09-26 00:37:04 +02:00
|
|
|
|
2001-10-14 18:13:14 +02:00
|
|
|
/* FIXME - search all filters from renderer. */
|
2001-09-26 00:37:04 +02:00
|
|
|
|
|
|
|
hr = QUARTZ_CreateSystemClock( NULL, (void**)&punk );
|
|
|
|
if ( FAILED(hr) )
|
|
|
|
return hr;
|
|
|
|
hr = IUnknown_QueryInterface( punk, &IID_IReferenceClock, (void**)&pClock ); IUnknown_Release( punk );
|
|
|
|
if ( FAILED(hr) )
|
|
|
|
return hr;
|
|
|
|
|
|
|
|
hr = IMediaFilter_SetSyncSource(
|
|
|
|
CFilterGraph_IMediaFilter(This), pClock );
|
|
|
|
IReferenceClock_Release( pClock );
|
|
|
|
|
|
|
|
return hr;
|
2001-08-15 21:26:52 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI
|
|
|
|
IFilterGraph2_fnConnect(IFilterGraph2* iface,IPin* pOut,IPin* pIn)
|
|
|
|
{
|
|
|
|
CFilterGraph_THIS(iface,fgraph);
|
2001-09-07 21:46:49 +02:00
|
|
|
HRESULT hr;
|
|
|
|
|
|
|
|
TRACE( "(%p)->(%p,%p)\n",This,pOut,pIn );
|
|
|
|
|
|
|
|
/* At first, try to connect directly. */
|
|
|
|
hr = IFilterGraph_ConnectDirect(iface,pOut,pIn,NULL);
|
|
|
|
if ( hr == NOERROR )
|
|
|
|
return NOERROR;
|
|
|
|
|
|
|
|
/* FIXME - try to connect indirectly. */
|
|
|
|
FIXME( "(%p)->(%p,%p) stub!\n",This,pOut,pIn );
|
|
|
|
|
2001-08-15 21:26:52 +02:00
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI
|
|
|
|
IFilterGraph2_fnRender(IFilterGraph2* iface,IPin* pOut)
|
|
|
|
{
|
|
|
|
CFilterGraph_THIS(iface,fgraph);
|
|
|
|
|
2001-09-07 21:46:49 +02:00
|
|
|
FIXME( "(%p)->(%p) stub!\n",This,pOut );
|
2001-08-15 21:26:52 +02:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI
|
|
|
|
IFilterGraph2_fnRenderFile(IFilterGraph2* iface,LPCWSTR lpFileName,LPCWSTR lpPlayList)
|
|
|
|
{
|
|
|
|
CFilterGraph_THIS(iface,fgraph);
|
2001-09-07 21:46:49 +02:00
|
|
|
HRESULT hr;
|
|
|
|
IBaseFilter* pFilter = NULL;
|
|
|
|
IEnumPins* pEnum = NULL;
|
|
|
|
IPin* pPin;
|
|
|
|
ULONG cFetched;
|
|
|
|
PIN_DIRECTION dir;
|
|
|
|
ULONG cTryToRender;
|
|
|
|
ULONG cActRender;
|
|
|
|
|
|
|
|
TRACE( "(%p)->(%s,%s)\n",This,
|
|
|
|
debugstr_w(lpFileName),debugstr_w(lpPlayList) );
|
|
|
|
|
|
|
|
if ( lpPlayList != NULL )
|
|
|
|
return E_INVALIDARG;
|
|
|
|
|
|
|
|
pFilter = NULL;
|
|
|
|
hr = IFilterGraph2_AddSourceFilter(iface,lpFileName,NULL,&pFilter);
|
|
|
|
if ( FAILED(hr) )
|
|
|
|
goto end;
|
|
|
|
if ( pFilter == NULL )
|
|
|
|
{
|
|
|
|
hr = E_FAIL;
|
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
pEnum = NULL;
|
|
|
|
hr = IBaseFilter_EnumPins( pFilter, &pEnum );
|
|
|
|
if ( FAILED(hr) )
|
|
|
|
goto end;
|
|
|
|
if ( pEnum == NULL )
|
|
|
|
{
|
|
|
|
hr = E_FAIL;
|
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
|
|
|
|
cTryToRender = 0;
|
|
|
|
cActRender = 0;
|
|
|
|
|
|
|
|
while ( 1 )
|
|
|
|
{
|
|
|
|
pPin = NULL;
|
|
|
|
cFetched = 0;
|
|
|
|
hr = IEnumPins_Next( pEnum, 1, &pPin, &cFetched );
|
|
|
|
if ( FAILED(hr) )
|
|
|
|
goto end;
|
|
|
|
if ( hr != NOERROR || pPin == NULL || cFetched != 1 )
|
|
|
|
{
|
|
|
|
hr = NOERROR;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
hr = IPin_QueryDirection( pPin, &dir );
|
|
|
|
if ( hr == NOERROR && dir == PINDIR_OUTPUT )
|
|
|
|
{
|
|
|
|
cTryToRender ++;
|
|
|
|
hr = IFilterGraph2_Render( iface, pPin );
|
|
|
|
if ( hr == NOERROR )
|
|
|
|
cActRender ++;
|
|
|
|
}
|
|
|
|
IPin_Release( pPin );
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( hr == NOERROR )
|
|
|
|
{
|
|
|
|
if ( cTryToRender > cActRender )
|
|
|
|
hr = VFW_S_PARTIAL_RENDER;
|
|
|
|
if ( cActRender == 0 )
|
|
|
|
hr = E_FAIL;
|
|
|
|
}
|
|
|
|
|
|
|
|
end:
|
|
|
|
if ( pEnum != NULL )
|
|
|
|
IEnumPins_Release( pEnum );
|
|
|
|
if ( pFilter != NULL )
|
|
|
|
IBaseFilter_Release( pFilter );
|
|
|
|
|
|
|
|
return hr;
|
2001-08-15 21:26:52 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI
|
|
|
|
IFilterGraph2_fnAddSourceFilter(IFilterGraph2* iface,LPCWSTR lpFileName,LPCWSTR lpFilterName,IBaseFilter** ppBaseFilter)
|
|
|
|
{
|
|
|
|
CFilterGraph_THIS(iface,fgraph);
|
|
|
|
|
2001-09-07 21:46:49 +02:00
|
|
|
FIXME( "(%p)->(%s,%s,%p) stub!\n",This,
|
|
|
|
debugstr_w(lpFileName),debugstr_w(lpFilterName),ppBaseFilter );
|
2001-08-15 21:26:52 +02:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI
|
|
|
|
IFilterGraph2_fnSetLogFile(IFilterGraph2* iface,DWORD_PTR hFile)
|
|
|
|
{
|
|
|
|
CFilterGraph_THIS(iface,fgraph);
|
|
|
|
|
|
|
|
FIXME( "(%p)->() stub!\n", This );
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI
|
|
|
|
IFilterGraph2_fnAbort(IFilterGraph2* iface)
|
|
|
|
{
|
|
|
|
CFilterGraph_THIS(iface,fgraph);
|
|
|
|
|
|
|
|
/* undoc. */
|
|
|
|
|
|
|
|
FIXME( "(%p)->() stub!\n", This );
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI
|
|
|
|
IFilterGraph2_fnShouldOperationContinue(IFilterGraph2* iface)
|
|
|
|
{
|
|
|
|
CFilterGraph_THIS(iface,fgraph);
|
|
|
|
|
|
|
|
/* undoc. */
|
|
|
|
|
|
|
|
FIXME( "(%p)->() stub!\n", This );
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI
|
|
|
|
IFilterGraph2_fnAddSourceFilterForMoniker(IFilterGraph2* iface,IMoniker* pMon,IBindCtx* pCtx,LPCWSTR pFilterName,IBaseFilter** ppFilter)
|
|
|
|
{
|
|
|
|
CFilterGraph_THIS(iface,fgraph);
|
|
|
|
|
|
|
|
FIXME( "(%p)->() stub!\n", This );
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI
|
|
|
|
IFilterGraph2_fnReconnectEx(IFilterGraph2* iface,IPin* pPin,const AM_MEDIA_TYPE* pmt)
|
|
|
|
{
|
|
|
|
CFilterGraph_THIS(iface,fgraph);
|
2001-10-01 22:53:58 +02:00
|
|
|
HRESULT hr;
|
2001-08-15 21:26:52 +02:00
|
|
|
|
2001-09-07 21:46:49 +02:00
|
|
|
FIXME( "(%p)->(%p,%p) stub!\n",This,pPin,pmt );
|
|
|
|
|
2001-09-26 00:37:04 +02:00
|
|
|
/* reconnect asynchronously. */
|
|
|
|
|
2001-10-14 18:13:14 +02:00
|
|
|
QUARTZ_CompList_Lock( This->m_pFilterList );
|
2001-10-01 22:53:58 +02:00
|
|
|
hr = CFilterGraph_GraphChanged(This);
|
2001-10-14 18:13:14 +02:00
|
|
|
QUARTZ_CompList_Unlock( This->m_pFilterList );
|
2001-09-07 21:46:49 +02:00
|
|
|
|
2001-08-15 21:26:52 +02:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI
|
|
|
|
IFilterGraph2_fnRenderEx(IFilterGraph2* iface,IPin* pPin,DWORD dwParam1,DWORD* pdwParam2)
|
|
|
|
{
|
|
|
|
CFilterGraph_THIS(iface,fgraph);
|
|
|
|
|
|
|
|
/* undoc. */
|
2001-09-07 21:46:49 +02:00
|
|
|
FIXME( "(%p)->(%p,%08lx,%p) stub!\n",This,pPin,dwParam1,pdwParam2);
|
2001-08-15 21:26:52 +02:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static ICOM_VTABLE(IFilterGraph2) ifgraph =
|
|
|
|
{
|
|
|
|
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
|
|
|
|
/* IUnknown fields */
|
|
|
|
IFilterGraph2_fnQueryInterface,
|
|
|
|
IFilterGraph2_fnAddRef,
|
|
|
|
IFilterGraph2_fnRelease,
|
|
|
|
/* IFilterGraph fields */
|
|
|
|
IFilterGraph2_fnAddFilter,
|
|
|
|
IFilterGraph2_fnRemoveFilter,
|
|
|
|
IFilterGraph2_fnEnumFilters,
|
|
|
|
IFilterGraph2_fnFindFilterByName,
|
|
|
|
IFilterGraph2_fnConnectDirect,
|
|
|
|
IFilterGraph2_fnReconnect,
|
|
|
|
IFilterGraph2_fnDisconnect,
|
|
|
|
IFilterGraph2_fnSetDefaultSyncSource,
|
|
|
|
/* IGraphBuilder fields */
|
|
|
|
IFilterGraph2_fnConnect,
|
|
|
|
IFilterGraph2_fnRender,
|
|
|
|
IFilterGraph2_fnRenderFile,
|
|
|
|
IFilterGraph2_fnAddSourceFilter,
|
|
|
|
IFilterGraph2_fnSetLogFile,
|
|
|
|
IFilterGraph2_fnAbort,
|
|
|
|
IFilterGraph2_fnShouldOperationContinue,
|
|
|
|
/* IFilterGraph2 fields */
|
|
|
|
IFilterGraph2_fnAddSourceFilterForMoniker,
|
|
|
|
IFilterGraph2_fnReconnectEx,
|
|
|
|
IFilterGraph2_fnRenderEx,
|
|
|
|
};
|
|
|
|
|
2001-09-07 21:46:49 +02:00
|
|
|
HRESULT CFilterGraph_InitIFilterGraph2( CFilterGraph* pfg )
|
2001-08-15 21:26:52 +02:00
|
|
|
{
|
|
|
|
TRACE("(%p)\n",pfg);
|
|
|
|
ICOM_VTBL(&pfg->fgraph) = &ifgraph;
|
2001-09-07 21:46:49 +02:00
|
|
|
|
|
|
|
pfg->m_pFilterList = QUARTZ_CompList_Alloc();
|
|
|
|
if ( pfg->m_pFilterList == NULL )
|
|
|
|
return E_OUTOFMEMORY;
|
|
|
|
|
|
|
|
return NOERROR;
|
2001-08-15 21:26:52 +02:00
|
|
|
}
|
2001-08-28 19:25:39 +02:00
|
|
|
|
|
|
|
void CFilterGraph_UninitIFilterGraph2( CFilterGraph* pfg )
|
|
|
|
{
|
2001-09-07 21:46:49 +02:00
|
|
|
QUARTZ_CompListItem* pItem;
|
|
|
|
|
2001-08-28 19:25:39 +02:00
|
|
|
TRACE("(%p)\n",pfg);
|
2001-09-07 21:46:49 +02:00
|
|
|
|
|
|
|
/* remove all filters... */
|
|
|
|
while ( 1 )
|
|
|
|
{
|
|
|
|
pItem = QUARTZ_CompList_GetFirst( pfg->m_pFilterList );
|
|
|
|
if ( pItem == NULL )
|
|
|
|
break;
|
2001-09-26 00:37:04 +02:00
|
|
|
IFilterGraph2_RemoveFilter(
|
2001-09-07 21:46:49 +02:00
|
|
|
(IFilterGraph2*)(&pfg->fgraph),
|
|
|
|
(IBaseFilter*)QUARTZ_CompList_GetItemPtr(pItem) );
|
|
|
|
}
|
|
|
|
|
|
|
|
QUARTZ_CompList_Free( pfg->m_pFilterList );
|
2001-08-28 19:25:39 +02:00
|
|
|
}
|
2001-10-14 18:13:14 +02:00
|
|
|
|
|
|
|
/***************************************************************************
|
|
|
|
*
|
|
|
|
* CFilterGraph::IGraphVersion methods
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
static HRESULT WINAPI
|
|
|
|
IGraphVersion_fnQueryInterface(IGraphVersion* iface,REFIID riid,void** ppobj)
|
|
|
|
{
|
|
|
|
CFilterGraph_THIS(iface,graphversion);
|
|
|
|
|
|
|
|
TRACE("(%p)->()\n",This);
|
|
|
|
|
|
|
|
return IUnknown_QueryInterface(This->unk.punkControl,riid,ppobj);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI
|
|
|
|
IGraphVersion_fnAddRef(IGraphVersion* iface)
|
|
|
|
{
|
|
|
|
CFilterGraph_THIS(iface,graphversion);
|
|
|
|
|
|
|
|
TRACE("(%p)->()\n",This);
|
|
|
|
|
|
|
|
return IUnknown_AddRef(This->unk.punkControl);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI
|
|
|
|
IGraphVersion_fnRelease(IGraphVersion* iface)
|
|
|
|
{
|
|
|
|
CFilterGraph_THIS(iface,graphversion);
|
|
|
|
|
|
|
|
TRACE("(%p)->()\n",This);
|
|
|
|
|
|
|
|
return IUnknown_Release(This->unk.punkControl);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static HRESULT WINAPI
|
|
|
|
IGraphVersion_fnQueryVersion(IGraphVersion* iface,LONG* plVersion)
|
|
|
|
{
|
|
|
|
CFilterGraph_THIS(iface,graphversion);
|
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n",This,plVersion);
|
|
|
|
|
|
|
|
if ( plVersion == NULL )
|
|
|
|
return E_POINTER;
|
|
|
|
|
|
|
|
QUARTZ_CompList_Lock( This->m_pFilterList );
|
|
|
|
*plVersion = This->m_lGraphVersion;
|
|
|
|
QUARTZ_CompList_Unlock( This->m_pFilterList );
|
|
|
|
|
|
|
|
return NOERROR;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static ICOM_VTABLE(IGraphVersion) igraphversion =
|
|
|
|
{
|
|
|
|
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
|
|
|
|
/* IUnknown fields */
|
|
|
|
IGraphVersion_fnQueryInterface,
|
|
|
|
IGraphVersion_fnAddRef,
|
|
|
|
IGraphVersion_fnRelease,
|
|
|
|
/* IGraphVersion fields */
|
|
|
|
IGraphVersion_fnQueryVersion,
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
HRESULT CFilterGraph_InitIGraphVersion( CFilterGraph* pfg )
|
|
|
|
{
|
|
|
|
TRACE("(%p)\n",pfg);
|
|
|
|
ICOM_VTBL(&pfg->graphversion) = &igraphversion;
|
|
|
|
|
|
|
|
pfg->m_lGraphVersion = 1;
|
|
|
|
|
|
|
|
return NOERROR;
|
|
|
|
}
|
|
|
|
|
|
|
|
void CFilterGraph_UninitIGraphVersion( CFilterGraph* pfg )
|
|
|
|
{
|
|
|
|
TRACE("(%p)\n",pfg);
|
|
|
|
}
|
|
|
|
|
|
|
|
/***************************************************************************
|
|
|
|
*
|
|
|
|
* CFilterGraph::IGraphConfig methods
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
static HRESULT WINAPI
|
|
|
|
IGraphConfig_fnQueryInterface(IGraphConfig* iface,REFIID riid,void** ppobj)
|
|
|
|
{
|
|
|
|
CFilterGraph_THIS(iface,grphconf);
|
|
|
|
|
|
|
|
TRACE("(%p)->()\n",This);
|
|
|
|
|
|
|
|
return IUnknown_QueryInterface(This->unk.punkControl,riid,ppobj);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI
|
|
|
|
IGraphConfig_fnAddRef(IGraphConfig* iface)
|
|
|
|
{
|
|
|
|
CFilterGraph_THIS(iface,grphconf);
|
|
|
|
|
|
|
|
TRACE("(%p)->()\n",This);
|
|
|
|
|
|
|
|
return IUnknown_AddRef(This->unk.punkControl);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI
|
|
|
|
IGraphConfig_fnRelease(IGraphConfig* iface)
|
|
|
|
{
|
|
|
|
CFilterGraph_THIS(iface,grphconf);
|
|
|
|
|
|
|
|
TRACE("(%p)->()\n",This);
|
|
|
|
|
|
|
|
return IUnknown_Release(This->unk.punkControl);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static HRESULT WINAPI
|
|
|
|
IGraphConfig_fnReconnect(IGraphConfig* iface,IPin* pOut,IPin* pIn,const AM_MEDIA_TYPE* pmt,IBaseFilter* pFilter,HANDLE hAbort,DWORD dwFlags)
|
|
|
|
{
|
|
|
|
CFilterGraph_THIS(iface,grphconf);
|
|
|
|
|
|
|
|
FIXME("(%p)->() stub!\n",This);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI
|
|
|
|
IGraphConfig_fnReconfigure(IGraphConfig* iface,IGraphConfigCallback* pCallback,PVOID pvParam,DWORD dwFlags,HANDLE hAbort)
|
|
|
|
{
|
|
|
|
CFilterGraph_THIS(iface,grphconf);
|
|
|
|
HRESULT hr;
|
|
|
|
|
|
|
|
FIXME("(%p)->(%p,%p,%08lx,%08x) stub!\n",This,pCallback,pvParam,dwFlags,hAbort);
|
|
|
|
|
|
|
|
QUARTZ_CompList_Lock( This->m_pFilterList );
|
|
|
|
EnterCriticalSection( &This->m_csGraphState );
|
|
|
|
|
|
|
|
hr = IGraphConfigCallback_Reconfigure(pCallback,pvParam,dwFlags);
|
|
|
|
|
|
|
|
LeaveCriticalSection( &This->m_csGraphState );
|
|
|
|
QUARTZ_CompList_Unlock( This->m_pFilterList );
|
|
|
|
|
|
|
|
return hr;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI
|
|
|
|
IGraphConfig_fnAddFilterToCache(IGraphConfig* iface,IBaseFilter* pFilter)
|
|
|
|
{
|
|
|
|
CFilterGraph_THIS(iface,grphconf);
|
|
|
|
|
|
|
|
FIXME("(%p)->() stub!\n",This);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI
|
|
|
|
IGraphConfig_fnEnumCacheFilter(IGraphConfig* iface,IEnumFilters** ppenum)
|
|
|
|
{
|
|
|
|
CFilterGraph_THIS(iface,grphconf);
|
|
|
|
|
|
|
|
FIXME("(%p)->() stub!\n",This);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI
|
|
|
|
IGraphConfig_fnRemoveFilterFromCache(IGraphConfig* iface,IBaseFilter* pFilter)
|
|
|
|
{
|
|
|
|
CFilterGraph_THIS(iface,grphconf);
|
|
|
|
|
|
|
|
FIXME("(%p)->() stub!\n",This);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI
|
|
|
|
IGraphConfig_fnGetStartTime(IGraphConfig* iface,REFERENCE_TIME* prt)
|
|
|
|
{
|
|
|
|
CFilterGraph_THIS(iface,grphconf);
|
|
|
|
|
|
|
|
FIXME("(%p)->() stub!\n",This);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI
|
|
|
|
IGraphConfig_fnPushThroughData(IGraphConfig* iface,IPin* pOut,IPinConnection* pConn,HANDLE hAbort)
|
|
|
|
{
|
|
|
|
CFilterGraph_THIS(iface,grphconf);
|
|
|
|
|
|
|
|
FIXME("(%p)->() stub!\n",This);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI
|
|
|
|
IGraphConfig_fnSetFilterFlags(IGraphConfig* iface,IBaseFilter* pFilter,DWORD dwFlags)
|
|
|
|
{
|
|
|
|
CFilterGraph_THIS(iface,grphconf);
|
|
|
|
|
|
|
|
FIXME("(%p)->() stub!\n",This);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI
|
|
|
|
IGraphConfig_fnGetFilterFlags(IGraphConfig* iface,IBaseFilter* pFilter,DWORD* pdwFlags)
|
|
|
|
{
|
|
|
|
CFilterGraph_THIS(iface,grphconf);
|
|
|
|
|
|
|
|
FIXME("(%p)->() stub!\n",This);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI
|
|
|
|
IGraphConfig_fnRemoveFilterEx(IGraphConfig* iface,IBaseFilter* pFilter,DWORD dwFlags)
|
|
|
|
{
|
|
|
|
CFilterGraph_THIS(iface,grphconf);
|
|
|
|
|
|
|
|
FIXME("(%p)->() stub!\n",This);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static ICOM_VTABLE(IGraphConfig) igraphconfig =
|
|
|
|
{
|
|
|
|
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
|
|
|
|
/* IUnknown fields */
|
|
|
|
IGraphConfig_fnQueryInterface,
|
|
|
|
IGraphConfig_fnAddRef,
|
|
|
|
IGraphConfig_fnRelease,
|
|
|
|
/* IGraphConfig fields */
|
|
|
|
IGraphConfig_fnReconnect,
|
|
|
|
IGraphConfig_fnReconfigure,
|
|
|
|
IGraphConfig_fnAddFilterToCache,
|
|
|
|
IGraphConfig_fnEnumCacheFilter,
|
|
|
|
IGraphConfig_fnRemoveFilterFromCache,
|
|
|
|
IGraphConfig_fnGetStartTime,
|
|
|
|
IGraphConfig_fnPushThroughData,
|
|
|
|
IGraphConfig_fnSetFilterFlags,
|
|
|
|
IGraphConfig_fnGetFilterFlags,
|
|
|
|
IGraphConfig_fnRemoveFilterEx,
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
HRESULT CFilterGraph_InitIGraphConfig( CFilterGraph* pfg )
|
|
|
|
{
|
|
|
|
TRACE("(%p)\n",pfg);
|
|
|
|
ICOM_VTBL(&pfg->grphconf) = &igraphconfig;
|
|
|
|
|
|
|
|
return NOERROR;
|
|
|
|
}
|
|
|
|
|
|
|
|
void CFilterGraph_UninitIGraphConfig( CFilterGraph* pfg )
|
|
|
|
{
|
|
|
|
TRACE("(%p)\n",pfg);
|
|
|
|
}
|
|
|
|
|
|
|
|
|