ReactOS  0.4.15-dev-509-g96a357b
avico.c
Go to the documentation of this file.
1 /*
2  * Copyright 2013 Jacek Caban for CodeWeavers
3  *
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.
8  *
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.
13  *
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
17  */
18 
19 #include <stdarg.h>
20 
21 #define COBJMACROS
22 
23 #include "windef.h"
24 #include "winbase.h"
25 #include "dshow.h"
26 #include "vfw.h"
27 #include "aviriff.h"
28 
29 #include "qcap_main.h"
30 
31 #include "wine/debug.h"
32 #include "wine/heap.h"
33 
35 
36 typedef struct {
39 
42 
44  HIC hic;
45 
50 
53 
55 {
57 }
58 
60 {
61  BaseFilter *filter = CONTAINING_RECORD(iface, BaseFilter, IBaseFilter_iface);
63 }
64 
66 {
67  return impl_from_IBaseFilter(pin->pinInfo.pFilter);
68 }
69 
71 {
72  if(This->hic)
73  return S_OK;
74 
75  This->hic = ICOpen(FCC('v','i','d','c'), This->fcc_handler, ICMODE_COMPRESS);
76  if(!This->hic) {
77  FIXME("ICOpen failed\n");
78  return E_FAIL;
79  }
80 
81  return S_OK;
82 }
83 
85 {
86  DWORD size;
87  ICINFO icinfo;
88  HRESULT hres;
89 
91  if(hres != S_OK)
92  return hres;
93 
94  size = ICGetInfo(This->hic, &icinfo, sizeof(icinfo));
95  if(size != sizeof(icinfo))
96  return E_FAIL;
97 
98  size = ICCompressGetFormatSize(This->hic, &src_videoinfo->bmiHeader);
99  if(!size) {
100  FIXME("ICCompressGetFormatSize failed\n");
101  return E_FAIL;
102  }
103 
104  size += FIELD_OFFSET(VIDEOINFOHEADER, bmiHeader);
105  This->videoinfo = heap_alloc(size);
106  if(!This->videoinfo)
107  return E_OUTOFMEMORY;
108 
109  This->videoinfo_size = size;
110  This->driver_flags = icinfo.dwFlags;
111  memset(This->videoinfo, 0, sizeof(*This->videoinfo));
112  ICCompressGetFormat(This->hic, &src_videoinfo->bmiHeader, &This->videoinfo->bmiHeader);
113 
114  This->videoinfo->dwBitRate = 10000000/src_videoinfo->AvgTimePerFrame * This->videoinfo->bmiHeader.biSizeImage * 8;
115  This->videoinfo->AvgTimePerFrame = src_videoinfo->AvgTimePerFrame;
116  This->max_frame_size = This->videoinfo->bmiHeader.biSizeImage;
117  return S_OK;
118 }
119 
121 {
123 
124  if(IsEqualIID(riid, &IID_IUnknown)) {
125  TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
126  *ppv = &This->filter.IBaseFilter_iface;
127  }else if(IsEqualIID(riid, &IID_IPersist)) {
128  TRACE("(%p)->(IID_IPersist %p)\n", This, ppv);
129  *ppv = &This->filter.IBaseFilter_iface;
130  }else if(IsEqualIID(riid, &IID_IMediaFilter)) {
131  TRACE("(%p)->(IID_IMediaFilter %p)\n", This, ppv);
132  *ppv = &This->filter.IBaseFilter_iface;
133  }else if(IsEqualIID(riid, &IID_IBaseFilter)) {
134  TRACE("(%p)->(IID_IBaseFilter %p)\n", This, ppv);
135  *ppv = &This->filter.IBaseFilter_iface;
137  TRACE("(%p)->(IID_IPersistPropertyBag %p)\n", This, ppv);
138  *ppv = &This->IPersistPropertyBag_iface;
139  }else {
140  FIXME("no interface for %s\n", debugstr_guid(riid));
141  *ppv = NULL;
142  return E_NOINTERFACE;
143  }
144 
145  IUnknown_AddRef((IUnknown*)*ppv);
146  return S_OK;
147 
148 }
149 
151 {
153  ULONG ref = BaseFilterImpl_Release(&This->filter.IBaseFilter_iface);
154 
155  TRACE("(%p) ref=%d\n", This, ref);
156 
157  if(!ref) {
158  if(This->hic)
159  ICClose(This->hic);
160  heap_free(This->videoinfo);
161  if(This->in)
162  BaseInputPinImpl_Release(&This->in->pin.IPin_iface);
163  if(This->out)
164  BaseOutputPinImpl_Release(&This->out->pin.IPin_iface);
165  heap_free(This);
166  }
167 
168  return ref;
169 }
170 
172 {
174 
175  TRACE("(%p)\n", This);
176 
177  if(This->filter.state == State_Stopped)
178  return S_OK;
179 
180  ICCompressEnd(This->hic);
181  This->filter.state = State_Stopped;
182  return S_OK;
183 }
184 
186 {
188  FIXME("(%p)\n", This);
189  return E_NOTIMPL;
190 }
191 
193 {
195  HRESULT hres;
196 
197  TRACE("(%p)->(%s)\n", This, wine_dbgstr_longlong(tStart));
198 
199  if(This->filter.state == State_Running)
200  return S_OK;
201 
202  hres = IMemAllocator_Commit(This->out->pAllocator);
203  if(FAILED(hres)) {
204  FIXME("Commit failed: %08x\n", hres);
205  return hres;
206  }
207 
208  This->frame_cnt = 0;
209 
210  This->filter.state = State_Running;
211  return S_OK;
212 }
213 
215 {
217  FIXME("(%p)->(%s %p)\n", This, debugstr_w(Id), ppPin);
218  return VFW_E_NOT_FOUND;
219 }
220 
221 static HRESULT WINAPI AVICompressor_QueryFilterInfo(IBaseFilter *iface, FILTER_INFO *pInfo)
222 {
224  FIXME("(%p)->(%p)\n", This, pInfo);
225  return E_NOTIMPL;
226 }
227 
229 {
231  FIXME("(%p)->(%p)\n", This, pVendorInfo);
232  return E_NOTIMPL;
233 }
234 
235 static const IBaseFilterVtbl AVICompressorVtbl = {
251 };
252 
254 {
256  IPin *ret;
257 
258  TRACE("(%p)->(%d)\n", This, pos);
259 
260  switch(pos) {
261  case 0:
262  ret = &This->in->pin.IPin_iface;
263  break;
264  case 1:
265  ret = &This->out->pin.IPin_iface;
266  break;
267  default:
268  TRACE("No pin %d\n", pos);
269  return NULL;
270  };
271 
272  IPin_AddRef(ret);
273  return ret;
274 }
275 
277 {
278  return 2;
279 }
280 
284 };
285 
287 {
288  return CONTAINING_RECORD(iface, AVICompressor, IPersistPropertyBag_iface);
289 }
290 
292 {
294  return IBaseFilter_QueryInterface(&This->filter.IBaseFilter_iface, riid, ppv);
295 }
296 
298 {
300  return IBaseFilter_AddRef(&This->filter.IBaseFilter_iface);
301 }
302 
304 {
306  return IBaseFilter_Release(&This->filter.IBaseFilter_iface);
307 }
308 
310 {
312  return IBaseFilter_GetClassID(&This->filter.IBaseFilter_iface, pClassID);
313 }
314 
316 {
318  FIXME("(%p)->()\n", This);
319  return E_NOTIMPL;
320 }
321 
323 {
325  BSTR str;
326  VARIANT v;
327  HRESULT hres;
328 
329  static const WCHAR fcc_handlerW[] = {'F','c','c','H','a','n','d','l','e','r',0};
330 
331  TRACE("(%p)->(%p %p)\n", This, pPropBag, pErrorLog);
332 
333  V_VT(&v) = VT_EMPTY;
334  hres = IPropertyBag_Read(pPropBag, fcc_handlerW, &v, NULL);
335  if(FAILED(hres)) {
336  WARN("Could not read FccHandler: %08x\n", hres);
337  return hres;
338  }
339 
340  if(V_VT(&v) != VT_BSTR) {
341  FIXME("Got vt %d\n", V_VT(&v));
342  VariantClear(&v);
343  return E_FAIL;
344  }
345 
346  str = V_BSTR(&v);
347  TRACE("FccHandler = %s\n", debugstr_w(str));
348  if(SysStringLen(str) != 4) {
349  FIXME("Invalid FccHandler len\n");
351  return E_FAIL;
352  }
353 
354  This->fcc_handler = FCC(str[0], str[1], str[2], str[3]);
356  return S_OK;
357 }
358 
360  BOOL fClearDirty, BOOL fSaveAllProperties)
361 {
363  FIXME("(%p)->(%p %x %x)\n", This, pPropBag, fClearDirty, fSaveAllProperties);
364  return E_NOTIMPL;
365 }
366 
367 static const IPersistPropertyBagVtbl PersistPropertyBagVtbl = {
375 };
376 
377 static inline AVICompressor *impl_from_IPin(IPin *iface)
378 {
379  BasePin *bp = CONTAINING_RECORD(iface, BasePin, IPin_iface);
380  return impl_from_IBaseFilter(bp->pinInfo.pFilter);
381 }
382 
384 {
385  return BaseInputPinImpl_QueryInterface(iface, riid, ppv);
386 }
387 
389 {
391  return IBaseFilter_AddRef(&This->filter.IBaseFilter_iface);
392 }
393 
395 {
397  return IBaseFilter_Release(&This->filter.IBaseFilter_iface);
398 }
399 
401  IPin *pConnector, const AM_MEDIA_TYPE *pmt)
402 {
404  HRESULT hres;
405 
406  TRACE("(%p)->(%p AM_MEDIA_TYPE(%p))\n", This, pConnector, pmt);
407  dump_AM_MEDIA_TYPE(pmt);
408 
409  hres = BaseInputPinImpl_ReceiveConnection(iface, pConnector, pmt);
410  if(FAILED(hres))
411  return hres;
412 
413  hres = fill_format_info(This, (VIDEOINFOHEADER*)pmt->pbFormat);
414  if(FAILED(hres))
415  BasePinImpl_Disconnect(iface);
416  return hres;
417 }
418 
420 {
422  HRESULT hres;
423 
424  TRACE("(%p)\n", This);
425 
426  hres = BasePinImpl_Disconnect(iface);
427  if(FAILED(hres))
428  return hres;
429 
430  heap_free(This->videoinfo);
431  This->videoinfo = NULL;
432  return S_OK;
433 }
434 
435 static const IPinVtbl AVICompressorInputPinVtbl = {
454 };
455 
457 {
459  VIDEOINFOHEADER *videoinfo;
460  HRESULT hres;
461  DWORD res;
462 
463  TRACE("(%p)->(AM_MEDIA_TYPE(%p))\n", base, pmt);
464  dump_AM_MEDIA_TYPE(pmt);
465 
466  if(!IsEqualIID(&pmt->majortype, &MEDIATYPE_Video))
467  return S_FALSE;
468 
469  if(!IsEqualIID(&pmt->formattype, &FORMAT_VideoInfo)) {
470  FIXME("formattype %s unsupported\n", debugstr_guid(&pmt->formattype));
471  return S_FALSE;
472  }
473 
475  if(hres != S_OK)
476  return hres;
477 
478  videoinfo = (VIDEOINFOHEADER*)pmt->pbFormat;
479  res = ICCompressQuery(This->hic, &videoinfo->bmiHeader, NULL);
480  return res == ICERR_OK ? S_OK : S_FALSE;
481 }
482 
484 {
485  return 0;
486 }
487 
489 {
490  TRACE("(%p)->(%d %p)\n", base, iPosition, amt);
491  return S_FALSE;
492 }
493 
495 {
497  VIDEOINFOHEADER *src_videoinfo;
498  REFERENCE_TIME start, stop;
499  IMediaSample *out_sample;
500  AM_MEDIA_TYPE *mt;
501  IMediaSample2 *sample2;
502  DWORD comp_flags = 0;
503  BOOL is_preroll;
504  BOOL sync_point;
505  BYTE *ptr, *buf;
506  DWORD res;
507  HRESULT hres;
508 
509  TRACE("(%p)->(%p)\n", base, pSample);
510 
511  if(!This->hic) {
512  FIXME("Driver not loaded\n");
513  return E_UNEXPECTED;
514  }
515 
516  hres = IMediaSample_QueryInterface(pSample, &IID_IMediaSample2, (void**)&sample2);
517  if(SUCCEEDED(hres)) {
518  FIXME("Use IMediaSample2\n");
519  IMediaSample2_Release(sample2);
520  }
521 
522  is_preroll = IMediaSample_IsPreroll(pSample) == S_OK;
523  sync_point = IMediaSample_IsSyncPoint(pSample) == S_OK;
524 
525  hres = IMediaSample_GetTime(pSample, &start, &stop);
526  if(FAILED(hres)) {
527  WARN("GetTime failed: %08x\n", hres);
528  return hres;
529  }
530 
531  hres = IMediaSample_GetMediaType(pSample, &mt);
532  if(FAILED(hres))
533  return hres;
534 
535  hres = IMediaSample_GetPointer(pSample, &ptr);
536  if(FAILED(hres)) {
537  WARN("GetPointer failed: %08x\n", hres);
538  return hres;
539  }
540 
541  hres = BaseOutputPinImpl_GetDeliveryBuffer(This->out, &out_sample, &start, &stop, 0);
542  if(FAILED(hres))
543  return hres;
544 
545  hres = IMediaSample_GetPointer(out_sample, &buf);
546  if(FAILED(hres))
547  return hres;
548 
549  if((This->driver_flags & VIDCF_TEMPORAL) && !(This->driver_flags & VIDCF_FASTTEMPORALC))
550  FIXME("Unsupported temporal compression\n");
551 
552  src_videoinfo = (VIDEOINFOHEADER*)This->in->pin.mtCurrent.pbFormat;
553  This->videoinfo->bmiHeader.biSizeImage = This->max_frame_size;
554  res = ICCompress(This->hic, sync_point ? ICCOMPRESS_KEYFRAME : 0, &This->videoinfo->bmiHeader, buf,
555  &src_videoinfo->bmiHeader, ptr, 0, &comp_flags, This->frame_cnt, 0, 0, NULL, NULL);
556  if(res != ICERR_OK) {
557  WARN("ICCompress failed: %d\n", res);
558  IMediaSample_Release(out_sample);
559  return E_FAIL;
560  }
561 
562  IMediaSample_SetActualDataLength(out_sample, This->videoinfo->bmiHeader.biSizeImage);
563  IMediaSample_SetPreroll(out_sample, is_preroll);
564  IMediaSample_SetSyncPoint(out_sample, (comp_flags&AVIIF_KEYFRAME) != 0);
565  IMediaSample_SetDiscontinuity(out_sample, (IMediaSample_IsDiscontinuity(pSample) == S_OK));
566 
567  if (IMediaSample_GetMediaTime(pSample, &start, &stop) == S_OK)
568  IMediaSample_SetMediaTime(out_sample, &start, &stop);
569  else
570  IMediaSample_SetMediaTime(out_sample, NULL, NULL);
571 
572  hres = BaseOutputPinImpl_Deliver(This->out, out_sample);
573  if(FAILED(hres))
574  WARN("Deliver failed: %08x\n", hres);
575 
576  IMediaSample_Release(out_sample);
577  This->frame_cnt++;
578  return hres;
579 }
580 
582  {
584  NULL,
587  },
589 };
590 
592 {
593  return BaseInputPinImpl_QueryInterface(iface, riid, ppv);
594 }
595 
597 {
599  return IBaseFilter_AddRef(&This->filter.IBaseFilter_iface);
600 }
601 
603 {
605  return IBaseFilter_Release(&This->filter.IBaseFilter_iface);
606 }
607 
608 static const IPinVtbl AVICompressorOutputPinVtbl = {
627 };
628 
630 {
631  FIXME("(%p)\n", base);
632  return 0;
633 }
634 
636 {
637  AVICompressor *This = impl_from_IBaseFilter(base->pinInfo.pFilter);
638 
639  TRACE("(%p)->(%d %p)\n", base, iPosition, amt);
640 
641  if(iPosition || !This->videoinfo)
642  return S_FALSE;
643 
644  amt->majortype = MEDIATYPE_Video;
645  amt->subtype = MEDIASUBTYPE_PCM;
646  amt->bFixedSizeSamples = FALSE;
647  amt->bTemporalCompression = (This->driver_flags & VIDCF_TEMPORAL) != 0;
648  amt->lSampleSize = This->in->pin.mtCurrent.lSampleSize;
649  amt->formattype = FORMAT_VideoInfo;
650  amt->pUnk = NULL;
651  amt->cbFormat = This->videoinfo_size;
652  amt->pbFormat = (BYTE*)This->videoinfo;
653  return S_OK;
654 }
655 
657 {
659  ALLOCATOR_PROPERTIES actual;
660 
661  TRACE("(%p)\n", This);
662 
663  if (!ppropInputRequest->cBuffers)
664  ppropInputRequest->cBuffers = 1;
665  if (ppropInputRequest->cbBuffer < This->max_frame_size)
666  ppropInputRequest->cbBuffer = This->max_frame_size;
667  if (!ppropInputRequest->cbAlign)
668  ppropInputRequest->cbAlign = 1;
669 
670  return IMemAllocator_SetProperties(alloc, ppropInputRequest, &actual);
671 }
672 
674  IMemInputPin *pPin, IMemAllocator **pAlloc)
675 {
676  TRACE("(%p)->(%p %p)\n", base, pPin, pAlloc);
677  return BaseOutputPinImpl_DecideAllocator(base, pPin, pAlloc);
678 }
679 
681 {
682  FIXME("(%p)\n", base);
683  return E_NOTIMPL;
684 }
685 
687  {
688  NULL,
692  },
696 };
697 
699 {
700  PIN_INFO in_pin_info = {NULL, PINDIR_INPUT, {'I','n','p','u','t',0}};
701  PIN_INFO out_pin_info = {NULL, PINDIR_OUTPUT, {'O','u','t','p','u','t',0}};
702  AVICompressor *compressor;
703  HRESULT hres;
704 
705  TRACE("\n");
706 
707  compressor = heap_alloc_zero(sizeof(*compressor));
708  if(!compressor) {
709  *phr = E_NOINTERFACE;
710  return NULL;
711  }
712 
713  BaseFilter_Init(&compressor->filter, &AVICompressorVtbl, &CLSID_AVICo,
714  (DWORD_PTR)(__FILE__ ": AVICompressor.csFilter"), &filter_func_table);
715 
717 
718  in_pin_info.pFilter = &compressor->filter.IBaseFilter_iface;
720  &AVICompressorBaseInputPinVtbl, &compressor->filter.csFilter, NULL, (IPin**)&compressor->in);
721  if(FAILED(hres)) {
722  IBaseFilter_Release(&compressor->filter.IBaseFilter_iface);
723  *phr = hres;
724  return NULL;
725  }
726 
727  out_pin_info.pFilter = &compressor->filter.IBaseFilter_iface;
729  &AVICompressorBaseOutputPinVtbl, &compressor->filter.csFilter, (IPin**)&compressor->out);
730  if(FAILED(hres)) {
731  IBaseFilter_Release(&compressor->filter.IBaseFilter_iface);
732  *phr = hres;
733  return NULL;
734  }
735 
736  *phr = S_OK;
737  return (IUnknown*)&compressor->filter.IBaseFilter_iface;
738 }
HRESULT WINAPI BaseOutputPinImpl_GetDeliveryBuffer(BaseOutputPin *This, IMediaSample **ppSample, REFERENCE_TIME *tStart, REFERENCE_TIME *tStop, DWORD dwFlags)
Definition: pin.c:554
const GUID IID_IBaseFilter
static const BaseInputPinFuncTable AVICompressorBaseInputPinVtbl
Definition: avico.c:581
static HRESULT WINAPI AVICompressor_Pause(IBaseFilter *iface)
Definition: avico.c:185
HRESULT WINAPI BaseFilterImpl_SetSyncSource(IBaseFilter *iface, IReferenceClock *pClock)
Definition: filter.c:101
#define REFIID
Definition: guiddef.h:118
HIC VFWAPI ICOpen(DWORD fccType, DWORD fccHandler, UINT wMode)
Definition: msvideo_main.c:441
static HRESULT WINAPI AVICompressorOut_GetMediaType(BasePin *base, int iPosition, AM_MEDIA_TYPE *amt)
Definition: avico.c:635
#define E_NOINTERFACE
Definition: winerror.h:2364
HRESULT WINAPI BaseInputPinImpl_QueryInterface(IPin *iface, REFIID riid, LPVOID *ppv)
Definition: pin.c:838
static HRESULT fill_format_info(AVICompressor *This, VIDEOINFOHEADER *src_videoinfo)
Definition: avico.c:84
static HRESULT WINAPI AVICompressorPropertyBag_GetClassID(IPersistPropertyBag *iface, CLSID *pClassID)
Definition: avico.c:309
static const IBaseFilterVtbl AVICompressorVtbl
Definition: avico.c:235
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
DWORD dwFlags
Definition: vfw.h:284
#define ICCOMPRESS_KEYFRAME
Definition: vfw.h:170
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
size_t videoinfo_size
Definition: avico.c:47
static HRESULT WINAPI AVICompressorIn_ReceiveConnection(IPin *iface, IPin *pConnector, const AM_MEDIA_TYPE *pmt)
Definition: avico.c:400
REFIID riid
Definition: precomp.h:44
static HRESULT WINAPI AVICompressorIn_GetMediaType(BasePin *base, int iPosition, AM_MEDIA_TYPE *amt)
Definition: avico.c:488
HRESULT WINAPI BaseFilterImpl_GetState(IBaseFilter *iface, DWORD dwMilliSecsTimeout, FILTER_STATE *pState)
Definition: filter.c:87
const GUID IID_IPersist
Definition: proxy.cpp:14
HRESULT WINAPI BaseInputPinImpl_Connect(IPin *iface, IPin *pConnector, const AM_MEDIA_TYPE *pmt)
Definition: pin.c:881
#define WARN(fmt,...)
Definition: debug.h:112
HRESULT WINAPI BaseInputPinImpl_EndFlush(IPin *iface)
Definition: pin.c:988
static HRESULT WINAPI AVICompressor_QueryFilterInfo(IBaseFilter *iface, FILTER_INFO *pInfo)
Definition: avico.c:221
REFIID LPVOID * ppv
Definition: atlbase.h:39
static IPin *WINAPI AVICompressor_GetPin(BaseFilter *iface, int pos)
Definition: avico.c:253
#define AVIIF_KEYFRAME
Definition: aviriff.h:131
HRESULT WINAPI BaseOutputPinImpl_EndOfStream(IPin *iface)
Definition: pin.c:527
#define VIDCF_TEMPORAL
Definition: vfw.h:299
DWORD max_frame_size
Definition: avico.c:49
OLECHAR * BSTR
Definition: compat.h:1943
#define ICERR_OK
Definition: vfw.h:50
HIC hic
Definition: avico.c:44
#define E_FAIL
Definition: ddrawi.h:102
static ULONG WINAPI AVICompressorIn_Release(IPin *iface)
Definition: avico.c:394
Definition: send.c:48
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
#define ICCompressGetFormat(hic, lpbiInput, lpbiOutput)
Definition: vfw.h:204
DWORD Id
static AVICompressor * impl_from_BaseFilter(BaseFilter *filter)
Definition: avico.c:54
Definition: regsvr.c:103
ULONG WINAPI BaseFilterImpl_Release(IBaseFilter *iface)
Definition: filter.c:64
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
static HRESULT WINAPI AVICompressorIn_Receive(BaseInputPin *base, IMediaSample *pSample)
Definition: avico.c:494
unsigned int BOOL
Definition: ntddk_ex.h:94
LRESULT WINAPI ICClose(HIC hic)
long LONG
Definition: pedump.c:60
static HRESULT WINAPI AVICompressorIn_Disconnect(IPin *iface)
Definition: avico.c:419
const GUID IID_IPersistPropertyBag
Definition: proxy.cpp:11
static HRESULT WINAPI AVICompressor_FindPin(IBaseFilter *iface, LPCWSTR Id, IPin **ppPin)
Definition: avico.c:214
HRESULT WINAPI BaseFilterImpl_GetClassID(IBaseFilter *iface, CLSID *pClsid)
Definition: filter.c:77
#define ICCompressQuery(hic, lpbiInput, lpbiOutput)
Definition: vfw.h:224
#define debugstr_w
Definition: kernel32.h:32
GLenum GLint ref
Definition: glext.h:6028
HRESULT WINAPI BaseOutputPinImpl_EndFlush(IPin *iface)
Definition: pin.c:545
#define FIXME(fmt,...)
Definition: debug.h:111
static PVOID ptr
Definition: dispmode.c:27
HRESULT WINAPI BasePinImpl_Disconnect(IPin *iface)
Definition: pin.c:197
#define S_FALSE
Definition: winerror.h:2357
HRESULT WINAPI BasePinImpl_QueryAccept(IPin *iface, const AM_MEDIA_TYPE *pmt)
Definition: pin.c:311
static LONG WINAPI AVICompressorOut_GetMediaTypeVersion(BasePin *base)
Definition: avico.c:629
REFERENCE_TIME AvgTimePerFrame
Definition: amvideo.idl:187
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
BITMAPINFOHEADER bmiHeader
Definition: amvideo.idl:189
static HRESULT WINAPI AVICompressorPropertyBag_Save(IPersistPropertyBag *iface, IPropertyBag *pPropBag, BOOL fClearDirty, BOOL fSaveAllProperties)
Definition: avico.c:359
HRESULT WINAPI BasePinImpl_QueryDirection(IPin *iface, PIN_DIRECTION *pPinDir)
Definition: pin.c:285
#define VFW_E_NOT_FOUND
Definition: vfwmsgs.h:61
static const IPinVtbl AVICompressorOutputPinVtbl
Definition: avico.c:608
HRESULT WINAPI BasePinImpl_ConnectedTo(IPin *iface, IPin **ppPin)
Definition: pin.c:222
HRESULT WINAPI BasePinImpl_EnumMediaTypes(IPin *iface, IEnumMediaTypes **ppEnum)
Definition: pin.c:318
ULONG WINAPI BaseInputPinImpl_Release(IPin *iface)
Definition: pin.c:868
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)
Definition: msvideo_main.c:797
static LONG WINAPI AVICompressorIn_GetMediaTypeVersion(BasePin *base)
Definition: avico.c:483
#define debugstr_guid
Definition: kernel32.h:35
static HRESULT WINAPI AVICompressorOut_QueryInterface(IPin *iface, REFIID riid, void **ppv)
Definition: avico.c:591
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
#define FCC(ch0, ch1, ch2, ch3)
Definition: aviriff.h:38
HRESULT BaseInputPin_Construct(const IPinVtbl *InputPin_Vtbl, LONG inputpin_size, const PIN_INFO *pPinInfo, const BaseInputPinFuncTable *pBaseInputFuncsTable, LPCRITICAL_SECTION pCritSec, IMemAllocator *, IPin **ppPin)
Definition: pin.c:1189
HRESULT WINAPI BaseOutputPinImpl_DecideAllocator(BaseOutputPin *This, IMemInputPin *pPin, IMemAllocator **pAlloc)
Definition: pin.c:683
#define ICCompressGetFormatSize(hic, lpbi)
Definition: vfw.h:210
#define ICCompressEnd(hic)
Definition: vfw.h:230
static HRESULT WINAPI AVICompressorPropertyBag_Load(IPersistPropertyBag *iface, IPropertyBag *pPropBag, IErrorLog *pErrorLog)
Definition: avico.c:322
DWORD driver_flags
Definition: avico.c:48
void dump_AM_MEDIA_TYPE(const AM_MEDIA_TYPE *pmt)
Definition: enummedia.c:38
LRESULT VFWAPI ICGetInfo(HIC hic, ICINFO *picinfo, DWORD cb)
Definition: msvideo_main.c:594
#define TRACE(s)
Definition: solgame.cpp:4
GLsizeiptr size
Definition: glext.h:5919
HRESULT hres
Definition: protocol.c:465
HRESULT WINAPI BasePinImpl_NewSegment(IPin *iface, REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate)
Definition: pin.c:338
static ULONG WINAPI AVICompressorIn_AddRef(IPin *iface)
Definition: avico.c:388
static AVICompressor * impl_from_BasePin(BasePin *pin)
Definition: avico.c:65
static HRESULT WINAPI AVICompressorPropertyBag_InitNew(IPersistPropertyBag *iface)
Definition: avico.c:315
HRESULT WINAPI BaseInputPinImpl_BeginFlush(IPin *iface)
Definition: pin.c:968
LONGLONG REFERENCE_TIME
Definition: dmusicks.h:9
__wchar_t WCHAR
Definition: xmlstorage.h:180
HRESULT WINAPI BaseOutputPinImpl_BeginFlush(IPin *iface)
Definition: pin.c:536
LONG HRESULT
Definition: typedefs.h:78
ULONG WINAPI BaseOutputPinImpl_Release(IPin *iface)
Definition: pin.c:392
const GUID IID_IUnknown
IUnknown *WINAPI QCAP_createAVICompressor(IUnknown *outer, HRESULT *phr)
Definition: avico.c:698
#define WINAPI
Definition: msvc.h:6
VIDEOINFOHEADER * videoinfo
Definition: avico.c:46
unsigned long DWORD
Definition: ntddk_ex.h:95
#define VIDCF_FASTTEMPORALC
Definition: vfw.h:302
BaseFilter filter
Definition: avico.c:37
HRESULT WINAPI BasePinImpl_QueryPinInfo(IPin *iface, PIN_INFO *pInfo)
Definition: pin.c:273
int ret
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:648
static LONG WINAPI AVICompressor_GetPinCount(BaseFilter *iface)
Definition: avico.c:276
IBaseFilter IBaseFilter_iface
Definition: strmbase.h:163
#define V_VT(A)
Definition: oleauto.h:211
HRESULT WINAPI BasePinImpl_QueryId(IPin *iface, LPWSTR *Id)
Definition: pin.c:296
static const IPersistPropertyBagVtbl PersistPropertyBagVtbl
Definition: avico.c:367
CRITICAL_SECTION csFilter
Definition: strmbase.h:165
static const BaseFilterFuncTable filter_func_table
Definition: avico.c:281
static ULONG WINAPI AVICompressorPropertyBag_AddRef(IPersistPropertyBag *iface)
Definition: avico.c:297
UINT WINAPI SysStringLen(BSTR str)
Definition: oleaut.c:196
HRESULT WINAPI BasePinImpl_QueryInternalConnections(IPin *iface, IPin **apPin, ULONG *cPin)
Definition: pin.c:329
HRESULT WINAPI BaseFilterImpl_EnumPins(IBaseFilter *iface, IEnumPins **ppEnum)
Definition: filter.c:135
static HRESULT WINAPI AVICompressorIn_QueryInterface(IPin *iface, REFIID riid, void **ppv)
Definition: avico.c:383
uint32_t DWORD_PTR
Definition: typedefs.h:64
static HRESULT WINAPI AVICompressor_QueryVendorInfo(IBaseFilter *iface, LPWSTR *pVendorInfo)
Definition: avico.c:228
static HRESULT ensure_driver(AVICompressor *This)
Definition: avico.c:70
unsigned char BYTE
Definition: xxhash.c:193
#define V_BSTR(A)
Definition: oleauto.h:226
HRESULT WINAPI BaseOutputPinImpl_Connect(IPin *iface, IPin *pReceivePin, const AM_MEDIA_TYPE *pmt)
Definition: pin.c:405
static AVICompressor * impl_from_IBaseFilter(IBaseFilter *iface)
Definition: avico.c:59
BaseInputPin * in
Definition: avico.c:40
Definition: vfw.h:280
#define ICMODE_COMPRESS
Definition: vfw.h:268
HRESULT WINAPI BaseOutputPinImpl_ReceiveConnection(IPin *iface, IPin *pReceivePin, const AM_MEDIA_TYPE *pmt)
Definition: pin.c:490
static const IPinVtbl AVICompressorInputPinVtbl
Definition: avico.c:435
#define S_OK
Definition: intsafe.h:59
static HRESULT WINAPI AVICompressorOut_BreakConnect(BaseOutputPin *base)
Definition: avico.c:680
const GLdouble * v
Definition: gl.h:2040
static HRESULT WINAPI AVICompressor_Run(IBaseFilter *iface, REFERENCE_TIME tStart)
Definition: avico.c:192
HRESULT WINAPI BaseOutputPinImpl_AttemptConnection(BasePin *This, IPin *pReceivePin, const AM_MEDIA_TYPE *pmt)
Definition: pin.c:712
GLuint start
Definition: gl.h:1545
static HRESULT WINAPI AVICompressor_Stop(IBaseFilter *iface)
Definition: avico.c:171
Definition: axcore.idl:91
WINE_DEFAULT_DEBUG_CHANNEL(qcap)
#define E_NOTIMPL
Definition: ddrawi.h:99
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:254
DWORD fcc_handler
Definition: avico.c:43
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:271
#define alloc
Definition: rosglue.h:13
ULONG WINAPI BaseFilterImpl_AddRef(IBaseFilter *iface)
Definition: filter.c:54
HRESULT WINAPI BaseFilterImpl_GetSyncSource(IBaseFilter *iface, IReferenceClock **ppClock)
Definition: filter.c:119
#define E_UNEXPECTED
Definition: winerror.h:2456
PIN_INFO pinInfo
Definition: strmbase.h:38
HRESULT WINAPI BaseOutputPinImpl_Deliver(BaseOutputPin *This, IMediaSample *pSample)
Definition: pin.c:574
static AVICompressor * impl_from_IPersistPropertyBag(IPersistPropertyBag *iface)
Definition: avico.c:286
IPersistPropertyBag IPersistPropertyBag_iface
Definition: avico.c:38
static HRESULT WINAPI AVICompressorOut_DecideBufferSize(BaseOutputPin *base, IMemAllocator *alloc, ALLOCATOR_PROPERTIES *ppropInputRequest)
Definition: avico.c:656
HRESULT WINAPI BaseInputPinImpl_ReceiveConnection(IPin *iface, IPin *pReceivePin, const AM_MEDIA_TYPE *pmt)
Definition: pin.c:889
GLuint res
Definition: glext.h:9613
HRESULT WINAPI BaseFilterImpl_JoinFilterGraph(IBaseFilter *iface, IFilterGraph *pGraph, LPCWSTR pName)
Definition: filter.c:159
HRESULT WINAPI BaseOutputPin_Construct(const IPinVtbl *OutputPin_Vtbl, LONG outputpin_size, const PIN_INFO *pPinInfo, const BaseOutputPinFuncTable *pBaseOutputFuncsTable, LPCRITICAL_SECTION pCritSec, IPin **ppPin)
Definition: pin.c:791
unsigned int ULONG
Definition: retypes.h:1
DWORD frame_cnt
Definition: avico.c:51
static __inline const char * wine_dbgstr_longlong(ULONGLONG ll)
Definition: compat.h:41
HRESULT WINAPI BaseFilter_Init(BaseFilter *This, const IBaseFilterVtbl *Vtbl, const CLSID *pClsid, DWORD_PTR DebugInfo, const BaseFilterFuncTable *pBaseFuncsTable)
Definition: filter.c:196
static ULONG WINAPI AVICompressorPropertyBag_Release(IPersistPropertyBag *iface)
Definition: avico.c:303
static HRESULT WINAPI AVICompressorPropertyBag_QueryInterface(IPersistPropertyBag *iface, REFIID riid, void **ppv)
Definition: avico.c:291
static ULONG WINAPI AVICompressor_Release(IBaseFilter *iface)
Definition: avico.c:150
HRESULT WINAPI BaseInputPinImpl_NewSegment(IPin *iface, REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate)
Definition: pin.c:1015
HRESULT WINAPI BasePinImpl_ConnectionMediaType(IPin *iface, AM_MEDIA_TYPE *pmt)
Definition: pin.c:248
WCHAR * LPWSTR
Definition: xmlstorage.h:184
static ULONG WINAPI AVICompressorOut_Release(IPin *iface)
Definition: avico.c:602
static HRESULT WINAPI AVICompressorOut_DecideAllocator(BaseOutputPin *base, IMemInputPin *pPin, IMemAllocator **pAlloc)
Definition: avico.c:673
#define memset(x, y, z)
Definition: compat.h:39
static const BaseOutputPinFuncTable AVICompressorBaseOutputPinVtbl
Definition: avico.c:686
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
Definition: glext.h:7005
HRESULT WINAPI BaseOutputPinImpl_Disconnect(IPin *iface)
Definition: pin.c:497
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95
static AVICompressor * impl_from_IPin(IPin *iface)
Definition: avico.c:377
static HRESULT WINAPI AVICompressorIn_CheckMediaType(BasePin *base, const AM_MEDIA_TYPE *pmt)
Definition: avico.c:456
BaseOutputPin * out
Definition: avico.c:41
#define SUCCEEDED(hr)
Definition: intsafe.h:57
static BOOL heap_free(void *mem)
Definition: appwiz.h:75
static ULONG WINAPI AVICompressorOut_AddRef(IPin *iface)
Definition: avico.c:596
HRESULT WINAPI BaseInputPinImpl_EndOfStream(IPin *iface)
Definition: pin.c:944
static HRESULT WINAPI AVICompressor_QueryInterface(IBaseFilter *iface, REFIID riid, void **ppv)
Definition: avico.c:120