2 * Implements dmort APIs.
4 * Copyright (C) Hidenori TAKESHIMA <hidenori@a2.ctktv.ne.jp>
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26 #include "wine/obj_base.h"
30 #include "wine/debug.h"
31 WINE_DEFAULT_DEBUG_CHANNEL(msdmo);
34 HRESULT WINAPI MoCopyMediaType( DMO_MEDIA_TYPE* pmtDst, const DMO_MEDIA_TYPE* pmtSrc )
36 FIXME( "() not tested\n" );
38 memcpy( &pmtDst->majortype, &pmtSrc->majortype, sizeof(GUID) );
39 memcpy( &pmtDst->subtype, &pmtSrc->subtype, sizeof(GUID) );
40 pmtDst->bFixedSizeSamples = pmtSrc->bFixedSizeSamples;
41 pmtDst->bTemporalCompression = pmtSrc->bTemporalCompression;
42 pmtDst->lSampleSize = pmtSrc->lSampleSize;
43 memcpy( &pmtDst->formattype, &pmtSrc->formattype, sizeof(GUID) );
45 pmtDst->cbFormat = pmtSrc->cbFormat;
46 pmtDst->pbFormat = NULL;
48 if ( pmtSrc->pbFormat != NULL && pmtSrc->cbFormat != 0 )
50 pmtDst->pbFormat = (BYTE*)CoTaskMemAlloc( pmtSrc->cbFormat );
51 if ( pmtDst->pbFormat == NULL )
55 memcpy( pmtDst->pbFormat, pmtSrc->pbFormat, pmtSrc->cbFormat );
58 if ( pmtSrc->pUnk != NULL )
60 pmtDst->pUnk = pmtSrc->pUnk;
61 IUnknown_AddRef( pmtSrc->pUnk );
67 HRESULT WINAPI MoCreateMediaType( DMO_MEDIA_TYPE** ppmt, DWORD cbFormat )
72 FIXME( "() not tested\n" );
78 pmt = (DMO_MEDIA_TYPE*)CoTaskMemAlloc( sizeof(DMO_MEDIA_TYPE) );
81 hr = MoInitMediaType( pmt, cbFormat );
90 HRESULT WINAPI MoDeleteMediaType( DMO_MEDIA_TYPE* pmt )
92 FIXME( "() not tested\n" );
94 MoFreeMediaType( pmt );
100 HRESULT WINAPI MoDuplicateMediaType( DMO_MEDIA_TYPE** ppmtDest, const DMO_MEDIA_TYPE* pmtSrc )
103 DMO_MEDIA_TYPE* pmtDup;
105 FIXME( "() not tested\n" );
107 if ( ppmtDest == NULL )
111 pmtDup = (DMO_MEDIA_TYPE*)CoTaskMemAlloc( sizeof(DMO_MEDIA_TYPE) );
112 if ( pmtDup == NULL )
113 return E_OUTOFMEMORY;
114 hr = MoCopyMediaType( pmtDup, pmtSrc );
123 HRESULT WINAPI MoFreeMediaType( DMO_MEDIA_TYPE* pmt )
125 FIXME( "() not tested\n" );
127 if ( pmt->pUnk != NULL )
129 IUnknown_Release( pmt->pUnk );
132 if ( pmt->pbFormat != NULL )
134 CoTaskMemFree( pmt->pbFormat );
136 pmt->pbFormat = NULL;
142 HRESULT WINAPI MoInitMediaType( DMO_MEDIA_TYPE* pmt, DWORD cbFormat )
144 FIXME( "() not tested\n" );
146 memset( pmt, 0, sizeof(DMO_MEDIA_TYPE) );
151 pmt->pbFormat = (BYTE*)CoTaskMemAlloc( cbFormat );
152 if ( pmt->pbFormat == NULL )
153 return E_OUTOFMEMORY;
154 memset( pmt->pbFormat, 0, cbFormat );
156 pmt->cbFormat = cbFormat;