2 * Implements ACM Wrapper(CLSID_ACMWrapper).
6 * Copyright (C) 2002 Hidenori TAKESHIMA <hidenori@a2.ctktv.ne.jp>
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
38 #include "wine/debug.h"
39 WINE_DEFAULT_DEBUG_CHANNEL(quartz);
41 #include "quartz_private.h"
45 static const WCHAR ACMWrapper_FilterName[] =
46 {'A','C','M',' ','W','r','a','p','p','e','r',0};
49 typedef struct CACMWrapperImpl
54 /***************************************************************************
56 * CACMWrapperImpl methods
60 static void ACMWrapper_Close( CACMWrapperImpl* This )
62 if ( This->has != (HACMSTREAM)NULL )
64 acmStreamReset( This->has, 0 );
65 acmStreamClose( This->has, 0 );
66 This->has = (HACMSTREAM)NULL;
70 static HRESULT ACMWrapper_Init( CTransformBaseImpl* pImpl )
72 CACMWrapperImpl* This = pImpl->m_pUserData;
79 This = (CACMWrapperImpl*)QUARTZ_AllocMem( sizeof(CACMWrapperImpl) );
82 ZeroMemory( This, sizeof(CACMWrapperImpl) );
83 pImpl->m_pUserData = This;
86 This->has = (HACMSTREAM)NULL;
91 static HRESULT ACMWrapper_Cleanup( CTransformBaseImpl* pImpl )
93 CACMWrapperImpl* This = pImpl->m_pUserData;
101 ACMWrapper_Close( This );
103 QUARTZ_FreeMem( This );
104 pImpl->m_pUserData = NULL;
109 static HRESULT ACMWrapper_CheckMediaType( CTransformBaseImpl* pImpl, const AM_MEDIA_TYPE* pmtIn, const AM_MEDIA_TYPE* pmtOut )
111 CACMWrapperImpl* This = pImpl->m_pUserData;
113 FIXME("(%p)\n",This);
120 static HRESULT ACMWrapper_GetOutputTypes( CTransformBaseImpl* pImpl, const AM_MEDIA_TYPE* pmtIn, const AM_MEDIA_TYPE** ppmtAcceptTypes, ULONG* pcAcceptTypes )
122 CACMWrapperImpl* This = pImpl->m_pUserData;
125 FIXME("(%p)\n",This);
126 hr = ACMWrapper_CheckMediaType( pImpl, pmtIn, NULL );
133 static HRESULT ACMWrapper_GetAllocProp( CTransformBaseImpl* pImpl, const AM_MEDIA_TYPE* pmtIn, const AM_MEDIA_TYPE* pmtOut, ALLOCATOR_PROPERTIES* pProp, BOOL* pbTransInPlace, BOOL* pbTryToReuseSample )
135 CACMWrapperImpl* This = pImpl->m_pUserData;
138 FIXME("(%p)\n",This);
143 hr = ACMWrapper_CheckMediaType( pImpl, pmtIn, pmtOut );
147 *pbTransInPlace = FALSE;
148 *pbTryToReuseSample = FALSE;
153 static HRESULT ACMWrapper_BeginTransform( CTransformBaseImpl* pImpl, const AM_MEDIA_TYPE* pmtIn, const AM_MEDIA_TYPE* pmtOut, BOOL bReuseSample )
155 CACMWrapperImpl* This = pImpl->m_pUserData;
157 FIXME("(%p,%p,%p,%d)\n",This,pmtIn,pmtOut,bReuseSample);
165 static HRESULT ACMWrapper_ProcessReceive( CTransformBaseImpl* pImpl, IMediaSample* pSampIn )
167 CACMWrapperImpl* This = pImpl->m_pUserData;
168 BYTE* pDataIn = NULL;
172 FIXME("(%p)\n",This);
177 hr = IMediaSample_GetPointer( pSampIn, &pDataIn );
180 lDataInLen = IMediaSample_GetActualDataLength( pSampIn );
185 static HRESULT ACMWrapper_EndTransform( CTransformBaseImpl* pImpl )
187 CACMWrapperImpl* This = pImpl->m_pUserData;
189 TRACE("(%p)\n",This);
194 ACMWrapper_Close( This );
199 static const TransformBaseHandlers transhandlers =
203 ACMWrapper_CheckMediaType,
204 ACMWrapper_GetOutputTypes,
205 ACMWrapper_GetAllocProp,
206 ACMWrapper_BeginTransform,
207 ACMWrapper_ProcessReceive,
209 ACMWrapper_EndTransform,
212 HRESULT QUARTZ_CreateACMWrapper(IUnknown* punkOuter,void** ppobj)
214 return QUARTZ_CreateTransformBase(
217 ACMWrapper_FilterName,