2 * Implements QuickTime Parser(Splitter).
7 * Copyright (C) Hidenori TAKESHIMA <hidenori@a2.ctktv.ne.jp>
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation; either
12 * version 2.1 of the License, or (at your option) any later version.
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this library; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
40 #include "wine/debug.h"
41 WINE_DEFAULT_DEBUG_CHANNEL(quartz);
43 #include "quartz_private.h"
49 static const WCHAR QUARTZ_QTParser_Name[] =
50 { 'Q','u','i','c','k','T','i','m','e',' ','M','o','v','i','e',' ','P','a','r','s','e','r',0 };
51 static const WCHAR QUARTZ_QTParserInPin_Name[] =
53 static const WCHAR QUARTZ_QTParserOutPin_Basename[] =
54 { 'S','t','r','e','a','m',0 };
56 #define WINE_QUARTZ_QTPINNAME_MAX 64
58 /****************************************************************************
64 typedef struct CQTParseImpl CQTParseImpl;
65 typedef struct CQTParseStream CQTParseStream;
69 CQTParseStream* pStreamsBuf;
71 WCHAR wchWork[ WINE_QUARTZ_QTPINNAME_MAX ];
80 static HRESULT CQTParseImpl_InitParser( CParserImpl* pImpl, ULONG* pcStreams )
82 WARN("(%p,%p) stub\n",pImpl,pcStreams);
87 static HRESULT CQTParseImpl_UninitParser( CParserImpl* pImpl )
89 CQTParseImpl* This = (CQTParseImpl*)pImpl->m_pUserData;
98 QUARTZ_FreeMem( This );
99 pImpl->m_pUserData = NULL;
104 static LPCWSTR CQTParseImpl_GetOutPinName( CParserImpl* pImpl, ULONG nStreamIndex )
106 CQTParseImpl* This = (CQTParseImpl*)pImpl->m_pUserData;
109 TRACE("(%p,%lu)\n",This,nStreamIndex);
111 if ( This == NULL /*|| nStreamIndex >= This->avih.dwStreams*/ )
114 wlen = lstrlenW(QUARTZ_QTParserOutPin_Basename);
115 memcpy( This->wchWork, QUARTZ_QTParserOutPin_Basename, sizeof(WCHAR)*wlen );
116 This->wchWork[ wlen ] = (nStreamIndex/10) + '0';
117 This->wchWork[ wlen+1 ] = (nStreamIndex%10) + '0';
118 This->wchWork[ wlen+2 ] = 0;
120 return This->wchWork;
123 static HRESULT CQTParseImpl_GetStreamType( CParserImpl* pImpl, ULONG nStreamIndex, AM_MEDIA_TYPE* pmt )
125 CQTParseImpl* This = (CQTParseImpl*)pImpl->m_pUserData;
127 FIXME("(%p) stub\n",This);
132 static HRESULT CQTParseImpl_CheckStreamType( CParserImpl* pImpl, ULONG nStreamIndex, const AM_MEDIA_TYPE* pmt )
134 CQTParseImpl* This = (CQTParseImpl*)pImpl->m_pUserData;
136 FIXME("(%p) stub\n",This);
141 static HRESULT CQTParseImpl_GetAllocProp( CParserImpl* pImpl, ALLOCATOR_PROPERTIES* pReqProp )
143 CQTParseImpl* This = (CQTParseImpl*)pImpl->m_pUserData;
145 FIXME("(%p,%p) stub\n",This,pReqProp);
152 static HRESULT CQTParseImpl_GetNextRequest( CParserImpl* pImpl, ULONG* pnStreamIndex, LONGLONG* pllStart, LONG* plLength, REFERENCE_TIME* prtStart, REFERENCE_TIME* prtStop, DWORD* pdwSampleFlags )
154 CQTParseImpl* This = (CQTParseImpl*)pImpl->m_pUserData;
156 FIXME("(%p) stub\n",This);
164 static HRESULT CQTParseImpl_ProcessSample( CParserImpl* pImpl, ULONG nStreamIndex, LONGLONG llStart, LONG lLength, IMediaSample* pSample )
166 CQTParseImpl* This = (CQTParseImpl*)pImpl->m_pUserData;
168 FIXME("(%p,%lu,%ld,%ld,%p)\n",This,nStreamIndex,(long)llStart,lLength,pSample);
176 static const struct ParserHandlers CQTParseImpl_Handlers =
178 CQTParseImpl_InitParser,
179 CQTParseImpl_UninitParser,
180 CQTParseImpl_GetOutPinName,
181 CQTParseImpl_GetStreamType,
182 CQTParseImpl_CheckStreamType,
183 CQTParseImpl_GetAllocProp,
184 CQTParseImpl_GetNextRequest,
185 CQTParseImpl_ProcessSample,
187 /* for IQualityControl */
188 NULL, /* pQualityNotify */
191 NULL, /* pGetSeekingCaps */
192 NULL, /* pIsTimeFormatSupported */
193 NULL, /* pGetCurPos */
194 NULL, /* pSetCurPos */
195 NULL, /* pGetDuration */
196 NULL, /* pGetStopPos */
197 NULL, /* pSetStopPos */
198 NULL, /* pGetPreroll */
201 HRESULT QUARTZ_CreateQuickTimeMovieParser(IUnknown* punkOuter,void** ppobj)
203 return QUARTZ_CreateParser(
205 &CLSID_quartzQuickTimeMovieParser,
206 QUARTZ_QTParser_Name,
207 QUARTZ_QTParserInPin_Name,
208 &CQTParseImpl_Handlers );