2 * Implements QuickTime Video Decompressor.
6 * Copyright (C) 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"
44 static const WCHAR QTDec_FilterName
[] =
45 {'Q','u','i','c','k','T','i','m','e',' ','D','e','c','o','m','p','r','e','s','s','o','r',0};
47 typedef struct CQTDecImpl
49 AM_MEDIA_TYPE
* m_pmtConv
;
53 /***************************************************************************
59 static void QTDec_FreeOutTypes(CQTDecImpl
* This
)
63 if ( This
->m_pmtConv
== NULL
)
66 TRACE("cConv = %lu\n",This
->m_cConv
);
67 for ( i
= 0; i
< This
->m_cConv
; i
++ )
69 QUARTZ_MediaType_Free(&This
->m_pmtConv
[i
]);
71 QUARTZ_FreeMem(This
->m_pmtConv
);
72 This
->m_pmtConv
= NULL
;
77 static HRESULT
QTDec_Init( CTransformBaseImpl
* pImpl
)
79 CQTDecImpl
* This
= pImpl
->m_pUserData
;
84 This
= (CQTDecImpl
*)QUARTZ_AllocMem( sizeof(CQTDecImpl
) );
87 ZeroMemory( This
, sizeof(CQTDecImpl
) );
88 pImpl
->m_pUserData
= This
;
90 This
->m_pmtConv
= NULL
;
96 static HRESULT
QTDec_Cleanup( CTransformBaseImpl
* pImpl
)
98 CQTDecImpl
* This
= pImpl
->m_pUserData
;
103 QTDec_FreeOutTypes(This
);
105 QUARTZ_FreeMem( This
);
106 pImpl
->m_pUserData
= NULL
;
111 static HRESULT
QTDec_CheckMediaType( CTransformBaseImpl
* pImpl
, const AM_MEDIA_TYPE
* pmtIn
, const AM_MEDIA_TYPE
* pmtOut
)
113 CQTDecImpl
* This
= pImpl
->m_pUserData
;
115 WARN("(%p) stub\n",This
);
123 static HRESULT
QTDec_GetOutputTypes( CTransformBaseImpl
* pImpl
, const AM_MEDIA_TYPE
* pmtIn
, const AM_MEDIA_TYPE
** ppmtAcceptTypes
, ULONG
* pcAcceptTypes
)
125 CQTDecImpl
* This
= pImpl
->m_pUserData
;
128 FIXME("(%p)\n",This
);
133 hr
= QTDec_CheckMediaType( pImpl
, pmtIn
, NULL
);
137 QTDec_FreeOutTypes(This
);
139 *ppmtAcceptTypes
= This
->m_pmtConv
;
140 *pcAcceptTypes
= This
->m_cConv
;
145 static HRESULT
QTDec_GetAllocProp( CTransformBaseImpl
* pImpl
, const AM_MEDIA_TYPE
* pmtIn
, const AM_MEDIA_TYPE
* pmtOut
, ALLOCATOR_PROPERTIES
* pProp
, BOOL
* pbTransInPlace
, BOOL
* pbTryToReuseSample
)
147 CQTDecImpl
* This
= pImpl
->m_pUserData
;
150 FIXME("(%p)\n",This
);
155 hr
= QTDec_CheckMediaType( pImpl
, pmtIn
, NULL
);
162 static HRESULT
QTDec_BeginTransform( CTransformBaseImpl
* pImpl
, const AM_MEDIA_TYPE
* pmtIn
, const AM_MEDIA_TYPE
* pmtOut
, BOOL bReuseSample
)
164 CQTDecImpl
* This
= pImpl
->m_pUserData
;
167 FIXME("(%p)\n",This
);
172 hr
= QTDec_CheckMediaType( pImpl
, pmtIn
, NULL
);
179 static HRESULT
QTDec_Transform( CTransformBaseImpl
* pImpl
, IMediaSample
* pSampIn
, IMediaSample
* pSampOut
)
181 CQTDecImpl
* This
= pImpl
->m_pUserData
;
182 BYTE
* pDataIn
= NULL
;
183 BYTE
* pDataOut
= NULL
;
186 FIXME("(%p)\n",This
);
191 hr
= IMediaSample_GetPointer( pSampIn
, &pDataIn
);
194 hr
= IMediaSample_GetPointer( pSampOut
, &pDataOut
);
201 static HRESULT
QTDec_EndTransform( CTransformBaseImpl
* pImpl
)
203 CQTDecImpl
* This
= pImpl
->m_pUserData
;
212 static const TransformBaseHandlers transhandlers
=
216 QTDec_CheckMediaType
,
217 QTDec_GetOutputTypes
,
219 QTDec_BeginTransform
,
225 HRESULT
QUARTZ_CreateQuickTimeDecompressor(IUnknown
* punkOuter
,void** ppobj
)
227 return QUARTZ_CreateTransformBase(
229 &CLSID_quartzQuickTimeDecompressor
,