Hidenori Takeshima | 425acfd | 2002-04-08 20:13:54 +0000 | [diff] [blame^] | 1 | /* |
| 2 | * Implements MPEG Audio Decoder(CLSID_CMpegAudioCodec) |
| 3 | * |
| 4 | * FIXME - what library can we use? SMPEG?? |
| 5 | * |
| 6 | * FIXME - stub |
| 7 | * |
| 8 | * Copyright (C) Hidenori TAKESHIMA <hidenori@a2.ctktv.ne.jp> |
| 9 | * |
| 10 | * This library is free software; you can redistribute it and/or |
| 11 | * modify it under the terms of the GNU Lesser General Public |
| 12 | * License as published by the Free Software Foundation; either |
| 13 | * version 2.1 of the License, or (at your option) any later version. |
| 14 | * |
| 15 | * This library is distributed in the hope that it will be useful, |
| 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 18 | * Lesser General Public License for more details. |
| 19 | * |
| 20 | * You should have received a copy of the GNU Lesser General Public |
| 21 | * License along with this library; if not, write to the Free Software |
| 22 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 23 | */ |
| 24 | |
| 25 | #include "config.h" |
| 26 | |
| 27 | #include "windef.h" |
| 28 | #include "winbase.h" |
| 29 | #include "wingdi.h" |
| 30 | #include "winuser.h" |
| 31 | #include "winerror.h" |
| 32 | #include "strmif.h" |
| 33 | #include "control.h" |
| 34 | #include "amvideo.h" |
| 35 | #include "vfwmsgs.h" |
| 36 | #include "uuids.h" |
| 37 | |
| 38 | #include "wine/debug.h" |
| 39 | WINE_DEFAULT_DEBUG_CHANNEL(quartz); |
| 40 | |
| 41 | #include "quartz_private.h" |
| 42 | #include "xform.h" |
| 43 | #include "mtype.h" |
| 44 | |
| 45 | static const WCHAR CMPEGAudioDecoderImpl_FilterName[] = |
| 46 | {'M','P','E','G',' ','A','u','d','i','o',' ','D','e','c','o','d','e','r',0}; |
| 47 | |
| 48 | |
| 49 | typedef struct CMPEGAudioDecoderImpl |
| 50 | { |
| 51 | int dummy; |
| 52 | } CMPEGAudioDecoderImpl; |
| 53 | |
| 54 | |
| 55 | /*************************************************************************** |
| 56 | * |
| 57 | * CMPEGAudioDecoderImpl methods |
| 58 | * |
| 59 | */ |
| 60 | |
| 61 | static HRESULT CMPEGAudioDecoderImpl_Init( CTransformBaseImpl* pImpl ) |
| 62 | { |
| 63 | CMPEGAudioDecoderImpl* This = pImpl->m_pUserData; |
| 64 | |
| 65 | TRACE("(%p)\n",This); |
| 66 | |
| 67 | if ( This != NULL ) |
| 68 | return NOERROR; |
| 69 | |
| 70 | This = (CMPEGAudioDecoderImpl*)QUARTZ_AllocMem( sizeof(CMPEGAudioDecoderImpl) ); |
| 71 | if ( This == NULL ) |
| 72 | return E_OUTOFMEMORY; |
| 73 | ZeroMemory( This, sizeof(CMPEGAudioDecoderImpl) ); |
| 74 | pImpl->m_pUserData = This; |
| 75 | |
| 76 | /* construct */ |
| 77 | |
| 78 | return S_OK; |
| 79 | } |
| 80 | |
| 81 | static HRESULT CMPEGAudioDecoderImpl_Cleanup( CTransformBaseImpl* pImpl ) |
| 82 | { |
| 83 | CMPEGAudioDecoderImpl* This = pImpl->m_pUserData; |
| 84 | |
| 85 | TRACE("(%p)\n",This); |
| 86 | |
| 87 | if ( This == NULL ) |
| 88 | return S_OK; |
| 89 | |
| 90 | /* destruct */ |
| 91 | |
| 92 | QUARTZ_FreeMem( This ); |
| 93 | pImpl->m_pUserData = NULL; |
| 94 | |
| 95 | return S_OK; |
| 96 | } |
| 97 | |
| 98 | static HRESULT CMPEGAudioDecoderImpl_CheckMediaType( CTransformBaseImpl* pImpl, const AM_MEDIA_TYPE* pmtIn, const AM_MEDIA_TYPE* pmtOut ) |
| 99 | { |
| 100 | CMPEGAudioDecoderImpl* This = pImpl->m_pUserData; |
| 101 | |
| 102 | FIXME("(%p)\n",This); |
| 103 | if ( This == NULL ) |
| 104 | return E_UNEXPECTED; |
| 105 | |
| 106 | return E_NOTIMPL; |
| 107 | } |
| 108 | |
| 109 | static HRESULT CMPEGAudioDecoderImpl_GetOutputTypes( CTransformBaseImpl* pImpl, const AM_MEDIA_TYPE* pmtIn, const AM_MEDIA_TYPE** ppmtAcceptTypes, ULONG* pcAcceptTypes ) |
| 110 | { |
| 111 | CMPEGAudioDecoderImpl* This = pImpl->m_pUserData; |
| 112 | |
| 113 | FIXME("(%p)\n",This); |
| 114 | if ( This == NULL ) |
| 115 | return E_UNEXPECTED; |
| 116 | |
| 117 | return E_NOTIMPL; |
| 118 | } |
| 119 | |
| 120 | static HRESULT CMPEGAudioDecoderImpl_GetAllocProp( CTransformBaseImpl* pImpl, const AM_MEDIA_TYPE* pmtIn, const AM_MEDIA_TYPE* pmtOut, ALLOCATOR_PROPERTIES* pProp, BOOL* pbTransInPlace, BOOL* pbTryToReuseSample ) |
| 121 | { |
| 122 | CMPEGAudioDecoderImpl* This = pImpl->m_pUserData; |
| 123 | |
| 124 | FIXME("(%p)\n",This); |
| 125 | if ( This == NULL ) |
| 126 | return E_UNEXPECTED; |
| 127 | |
| 128 | return E_NOTIMPL; |
| 129 | } |
| 130 | |
| 131 | static HRESULT CMPEGAudioDecoderImpl_BeginTransform( CTransformBaseImpl* pImpl, const AM_MEDIA_TYPE* pmtIn, const AM_MEDIA_TYPE* pmtOut, BOOL bReuseSample ) |
| 132 | { |
| 133 | CMPEGAudioDecoderImpl* This = pImpl->m_pUserData; |
| 134 | |
| 135 | FIXME("(%p,%p,%p,%d)\n",This,pmtIn,pmtOut,bReuseSample); |
| 136 | if ( This == NULL ) |
| 137 | return E_UNEXPECTED; |
| 138 | |
| 139 | return E_NOTIMPL; |
| 140 | } |
| 141 | |
| 142 | static HRESULT CMPEGAudioDecoderImpl_ProcessReceive( CTransformBaseImpl* pImpl, IMediaSample* pSampIn ) |
| 143 | { |
| 144 | CMPEGAudioDecoderImpl* This = pImpl->m_pUserData; |
| 145 | |
| 146 | FIXME("(%p)\n",This); |
| 147 | if ( This == NULL ) |
| 148 | return E_UNEXPECTED; |
| 149 | |
| 150 | return E_NOTIMPL; |
| 151 | } |
| 152 | |
| 153 | static HRESULT CMPEGAudioDecoderImpl_EndTransform( CTransformBaseImpl* pImpl ) |
| 154 | { |
| 155 | CMPEGAudioDecoderImpl* This = pImpl->m_pUserData; |
| 156 | |
| 157 | FIXME("(%p)\n",This); |
| 158 | if ( This == NULL ) |
| 159 | return E_UNEXPECTED; |
| 160 | |
| 161 | return E_NOTIMPL; |
| 162 | } |
| 163 | |
| 164 | static const TransformBaseHandlers transhandlers = |
| 165 | { |
| 166 | CMPEGAudioDecoderImpl_Init, |
| 167 | CMPEGAudioDecoderImpl_Cleanup, |
| 168 | CMPEGAudioDecoderImpl_CheckMediaType, |
| 169 | CMPEGAudioDecoderImpl_GetOutputTypes, |
| 170 | CMPEGAudioDecoderImpl_GetAllocProp, |
| 171 | CMPEGAudioDecoderImpl_BeginTransform, |
| 172 | CMPEGAudioDecoderImpl_ProcessReceive, |
| 173 | NULL, |
| 174 | CMPEGAudioDecoderImpl_EndTransform, |
| 175 | }; |
| 176 | |
| 177 | HRESULT QUARTZ_CreateCMpegAudioCodec(IUnknown* punkOuter,void** ppobj) |
| 178 | { |
| 179 | return QUARTZ_CreateTransformBase( |
| 180 | punkOuter,ppobj, |
| 181 | &CLSID_CMpegAudioCodec, |
| 182 | CMPEGAudioDecoderImpl_FilterName, |
| 183 | NULL, NULL, |
| 184 | &transhandlers ); |
| 185 | } |
| 186 | |
| 187 | |