60 FIXME(
"ICOpen failed\n");
78 if(
size !=
sizeof(icinfo))
83 FIXME(
"ICCompressGetFormatSize failed\n");
95 This->videoinfo->dwBitRate = 10000000/src_videoinfo->
AvgTimePerFrame *
This->videoinfo->bmiHeader.biSizeImage * 8;
97 This->max_frame_size =
This->videoinfo->bmiHeader.biSizeImage;
108 return &
filter->source.pin;
130 *
out = &
filter->IPersistPropertyBag_iface;
145 ERR(
"Failed to commit allocator, hr %#lx.\n",
hr);
179 return IBaseFilter_QueryInterface(&
This->filter.IBaseFilter_iface,
riid,
ppv);
185 return IBaseFilter_AddRef(&
This->filter.IBaseFilter_iface);
191 return IBaseFilter_Release(&
This->filter.IBaseFilter_iface);
197 return IBaseFilter_GetClassID(&
This->filter.IBaseFilter_iface, pClassID);
214 TRACE(
"(%p)->(%p %p)\n",
This, pPropBag, pErrorLog);
217 hres = IPropertyBag_Read(pPropBag,
L"FccHandler", &
v,
NULL);
219 ERR(
"Failed to read FccHandler value, hr %#lx.\n",
hres);
232 FIXME(
"Invalid FccHandler len\n");
243 BOOL fClearDirty,
BOOL fSaveAllProperties)
246 FIXME(
"(%p)->(%p %x %x)\n",
This, pPropBag, fClearDirty, fSaveAllProperties);
267 TRACE(
"(%p)->(AM_MEDIA_TYPE(%p))\n",
base, pmt);
269 if(!
IsEqualIID(&pmt->majortype, &MEDIATYPE_Video))
272 if(!
IsEqualIID(&pmt->formattype, &FORMAT_VideoInfo)) {
308 DWORD comp_flags = 0;
319 WARN(
"Source is not connected, returning VFW_E_NOT_CONNECTED.\n");
324 FIXME(
"Driver not loaded\n");
328 hres = IMediaSample_QueryInterface(pSample, &IID_IMediaSample2, (
void**)&sample2);
330 FIXME(
"Use IMediaSample2\n");
331 IMediaSample2_Release(sample2);
334 is_preroll = IMediaSample_IsPreroll(pSample) ==
S_OK;
335 sync_point = IMediaSample_IsSyncPoint(pSample) ==
S_OK;
337 hres = IMediaSample_GetTime(pSample, &
start, &stop);
339 WARN(
"Failed to get sample time, hr %#lx.\n",
hres);
343 hres = IMediaSample_GetMediaType(pSample, &mt);
347 hres = IMediaSample_GetPointer(pSample, &
ptr);
349 ERR(
"Failed to get input buffer pointer, hr %#lx.\n",
hres);
353 if (
FAILED(
hres = IMemAllocator_GetBuffer(
This->source.pAllocator, &out_sample, &
start, &stop, 0)))
355 ERR(
"Failed to get sample, hr %#lx.\n",
hres);
360 ERR(
"Failed to set time, hr %#lx.\n",
hres);
362 hres = IMediaSample_GetPointer(out_sample, &
buf);
367 FIXME(
"Unsupported temporal compression\n");
370 This->videoinfo->bmiHeader.biSizeImage =
This->max_frame_size;
374 ERR(
"Failed to compress frame, error %Id.\n",
res);
375 IMediaSample_Release(out_sample);
379 IMediaSample_SetActualDataLength(out_sample,
This->videoinfo->bmiHeader.biSizeImage);
380 IMediaSample_SetPreroll(out_sample, is_preroll);
381 IMediaSample_SetSyncPoint(out_sample, (comp_flags&
AVIIF_KEYFRAME) != 0);
382 IMediaSample_SetDiscontinuity(out_sample, (IMediaSample_IsDiscontinuity(pSample) ==
S_OK));
384 if (IMediaSample_GetMediaTime(pSample, &
start, &stop) ==
S_OK)
385 IMediaSample_SetMediaTime(out_sample, &
start, &stop);
387 IMediaSample_SetMediaTime(out_sample,
NULL,
NULL);
389 hres = IMemInputPin_Receive(meminput, out_sample);
391 WARN(
"Failed to deliver sample, hr %#lx.\n",
hres);
393 IMediaSample_Release(out_sample);
424 if(iPosition || !
This->videoinfo)
427 amt->majortype = MEDIATYPE_Video;
428 amt->subtype = MEDIASUBTYPE_PCM;
429 amt->bFixedSizeSamples =
FALSE;
431 amt->lSampleSize =
This->sink.pin.mt.lSampleSize;
432 amt->formattype = FORMAT_VideoInfo;
434 amt->cbFormat =
This->videoinfo_size;
435 amt->pbFormat = (
BYTE*)
This->videoinfo;
451 if (!ppropInputRequest->
cbAlign)
452 ppropInputRequest->
cbAlign = 1;
454 return IMemAllocator_SetProperties(
alloc, ppropInputRequest, &actual);
460 TRACE(
"(%p)->(%p %p)\n",
base, pPin, pAlloc);
476 if (!(
object =
calloc(1,
sizeof(*
object))))
488 TRACE(
"Created AVI compressor %p.\n",
object);
489 *
out = &
object->filter.IUnknown_inner;
static HRESULT WINAPI AVICompressorOut_DecideBufferSize(struct strmbase_source *base, IMemAllocator *alloc, ALLOCATOR_PROPERTIES *ppropInputRequest)
static struct strmbase_pin * avi_compressor_get_pin(struct strmbase_filter *iface, unsigned int index)
static ULONG WINAPI AVICompressorPropertyBag_Release(IPersistPropertyBag *iface)
static HRESULT WINAPI AVICompressorPropertyBag_Save(IPersistPropertyBag *iface, IPropertyBag *pPropBag, BOOL fClearDirty, BOOL fSaveAllProperties)
static HRESULT avi_compressor_query_interface(struct strmbase_filter *iface, REFIID iid, void **out)
static HRESULT WINAPI AVICompressorPropertyBag_GetClassID(IPersistPropertyBag *iface, CLSID *pClassID)
static HRESULT sink_connect(struct strmbase_sink *iface, IPin *peer, const AM_MEDIA_TYPE *mt)
static void sink_disconnect(struct strmbase_sink *iface)
static AVICompressor * impl_from_strmbase_pin(struct strmbase_pin *pin)
static HRESULT WINAPI AVICompressorPropertyBag_Load(IPersistPropertyBag *iface, IPropertyBag *pPropBag, IErrorLog *pErrorLog)
static AVICompressor * impl_from_strmbase_filter(struct strmbase_filter *filter)
static HRESULT fill_format_info(AVICompressor *This, VIDEOINFOHEADER *src_videoinfo)
static const struct strmbase_source_ops source_ops
static AVICompressor * impl_from_IPersistPropertyBag(IPersistPropertyBag *iface)
static const struct strmbase_sink_ops sink_ops
static HRESULT WINAPI AVICompressorPropertyBag_InitNew(IPersistPropertyBag *iface)
static HRESULT sink_query_accept(struct strmbase_pin *base, const AM_MEDIA_TYPE *pmt)
static const struct strmbase_filter_ops filter_ops
HRESULT avi_compressor_create(IUnknown *outer, IUnknown **out)
static HRESULT ensure_driver(AVICompressor *This)
static HRESULT WINAPI AVICompressorOut_DecideAllocator(struct strmbase_source *base, IMemInputPin *pPin, IMemAllocator **pAlloc)
static void avi_compressor_destroy(struct strmbase_filter *iface)
static HRESULT source_get_media_type(struct strmbase_pin *base, unsigned int iPosition, AM_MEDIA_TYPE *amt)
static const IPersistPropertyBagVtbl PersistPropertyBagVtbl
static ULONG WINAPI AVICompressorPropertyBag_AddRef(IPersistPropertyBag *iface)
static HRESULT WINAPI AVICompressorPropertyBag_QueryInterface(IPersistPropertyBag *iface, REFIID riid, void **ppv)
static HRESULT avi_compressor_init_stream(struct strmbase_filter *iface)
static HRESULT avi_compressor_cleanup_stream(struct strmbase_filter *iface)
static HRESULT WINAPI AVICompressorIn_Receive(struct strmbase_sink *base, IMediaSample *pSample)
static HRESULT sink_query_interface(struct strmbase_pin *iface, REFIID iid, void **out)
#define FCC(ch0, ch1, ch2, ch3)
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
GLenum GLuint GLenum GLsizei const GLchar * buf
GLsizei GLenum GLboolean sink
HIC VFWAPI ICOpen(DWORD fccType, DWORD fccHandler, UINT wMode)
LRESULT VFWAPI ICGetInfo(HIC hic, ICINFO *picinfo, DWORD cb)
DWORD VFWAPIV ICCompress(HIC hic, DWORD dwFlags, LPBITMAPINFOHEADER lpbiOutput, LPVOID lpData, LPBITMAPINFOHEADER lpbiInput, LPVOID lpBits, LPDWORD lpckid, LPDWORD lpdwFlags, LONG lFrameNum, DWORD dwFrameSize, DWORD dwQuality, LPBITMAPINFOHEADER lpbiPrev, LPVOID lpPrev)
LRESULT WINAPI ICClose(HIC hic)
UINT WINAPI SysStringLen(BSTR str)
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
const GUID IID_IPersistPropertyBag
#define IsEqualGUID(rguid1, rguid2)
#define IsEqualIID(riid1, riid2)
HRESULT WINAPI BaseOutputPinImpl_DecideAllocator(struct strmbase_source *pin, IMemInputPin *peer, IMemAllocator **allocator)
void strmbase_source_init(struct strmbase_source *pin, struct strmbase_filter *filter, const WCHAR *name, const struct strmbase_source_ops *func_table)
void strmbase_sink_cleanup(struct strmbase_sink *pin)
void strmbase_sink_init(struct strmbase_sink *pin, struct strmbase_filter *filter, const WCHAR *name, const struct strmbase_sink_ops *ops, IMemAllocator *allocator)
void strmbase_filter_cleanup(struct strmbase_filter *filter)
void strmbase_source_cleanup(struct strmbase_source *pin)
void strmbase_filter_init(struct strmbase_filter *filter, IUnknown *outer, const CLSID *clsid, const struct strmbase_filter_ops *func_table)
HRESULT WINAPI BaseOutputPinImpl_AttemptConnection(struct strmbase_source *pin, IPin *peer, const AM_MEDIA_TYPE *mt)
IPersistPropertyBag IPersistPropertyBag_iface
VIDEOINFOHEADER * videoinfo
#define FIELD_OFFSET(t, f)
#define CONTAINING_RECORD(address, type, field)
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
#define ICCompressGetFormat(hic, lpbiInput, lpbiOutput)
#define VIDCF_FASTTEMPORALC
#define ICCOMPRESS_KEYFRAME
#define ICCompressEnd(hic)
#define ICCompressQuery(hic, lpbiInput, lpbiOutput)
#define ICCompressGetFormatSize(hic, lpbi)
#define VFW_E_NOT_CONNECTED
wchar_t tm const _CrtWcstime_Writes_and_advances_ptr_ count wchar_t ** out