2 * Copyright 2015 Jacek Caban for CodeWeavers
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
22 #include "wine/debug.h"
24 WINE_DEFAULT_DEBUG_CHANNEL(wmvcore
);
27 IWMWriter IWMWriter_iface
;
31 static inline WMWriter
*impl_from_IWMWriter(IWMWriter
*iface
)
33 return CONTAINING_RECORD(iface
, WMWriter
, IWMWriter_iface
);
36 static HRESULT WINAPI
WMWriter_QueryInterface(IWMWriter
*iface
, REFIID riid
, void **ppv
)
38 WMWriter
*This
= impl_from_IWMWriter(iface
);
40 if(IsEqualGUID(&IID_IUnknown
, riid
)) {
41 TRACE("(%p)->(IID_IUnknown %p)\n", This
, ppv
);
42 *ppv
= &This
->IWMWriter_iface
;
43 }else if(IsEqualGUID(&IID_IWMWriter
, riid
)) {
44 TRACE("(%p)->(IID_IWMWriter %p)\n", This
, ppv
);
45 *ppv
= &This
->IWMWriter_iface
;
47 FIXME("Unsupported iface %s\n", debugstr_guid(riid
));
52 IUnknown_AddRef((IUnknown
*)*ppv
);
56 static ULONG WINAPI
WMWriter_AddRef(IWMWriter
*iface
)
58 WMWriter
*This
= impl_from_IWMWriter(iface
);
59 LONG ref
= InterlockedIncrement(&This
->ref
);
61 TRACE("(%p) ref=%d\n", This
, ref
);
66 static ULONG WINAPI
WMWriter_Release(IWMWriter
*iface
)
68 WMWriter
*This
= impl_from_IWMWriter(iface
);
69 LONG ref
= InterlockedDecrement(&This
->ref
);
71 TRACE("(%p) ref=%d\n", This
, ref
);
79 static HRESULT WINAPI
WMWriter_SetProfileByID(IWMWriter
*iface
, REFGUID guidProfile
)
81 WMWriter
*This
= impl_from_IWMWriter(iface
);
82 FIXME("(%p)->(%s)\n", This
, debugstr_guid(guidProfile
));
86 static HRESULT WINAPI
WMWriter_SetProfile(IWMWriter
*iface
, IWMProfile
*profile
)
88 WMWriter
*This
= impl_from_IWMWriter(iface
);
89 FIXME("(%p)->(%p)\n", This
, profile
);
93 static HRESULT WINAPI
WMWriter_SetOutputFilename(IWMWriter
*iface
, const WCHAR
*filename
)
95 WMWriter
*This
= impl_from_IWMWriter(iface
);
96 FIXME("(%p)->(%s)\n", This
, debugstr_w(filename
));
100 static HRESULT WINAPI
WMWriter_GetInputCount(IWMWriter
*iface
, DWORD
*pcInputs
)
102 WMWriter
*This
= impl_from_IWMWriter(iface
);
103 FIXME("(%p)->(%p)\n", This
, pcInputs
);
107 static HRESULT WINAPI
WMWriter_GetInputProps(IWMWriter
*iface
, DWORD dwInputNum
, IWMInputMediaProps
**input
)
109 WMWriter
*This
= impl_from_IWMWriter(iface
);
110 FIXME("(%p)->(%d %p)\n", This
, dwInputNum
, input
);
114 static HRESULT WINAPI
WMWriter_SetInputProps(IWMWriter
*iface
, DWORD dwInputNum
, IWMInputMediaProps
*input
)
116 WMWriter
*This
= impl_from_IWMWriter(iface
);
117 FIXME("(%p)->(%d %p)\n", This
, dwInputNum
, input
);
121 static HRESULT WINAPI
WMWriter_GetInputFormatCount(IWMWriter
*iface
, DWORD dwInputNumber
, DWORD
*pcFormat
)
123 WMWriter
*This
= impl_from_IWMWriter(iface
);
124 FIXME("(%p)->(%d %p)\n", This
, dwInputNumber
, pcFormat
);
128 static HRESULT WINAPI
WMWriter_GetInputFormat(IWMWriter
*iface
, DWORD dwInputNumber
, DWORD dwFormatNumber
,
129 IWMInputMediaProps
**props
)
131 WMWriter
*This
= impl_from_IWMWriter(iface
);
132 FIXME("(%p)->(%d %d %p)\n", This
, dwInputNumber
, dwFormatNumber
, props
);
136 static HRESULT WINAPI
WMWriter_BeginWriting(IWMWriter
*iface
)
138 WMWriter
*This
= impl_from_IWMWriter(iface
);
139 FIXME("(%p)\n", This
);
143 static HRESULT WINAPI
WMWriter_EndWriting(IWMWriter
*iface
)
145 WMWriter
*This
= impl_from_IWMWriter(iface
);
146 FIXME("(%p)\n", This
);
150 static HRESULT WINAPI
WMWriter_AllocateSample(IWMWriter
*iface
, DWORD size
, INSSBuffer
**sample
)
152 WMWriter
*This
= impl_from_IWMWriter(iface
);
153 FIXME("(%p)->(%d %p)\n", This
, size
, sample
);
157 static HRESULT WINAPI
WMWriter_WriteSample(IWMWriter
*iface
, DWORD dwInputNum
, QWORD cnsSampleTime
,
158 DWORD flags
, INSSBuffer
*sample
)
160 WMWriter
*This
= impl_from_IWMWriter(iface
);
161 FIXME("(%p)->(%d %s %x %p)\n", This
, dwInputNum
, wine_dbgstr_longlong(cnsSampleTime
), flags
, sample
);
165 static HRESULT WINAPI
WMWriter_Flush(IWMWriter
*iface
)
167 WMWriter
*This
= impl_from_IWMWriter(iface
);
168 FIXME("(%p)\n", This
);
172 static const IWMWriterVtbl WMWriterVtbl
= {
173 WMWriter_QueryInterface
,
176 WMWriter_SetProfileByID
,
178 WMWriter_SetOutputFilename
,
179 WMWriter_GetInputCount
,
180 WMWriter_GetInputProps
,
181 WMWriter_SetInputProps
,
182 WMWriter_GetInputFormatCount
,
183 WMWriter_GetInputFormat
,
184 WMWriter_BeginWriting
,
186 WMWriter_AllocateSample
,
187 WMWriter_WriteSample
,
191 HRESULT WINAPI
WMCreateWriter(IUnknown
*reserved
, IWMWriter
**writer
)
195 TRACE("(%p %p)\n", reserved
, writer
);
197 ret
= heap_alloc(sizeof(*ret
));
199 return E_OUTOFMEMORY
;
201 ret
->IWMWriter_iface
.lpVtbl
= &WMWriterVtbl
;
204 *writer
= &ret
->IWMWriter_iface
;