Commit bc7d0272 authored by Hidenori Takeshima's avatar Hidenori Takeshima Committed by Alexandre Julliard

Started implementing AVI splitter.

Implemented AsyncSource. Merged some C sources. Fixed some bugs.
parent 055057e3
......@@ -11,7 +11,9 @@ SYMBOLFILE = $(MODULE).tmp.o
C_SRCS = \
amundoc.c \
asyncsrc.c \
audioutl.c \
audren.c \
aviparse.c \
basefilt.c \
basepin.c \
complist.c \
......@@ -19,14 +21,10 @@ C_SRCS = \
devmon.c \
enumunk.c \
fgevent.c \
fgidisp.c \
fgpass.c \
fgraph.c \
fmap.c \
fmap2.c \
ifgraph.c \
igconfig.c \
igrver.c \
imcntl.c \
imfilter.c \
impos.c \
......
......@@ -12,6 +12,7 @@
typedef struct CAsyncSourceImpl CAsyncSourceImpl;
typedef struct CAsyncSourcePinImpl CAsyncSourcePinImpl;
typedef struct AsyncSourceRequest AsyncSourceRequest;
typedef struct AsyncSourceHandlers AsyncSourceHandlers;
typedef struct CAsyncReaderImpl
......@@ -23,13 +24,20 @@ typedef struct CAsyncReaderImpl
/* IAsyncReader fields */
CAsyncSourceImpl* pSource;
CRITICAL_SECTION* pcsReader;
CRITICAL_SECTION m_csReader;
BOOL m_bInFlushing;
BOOL m_bAbortThread;
HANDLE m_hEventInit;
HANDLE m_hEventAbort;
HANDLE m_hEventCancel;
HANDLE m_hEventReqQueued;
HANDLE m_hEventSampQueued;
HANDLE m_hEventCompletion;
HANDLE m_hThread;
CRITICAL_SECTION m_csRequest;
AsyncSourceRequest* m_pRequestFirst;
CRITICAL_SECTION m_csReply;
AsyncSourceRequest* m_pReplyFirst;
CRITICAL_SECTION m_csFree;
AsyncSourceRequest* m_pFreeFirst;
} CAsyncReaderImpl;
typedef struct CFileSourceFilterImpl
......@@ -70,15 +78,27 @@ struct CAsyncSourcePinImpl
CAsyncSourceImpl* pSource;
};
struct AsyncSourceRequest
{
AsyncSourceRequest* pNext;
LONGLONG llStart;
LONG lLength;
LONG lActual;
BYTE* pBuf;
IMediaSample* pSample; /* for async req. */
DWORD_PTR dwContext; /* for async req. */
};
struct AsyncSourceHandlers
{
/* all handlers MUST be implemented. */
HRESULT (*pLoad)( CAsyncSourceImpl* pImpl, LPCWSTR lpwszSourceName );
HRESULT (*pCleanup)( CAsyncSourceImpl* pImpl );
HRESULT (*pGetLength)( CAsyncSourceImpl* pImpl, LONGLONG* pllTotal, LONGLONG* pllAvailable );
HRESULT (*pReadAsync)( CAsyncSourceImpl* pImpl, LONGLONG llOfsStart, LONG lLength, BYTE* pBuf, HANDLE hEventCompletion );
HRESULT (*pGetResult)( CAsyncSourceImpl* pImpl, LONG* plReturned );
HRESULT (*pCancelAsync)( CAsyncSourceImpl* pImpl );
/* S_OK = OK / S_FALSE = Canceled / other = error */
/* hEventCancel may be NULL */
HRESULT (*pRead)( CAsyncSourceImpl* pImpl, LONGLONG llOfsStart, LONG lLength, BYTE* pBuf, LONG* plReturned, HANDLE hEventCancel );
};
#define CAsyncSourceImpl_THIS(iface,member) CAsyncSourceImpl* This = ((CAsyncSourceImpl*)(((char*)iface)-offsetof(CAsyncSourceImpl,member)))
......@@ -87,8 +107,7 @@ struct AsyncSourceHandlers
HRESULT CAsyncReaderImpl_InitIAsyncReader(
CAsyncReaderImpl* This, IUnknown* punkControl,
CAsyncSourceImpl* pSource,
CRITICAL_SECTION* pcsReader );
CAsyncSourceImpl* pSource );
void CAsyncReaderImpl_UninitIAsyncReader(
CAsyncReaderImpl* This );
HRESULT CFileSourceFilterImpl_InitIFileSourceFilter(
......@@ -112,4 +131,10 @@ HRESULT QUARTZ_CreateAsyncSourcePin(
LPCWSTR pwszPinName );
HRESULT QUARTZ_CreateAsyncReader(IUnknown* punkOuter,void** ppobj);
HRESULT QUARTZ_CreateURLReader(IUnknown* punkOuter,void** ppobj);
#define ASYNCSRC_FILE_BLOCKSIZE 4096
#endif /* WINE_DSHOW_ASYNCSRC_H */
/*
* hidenori@a2.ctktv.ne.jp
*/
#include "config.h"
#include "windef.h"
#include "debugtools.h"
DEFAULT_DEBUG_CHANNEL(quartz);
#include "audioutl.h"
void AUDIOUTL_ChangeSign8( BYTE* pbData, DWORD cbData )
{
BYTE* pbEnd = pbData + cbData;
while ( pbData < pbEnd )
{
*pbData ^= 0x80;
pbData ++;
}
}
void AUDIOUTL_ChangeSign16LE( BYTE* pbData, DWORD cbData )
{
BYTE* pbEnd = pbData + cbData;
pbData ++;
while ( pbData < pbEnd )
{
*pbData ^= 0x80;
pbData += 2;
}
}
void AUDIOUTL_ChangeSign16BE( BYTE* pbData, DWORD cbData )
{
BYTE* pbEnd = pbData + cbData;
while ( pbData < pbEnd )
{
*pbData ^= 0x80;
pbData += 2;
}
}
void AUDIOUTL_ByteSwap( BYTE* pbData, DWORD cbData )
{
BYTE* pbEnd = pbData + cbData - 1;
BYTE bTemp;
while ( pbData < pbEnd )
{
bTemp = pbData[0];
pbData[0] = pbData[1];
pbData[1] = bTemp;
pbData += 2;
}
}
#ifndef QUARTZ_AUDIOUTL_H
#define QUARTZ_AUDIOUTL_H
void AUDIOUTL_ChangeSign8( BYTE* pbData, DWORD cbData );
void AUDIOUTL_ChangeSign16LE( BYTE* pbData, DWORD cbData );
void AUDIOUTL_ChangeSign16BE( BYTE* pbData, DWORD cbData );
void AUDIOUTL_ByteSwap( BYTE* pbData, DWORD cbData );
#endif /* QUARTZ_AUDIOUTL_H */
......@@ -16,8 +16,6 @@
#include "winuser.h"
#include "mmsystem.h"
#include "winerror.h"
#include "wine/obj_base.h"
#include "wine/obj_oleaut.h"
#include "strmif.h"
#include "control.h"
#include "vfwmsgs.h"
......
......@@ -11,10 +11,8 @@
#include "wingdi.h"
#include "winuser.h"
#include "winerror.h"
#include "wine/obj_base.h"
#include "strmif.h"
#include "vfwmsgs.h"
#include "wine/unicode.h"
#include "debugtools.h"
DEFAULT_DEBUG_CHANNEL(quartz);
......@@ -355,7 +353,7 @@ CBaseFilterImpl_fnJoinFilterGraph(IBaseFilter* iface,IFilterGraph* pfg,LPCWSTR l
}
This->pfg = pfg;
This->cbNameGraph = sizeof(WCHAR) * (strlenW(lpwszName)+1);
This->cbNameGraph = sizeof(WCHAR) * (lstrlenW(lpwszName)+1);
This->pwszNameGraph = (WCHAR*)QUARTZ_AllocMem( This->cbNameGraph );
if ( This->pwszNameGraph == NULL )
{
......@@ -440,7 +438,7 @@ HRESULT CBaseFilterImpl_InitIBaseFilter(
This->rtStart = 0;
This->fstate = State_Stopped;
This->cbNameGraph = sizeof(WCHAR) * (strlenW(lpwszNameGraph)+1);
This->cbNameGraph = sizeof(WCHAR) * (lstrlenW(lpwszNameGraph)+1);
This->pwszNameGraph = (WCHAR*)QUARTZ_AllocMem( This->cbNameGraph );
if ( This->pwszNameGraph == NULL )
return E_OUTOFMEMORY;
......
......@@ -11,10 +11,8 @@
#include "wingdi.h"
#include "winuser.h"
#include "winerror.h"
#include "wine/obj_base.h"
#include "strmif.h"
#include "vfwmsgs.h"
#include "wine/unicode.h"
#include "debugtools.h"
DEFAULT_DEBUG_CHANNEL(quartz);
......@@ -67,7 +65,7 @@ CPinBaseImpl_fnConnect(IPin* iface,IPin* pPin,const AM_MEDIA_TYPE* pmt)
HRESULT hr = E_NOTIMPL;
ULONG i;
FIXME("(%p)->(%p,%p) stub!\n",This,pPin,pmt);
FIXME("(%p)->(%p,%p)\n",This,pPin,pmt);
if ( !This->bOutput )
return E_UNEXPECTED;
......@@ -167,7 +165,7 @@ CPinBaseImpl_fnReceiveConnection(IPin* iface,IPin* pPin,const AM_MEDIA_TYPE* pmt
ICOM_THIS(CPinBaseImpl,iface);
HRESULT hr = E_NOTIMPL;
FIXME("(%p)->(%p,%p) stub!\n",This,pPin,pmt);
FIXME("(%p)->(%p,%p)\n",This,pPin,pmt);
if ( This->bOutput )
return E_UNEXPECTED;
......@@ -559,7 +557,7 @@ HRESULT CPinBaseImpl_InitIPin(
ICOM_VTBL(This) = &ipin;
This->punkControl = punkControl;
This->pHandlers = pHandlers;
This->cbIdLen = sizeof(WCHAR)*(strlenW(pwszId)+1);
This->cbIdLen = sizeof(WCHAR)*(lstrlenW(pwszId)+1);
This->pwszId = NULL;
This->bOutput = bOutput;
This->pmtAcceptTypes = NULL;
......@@ -986,7 +984,7 @@ HRESULT CPinBaseImpl_SendNewSegment( CPinBaseImpl* This, REFERENCE_TIME rtStart,
HRESULT OutputPinSync_Receive( CPinBaseImpl* pImpl, IMediaSample* pSample )
{
if ( pImpl->pMemInputPinConnectedTo == NULL )
return E_UNEXPECTED;
return NOERROR;
return IMemInputPin_Receive(pImpl->pMemInputPinConnectedTo,pSample);
}
......
......@@ -8,11 +8,8 @@
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "winerror.h"
#include "wine/obj_base.h"
#include "strmif.h"
#include "debugtools.h"
DEFAULT_DEBUG_CHANNEL(quartz);
......@@ -126,7 +123,7 @@ QUARTZ_CompList* QUARTZ_CompList_Dup(
return pNewList;
}
HRESULT QUARTZ_CompList_AddComp(
static QUARTZ_CompListItem* QUARTZ_CompList_AllocComp(
QUARTZ_CompList* pList, IUnknown* punk,
const void* pvData, DWORD dwDataLen )
{
......@@ -134,7 +131,7 @@ HRESULT QUARTZ_CompList_AddComp(
pItem = (QUARTZ_CompListItem*)QUARTZ_AllocMem( sizeof(QUARTZ_CompListItem) );
if ( pItem == NULL )
return E_OUTOFMEMORY; /* out of memory. */
return NULL;
pItem->pvData = NULL;
pItem->dwDataLen = 0;
......@@ -144,7 +141,7 @@ HRESULT QUARTZ_CompList_AddComp(
if ( pItem->pvData == NULL )
{
QUARTZ_FreeMem( pItem );
return E_OUTOFMEMORY;
return NULL;
}
memcpy( pItem->pvData, pvData, dwDataLen );
pItem->dwDataLen = dwDataLen;
......@@ -152,6 +149,19 @@ HRESULT QUARTZ_CompList_AddComp(
pItem->punk = punk; IUnknown_AddRef(punk);
return pItem;
}
HRESULT QUARTZ_CompList_AddComp(
QUARTZ_CompList* pList, IUnknown* punk,
const void* pvData, DWORD dwDataLen )
{
QUARTZ_CompListItem* pItem;
pItem = QUARTZ_CompList_AllocComp( pList, punk, pvData, dwDataLen );
if ( pItem == NULL )
return E_OUTOFMEMORY;
if ( pList->pFirst != NULL )
pList->pFirst->pPrev = pItem;
else
......@@ -163,6 +173,27 @@ HRESULT QUARTZ_CompList_AddComp(
return S_OK;
}
HRESULT QUARTZ_CompList_AddTailComp(
QUARTZ_CompList* pList, IUnknown* punk,
const void* pvData, DWORD dwDataLen )
{
QUARTZ_CompListItem* pItem;
pItem = QUARTZ_CompList_AllocComp( pList, punk, pvData, dwDataLen );
if ( pItem == NULL )
return E_OUTOFMEMORY;
if ( pList->pLast != NULL )
pList->pLast->pNext = pItem;
else
pList->pFirst = pItem;
pItem->pPrev = pList->pLast;
pList->pLast = pItem;
pItem->pNext = NULL;
return S_OK;
}
HRESULT QUARTZ_CompList_RemoveComp( QUARTZ_CompList* pList, IUnknown* punk )
{
QUARTZ_CompListItem* pCur;
......@@ -230,12 +261,24 @@ QUARTZ_CompListItem* QUARTZ_CompList_GetFirst(
return pList->pFirst;
}
QUARTZ_CompListItem* QUARTZ_CompList_GetLast(
QUARTZ_CompList* pList )
{
return pList->pLast;
}
QUARTZ_CompListItem* QUARTZ_CompList_GetNext(
QUARTZ_CompList* pList, QUARTZ_CompListItem* pPrev )
{
return pPrev->pNext;
}
QUARTZ_CompListItem* QUARTZ_CompList_GetPrev(
QUARTZ_CompList* pList, QUARTZ_CompListItem* pNext )
{
return pNext->pPrev;
}
IUnknown* QUARTZ_CompList_GetItemPtr( QUARTZ_CompListItem* pItem )
{
return pItem->punk;
......
......@@ -20,6 +20,9 @@ QUARTZ_CompList* QUARTZ_CompList_Dup(
HRESULT QUARTZ_CompList_AddComp(
QUARTZ_CompList* pList, IUnknown* punk,
const void* pvData, DWORD dwDataLen );
HRESULT QUARTZ_CompList_AddTailComp(
QUARTZ_CompList* pList, IUnknown* punk,
const void* pvData, DWORD dwDataLen );
HRESULT QUARTZ_CompList_RemoveComp( QUARTZ_CompList* pList, IUnknown* punk );
QUARTZ_CompListItem* QUARTZ_CompList_SearchComp(
QUARTZ_CompList* pList, IUnknown* punk );
......@@ -27,8 +30,12 @@ QUARTZ_CompListItem* QUARTZ_CompList_SearchData(
QUARTZ_CompList* pList, const void* pvData, DWORD dwDataLen );
QUARTZ_CompListItem* QUARTZ_CompList_GetFirst(
QUARTZ_CompList* pList );
QUARTZ_CompListItem* QUARTZ_CompList_GetLast(
QUARTZ_CompList* pList );
QUARTZ_CompListItem* QUARTZ_CompList_GetNext(
QUARTZ_CompList* pList, QUARTZ_CompListItem* pPrev );
QUARTZ_CompListItem* QUARTZ_CompList_GetPrev(
QUARTZ_CompList* pList, QUARTZ_CompListItem* pNext );
IUnknown* QUARTZ_CompList_GetItemPtr( QUARTZ_CompListItem* pItem );
const void* QUARTZ_CompList_GetDataPtr( QUARTZ_CompListItem* pItem );
DWORD QUARTZ_CompList_GetDataLength( QUARTZ_CompListItem* pItem );
......
......@@ -14,14 +14,7 @@
#include "winuser.h"
#include "winreg.h"
#include "winerror.h"
#include "wine/obj_base.h"
#include "objidl.h"
#include "oleidl.h"
#include "ocidl.h"
#include "strmif.h"
#include "control.h"
#include "uuids.h"
#include "wine/unicode.h"
#include "debugtools.h"
DEFAULT_DEBUG_CHANNEL(quartz);
......@@ -159,7 +152,7 @@ ICreateDevEnum_fnCreateClassEnumerator(ICreateDevEnum* iface,REFCLSID rclsidDevi
0, KEY_READ, &hKey ) != ERROR_SUCCESS )
return E_FAIL;
dwLen = strlenW(wszPath);
dwLen = lstrlenW(wszPath);
wszPath[dwLen++] = '\\'; wszPath[dwLen] = 0;
dwNameMax = sizeof(wszPath)/sizeof(wszPath[0]) - dwLen - 8;
......
......@@ -13,14 +13,12 @@
#include "winuser.h"
#include "winreg.h"
#include "winerror.h"
#include "wine/obj_base.h"
#include "objidl.h"
#include "oleidl.h"
#include "ocidl.h"
#include "oleauto.h"
#include "strmif.h"
#include "uuids.h"
#include "wine/unicode.h"
#include "debugtools.h"
DEFAULT_DEBUG_CHANNEL(quartz);
......@@ -366,7 +364,7 @@ static HRESULT CDeviceMoniker_InitIMoniker(
pdm->m_hkRoot = hkRoot;
pdm->m_pwszPath = NULL;
dwLen = sizeof(WCHAR)*(strlenW(lpKeyPath)+1);
dwLen = sizeof(WCHAR)*(lstrlenW(lpKeyPath)+1);
pdm->m_pwszPath = (WCHAR*)QUARTZ_AllocMem( dwLen );
if ( pdm->m_pwszPath == NULL )
return E_OUTOFMEMORY;
......
......@@ -8,14 +8,9 @@
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "winerror.h"
#include "wine/obj_base.h"
#include "wine/obj_oleaut.h"
#include "strmif.h"
#include "control.h"
#include "uuids.h"
#include "wine/obj_misc.h"
#include "debugtools.h"
DEFAULT_DEBUG_CHANNEL(quartz);
......
......@@ -11,8 +11,6 @@
#include "wingdi.h"
#include "winuser.h"
#include "winerror.h"
#include "wine/obj_base.h"
#include "wine/obj_oleaut.h"
#include "strmif.h"
#include "control.h"
#include "evcode.h"
......
/*
* Implementation of IDispatch for FilterGraph.
*
* FIXME - stub.
*
* hidenori@a2.ctktv.ne.jp
*/
#include "config.h"
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "winerror.h"
#include "wine/obj_base.h"
#include "wine/obj_oleaut.h"
#include "strmif.h"
#include "control.h"
#include "uuids.h"
#include "debugtools.h"
DEFAULT_DEBUG_CHANNEL(quartz);
#include "quartz_private.h"
#include "fgraph.h"
static HRESULT WINAPI
IDispatch_fnQueryInterface(IDispatch* iface,REFIID riid,void** ppobj)
{
CFilterGraph_THIS(iface,disp);
TRACE("(%p)->()\n",This);
return IUnknown_QueryInterface(This->unk.punkControl,riid,ppobj);
}
static ULONG WINAPI
IDispatch_fnAddRef(IDispatch* iface)
{
CFilterGraph_THIS(iface,disp);
TRACE("(%p)->()\n",This);
return IUnknown_AddRef(This->unk.punkControl);
}
static ULONG WINAPI
IDispatch_fnRelease(IDispatch* iface)
{
CFilterGraph_THIS(iface,disp);
TRACE("(%p)->()\n",This);
return IUnknown_Release(This->unk.punkControl);
}
static HRESULT WINAPI
IDispatch_fnGetTypeInfoCount(IDispatch* iface,UINT* pcTypeInfo)
{
CFilterGraph_THIS(iface,disp);
FIXME("(%p)->()\n",This);
return E_NOTIMPL;
}
static HRESULT WINAPI
IDispatch_fnGetTypeInfo(IDispatch* iface,UINT iTypeInfo, LCID lcid, ITypeInfo** ppobj)
{
CFilterGraph_THIS(iface,disp);
FIXME("(%p)->()\n",This);
return E_NOTIMPL;
}
static HRESULT WINAPI
IDispatch_fnGetIDsOfNames(IDispatch* iface,REFIID riid, LPOLESTR* ppwszName, UINT cNames, LCID lcid, DISPID* pDispId)
{
CFilterGraph_THIS(iface,disp);
FIXME("(%p)->()\n",This);
return E_NOTIMPL;
}
static HRESULT WINAPI
IDispatch_fnInvoke(IDispatch* iface,DISPID DispId, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS* pDispParams, VARIANT* pVarRes, EXCEPINFO* pExcepInfo, UINT* puArgErr)
{
CFilterGraph_THIS(iface,disp);
FIXME("(%p)->()\n",This);
return E_NOTIMPL;
}
static ICOM_VTABLE(IDispatch) idispatch =
{
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
/* IUnknown fields */
IDispatch_fnQueryInterface,
IDispatch_fnAddRef,
IDispatch_fnRelease,
/* IDispatch fields */
IDispatch_fnGetTypeInfoCount,
IDispatch_fnGetTypeInfo,
IDispatch_fnGetIDsOfNames,
IDispatch_fnInvoke,
};
HRESULT CFilterGraph_InitIDispatch( CFilterGraph* pfg )
{
TRACE("(%p)\n",pfg);
ICOM_VTBL(&pfg->disp) = &idispatch;
return NOERROR;
}
void CFilterGraph_UninitIDispatch( CFilterGraph* pfg )
{
TRACE("(%p)\n",pfg);
}
......@@ -13,8 +13,6 @@
#include "wingdi.h"
#include "winuser.h"
#include "winerror.h"
#include "wine/obj_base.h"
#include "wine/obj_oleaut.h"
#include "strmif.h"
#include "control.h"
#include "uuids.h"
......
......@@ -11,8 +11,6 @@
#include "wingdi.h"
#include "winuser.h"
#include "winerror.h"
#include "wine/obj_base.h"
#include "wine/obj_oleaut.h"
#include "strmif.h"
#include "control.h"
#include "uuids.h"
......@@ -221,3 +219,109 @@ void CFilterGraph_UninitIPersist( CFilterGraph* pfg )
{
TRACE("(%p)\n",pfg);
}
/***************************************************************************
*
* CFilterGraph::IDispatch
*
*/
static HRESULT WINAPI
IDispatch_fnQueryInterface(IDispatch* iface,REFIID riid,void** ppobj)
{
CFilterGraph_THIS(iface,disp);
TRACE("(%p)->()\n",This);
return IUnknown_QueryInterface(This->unk.punkControl,riid,ppobj);
}
static ULONG WINAPI
IDispatch_fnAddRef(IDispatch* iface)
{
CFilterGraph_THIS(iface,disp);
TRACE("(%p)->()\n",This);
return IUnknown_AddRef(This->unk.punkControl);
}
static ULONG WINAPI
IDispatch_fnRelease(IDispatch* iface)
{
CFilterGraph_THIS(iface,disp);
TRACE("(%p)->()\n",This);
return IUnknown_Release(This->unk.punkControl);
}
static HRESULT WINAPI
IDispatch_fnGetTypeInfoCount(IDispatch* iface,UINT* pcTypeInfo)
{
CFilterGraph_THIS(iface,disp);
FIXME("(%p)->()\n",This);
return E_NOTIMPL;
}
static HRESULT WINAPI
IDispatch_fnGetTypeInfo(IDispatch* iface,UINT iTypeInfo, LCID lcid, ITypeInfo** ppobj)
{
CFilterGraph_THIS(iface,disp);
FIXME("(%p)->()\n",This);
return E_NOTIMPL;
}
static HRESULT WINAPI
IDispatch_fnGetIDsOfNames(IDispatch* iface,REFIID riid, LPOLESTR* ppwszName, UINT cNames, LCID lcid, DISPID* pDispId)
{
CFilterGraph_THIS(iface,disp);
FIXME("(%p)->()\n",This);
return E_NOTIMPL;
}
static HRESULT WINAPI
IDispatch_fnInvoke(IDispatch* iface,DISPID DispId, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS* pDispParams, VARIANT* pVarRes, EXCEPINFO* pExcepInfo, UINT* puArgErr)
{
CFilterGraph_THIS(iface,disp);
FIXME("(%p)->()\n",This);
return E_NOTIMPL;
}
static ICOM_VTABLE(IDispatch) idispatch =
{
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
/* IUnknown fields */
IDispatch_fnQueryInterface,
IDispatch_fnAddRef,
IDispatch_fnRelease,
/* IDispatch fields */
IDispatch_fnGetTypeInfoCount,
IDispatch_fnGetTypeInfo,
IDispatch_fnGetIDsOfNames,
IDispatch_fnInvoke,
};
HRESULT CFilterGraph_InitIDispatch( CFilterGraph* pfg )
{
TRACE("(%p)\n",pfg);
ICOM_VTBL(&pfg->disp) = &idispatch;
return NOERROR;
}
void CFilterGraph_UninitIDispatch( CFilterGraph* pfg )
{
TRACE("(%p)\n",pfg);
}
......@@ -125,7 +125,6 @@ typedef struct CFilterGraph
/* IFilterGraph2 fields. */
QUARTZ_CompList* m_pFilterList;
/* IGraphVersion fields. */
CRITICAL_SECTION m_csGraphVersion;
LONG m_lGraphVersion;
/* IMediaControl fields. */
/* IMediaFilter fields. */
......
/*
* Implementation of CLSID_FilterMapper.
* Implementation of CLSID_FilterMapper and CLSID_FilterMapper2.
*
* FIXME - stub.
*
......@@ -14,10 +14,7 @@
#include "winuser.h"
#include "winreg.h"
#include "winerror.h"
#include "wine/obj_base.h"
#include "wine/obj_oleaut.h"
#include "strmif.h"
#include "control.h"
#include "uuids.h"
#include "debugtools.h"
......@@ -35,7 +32,7 @@ DEFAULT_DEBUG_CHANNEL(quartz);
*/
/* can I use offsetof safely? - FIXME? */
static QUARTZ_IFEntry IFEntries[] =
static QUARTZ_IFEntry FMapIFEntries[] =
{
{ &IID_IFilterMapper, offsetof(CFilterMapper,fmap)-offsetof(CFilterMapper,unk) },
};
......@@ -67,8 +64,8 @@ HRESULT QUARTZ_CreateFilterMapper(IUnknown* punkOuter,void** ppobj)
return hr;
}
pfm->unk.pEntries = IFEntries;
pfm->unk.dwEntries = sizeof(IFEntries)/sizeof(IFEntries[0]);
pfm->unk.pEntries = FMapIFEntries;
pfm->unk.dwEntries = sizeof(FMapIFEntries)/sizeof(FMapIFEntries[0]);
pfm->unk.pOnFinalRelease = QUARTZ_DestroyFilterMapper;
*ppobj = (void*)(&pfm->unk);
......@@ -254,3 +251,212 @@ void CFilterMapper_UninitIFilterMapper( CFilterMapper* pfm )
{
TRACE("(%p)\n",pfm);
}
/***************************************************************************
*
* new/delete for CLSID_FilterMapper2
*
*/
/* can I use offsetof safely? - FIXME? */
static QUARTZ_IFEntry FMap2IFEntries[] =
{
{ &IID_IFilterMapper2, offsetof(CFilterMapper2,fmap3)-offsetof(CFilterMapper2,unk) },
{ &IID_IFilterMapper3, offsetof(CFilterMapper2,fmap3)-offsetof(CFilterMapper2,unk) },
};
static void QUARTZ_DestroyFilterMapper2(IUnknown* punk)
{
CFilterMapper2_THIS(punk,unk);
CFilterMapper2_UninitIFilterMapper3( This );
}
HRESULT QUARTZ_CreateFilterMapper2(IUnknown* punkOuter,void** ppobj)
{
CFilterMapper2* pfm;
HRESULT hr;
TRACE("(%p,%p)\n",punkOuter,ppobj);
pfm = (CFilterMapper2*)QUARTZ_AllocObj( sizeof(CFilterMapper2) );
if ( pfm == NULL )
return E_OUTOFMEMORY;
QUARTZ_IUnkInit( &pfm->unk, punkOuter );
hr = CFilterMapper2_InitIFilterMapper3( pfm );
if ( FAILED(hr) )
{
QUARTZ_FreeObj( pfm );
return hr;
}
pfm->unk.pEntries = FMap2IFEntries;
pfm->unk.dwEntries = sizeof(FMap2IFEntries)/sizeof(FMap2IFEntries[0]);
pfm->unk.pOnFinalRelease = QUARTZ_DestroyFilterMapper2;
*ppobj = (void*)(&pfm->unk);
return S_OK;
}
/***************************************************************************
*
* CLSID_FilterMapper2::IFilterMapper3
*
*/
static HRESULT WINAPI
IFilterMapper3_fnQueryInterface(IFilterMapper3* iface,REFIID riid,void** ppobj)
{
CFilterMapper2_THIS(iface,fmap3);
TRACE("(%p)->()\n",This);
return IUnknown_QueryInterface(This->unk.punkControl,riid,ppobj);
}
static ULONG WINAPI
IFilterMapper3_fnAddRef(IFilterMapper3* iface)
{
CFilterMapper2_THIS(iface,fmap3);
TRACE("(%p)->()\n",This);
return IUnknown_AddRef(This->unk.punkControl);
}
static ULONG WINAPI
IFilterMapper3_fnRelease(IFilterMapper3* iface)
{
CFilterMapper2_THIS(iface,fmap3);
TRACE("(%p)->()\n",This);
return IUnknown_Release(This->unk.punkControl);
}
static HRESULT WINAPI
IFilterMapper3_fnCreateCategory(IFilterMapper3* iface,REFCLSID rclsidCategory,DWORD dwMerit,LPCWSTR lpwszDesc)
{
CFilterMapper2_THIS(iface,fmap3);
FIXME("(%p)->(%s,%lu,%s) stub!\n",This,
debugstr_guid(rclsidCategory),
(unsigned long)dwMerit,debugstr_w(lpwszDesc));
return E_NOTIMPL;
}
static HRESULT WINAPI
IFilterMapper3_fnUnregisterFilter(IFilterMapper3* iface,const CLSID* pclsidCategory,const OLECHAR* lpwszInst,REFCLSID rclsidFilter)
{
CFilterMapper2_THIS(iface,fmap3);
FIXME("(%p)->(%s,%s,%s) stub!\n",This,
debugstr_guid(pclsidCategory),
debugstr_w(lpwszInst),
debugstr_guid(rclsidFilter));
if ( pclsidCategory == NULL )
pclsidCategory = &CLSID_LegacyAmFilterCategory;
/* FIXME */
return QUARTZ_RegisterAMovieFilter(
pclsidCategory,
rclsidFilter,
NULL, 0,
NULL, lpwszInst, FALSE );
}
static HRESULT WINAPI
IFilterMapper3_fnRegisterFilter(IFilterMapper3* iface,REFCLSID rclsidFilter,LPCWSTR lpName,IMoniker** ppMoniker,const CLSID* pclsidCategory,const OLECHAR* lpwszInst,const REGFILTER2* pRF2)
{
CFilterMapper2_THIS(iface,fmap3);
FIXME( "(%p)->(%s,%s,%p,%s,%s,%p) stub!\n",This,
debugstr_guid(rclsidFilter),debugstr_w(lpName),
ppMoniker,debugstr_guid(pclsidCategory),
debugstr_w(lpwszInst),pRF2 );
if ( lpName == NULL || pRF2 == NULL )
return E_POINTER;
if ( ppMoniker != NULL )
{
FIXME( "ppMoniker != NULL - not implemented!\n" );
return E_NOTIMPL;
}
if ( pclsidCategory == NULL )
pclsidCategory = &CLSID_LegacyAmFilterCategory;
/* FIXME!! - all members in REGFILTER2 are ignored ! */
return QUARTZ_RegisterAMovieFilter(
pclsidCategory,
rclsidFilter,
NULL, 0,
lpName, lpwszInst, TRUE );
}
static HRESULT WINAPI
IFilterMapper3_fnEnumMatchingFilters(IFilterMapper3* iface,IEnumMoniker** ppMoniker,DWORD dwFlags,BOOL bExactMatch,DWORD dwMerit,BOOL bInputNeeded,DWORD cInputTypes,const GUID* pguidInputTypes,const REGPINMEDIUM* pPinMediumIn,const CLSID* pPinCategoryIn,BOOL bRender,BOOL bOutputNeeded,DWORD cOutputTypes,const GUID* pguidOutputTypes,const REGPINMEDIUM* pPinMediumOut,const CLSID* pPinCategoryOut)
{
CFilterMapper2_THIS(iface,fmap3);
FIXME("(%p)->() stub!\n",This);
return E_NOTIMPL;
}
static HRESULT WINAPI
IFilterMapper3_fnGetICreateDevEnum(IFilterMapper3* iface,ICreateDevEnum** ppDevEnum)
{
CFilterMapper2_THIS(iface,fmap3);
/* undocumented */
FIXME("(%p)->() stub!\n",This);
return E_NOTIMPL;
}
static ICOM_VTABLE(IFilterMapper3) ifmap3 =
{
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
/* IUnknown fields */
IFilterMapper3_fnQueryInterface,
IFilterMapper3_fnAddRef,
IFilterMapper3_fnRelease,
/* IFilterMapper2 fields */
IFilterMapper3_fnCreateCategory,
IFilterMapper3_fnUnregisterFilter,
IFilterMapper3_fnRegisterFilter,
IFilterMapper3_fnEnumMatchingFilters,
/* IFilterMapper3 fields */
IFilterMapper3_fnGetICreateDevEnum,
};
HRESULT CFilterMapper2_InitIFilterMapper3( CFilterMapper2* pfm )
{
TRACE("(%p)\n",pfm);
ICOM_VTBL(&pfm->fmap3) = &ifmap3;
return NOERROR;
}
void CFilterMapper2_UninitIFilterMapper3( CFilterMapper2* pfm )
{
TRACE("(%p)\n",pfm);
}
......@@ -33,5 +33,37 @@ HRESULT CFilterMapper_InitIFilterMapper( CFilterMapper* pfm );
void CFilterMapper_UninitIFilterMapper( CFilterMapper* pfm );
#endif /* WINE_DSHOW_FMAP_H */
/*
implements CLSID_FilterMapper2.
- At least, the following interfaces should be implemented:
IUnknown
+ IFilterMapper2 - IFilterMapper3
*/
#include "iunk.h"
typedef struct FM2_IFilterMapper3Impl
{
ICOM_VFIELD(IFilterMapper3);
} FM2_IFilterMapper3Impl;
typedef struct CFilterMapper2
{
QUARTZ_IUnkImpl unk;
FM2_IFilterMapper3Impl fmap3;
/* IFilterMapper3 fields */
} CFilterMapper2;
#define CFilterMapper2_THIS(iface,member) CFilterMapper2* This = ((CFilterMapper2*)(((char*)iface)-offsetof(CFilterMapper2,member)))
HRESULT QUARTZ_CreateFilterMapper2(IUnknown* punkOuter,void** ppobj);
HRESULT CFilterMapper2_InitIFilterMapper3( CFilterMapper2* psde );
void CFilterMapper2_UninitIFilterMapper3( CFilterMapper2* psde );
#endif /* WINE_DSHOW_FMAP_H */
/*
* Implementation of CLSID_FilterMapper2.
*
* FIXME - stub.
*
* hidenori@a2.ctktv.ne.jp
*/
#include "config.h"
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "winreg.h"
#include "winerror.h"
#include "wine/obj_base.h"
#include "wine/obj_oleaut.h"
#include "strmif.h"
#include "control.h"
#include "uuids.h"
#include "debugtools.h"
DEFAULT_DEBUG_CHANNEL(quartz);
#include "quartz_private.h"
#include "fmap2.h"
#include "regsvr.h"
/***************************************************************************
*
* new/delete for CLSID_FilterMapper2
*
*/
/* can I use offsetof safely? - FIXME? */
static QUARTZ_IFEntry IFEntries[] =
{
{ &IID_IFilterMapper2, offsetof(CFilterMapper2,fmap3)-offsetof(CFilterMapper2,unk) },
{ &IID_IFilterMapper3, offsetof(CFilterMapper2,fmap3)-offsetof(CFilterMapper2,unk) },
};
static void QUARTZ_DestroyFilterMapper2(IUnknown* punk)
{
CFilterMapper2_THIS(punk,unk);
CFilterMapper2_UninitIFilterMapper3( This );
}
HRESULT QUARTZ_CreateFilterMapper2(IUnknown* punkOuter,void** ppobj)
{
CFilterMapper2* pfm;
HRESULT hr;
TRACE("(%p,%p)\n",punkOuter,ppobj);
pfm = (CFilterMapper2*)QUARTZ_AllocObj( sizeof(CFilterMapper2) );
if ( pfm == NULL )
return E_OUTOFMEMORY;
QUARTZ_IUnkInit( &pfm->unk, punkOuter );
hr = CFilterMapper2_InitIFilterMapper3( pfm );
if ( FAILED(hr) )
{
QUARTZ_FreeObj( pfm );
return hr;
}
pfm->unk.pEntries = IFEntries;
pfm->unk.dwEntries = sizeof(IFEntries)/sizeof(IFEntries[0]);
pfm->unk.pOnFinalRelease = QUARTZ_DestroyFilterMapper2;
*ppobj = (void*)(&pfm->unk);
return S_OK;
}
/***************************************************************************
*
* CLSID_FilterMapper2::IFilterMapper3
*
*/
static HRESULT WINAPI
IFilterMapper3_fnQueryInterface(IFilterMapper3* iface,REFIID riid,void** ppobj)
{
CFilterMapper2_THIS(iface,fmap3);
TRACE("(%p)->()\n",This);
return IUnknown_QueryInterface(This->unk.punkControl,riid,ppobj);
}
static ULONG WINAPI
IFilterMapper3_fnAddRef(IFilterMapper3* iface)
{
CFilterMapper2_THIS(iface,fmap3);
TRACE("(%p)->()\n",This);
return IUnknown_AddRef(This->unk.punkControl);
}
static ULONG WINAPI
IFilterMapper3_fnRelease(IFilterMapper3* iface)
{
CFilterMapper2_THIS(iface,fmap3);
TRACE("(%p)->()\n",This);
return IUnknown_Release(This->unk.punkControl);
}
static HRESULT WINAPI
IFilterMapper3_fnCreateCategory(IFilterMapper3* iface,REFCLSID rclsidCategory,DWORD dwMerit,LPCWSTR lpwszDesc)
{
CFilterMapper2_THIS(iface,fmap3);
FIXME("(%p)->(%s,%lu,%s) stub!\n",This,
debugstr_guid(rclsidCategory),
(unsigned long)dwMerit,debugstr_w(lpwszDesc));
return E_NOTIMPL;
}
static HRESULT WINAPI
IFilterMapper3_fnUnregisterFilter(IFilterMapper3* iface,const CLSID* pclsidCategory,const OLECHAR* lpwszInst,REFCLSID rclsidFilter)
{
CFilterMapper2_THIS(iface,fmap3);
FIXME("(%p)->(%s,%s,%s) stub!\n",This,
debugstr_guid(pclsidCategory),
debugstr_w(lpwszInst),
debugstr_guid(rclsidFilter));
if ( pclsidCategory == NULL )
pclsidCategory = &CLSID_LegacyAmFilterCategory;
/* FIXME */
return QUARTZ_RegisterAMovieFilter(
pclsidCategory,
rclsidFilter,
NULL, 0,
NULL, lpwszInst, FALSE );
}
static HRESULT WINAPI
IFilterMapper3_fnRegisterFilter(IFilterMapper3* iface,REFCLSID rclsidFilter,LPCWSTR lpName,IMoniker** ppMoniker,const CLSID* pclsidCategory,const OLECHAR* lpwszInst,const REGFILTER2* pRF2)
{
CFilterMapper2_THIS(iface,fmap3);
FIXME( "(%p)->(%s,%s,%p,%s,%s,%p) stub!\n",This,
debugstr_guid(rclsidFilter),debugstr_w(lpName),
ppMoniker,debugstr_guid(pclsidCategory),
debugstr_w(lpwszInst),pRF2 );
if ( lpName == NULL || pRF2 == NULL )
return E_POINTER;
if ( ppMoniker != NULL )
{
FIXME( "ppMoniker != NULL - not implemented!\n" );
return E_NOTIMPL;
}
if ( pclsidCategory == NULL )
pclsidCategory = &CLSID_LegacyAmFilterCategory;
/* FIXME!! - all members in REGFILTER2 are ignored ! */
return QUARTZ_RegisterAMovieFilter(
pclsidCategory,
rclsidFilter,
NULL, 0,
lpName, lpwszInst, TRUE );
}
static HRESULT WINAPI
IFilterMapper3_fnEnumMatchingFilters(IFilterMapper3* iface,IEnumMoniker** ppMoniker,DWORD dwFlags,BOOL bExactMatch,DWORD dwMerit,BOOL bInputNeeded,DWORD cInputTypes,const GUID* pguidInputTypes,const REGPINMEDIUM* pPinMediumIn,const CLSID* pPinCategoryIn,BOOL bRender,BOOL bOutputNeeded,DWORD cOutputTypes,const GUID* pguidOutputTypes,const REGPINMEDIUM* pPinMediumOut,const CLSID* pPinCategoryOut)
{
CFilterMapper2_THIS(iface,fmap3);
FIXME("(%p)->() stub!\n",This);
return E_NOTIMPL;
}
static HRESULT WINAPI
IFilterMapper3_fnGetICreateDevEnum(IFilterMapper3* iface,ICreateDevEnum** ppDevEnum)
{
CFilterMapper2_THIS(iface,fmap3);
/* undocumented */
FIXME("(%p)->() stub!\n",This);
return E_NOTIMPL;
}
static ICOM_VTABLE(IFilterMapper3) ifmap3 =
{
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
/* IUnknown fields */
IFilterMapper3_fnQueryInterface,
IFilterMapper3_fnAddRef,
IFilterMapper3_fnRelease,
/* IFilterMapper2 fields */
IFilterMapper3_fnCreateCategory,
IFilterMapper3_fnUnregisterFilter,
IFilterMapper3_fnRegisterFilter,
IFilterMapper3_fnEnumMatchingFilters,
/* IFilterMapper3 fields */
IFilterMapper3_fnGetICreateDevEnum,
};
HRESULT CFilterMapper2_InitIFilterMapper3( CFilterMapper2* pfm )
{
TRACE("(%p)\n",pfm);
ICOM_VTBL(&pfm->fmap3) = &ifmap3;
return NOERROR;
}
void CFilterMapper2_UninitIFilterMapper3( CFilterMapper2* pfm )
{
TRACE("(%p)\n",pfm);
}
#ifndef WINE_DSHOW_FMAP2_H
#define WINE_DSHOW_FMAP2_H
/*
implements CLSID_FilterMapper2.
- At least, the following interfaces should be implemented:
IUnknown
+ IFilterMapper2 - IFilterMapper3
*/
#include "iunk.h"
typedef struct FM2_IFilterMapper3Impl
{
ICOM_VFIELD(IFilterMapper3);
} FM2_IFilterMapper3Impl;
typedef struct CFilterMapper2
{
QUARTZ_IUnkImpl unk;
FM2_IFilterMapper3Impl fmap3;
/* IFilterMapper3 fields */
} CFilterMapper2;
#define CFilterMapper2_THIS(iface,member) CFilterMapper2* This = ((CFilterMapper2*)(((char*)iface)-offsetof(CFilterMapper2,member)))
HRESULT QUARTZ_CreateFilterMapper2(IUnknown* punkOuter,void** ppobj);
HRESULT CFilterMapper2_InitIFilterMapper3( CFilterMapper2* psde );
void CFilterMapper2_UninitIFilterMapper3( CFilterMapper2* psde );
#endif /* WINE_DSHOW_FMAP2_H */
/*
* Implementation of IFilterGraph.
* Implementation of IFilterGraph and related interfaces
* + IGraphVersion, IGraphConfig
*
* FIXME - create a thread to process some methods correctly.
*
......@@ -17,13 +18,10 @@
#include "wingdi.h"
#include "winuser.h"
#include "winerror.h"
#include "wine/obj_base.h"
#include "wine/obj_oleaut.h"
#include "strmif.h"
#include "control.h"
#include "uuids.h"
#include "vfwmsgs.h"
#include "wine/unicode.h"
#include "evcode.h"
#include "debugtools.h"
......@@ -86,15 +84,17 @@ static HRESULT CFilterGraph_GraphChanged( CFilterGraph* This )
IMediaEventSink_Notify(CFilterGraph_IMediaEventSink(This),
EC_GRAPH_CHANGED, 0, 0);
EnterCriticalSection( &This->m_csGraphVersion );
This->m_lGraphVersion ++;
LeaveCriticalSection( &This->m_csGraphVersion );
return NOERROR;
}
/****************************************************************************/
/***************************************************************************
*
* CFilterGraph::IFilterGraph2 methods
*
*/
static HRESULT WINAPI
IFilterGraph2_fnQueryInterface(IFilterGraph2* iface,REFIID riid,void** ppobj)
......@@ -155,13 +155,13 @@ IFilterGraph2_fnAddFilter(IFilterGraph2* iface,IBaseFilter* pFilter, LPCWSTR pNa
{
pItem = QUARTZ_CompList_SearchData(
This->m_pFilterList,
pName, sizeof(WCHAR)*(strlenW(pName)+1) );
pName, sizeof(WCHAR)*(lstrlenW(pName)+1) );
if ( pItem == NULL )
goto name_ok;
hrSucceeded = VFW_S_DUPLICATE_NAME;
iLen = strlenW(pName);
iLen = lstrlenW(pName);
if ( iLen > 32 )
iLen = 32;
memcpy( info.achName, pName, sizeof(WCHAR)*iLen );
......@@ -174,7 +174,7 @@ IFilterGraph2_fnAddFilter(IFilterGraph2* iface,IBaseFilter* pFilter, LPCWSTR pNa
if ( FAILED(hr) )
goto end;
iLen = strlenW(info.achName);
iLen = lstrlenW(info.achName);
pItem = QUARTZ_CompList_SearchData(
This->m_pFilterList,
info.achName, sizeof(WCHAR)*(iLen+1) );
......@@ -186,7 +186,7 @@ IFilterGraph2_fnAddFilter(IFilterGraph2* iface,IBaseFilter* pFilter, LPCWSTR pNa
}
/* generate modified names for this filter.. */
iLen = strlenW(info.achName);
iLen = lstrlenW(info.achName);
if ( iLen > 32 )
iLen = 32;
info.achName[iLen++] = ' ';
......@@ -215,7 +215,7 @@ name_ok:
/* register this filter. */
hr = QUARTZ_CompList_AddComp(
This->m_pFilterList, (IUnknown*)pFilter,
pName, sizeof(WCHAR)*(strlenW(pName)+1) );
pName, sizeof(WCHAR)*(lstrlenW(pName)+1) );
if ( FAILED(hr) )
goto end;
......@@ -325,7 +325,7 @@ IFilterGraph2_fnFindFilterByName(IFilterGraph2* iface,LPCWSTR pName,IBaseFilter*
pItem = QUARTZ_CompList_SearchData(
This->m_pFilterList,
pName, sizeof(WCHAR)*(strlenW(pName)+1) );
pName, sizeof(WCHAR)*(lstrlenW(pName)+1) );
if ( pItem != NULL )
{
*ppFilter = (IBaseFilter*)QUARTZ_CompList_GetItemPtr(pItem);
......@@ -346,6 +346,7 @@ IFilterGraph2_fnConnectDirect(IFilterGraph2* iface,IPin* pOut,IPin* pIn,const AM
PIN_INFO infoOut;
FILTER_INFO finfoIn;
FILTER_INFO finfoOut;
FILTER_STATE fs;
HRESULT hr;
TRACE( "(%p)->(%p,%p,%p)\n",This,pOut,pIn,pmt );
......@@ -357,6 +358,14 @@ IFilterGraph2_fnConnectDirect(IFilterGraph2* iface,IPin* pOut,IPin* pIn,const AM
QUARTZ_CompList_Lock( This->m_pFilterList );
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 = IPin_QueryPinInfo(pIn,&infoIn);
if ( FAILED(hr) )
goto end;
......@@ -482,7 +491,7 @@ IFilterGraph2_fnSetDefaultSyncSource(IFilterGraph2* iface)
FIXME( "(%p)->() stub!\n", This );
/* FIXME - search all filters. */
/* FIXME - search all filters from renderer. */
hr = QUARTZ_CreateSystemClock( NULL, (void**)&punk );
if ( FAILED(hr) )
......@@ -668,7 +677,9 @@ IFilterGraph2_fnReconnectEx(IFilterGraph2* iface,IPin* pPin,const AM_MEDIA_TYPE*
/* reconnect asynchronously. */
QUARTZ_CompList_Lock( This->m_pFilterList );
hr = CFilterGraph_GraphChanged(This);
QUARTZ_CompList_Unlock( This->m_pFilterList );
return E_NOTIMPL;
}
......@@ -747,3 +758,274 @@ void CFilterGraph_UninitIFilterGraph2( CFilterGraph* pfg )
QUARTZ_CompList_Free( pfg->m_pFilterList );
}
/***************************************************************************
*
* 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);
}
/*
* Implementation of IGraphConfig for FilterGraph.
*
* FIXME - stub.
*
* hidenori@a2.ctktv.ne.jp
*/
#include "config.h"
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "winerror.h"
#include "wine/obj_base.h"
#include "wine/obj_oleaut.h"
#include "strmif.h"
#include "control.h"
#include "uuids.h"
#include "debugtools.h"
DEFAULT_DEBUG_CHANNEL(quartz);
#include "quartz_private.h"
#include "fgraph.h"
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);
}
/*
* Implementation of IGraphVersion for FilterGraph.
*
* FIXME - stub.
*
* hidenori@a2.ctktv.ne.jp
*/
#include "config.h"
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "winerror.h"
#include "wine/obj_base.h"
#include "wine/obj_oleaut.h"
#include "strmif.h"
#include "control.h"
#include "uuids.h"
#include "debugtools.h"
DEFAULT_DEBUG_CHANNEL(quartz);
#include "quartz_private.h"
#include "fgraph.h"
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;
EnterCriticalSection( &This->m_csGraphVersion );
*plVersion = This->m_lGraphVersion;
LeaveCriticalSection( &This->m_csGraphVersion );
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;
InitializeCriticalSection( &pfg->m_csGraphVersion );
pfg->m_lGraphVersion = 1;
return NOERROR;
}
void CFilterGraph_UninitIGraphVersion( CFilterGraph* pfg )
{
TRACE("(%p)\n",pfg);
DeleteCriticalSection( &pfg->m_csGraphVersion );
}
......@@ -13,8 +13,6 @@
#include "wingdi.h"
#include "winuser.h"
#include "winerror.h"
#include "wine/obj_base.h"
#include "wine/obj_oleaut.h"
#include "oleauto.h"
#include "strmif.h"
#include "control.h"
......
......@@ -13,8 +13,6 @@
#include "wingdi.h"
#include "winuser.h"
#include "winerror.h"
#include "wine/obj_base.h"
#include "wine/obj_oleaut.h"
#include "strmif.h"
#include "control.h"
#include "uuids.h"
......
......@@ -13,8 +13,6 @@
#include "wingdi.h"
#include "winuser.h"
#include "winerror.h"
#include "wine/obj_base.h"
#include "wine/obj_oleaut.h"
#include "strmif.h"
#include "control.h"
#include "uuids.h"
......
......@@ -14,8 +14,6 @@
#include "wingdi.h"
#include "winuser.h"
#include "winerror.h"
#include "wine/obj_base.h"
#include "wine/obj_oleaut.h"
#include "strmif.h"
#include "control.h"
#include "uuids.h"
......
......@@ -14,7 +14,6 @@
#include "winnls.h"
#include "mmsystem.h"
#include "ole2.h"
#include "wine/obj_oleaut.h"
#include "strmif.h"
#include "control.h"
#include "uuids.h"
......@@ -23,17 +22,19 @@
#include "debugtools.h"
DEFAULT_DEBUG_CHANNEL(quartz);
#include "initguid.h"
#include "quartz_private.h"
#include "fgraph.h"
#include "sysclock.h"
#include "memalloc.h"
#include "devenum.h"
#include "fmap.h"
#include "fmap2.h"
#include "seekpass.h"
#include "audren.h"
#include "vidren.h"
#include "parser.h"
#include "asyncsrc.h"
typedef struct QUARTZ_CLASSENTRY
{
......@@ -80,6 +81,9 @@ static const QUARTZ_CLASSENTRY QUARTZ_ClassList[] =
{ &CLSID_AudioRender, &QUARTZ_CreateAudioRenderer },
{ &CLSID_VideoRenderer, &QUARTZ_CreateVideoRenderer },
{ &CLSID_quartzWaveParser, &QUARTZ_CreateWaveParser },
{ &CLSID_AviSplitter, &QUARTZ_CreateAVISplitter },
{ &CLSID_AsyncReader, &QUARTZ_CreateAsyncReader },
{ &CLSID_URLReader, &QUARTZ_CreateURLReader },
{ NULL, NULL },
};
......
......@@ -11,7 +11,6 @@
#include "wingdi.h"
#include "winuser.h"
#include "winerror.h"
#include "wine/obj_base.h"
#include "strmif.h"
#include "uuids.h"
......
......@@ -11,7 +11,7 @@
#include "wingdi.h"
#include "winuser.h"
#include "winerror.h"
#include "wine/obj_base.h"
#include "mmsystem.h"
#include "strmif.h"
#include "vfwmsgs.h"
#include "uuids.h"
......@@ -119,6 +119,108 @@ BOOL QUARTZ_MediaSubType_IsFourCC(
return IsEqualGUID( psubtype, &guidTemp );
}
HRESULT QUARTZ_MediaSubType_FromBitmap(
GUID* psubtype, const BITMAPINFOHEADER* pbi )
{
HRESULT hr;
DWORD* pdwBitf;
if ( (pbi->biCompression & 0xffff) != 0 )
return S_FALSE;
if ( pbi->biWidth <= 0 || pbi->biHeight == 0 )
return E_FAIL;
hr = E_FAIL;
switch ( pbi->biCompression )
{
case 0:
if ( pbi->biPlanes != 1 )
break;
switch ( pbi->biBitCount )
{
case 1:
memcpy( psubtype, &MEDIASUBTYPE_RGB1, sizeof(GUID) );
hr = S_OK;
break;
case 4:
memcpy( psubtype, &MEDIASUBTYPE_RGB4, sizeof(GUID) );
hr = S_OK;
break;
case 8:
memcpy( psubtype, &MEDIASUBTYPE_RGB8, sizeof(GUID) );
hr = S_OK;
break;
case 16:
memcpy( psubtype, &MEDIASUBTYPE_RGB555, sizeof(GUID) );
hr = S_OK;
break;
case 24:
memcpy( psubtype, &MEDIASUBTYPE_RGB24, sizeof(GUID) );
hr = S_OK;
break;
case 32:
memcpy( psubtype, &MEDIASUBTYPE_RGB32, sizeof(GUID) );
hr = S_OK;
break;
}
break;
case 1:
if ( pbi->biPlanes == 1 && pbi->biHeight > 0 &&
pbi->biBitCount == 8 )
{
QUARTZ_MediaSubType_FromFourCC( psubtype, mmioFOURCC('M','R','L','E') );
hr = S_OK;
}
break;
case 2:
if ( pbi->biPlanes == 1 && pbi->biHeight > 0 &&
pbi->biBitCount == 4 )
{
QUARTZ_MediaSubType_FromFourCC( psubtype, mmioFOURCC('M','R','L','E') );
hr = S_OK;
}
break;
case 3:
if ( pbi->biPlanes != 1 )
break;
pdwBitf = (DWORD*)( (BYTE*)pbi + sizeof(BITMAPINFOHEADER) );
switch ( pbi->biBitCount )
{
case 16:
if ( pdwBitf[0] == 0x7c00 &&
pdwBitf[1] == 0x03e0 &&
pdwBitf[2] == 0x001f )
{
memcpy( psubtype, &MEDIASUBTYPE_RGB555, sizeof(GUID) );
hr = S_OK;
}
if ( pdwBitf[0] == 0xf800 &&
pdwBitf[1] == 0x07e0 &&
pdwBitf[2] == 0x001f )
{
memcpy( psubtype, &MEDIASUBTYPE_RGB565, sizeof(GUID) );
hr = S_OK;
}
break;
case 32:
if ( pdwBitf[0] == 0x00ff0000 &&
pdwBitf[1] == 0x0000ff00 &&
pdwBitf[2] == 0x000000ff )
{
memcpy( psubtype, &MEDIASUBTYPE_RGB32, sizeof(GUID) );
hr = S_OK;
}
break;
}
break;
}
return hr;
}
/****************************************************************************/
typedef struct IEnumMediaTypesImpl
......
......@@ -22,6 +22,9 @@ void QUARTZ_MediaSubType_FromFourCC(
BOOL QUARTZ_MediaSubType_IsFourCC(
const GUID* psubtype );
HRESULT QUARTZ_MediaSubType_FromBitmap(
GUID* psubtype, const BITMAPINFOHEADER* pbi );
HRESULT QUARTZ_CreateEnumMediaTypes(
IEnumMediaTypes** ppobj,
const AM_MEDIA_TYPE* pTypes, ULONG cTypes );
......
......@@ -2,6 +2,8 @@
* Implements IBaseFilter for parsers. (internal)
*
* hidenori@a2.ctktv.ne.jp
*
* FIXME - save the array of pSample and handle errors/flushing correctly.
*/
#include "config.h"
......@@ -12,7 +14,6 @@
#include "winuser.h"
#include "mmsystem.h"
#include "winerror.h"
#include "wine/obj_base.h"
#include "strmif.h"
#include "vfwmsgs.h"
#include "uuids.h"
......@@ -179,6 +180,8 @@ HRESULT CParserImpl_ProcessNextSample( CParserImpl* This )
hr = NOERROR;
IMediaSample_Release(pSample);
TRACE("return %08lx\n",hr);
return hr;
}
......@@ -232,6 +235,9 @@ DWORD WINAPI CParserImpl_ThreadEntry( LPVOID pv )
}
continue;
}
if ( This->m_ppOutPins[nIndex]->pin.pPinConnectedTo == NULL )
continue;
rtSampleTimeStart = llReqStart * QUARTZ_TIMEUNITS;
rtSampleTimeEnd = (llReqStart + lReqLength) * QUARTZ_TIMEUNITS;
bReqNext = FALSE;
......
......@@ -124,7 +124,6 @@ HRESULT QUARTZ_CreateParserOutPin(
LPCWSTR pwszPinName );
#define QUARTZ_TIMEUNITS ((LONGLONG)10000000)
#define PARSER_POLL_INTERVAL 100
#define PARSER_RIFF_OfsFirst 12
......@@ -136,6 +135,9 @@ HRESULT QUARTZ_CreateParserOutPin(
#define PARSER_fact mmioFOURCC('f','a','c','t')
#define PARSER_data mmioFOURCC('d','a','t','a')
#define PARSER_LIST mmioFOURCC('L','I','S','T')
#define PARSER_hdrl mmioFOURCC('h','d','r','l')
#define PARSER_avih mmioFOURCC('a','v','i','h')
#define PARSER_strl mmioFOURCC('s','t','r','l')
#define PARSER_strh mmioFOURCC('s','t','r','h')
......@@ -156,7 +158,22 @@ HRESULT QUARTZ_CreateParserOutPin(
#define PARSER_BE_UINT32(ptr) (((DWORD)(ptr)[0]<<24)|((DWORD)(ptr)[1]<<16)|((DWORD)(ptr)[2]<<8)|((DWORD)(ptr)[3]))
HRESULT QUARTZ_CreateWaveParser(IUnknown* punkOuter,void** ppobj);
HRESULT QUARTZ_CreateAVISplitter(IUnknown* punkOuter,void** ppobj);
HRESULT RIFF_GetNext(
CParserImpl* pImpl, LONGLONG llOfs,
DWORD* pdwCode, DWORD* pdwLength );
HRESULT RIFF_SearchChunk(
CParserImpl* pImpl,
DWORD dwSearchLengthMax,
LONGLONG llOfs, DWORD dwChunk,
LONGLONG* pllOfs, DWORD* pdwChunkLength );
HRESULT RIFF_SearchList(
CParserImpl* pImpl,
DWORD dwSearchLengthMax,
LONGLONG llOfs, DWORD dwListChunk,
LONGLONG* pllOfs, DWORD* pdwChunkLength );
#endif /* WINE_DSHOW_PARSER_H */
......@@ -9,5 +9,7 @@ void* QUARTZ_AllocMem( DWORD dwSize );
void QUARTZ_FreeMem( void* pMem );
void* QUARTZ_ReallocMem( void* pMem, DWORD dwSize );
#define QUARTZ_TIMEUNITS ((LONGLONG)10000000)
#endif /* QUARTZ_PRIVATE_H */
......@@ -13,7 +13,6 @@
#include "winerror.h"
#include "winreg.h"
#include "uuids.h"
#include "wine/unicode.h"
#include "debugtools.h"
DEFAULT_DEBUG_CHANNEL(quartz);
......@@ -46,7 +45,7 @@ const WCHAR QUARTZ_wszMerit[] =
static
void QUARTZ_CatPathSepW( WCHAR* pBuf )
{
int len = strlenW(pBuf);
int len = lstrlenW(pBuf);
pBuf[len] = '\\';
pBuf[len+1] = 0;
}
......@@ -96,7 +95,7 @@ LONG QUARTZ_RegSetValueString(
return RegSetValueExW(
hKey, lpszName, 0, REG_SZ,
(const BYTE*)lpValue,
sizeof(lpValue[0]) * (strlenW(lpValue)+1) );
sizeof(lpValue[0]) * (lstrlenW(lpValue)+1) );
}
static
......@@ -124,16 +123,16 @@ HRESULT QUARTZ_CreateCLSIDPath(
{
int avail;
strcpyW( pwszBuf, QUARTZ_wszCLSID );
lstrcpyW( pwszBuf, QUARTZ_wszCLSID );
QUARTZ_CatPathSepW( pwszBuf+5 );
QUARTZ_GUIDtoString( pwszBuf+6, pclsid );
if ( lpszPathFromCLSID != NULL )
{
avail = (int)dwBufLen - strlenW(pwszBuf) - 8;
if ( avail <= strlenW(lpszPathFromCLSID) )
avail = (int)dwBufLen - lstrlenW(pwszBuf) - 8;
if ( avail <= lstrlenW(lpszPathFromCLSID) )
return E_FAIL;
QUARTZ_CatPathSepW( pwszBuf );
strcatW( pwszBuf, lpszPathFromCLSID );
lstrcatW( pwszBuf, lpszPathFromCLSID );
}
return NOERROR;
......@@ -245,9 +244,9 @@ HRESULT QUARTZ_RegisterCategory(
WCHAR szCLSID[ 256 ];
QUARTZ_GUIDtoString( szCLSID, pguidFilterCategory );
strcpyW( szFilterPath, QUARTZ_wszInstance );
lstrcpyW( szFilterPath, QUARTZ_wszInstance );
QUARTZ_CatPathSepW( szFilterPath );
strcatW( szFilterPath, szCLSID );
lstrcatW( szFilterPath, szCLSID );
if ( fRegister )
{
......@@ -313,9 +312,9 @@ HRESULT QUARTZ_RegisterAMovieFilter(
WCHAR szCLSID[ 256 ];
QUARTZ_GUIDtoString( szCLSID, pclsid );
strcpyW( szFilterPath, QUARTZ_wszInstance );
lstrcpyW( szFilterPath, QUARTZ_wszInstance );
QUARTZ_CatPathSepW( szFilterPath );
strcatW( szFilterPath, ( lpInstance != NULL ) ? lpInstance : szCLSID );
lstrcatW( szFilterPath, ( lpInstance != NULL ) ? lpInstance : szCLSID );
if ( fRegister )
{
......
......@@ -11,7 +11,6 @@
#include "wingdi.h"
#include "winuser.h"
#include "winerror.h"
#include "wine/obj_base.h"
#include "strmif.h"
#include "vfwmsgs.h"
......
......@@ -13,7 +13,6 @@
#include "wingdi.h"
#include "winuser.h"
#include "winerror.h"
#include "wine/obj_base.h"
#include "strmif.h"
#include "control.h"
#include "uuids.h"
......
......@@ -11,7 +11,6 @@
#include "wingdi.h"
#include "winuser.h"
#include "winerror.h"
#include "wine/obj_base.h"
#include "strmif.h"
#include "uuids.h"
......
......@@ -14,8 +14,6 @@
#include "wingdi.h"
#include "winuser.h"
#include "winerror.h"
#include "wine/obj_base.h"
#include "wine/obj_oleaut.h"
#include "mmsystem.h"
#include "strmif.h"
#include "control.h"
......
......@@ -11,8 +11,8 @@
#include "wingdi.h"
#include "winuser.h"
#include "mmsystem.h"
#include "mmreg.h"
#include "winerror.h"
#include "wine/obj_base.h"
#include "strmif.h"
#include "vfwmsgs.h"
#include "uuids.h"
......@@ -21,9 +21,7 @@
DEFAULT_DEBUG_CHANNEL(quartz);
#include "quartz_private.h"
/* for CLSID_quartzWaveParser. */
#include "initguid.h"
#include "audioutl.h"
#include "parser.h"
......@@ -63,29 +61,87 @@ HRESULT RIFF_GetNext(
/* S_OK = found, S_FALSE = not found */
HRESULT RIFF_SearchChunk(
CParserImpl* pImpl,
DWORD dwSearchLengthMax,
LONGLONG llOfs, DWORD dwChunk,
LONGLONG* pllOfs, DWORD* pdwChunkLength )
{
HRESULT hr;
DWORD dwCurCode;
DWORD dwCurLen;
LONGLONG llCurLen;
while ( 1 )
{
hr = RIFF_GetNext( pImpl, llOfs, &dwCurCode, &dwCurLen );
if ( hr != S_OK )
break;
TRACE("%c%c%c%c len %lu\n",
(int)(dwCurCode>> 0)&0xff,
(int)(dwCurCode>> 8)&0xff,
(int)(dwCurCode>>16)&0xff,
(int)(dwCurCode>>24)&0xff,
(unsigned long)dwCurLen);
if ( dwChunk == dwCurCode )
break;
llOfs += 8 + (LONGLONG)((dwCurLen+1)&(~1));
llCurLen = 8 + (LONGLONG)((dwCurLen+1)&(~1));
llOfs += llCurLen;
if ( (LONGLONG)dwSearchLengthMax <= llCurLen )
return S_FALSE;
if ( dwSearchLengthMax != (DWORD)0xffffffff )
dwSearchLengthMax -= (DWORD)llCurLen;
}
*pllOfs = llOfs;
*pllOfs = llOfs + 8;
*pdwChunkLength = dwCurLen;
return hr;
}
/* S_OK = found, S_FALSE = not found */
HRESULT RIFF_SearchList(
CParserImpl* pImpl,
DWORD dwSearchLengthMax,
LONGLONG llOfs, DWORD dwListChunk,
LONGLONG* pllOfs, DWORD* pdwChunkLength )
{
HRESULT hr;
DWORD dwCurLen;
LONGLONG llCurLen;
BYTE bTemp[4];
while ( 1 )
{
hr = RIFF_SearchChunk(
pImpl, dwSearchLengthMax,
llOfs, PARSER_LIST,
&llOfs, &dwCurLen );
if ( hr != S_OK )
break;
hr = IAsyncReader_SyncRead( pImpl->m_pReader, llOfs, 4, bTemp );
if ( hr != S_OK )
break;
if ( mmioFOURCC(bTemp[0],bTemp[1],bTemp[2],bTemp[3]) == dwListChunk )
break;
llCurLen = (LONGLONG)((dwCurLen+1)&(~1));
llOfs += llCurLen;
if ( (LONGLONG)dwSearchLengthMax <= (llCurLen+8) )
return S_FALSE;
if ( dwSearchLengthMax != (DWORD)0xffffffff )
dwSearchLengthMax -= (DWORD)(llCurLen+8);
}
if ( dwCurLen < 12 )
return E_FAIL;
*pllOfs = llOfs+4;
*pdwChunkLength = dwCurLen-4;
return hr;
}
......@@ -122,13 +178,13 @@ static HRESULT CWavParseImpl_InitWAV( CParserImpl* pImpl, CWavParseImpl* This )
DWORD dwChunkLength;
hr = RIFF_SearchChunk(
pImpl, PARSER_RIFF_OfsFirst,
PARSER_fmt, &llOfs, &dwChunkLength );
pImpl, (DWORD)0xffffffff,
PARSER_RIFF_OfsFirst, PARSER_fmt,
&llOfs, &dwChunkLength );
if ( FAILED(hr) )
return hr;
if ( hr != S_OK || ( dwChunkLength < (sizeof(WAVEFORMATEX)-2) ) )
return E_FAIL;
llOfs += 8;
This->cbFmt = dwChunkLength;
if ( dwChunkLength < sizeof(WAVEFORMATEX) )
......@@ -149,8 +205,9 @@ static HRESULT CWavParseImpl_InitWAV( CParserImpl* pImpl, CWavParseImpl* This )
hr = RIFF_SearchChunk(
pImpl, PARSER_RIFF_OfsFirst,
PARSER_data, &llOfs, &dwChunkLength );
pImpl, (DWORD)0xffffffff,
PARSER_RIFF_OfsFirst, PARSER_data,
&llOfs, &dwChunkLength );
if ( FAILED(hr) )
return hr;
if ( hr != S_OK || dwChunkLength == 0 )
......@@ -195,18 +252,18 @@ static HRESULT CWavParseImpl_InitAU( CParserImpl* pImpl, CWavParseImpl* This )
switch ( datafmt )
{
case 1:
wfx.wFormatTag = 7;
wfx.wFormatTag = WAVE_FORMAT_MULAW;
wfx.nBlockAlign = datachannels;
wfx.wBitsPerSample = 8;
break;
case 2:
wfx.wFormatTag = 1;
wfx.wFormatTag = WAVE_FORMAT_PCM;
wfx.nBlockAlign = datachannels;
wfx.wBitsPerSample = 8;
This->iFmtType = WaveParse_Signed8;
break;
case 3:
wfx.wFormatTag = 1;
wfx.wFormatTag = WAVE_FORMAT_PCM;
wfx.nBlockAlign = datachannels;
wfx.wBitsPerSample = 16;
This->iFmtType = WaveParse_Signed16BE;
......@@ -417,13 +474,36 @@ static HRESULT CWavParseImpl_GetNextRequest( CParserImpl* pImpl, ULONG* pnStream
static HRESULT CWavParseImpl_ProcessSample( CParserImpl* pImpl, ULONG nStreamIndex, LONGLONG llStart, LONG lLength, IMediaSample* pSample )
{
CWavParseImpl* This = (CWavParseImpl*)pImpl->m_pUserData;
BYTE* pData;
LONG lActLen;
HRESULT hr;
TRACE("(%p)\n",This);
hr = IMediaSample_GetPointer(pSample,&pData);
if ( FAILED(hr) )
return hr;
lActLen = (LONG)IMediaSample_GetActualDataLength(pSample);
if ( lActLen != lLength )
return E_FAIL;
switch ( This->iFmtType )
{
case WaveParse_Native:
break;
case WaveParse_Signed8:
AUDIOUTL_ChangeSign8(pData,lActLen);
break;
case WaveParse_Signed16BE:
AUDIOUTL_ByteSwap(pData,lActLen);
break;
case WaveParse_Unsigned16LE:
AUDIOUTL_ChangeSign16LE(pData,lActLen);
break;
case WaveParse_Unsigned16BE:
AUDIOUTL_ChangeSign16BE(pData,lActLen);
AUDIOUTL_ByteSwap(pData,lActLen);
break;
default:
FIXME("(%p) - %d not implemented\n", This, This->iFmtType );
return E_FAIL;
......
#ifndef __WINE_AMVIDEO_H_
#define __WINE_AMVIDEO_H_
#include "ole2.h"
#include "ddraw.h"
......
#ifndef __WINE_CONTROL_H_
#define __WINE_CONTROL_H_
#include "ole2.h"
/* forward decls. */
typedef struct IAMCollection IAMCollection;
......
......@@ -10,7 +10,10 @@
#ifndef __WINE_STRMIF_H_
#define __WINE_STRMIF_H_
#include "ole2.h"
#include "wine/obj_base.h"
#include "wine/obj_misc.h"
#include "wine/obj_storage.h"
#include "wine/obj_moniker.h"
#include "wine/obj_oleaut.h"
#include "wine/obj_property.h"
#include "wine/obj_ksproperty.h"
......
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