38#include "wine/unicode.h"
71 ERR(
"Cannot start processing (%d)\n",
result);
99 if (tStart < This->late) {
100 TRACE(
"Dropping sample\n");
122 hr = IMediaSample_GetPointer(pSample, &pbSrcStream);
125 ERR(
"Cannot get pointer to sample data (%x)\n",
hr);
129 cbSrcStream = IMediaSample_GetActualDataLength(pSample);
131 TRACE(
"Sample data ptr = %p, size = %d\n", pbSrcStream, cbSrcStream);
133 hr = IPin_ConnectionMediaType(
This->tf.ppPins[0], &amt);
135 ERR(
"Unable to retrieve media type\n");
140 This->pBihIn->biSizeImage = cbSrcStream;
144 ERR(
"Unable to get delivery buffer (%x)\n",
hr);
148 hr = IMediaSample_SetActualDataLength(pOutSample, 0);
151 hr = IMediaSample_GetPointer(pOutSample, &pbDstStream);
153 ERR(
"Unable to get pointer to buffer (%x)\n",
hr);
156 cbDstStream = IMediaSample_GetSize(pOutSample);
157 if (cbDstStream < This->pBihOut->biSizeImage) {
158 ERR(
"Sample size is too small %d < %d\n", cbDstStream,
This->pBihOut->biSizeImage);
163 if (IMediaSample_IsPreroll(pSample) ==
S_OK)
165 if (IMediaSample_IsSyncPoint(pSample) !=
S_OK)
167 hr = IMediaSample_GetTime(pSample, &tStart, &tStop);
173 ERR(
"Error occurred during the decompression (%x)\n",
res);
181 IMediaSample_SetActualDataLength(pOutSample,
This->pBihOut->biSizeImage);
183 IMediaSample_SetPreroll(pOutSample, (IMediaSample_IsPreroll(pSample) ==
S_OK));
184 IMediaSample_SetDiscontinuity(pOutSample, (IMediaSample_IsDiscontinuity(pSample) ==
S_OK));
185 IMediaSample_SetSyncPoint(pOutSample, (IMediaSample_IsSyncPoint(pSample) ==
S_OK));
188 IMediaSample_SetTime(pOutSample, &tStart, &tStop);
190 IMediaSample_SetTime(pOutSample, &tStart,
NULL);
192 IMediaSample_SetTime(pOutSample,
NULL,
NULL);
194 if (IMediaSample_GetMediaTime(pSample, &tStart, &tStop) ==
S_OK)
195 IMediaSample_SetMediaTime(pOutSample, &tStart, &tStop);
197 IMediaSample_SetMediaTime(pOutSample,
NULL,
NULL);
203 ERR(
"Error sending sample (%x)\n",
hr);
207 IMediaSample_Release(pOutSample);
226 ERR(
"Cannot stop processing (%d)\n",
result);
243 if ((
IsEqualIID(&pmt->majortype, &MEDIATYPE_Video)) &&
244 (!
memcmp(((
const char *)&pmt->subtype)+4, ((
const char *)&MEDIATYPE_Video)+4,
sizeof(
GUID)-4)))
250 if (
IsEqualIID(&pmt->formattype, &FORMAT_VideoInfo))
252 else if (
IsEqualIID(&pmt->formattype, &FORMAT_VideoInfo2))
253 bmi = &format2->bmiHeader;
262 const CLSID* outsubtype;
270 case 32: outsubtype = &MEDIASUBTYPE_RGB32;
break;
271 case 24: outsubtype = &MEDIASUBTYPE_RGB24;
break;
272 case 16: outsubtype = &MEDIASUBTYPE_RGB565;
break;
273 case 8: outsubtype = &MEDIASUBTYPE_RGB8;
break;
275 WARN(
"Non standard input depth %d, forced output depth to 32\n", bmi->
biBitCount);
276 outsubtype = &MEDIASUBTYPE_RGB32;
299 This->pBihOut->biCompression = 0;
300 This->pBihOut->biBitCount = output_depth;
301 This->pBihOut->biSizeImage =
This->pBihOut->biWidth *
This->pBihOut->biHeight *
This->pBihOut->biBitCount / 8;
302 TRACE(
"Size: %u\n",
This->pBihIn->biSize);
306 ERR(
"Unable to found a suitable output format (%d)\n",
result);
312 outpmt->subtype = *outsubtype;
314 if (
IsEqualIID(&pmt->formattype, &FORMAT_VideoInfo))
316 else if (
IsEqualIID(&pmt->formattype, &FORMAT_VideoInfo2))
321 TRACE(
"Connection accepted\n");
324 TRACE(
"Unable to find a suitable VFW decompressor\n");
329 TRACE(
"Connection refused\n");
367 if (!ppropInputRequest->
cbAlign)
368 ppropInputRequest->
cbAlign = 1;
376 return IMemAllocator_SetProperties(pAlloc, ppropInputRequest, &actual);
400 TRACE(
"(%p, %p)\n", pUnkOuter,
ppv);
416 *
ppv = &
This->tf.filter.IBaseFilter_iface;
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
static HRESULT WINAPI AVIDec_NotifyDrop(TransformFilter *pTransformFilter, IBaseFilter *sender, Quality qm)
static HRESULT WINAPI AVIDec_EndFlush(TransformFilter *pTransformFilter)
HRESULT AVIDec_create(IUnknown *pUnkOuter, LPVOID *ppv)
static HRESULT WINAPI AVIDec_DecideBufferSize(TransformFilter *tf, IMemAllocator *pAlloc, ALLOCATOR_PROPERTIES *ppropInputRequest)
static const IBaseFilterVtbl AVIDec_Vtbl
static const TransformFilterFuncTable AVIDec_FuncsTable
static HRESULT WINAPI AVIDec_BreakConnect(TransformFilter *tf, PIN_DIRECTION dir)
static HRESULT WINAPI AVIDec_Receive(TransformFilter *tf, IMediaSample *pSample)
static HRESULT WINAPI AVIDec_SetMediaType(TransformFilter *tf, PIN_DIRECTION dir, const AM_MEDIA_TYPE *pmt)
static HRESULT WINAPI AVIDec_CompleteConnect(TransformFilter *tf, PIN_DIRECTION dir, IPin *pin)
static int AVIDec_DropSample(AVIDecImpl *This, REFERENCE_TIME tStart)
static HRESULT WINAPI AVIDec_StopStreaming(TransformFilter *pTransformFilter)
static AVIDecImpl * impl_from_TransformFilter(TransformFilter *iface)
static HRESULT WINAPI AVIDec_StartStreaming(TransformFilter *pTransformFilter)
enum _PinDirection PIN_DIRECTION
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
static __inline const char * debugstr_an(const char *s, int n)
VOID WINAPI CoTaskMemFree(LPVOID ptr)
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
#define memcpy(s1, s2, n)
static void FreeMediaType(AM_MEDIA_TYPE *pMediaType)
static HRESULT CopyMediaType(AM_MEDIA_TYPE *pDest, const AM_MEDIA_TYPE *pSrc)
DWORD VFWAPIV ICDecompress(HIC hic, DWORD dwFlags, LPBITMAPINFOHEADER lpbiFormat, LPVOID lpData, LPBITMAPINFOHEADER lpbi, LPVOID lpBits)
HIC VFWAPI ICLocate(DWORD type, DWORD handler, BITMAPINFOHEADER *in, BITMAPINFOHEADER *out, WORD mode)
LRESULT WINAPI ICClose(HIC hic)
#define IsEqualIID(riid1, riid2)
HRESULT WINAPI BaseFilterImpl_SetSyncSource(IBaseFilter *iface, IReferenceClock *pClock)
HRESULT WINAPI TransformFilterImpl_Pause(IBaseFilter *iface)
HRESULT WINAPI TransformFilterImpl_Run(IBaseFilter *iface, REFERENCE_TIME tStart)
HRESULT WINAPI BaseFilterImpl_GetClassID(IBaseFilter *iface, CLSID *pClsid)
HRESULT WINAPI BaseFilterImpl_QueryFilterInfo(IBaseFilter *iface, FILTER_INFO *pInfo)
HRESULT WINAPI TransformFilterImpl_Stop(IBaseFilter *iface)
HRESULT WINAPI TransformFilterImpl_FindPin(IBaseFilter *iface, LPCWSTR Id, IPin **ppPin)
ULONG WINAPI BaseFilterImpl_AddRef(IBaseFilter *iface)
HRESULT WINAPI BaseOutputPinImpl_Deliver(BaseOutputPin *This, IMediaSample *pSample)
HRESULT WINAPI BaseFilterImpl_GetState(IBaseFilter *iface, DWORD dwMilliSecsTimeout, FILTER_STATE *pState)
ULONG WINAPI TransformFilterImpl_Release(IBaseFilter *iface)
HRESULT TransformFilter_Construct(const IBaseFilterVtbl *filterVtbl, LONG filter_size, const CLSID *pClsid, const TransformFilterFuncTable *pFuncsTable, IBaseFilter **ppTransformFilter)
HRESULT WINAPI BaseFilterImpl_JoinFilterGraph(IBaseFilter *iface, IFilterGraph *pGraph, LPCWSTR pName)
HRESULT WINAPI TransformFilterImpl_QueryInterface(IBaseFilter *iface, REFIID riid, LPVOID *ppv)
HRESULT WINAPI BaseFilterImpl_QueryVendorInfo(IBaseFilter *iface, LPWSTR *pVendorInfo)
HRESULT WINAPI BaseFilterImpl_GetSyncSource(IBaseFilter *iface, IReferenceClock **ppClock)
HRESULT WINAPI BaseOutputPinImpl_GetDeliveryBuffer(BaseOutputPin *This, IMediaSample **ppSample, REFERENCE_TIME *tStart, REFERENCE_TIME *tStop, DWORD dwFlags)
HRESULT WINAPI BaseFilterImpl_EnumPins(IBaseFilter *iface, IEnumPins **ppEnum)
BITMAPINFOHEADER * pBihIn
BITMAPINFOHEADER * pBihOut
#define CONTAINING_RECORD(address, type, field)
#define ICMODE_DECOMPRESS
#define ICDecompressQuery(hic, lpbiInput, lpbiOutput)
#define ICDecompressBegin(hic, lpbiInput, lpbiOutput)
#define ICDECOMPRESS_NOTKEYFRAME
#define ICDecompressEnd(hic)
#define ICDECOMPRESS_PREROLL
#define ICDECOMPRESS_HURRYUP
#define VFW_E_TYPE_NOT_ACCEPTED
#define VFW_S_NO_STOP_TIME
#define VFW_E_NOT_CONNECTED
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
#define CLASS_E_NOAGGREGATION