Added a framework for testing CreateProcess and a few tests.
[wine] / dlls / quartz / midparse.c
1 /*
2  * Implements MIDI Parser.
3  *
4  *      FIXME - stub
5  *      FIXME - no seeking
6  *
7  * Copyright (C) Hidenori TAKESHIMA <hidenori@a2.ctktv.ne.jp>
8  *
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.
13  *
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.
18  *
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
22  */
23
24 #include "config.h"
25
26 #include "windef.h"
27 #include "winbase.h"
28 #include "wingdi.h"
29 #include "winuser.h"
30 #include "mmsystem.h"
31 #include "vfw.h"
32 #include "winerror.h"
33 #include "strmif.h"
34 #include "control.h"
35 #include "vfwmsgs.h"
36 #include "amvideo.h"
37 #include "uuids.h"
38
39
40 #include "wine/debug.h"
41 WINE_DEFAULT_DEBUG_CHANNEL(quartz);
42
43 #include "quartz_private.h"
44 #include "parser.h"
45 #include "mtype.h"
46
47
48
49 static const WCHAR QUARTZ_MIDIParser_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_MIDIParserInPin_Name[] =
52 { 'I','n',0 };
53 static const WCHAR QUARTZ_MIDIParserOutPin_Name[] =
54 { 'O','u','t',0 };
55
56
57 /****************************************************************************
58  *
59  *      CMIDIParseImpl
60  */
61
62
63 typedef struct CMIDIParseImpl CMIDIParseImpl;
64
65 struct CMIDIParseImpl
66 {
67 };
68
69
70 static HRESULT CMIDIParseImpl_InitParser( CParserImpl* pImpl, ULONG* pcStreams )
71 {
72         WARN("(%p,%p) stub\n",pImpl,pcStreams);
73
74         return E_NOTIMPL;
75 }
76
77 static HRESULT CMIDIParseImpl_UninitParser( CParserImpl* pImpl )
78 {
79         CMIDIParseImpl* This = (CMIDIParseImpl*)pImpl->m_pUserData;
80
81         TRACE("(%p)\n",This);
82
83         if ( This == NULL )
84                 return NOERROR;
85
86         /* destruct */
87
88         QUARTZ_FreeMem( This );
89         pImpl->m_pUserData = NULL;
90
91         return NOERROR;
92 }
93
94 static LPCWSTR CMIDIParseImpl_GetOutPinName( CParserImpl* pImpl, ULONG nStreamIndex )
95 {
96         CMIDIParseImpl* This = (CMIDIParseImpl*)pImpl->m_pUserData;
97
98         TRACE("(%p,%lu)\n",This,nStreamIndex);
99
100         return QUARTZ_MIDIParserOutPin_Name;
101 }
102
103 static HRESULT CMIDIParseImpl_GetStreamType( CParserImpl* pImpl, ULONG nStreamIndex, AM_MEDIA_TYPE* pmt )
104 {
105         CMIDIParseImpl* This = (CMIDIParseImpl*)pImpl->m_pUserData;
106
107         FIXME("(%p) stub\n",This);
108
109         return E_NOTIMPL;
110 }
111
112 static HRESULT CMIDIParseImpl_CheckStreamType( CParserImpl* pImpl, ULONG nStreamIndex, const AM_MEDIA_TYPE* pmt )
113 {
114         CMIDIParseImpl* This = (CMIDIParseImpl*)pImpl->m_pUserData;
115
116         FIXME("(%p) stub\n",This);
117
118         return E_NOTIMPL;
119 }
120
121 static HRESULT CMIDIParseImpl_GetAllocProp( CParserImpl* pImpl, ALLOCATOR_PROPERTIES* pReqProp )
122 {
123         CMIDIParseImpl* This = (CMIDIParseImpl*)pImpl->m_pUserData;
124
125         FIXME("(%p,%p) stub\n",This,pReqProp);
126         if ( This == NULL )
127                 return E_UNEXPECTED;
128
129         return E_NOTIMPL;
130 }
131
132 static HRESULT CMIDIParseImpl_GetNextRequest( CParserImpl* pImpl, ULONG* pnStreamIndex, LONGLONG* pllStart, LONG* plLength, REFERENCE_TIME* prtStart, REFERENCE_TIME* prtStop, DWORD* pdwSampleFlags )
133 {
134         CMIDIParseImpl* This = (CMIDIParseImpl*)pImpl->m_pUserData;
135
136         FIXME("(%p) stub\n",This);
137
138         if ( This == NULL )
139                 return E_UNEXPECTED;
140
141         return E_NOTIMPL;
142 }
143
144 static HRESULT CMIDIParseImpl_ProcessSample( CParserImpl* pImpl, ULONG nStreamIndex, LONGLONG llStart, LONG lLength, IMediaSample* pSample )
145 {
146         CMIDIParseImpl* This = (CMIDIParseImpl*)pImpl->m_pUserData;
147
148         FIXME("(%p,%lu,%ld,%ld,%p)\n",This,nStreamIndex,(long)llStart,lLength,pSample);
149
150         if ( This == NULL )
151                 return E_UNEXPECTED;
152
153         return E_NOTIMPL;
154 }
155
156 static const struct ParserHandlers CMIDIParseImpl_Handlers =
157 {
158         CMIDIParseImpl_InitParser,
159         CMIDIParseImpl_UninitParser,
160         CMIDIParseImpl_GetOutPinName,
161         CMIDIParseImpl_GetStreamType,
162         CMIDIParseImpl_CheckStreamType,
163         CMIDIParseImpl_GetAllocProp,
164         CMIDIParseImpl_GetNextRequest,
165         CMIDIParseImpl_ProcessSample,
166
167         /* for IQualityControl */
168         NULL, /* pQualityNotify */
169
170         /* for seeking */
171         NULL, /* pGetSeekingCaps */
172         NULL, /* pIsTimeFormatSupported */
173         NULL, /* pGetCurPos */
174         NULL, /* pSetCurPos */
175         NULL, /* pGetDuration */
176         NULL, /* pGetStopPos */
177         NULL, /* pSetStopPos */
178         NULL, /* pGetPreroll */
179 };
180
181 HRESULT QUARTZ_CreateMIDIParser(IUnknown* punkOuter,void** ppobj)
182 {
183         return QUARTZ_CreateParser(
184                 punkOuter,ppobj,
185                 &CLSID_quartzMIDIParser,
186                 QUARTZ_MIDIParser_Name,
187                 QUARTZ_MIDIParserInPin_Name,
188                 &CMIDIParseImpl_Handlers );
189 }
190
191