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

Added some stubs.

Started implementing MPEG parser.
parent 5f5a05fb
...@@ -636,8 +636,8 @@ qcap/qcap.dll$(DLLEXT): dummy ntdll.dll$(DLLEXT) ...@@ -636,8 +636,8 @@ qcap/qcap.dll$(DLLEXT): dummy ntdll.dll$(DLLEXT)
@cd qcap && $(MAKE) qcap.dll$(DLLEXT) @cd qcap && $(MAKE) qcap.dll$(DLLEXT)
quartz/quartz.dll$(DLLEXT): dummy oleaut32.dll$(DLLEXT) ole32.dll$(DLLEXT) \ quartz/quartz.dll$(DLLEXT): dummy oleaut32.dll$(DLLEXT) ole32.dll$(DLLEXT) \
msvfw32.dll$(DLLEXT) winmm.dll$(DLLEXT) user32.dll$(DLLEXT) gdi32.dll$(DLLEXT) \ msvfw32.dll$(DLLEXT) msacm32.dll$(DLLEXT) winmm.dll$(DLLEXT) user32.dll$(DLLEXT) \
advapi32.dll$(DLLEXT) kernel32.dll$(DLLEXT) ntdll.dll$(DLLEXT) gdi32.dll$(DLLEXT) advapi32.dll$(DLLEXT) kernel32.dll$(DLLEXT) ntdll.dll$(DLLEXT)
@cd quartz && $(MAKE) quartz.dll$(DLLEXT) @cd quartz && $(MAKE) quartz.dll$(DLLEXT)
rasapi32/rasapi32.dll$(DLLEXT): dummy kernel32.dll$(DLLEXT) ntdll.dll$(DLLEXT) rasapi32/rasapi32.dll$(DLLEXT): dummy kernel32.dll$(DLLEXT) ntdll.dll$(DLLEXT)
......
...@@ -9,6 +9,7 @@ LDDLLFLAGS = @LDDLLFLAGS@ ...@@ -9,6 +9,7 @@ LDDLLFLAGS = @LDDLLFLAGS@
SYMBOLFILE = $(MODULE).tmp.o SYMBOLFILE = $(MODULE).tmp.o
C_SRCS = \ C_SRCS = \
acmwrap.c \
amundoc.c \ amundoc.c \
asyncsrc.c \ asyncsrc.c \
audioutl.c \ audioutl.c \
...@@ -35,6 +36,7 @@ C_SRCS = \ ...@@ -35,6 +36,7 @@ C_SRCS = \
iunk.c \ iunk.c \
main.c \ main.c \
memalloc.c \ memalloc.c \
mpgparse.c \
mtype.c \ mtype.c \
parser.c \ parser.c \
regsvr.c \ regsvr.c \
......
/*
* Implements ACM Wrapper(CLSID_ACMWrapper).
*
* FIXME - stub
*
* Copyright (C) 2002 Hidenori TAKESHIMA <hidenori@a2.ctktv.ne.jp>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "config.h"
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "winerror.h"
#include "msacm.h"
#include "strmif.h"
#include "control.h"
#include "amvideo.h"
#include "vfwmsgs.h"
#include "uuids.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(quartz);
#include "quartz_private.h"
#include "xform.h"
static const WCHAR ACMWrapper_FilterName[] =
{'A','C','M',' ','W','r','a','p','p','e','r',0};
typedef struct CACMWrapperImpl
{
HACMSTREAM has;
} CACMWrapperImpl;
/***************************************************************************
*
* CACMWrapperImpl methods
*
*/
static void ACMWrapper_Close( CACMWrapperImpl* This )
{
if ( This->has != (HACMSTREAM)NULL )
{
acmStreamReset( This->has, 0 );
acmStreamClose( This->has, 0 );
This->has = (HACMSTREAM)NULL;
}
}
static HRESULT ACMWrapper_Init( CTransformBaseImpl* pImpl )
{
CACMWrapperImpl* This = pImpl->m_pUserData;
TRACE("(%p)\n",This);
if ( This != NULL )
return NOERROR;
This = (CACMWrapperImpl*)QUARTZ_AllocMem( sizeof(CACMWrapperImpl) );
if ( This == NULL )
return E_OUTOFMEMORY;
ZeroMemory( This, sizeof(CACMWrapperImpl) );
pImpl->m_pUserData = This;
/* construct */
This->has = (HACMSTREAM)NULL;
return E_NOTIMPL;
}
static HRESULT ACMWrapper_Cleanup( CTransformBaseImpl* pImpl )
{
CACMWrapperImpl* This = pImpl->m_pUserData;
TRACE("(%p)\n",This);
if ( This == NULL )
return NOERROR;
/* destruct */
ACMWrapper_Close( This );
QUARTZ_FreeMem( This );
pImpl->m_pUserData = NULL;
return S_OK;
}
static HRESULT ACMWrapper_CheckMediaType( CTransformBaseImpl* pImpl, const AM_MEDIA_TYPE* pmtIn, const AM_MEDIA_TYPE* pmtOut )
{
CACMWrapperImpl* This = pImpl->m_pUserData;
FIXME("(%p)\n",This);
if ( This == NULL )
return E_UNEXPECTED;
return E_NOTIMPL;
}
static HRESULT ACMWrapper_GetOutputTypes( CTransformBaseImpl* pImpl, const AM_MEDIA_TYPE* pmtIn, const AM_MEDIA_TYPE** ppmtAcceptTypes, ULONG* pcAcceptTypes )
{
CACMWrapperImpl* This = pImpl->m_pUserData;
HRESULT hr;
FIXME("(%p)\n",This);
hr = ACMWrapper_CheckMediaType( pImpl, pmtIn, NULL );
if ( FAILED(hr) )
return hr;
return E_NOTIMPL;
}
static HRESULT ACMWrapper_GetAllocProp( CTransformBaseImpl* pImpl, const AM_MEDIA_TYPE* pmtIn, const AM_MEDIA_TYPE* pmtOut, ALLOCATOR_PROPERTIES* pProp, BOOL* pbTransInPlace, BOOL* pbTryToReuseSample )
{
CACMWrapperImpl* This = pImpl->m_pUserData;
HRESULT hr;
FIXME("(%p)\n",This);
if ( This == NULL )
return E_UNEXPECTED;
hr = ACMWrapper_CheckMediaType( pImpl, pmtIn, pmtOut );
if ( FAILED(hr) )
return hr;
*pbTransInPlace = FALSE;
*pbTryToReuseSample = FALSE;
return E_NOTIMPL;
}
static HRESULT ACMWrapper_BeginTransform( CTransformBaseImpl* pImpl, const AM_MEDIA_TYPE* pmtIn, const AM_MEDIA_TYPE* pmtOut, BOOL bReuseSample )
{
CACMWrapperImpl* This = pImpl->m_pUserData;
FIXME("(%p,%p,%p,%d)\n",This,pmtIn,pmtOut,bReuseSample);
if ( This == NULL )
return E_UNEXPECTED;
return E_NOTIMPL;
}
static HRESULT ACMWrapper_ProcessReceive( CTransformBaseImpl* pImpl, IMediaSample* pSampIn )
{
CACMWrapperImpl* This = pImpl->m_pUserData;
BYTE* pDataIn = NULL;
LONG lDataInLen;
HRESULT hr;
FIXME("(%p)\n",This);
if ( This == NULL )
return E_UNEXPECTED;
hr = IMediaSample_GetPointer( pSampIn, &pDataIn );
if ( FAILED(hr) )
return hr;
lDataInLen = IMediaSample_GetActualDataLength( pSampIn );
return E_NOTIMPL;
}
static HRESULT ACMWrapper_EndTransform( CTransformBaseImpl* pImpl )
{
CACMWrapperImpl* This = pImpl->m_pUserData;
TRACE("(%p)\n",This);
if ( This == NULL )
return E_UNEXPECTED;
ACMWrapper_Close( This );
return S_OK;
}
static const TransformBaseHandlers transhandlers =
{
ACMWrapper_Init,
ACMWrapper_Cleanup,
ACMWrapper_CheckMediaType,
ACMWrapper_GetOutputTypes,
ACMWrapper_GetAllocProp,
ACMWrapper_BeginTransform,
ACMWrapper_ProcessReceive,
NULL,
ACMWrapper_EndTransform,
};
HRESULT QUARTZ_CreateACMWrapper(IUnknown* punkOuter,void** ppobj)
{
return QUARTZ_CreateTransformBase(
punkOuter,ppobj,
&CLSID_ACMWrapper,
ACMWrapper_FilterName,
NULL, NULL,
&transhandlers );
}
/* /*
* Implements AVI Parser(Splitter). * Implements AVI Parser(Splitter).
* *
* FIXME - no seeking
*
* Copyright (C) Hidenori TAKESHIMA <hidenori@a2.ctktv.ne.jp> * Copyright (C) Hidenori TAKESHIMA <hidenori@a2.ctktv.ne.jp>
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
...@@ -79,6 +81,7 @@ struct CAVIParseStream ...@@ -79,6 +81,7 @@ struct CAVIParseStream
DWORD cIndexCur; DWORD cIndexCur;
REFERENCE_TIME rtCur; REFERENCE_TIME rtCur;
REFERENCE_TIME rtInternal; REFERENCE_TIME rtInternal;
BOOL bDataDiscontinuity;
}; };
...@@ -288,6 +291,7 @@ static HRESULT CAVIParseImpl_InitParser( CParserImpl* pImpl, ULONG* pcStreams ) ...@@ -288,6 +291,7 @@ static HRESULT CAVIParseImpl_InitParser( CParserImpl* pImpl, ULONG* pcStreams )
This->pStreamsBuf[nIndex].rtCur = 0; This->pStreamsBuf[nIndex].rtCur = 0;
This->pStreamsBuf[nIndex].rtInternal = 0; This->pStreamsBuf[nIndex].rtInternal = 0;
TRACE("stream %lu - %lu entries\n",nIndex,This->pStreamsBuf[nIndex].cIndexEntries); TRACE("stream %lu - %lu entries\n",nIndex,This->pStreamsBuf[nIndex].cIndexEntries);
This->pStreamsBuf[nIndex].bDataDiscontinuity = TRUE;
} }
QUARTZ_FreeMem(This->pIndexEntriesBuf); QUARTZ_FreeMem(This->pIndexEntriesBuf);
This->pIndexEntriesBuf = pEntriesBuf; This->pIndexEntriesBuf = pEntriesBuf;
...@@ -610,6 +614,11 @@ static HRESULT CAVIParseImpl_GetNextRequest( CParserImpl* pImpl, ULONG* pnStream ...@@ -610,6 +614,11 @@ static HRESULT CAVIParseImpl_GetNextRequest( CParserImpl* pImpl, ULONG* pnStream
*prtStop = rtNext; *prtStop = rtNext;
/* FIXME - is this frame keyframe?? */ /* FIXME - is this frame keyframe?? */
*pdwSampleFlags = AM_SAMPLE_SPLICEPOINT; *pdwSampleFlags = AM_SAMPLE_SPLICEPOINT;
if ( pStream->bDataDiscontinuity )
{
*pdwSampleFlags |= AM_SAMPLE_DATADISCONTINUITY;
pStream->bDataDiscontinuity = FALSE;
}
switch ( pStream->strh.fccType ) switch ( pStream->strh.fccType )
{ {
......
...@@ -187,20 +187,21 @@ static HRESULT WINAPI ...@@ -187,20 +187,21 @@ static HRESULT WINAPI
CBaseFilterImpl_fnGetState(IBaseFilter* iface,DWORD dw,FILTER_STATE* pState) CBaseFilterImpl_fnGetState(IBaseFilter* iface,DWORD dw,FILTER_STATE* pState)
{ {
ICOM_THIS(CBaseFilterImpl,iface); ICOM_THIS(CBaseFilterImpl,iface);
HRESULT hr = S_OK;
TRACE("(%p)->(%p)\n",This,pState); TRACE("(%p)->(%p)\n",This,pState);
if ( pState == NULL ) if ( pState == NULL )
return E_POINTER; return E_POINTER;
/* FIXME - ignore 'intermediate state' now */
EnterCriticalSection( &This->csFilter ); EnterCriticalSection( &This->csFilter );
TRACE("(%p) state = %d\n",This,This->fstate); TRACE("(%p) state = %d\n",This,This->fstate);
*pState = This->fstate; *pState = This->fstate;
if ( This->bIntermediateState )
hr = VFW_S_STATE_INTERMEDIATE;
LeaveCriticalSection( &This->csFilter ); LeaveCriticalSection( &This->csFilter );
return NOERROR; return hr;
} }
static HRESULT WINAPI static HRESULT WINAPI
...@@ -455,6 +456,7 @@ HRESULT CBaseFilterImpl_InitIBaseFilter( ...@@ -455,6 +456,7 @@ HRESULT CBaseFilterImpl_InitIBaseFilter(
This->pClock = NULL; This->pClock = NULL;
This->rtStart = 0; This->rtStart = 0;
This->fstate = State_Stopped; This->fstate = State_Stopped;
This->bIntermediateState = FALSE;
This->cbNameGraph = sizeof(WCHAR) * (lstrlenW(lpwszNameGraph)+1); This->cbNameGraph = sizeof(WCHAR) * (lstrlenW(lpwszNameGraph)+1);
This->pwszNameGraph = (WCHAR*)QUARTZ_AllocMem( This->cbNameGraph ); This->pwszNameGraph = (WCHAR*)QUARTZ_AllocMem( This->cbNameGraph );
......
...@@ -56,6 +56,7 @@ typedef struct CBaseFilterImpl ...@@ -56,6 +56,7 @@ typedef struct CBaseFilterImpl
IReferenceClock* pClock; IReferenceClock* pClock;
REFERENCE_TIME rtStart; REFERENCE_TIME rtStart;
FILTER_STATE fstate; FILTER_STATE fstate;
BOOL bIntermediateState; /* if set, fstate is ignored. */
} CBaseFilterImpl; } CBaseFilterImpl;
struct CBaseFilterHandlers struct CBaseFilterHandlers
......
...@@ -104,6 +104,8 @@ static const QUARTZ_CLASSENTRY QUARTZ_ClassList[] = ...@@ -104,6 +104,8 @@ static const QUARTZ_CLASSENTRY QUARTZ_ClassList[] =
{ &CLSID_VideoRenderer, &QUARTZ_CreateVideoRenderer }, { &CLSID_VideoRenderer, &QUARTZ_CreateVideoRenderer },
{ &CLSID_quartzWaveParser, &QUARTZ_CreateWaveParser }, { &CLSID_quartzWaveParser, &QUARTZ_CreateWaveParser },
{ &CLSID_AviSplitter, &QUARTZ_CreateAVISplitter }, { &CLSID_AviSplitter, &QUARTZ_CreateAVISplitter },
{ &CLSID_MPEG1Splitter, &QUARTZ_CreateMPEG1Splitter },
{ &CLSID_MMSPLITTER, &QUARTZ_CreateMPEG2Splitter },
{ &CLSID_AsyncReader, &QUARTZ_CreateAsyncReader }, { &CLSID_AsyncReader, &QUARTZ_CreateAsyncReader },
{ &CLSID_URLReader, &QUARTZ_CreateURLReader }, { &CLSID_URLReader, &QUARTZ_CreateURLReader },
{ &CLSID_AVIDec, &QUARTZ_CreateAVIDec }, { &CLSID_AVIDec, &QUARTZ_CreateAVIDec },
......
...@@ -172,6 +172,28 @@ static HRESULT CParserImplThread_SendEndOfStream( CParserImpl* This ) ...@@ -172,6 +172,28 @@ static HRESULT CParserImplThread_SendEndOfStream( CParserImpl* This )
return hrRet; return hrRet;
} }
static
void CParserImplThread_MemDecommit( CParserImpl* This )
{
ULONG nIndex;
IMemAllocator* pAlloc;
TRACE("(%p)\n",This);
if ( This->m_pAllocator != NULL )
IMemAllocator_Decommit( This->m_pAllocator );
if ( This->m_ppOutPins != NULL && This->m_cOutStreams > 0 )
{
for ( nIndex = 0; nIndex < This->m_cOutStreams; nIndex++ )
{
pAlloc = This->m_ppOutPins[nIndex]->m_pOutPinAllocator;
if ( pAlloc != NULL )
IMemAllocator_Decommit( pAlloc );
}
}
}
static HRESULT CParserImplThread_SendFlush( CParserImpl* This ) static HRESULT CParserImplThread_SendFlush( CParserImpl* This )
{ {
ULONG nIndex; ULONG nIndex;
...@@ -211,6 +233,19 @@ static void CParserImplThread_ErrorAbort( CParserImpl* This, HRESULT hr ) ...@@ -211,6 +233,19 @@ static void CParserImplThread_ErrorAbort( CParserImpl* This, HRESULT hr )
} }
static static
void CParserImplThread_ResetAllStreams( CParserImpl* This )
{
ULONG nIndex;
if ( This->m_pHandler->pSetCurPos != NULL )
{
for ( nIndex = 0; nIndex < This->m_cOutStreams; nIndex++ )
This->m_pHandler->pSetCurPos(This,
&This->m_guidTimeFormat,nIndex,(LONGLONG)0);
}
}
static
HRESULT CParserImplThread_ProcessNextSample( CParserImpl* This ) HRESULT CParserImplThread_ProcessNextSample( CParserImpl* This )
{ {
IMediaSample* pSample; IMediaSample* pSample;
...@@ -233,6 +268,11 @@ HRESULT CParserImplThread_ProcessNextSample( CParserImpl* This ) ...@@ -233,6 +268,11 @@ HRESULT CParserImplThread_ProcessNextSample( CParserImpl* This )
CParserImplThread_ClearAllRequests(This); CParserImplThread_ClearAllRequests(This);
CParserImplThread_SendFlush(This); CParserImplThread_SendFlush(This);
CParserImplThread_SendEndOfStream(This); CParserImplThread_SendEndOfStream(This);
This->m_bSendEOS = FALSE;
CParserImplThread_ResetAllStreams(This);
CParserImplThread_MemDecommit(This);
TRACE("(%p) exit thread\n",This); TRACE("(%p) exit thread\n",This);
return S_FALSE; return S_FALSE;
case QUARTZ_MSG_SEEK: case QUARTZ_MSG_SEEK:
...@@ -607,28 +647,6 @@ HRESULT CParserImpl_MemCommit( CParserImpl* This ) ...@@ -607,28 +647,6 @@ HRESULT CParserImpl_MemCommit( CParserImpl* This )
} }
static static
void CParserImpl_MemDecommit( CParserImpl* This )
{
ULONG nIndex;
IMemAllocator* pAlloc;
TRACE("(%p)\n",This);
if ( This->m_pAllocator != NULL )
IMemAllocator_Decommit( This->m_pAllocator );
if ( This->m_ppOutPins != NULL && This->m_cOutStreams > 0 )
{
for ( nIndex = 0; nIndex < This->m_cOutStreams; nIndex++ )
{
pAlloc = This->m_ppOutPins[nIndex]->m_pOutPinAllocator;
if ( pAlloc != NULL )
IMemAllocator_Decommit( pAlloc );
}
}
}
static
HRESULT CParserImpl_GetPreferredTimeFormat( CParserImpl* This, GUID* pguidFormat ) HRESULT CParserImpl_GetPreferredTimeFormat( CParserImpl* This, GUID* pguidFormat )
{ {
static const GUID* tryformats[] = static const GUID* tryformats[] =
...@@ -705,20 +723,10 @@ static HRESULT CParserImpl_OnInactive( CBaseFilterImpl* pImpl ) ...@@ -705,20 +723,10 @@ static HRESULT CParserImpl_OnInactive( CBaseFilterImpl* pImpl )
static HRESULT CParserImpl_OnStop( CBaseFilterImpl* pImpl ) static HRESULT CParserImpl_OnStop( CBaseFilterImpl* pImpl )
{ {
CParserImpl_THIS(pImpl,basefilter); CParserImpl_THIS(pImpl,basefilter);
DWORD n;
FIXME( "(%p)\n", This ); FIXME( "(%p)\n", This );
CParserImpl_EndThread(This); CParserImpl_EndThread(This);
CParserImpl_MemDecommit(This);
This->m_bSendEOS = FALSE;
/* reset streams. */
if ( This->m_pHandler->pSetCurPos != NULL )
{
for ( n = 0; n < This->m_cOutStreams; n++ )
This->m_pHandler->pSetCurPos(This,&This->m_guidTimeFormat,n,(LONGLONG)0);
}
return NOERROR; return NOERROR;
} }
......
...@@ -180,6 +180,8 @@ HRESULT QUARTZ_CreateParserOutPin( ...@@ -180,6 +180,8 @@ HRESULT QUARTZ_CreateParserOutPin(
HRESULT QUARTZ_CreateWaveParser(IUnknown* punkOuter,void** ppobj); HRESULT QUARTZ_CreateWaveParser(IUnknown* punkOuter,void** ppobj);
HRESULT QUARTZ_CreateAVISplitter(IUnknown* punkOuter,void** ppobj); HRESULT QUARTZ_CreateAVISplitter(IUnknown* punkOuter,void** ppobj);
HRESULT QUARTZ_CreateMPEG1Splitter(IUnknown* punkOuter,void** ppobj);
HRESULT QUARTZ_CreateMPEG2Splitter(IUnknown* punkOuter,void** ppobj);
HRESULT RIFF_GetNext( HRESULT RIFF_GetNext(
......
...@@ -5,6 +5,7 @@ init QUARTZ_DllMain ...@@ -5,6 +5,7 @@ init QUARTZ_DllMain
import oleaut32.dll import oleaut32.dll
import ole32.dll import ole32.dll
import msvfw32.dll import msvfw32.dll
import msacm32.dll
import winmm.dll import winmm.dll
import user32.dll import user32.dll
import gdi32.dll import gdi32.dll
......
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