85 if (
filter->source.pin.peer)
86 return IPin_EndFlush(
filter->source.pin.peer);
95 if (tStart < This->
late) {
96 TRACE(
"Dropping sample\n");
109 LONG cbDstStream, cbSrcStream;
120 if (!
This->source.pMemInputPin)
122 WARN(
"Source is not connected, returning VFW_E_NOT_CONNECTED.\n");
128 if (
This->filter.state == State_Stopped)
131 if (
This->sink.flushing)
134 hr = IMediaSample_GetPointer(pSample, &pbSrcStream);
137 ERR(
"Failed to get input buffer pointer, hr %#lx.\n",
hr);
141 cbSrcStream = IMediaSample_GetActualDataLength(pSample);
144 This->pBihIn->biSizeImage = cbSrcStream;
148 ERR(
"Failed to get sample, hr %#lx.\n",
hr);
152 hr = IMediaSample_SetActualDataLength(pOutSample, 0);
155 hr = IMediaSample_GetPointer(pOutSample, &pbDstStream);
157 ERR(
"Failed to get output buffer pointer, hr %#lx.\n",
hr);
158 IMediaSample_Release(pOutSample);
161 cbDstStream = IMediaSample_GetSize(pOutSample);
162 if (cbDstStream < source_format->bmiHeader.biSizeImage)
165 IMediaSample_Release(pOutSample);
169 if (IMediaSample_IsPreroll(pSample) ==
S_OK)
171 if (IMediaSample_IsSyncPoint(pSample) !=
S_OK)
173 hr = IMediaSample_GetTime(pSample, &tStart, &tStop);
181 ERR(
"Failed to decompress, error %Id.\n",
res);
185 IMediaSample_Release(pOutSample);
191 IMediaSample_SetPreroll(pOutSample, (IMediaSample_IsPreroll(pSample) ==
S_OK));
192 IMediaSample_SetDiscontinuity(pOutSample, (IMediaSample_IsDiscontinuity(pSample) ==
S_OK));
193 IMediaSample_SetSyncPoint(pOutSample, (IMediaSample_IsSyncPoint(pSample) ==
S_OK));
196 IMediaSample_SetTime(pOutSample, &tStart, &tStop);
198 IMediaSample_SetTime(pOutSample, &tStart,
NULL);
200 IMediaSample_SetTime(pOutSample,
NULL,
NULL);
202 hr = IMemInputPin_Receive(
This->source.pMemInputPin, pOutSample);
204 ERR(
"Failed to send sample, hr %#lx.\n",
hr);
206 IMediaSample_Release(pOutSample);
216 if ((
IsEqualIID(&pmt->majortype, &MEDIATYPE_Video)) &&
217 (!
memcmp(((
const char *)&pmt->subtype)+4, ((
const char *)&MEDIATYPE_Video)+4,
sizeof(
GUID)-4)))
223 if (
IsEqualIID(&pmt->formattype, &FORMAT_VideoInfo))
225 else if (
IsEqualIID(&pmt->formattype, &FORMAT_VideoInfo2))
226 bmi = &format2->bmiHeader;
248 WARN(
"No decompressor found, error %Id.\n",
result);
252 TRACE(
"Connection accepted\n");
255 TRACE(
"Unable to find a suitable VFW decompressor\n");
260 TRACE(
"Connection refused\n");
290 *
out = &
filter->source_IQualityControl_iface;
328 {&MEDIASUBTYPE_CLJR,
mmioFOURCC(
'C',
'L',
'J',
'R'), 8},
329 {&MEDIASUBTYPE_UYVY,
mmioFOURCC(
'U',
'Y',
'V',
'Y'), 16},
330 {&MEDIASUBTYPE_YUY2,
mmioFOURCC(
'Y',
'U',
'Y',
'2'), 16},
331 {&MEDIASUBTYPE_RGB32,
BI_RGB, 32},
332 {&MEDIASUBTYPE_RGB24,
BI_RGB, 24},
334 {&MEDIASUBTYPE_RGB555,
BI_RGB, 16},
335 {&MEDIASUBTYPE_RGB8,
BI_RGB, 8},
342 if (!
filter->sink.pin.peer)
370 format->bmiHeader.biSizeImage =
format->bmiHeader.biHeight * (((
format->bmiHeader.biWidth
375 format->dwBitMasks[iRED] = 0xf800;
376 format->dwBitMasks[iGREEN] = 0x07e0;
377 format->dwBitMasks[iBLUE] = 0x001f;
383 mt->majortype = MEDIATYPE_Video;
385 mt->bFixedSizeSamples =
TRUE;
386 mt->lSampleSize =
format->bmiHeader.biSizeImage;
387 mt->formattype = FORMAT_VideoInfo;
417 mt->majortype = MEDIATYPE_Video;
418 mt->subtype = MEDIATYPE_Video;
419 mt->subtype.Data1 =
format->bmiHeader.biCompression;
420 mt->bFixedSizeSamples =
TRUE;
421 mt->lSampleSize =
format->bmiHeader.biSizeImage;
422 mt->formattype = FORMAT_VideoInfo;
438 ppropInputRequest->
cbAlign = 1;
446 return IMemAllocator_SetProperties(pAlloc, ppropInputRequest, &actual);
468 return IPin_QueryInterface(&
filter->source.pin.IPin_iface, iid,
out);
474 return IPin_AddRef(&
filter->source.pin.IPin_iface);
480 return IPin_Release(&
filter->source.pin.IPin_iface);
488 TRACE(
"filter %p, sender %p, type %#x, proportion %ld, late %s, timestamp %s.\n",
494 filter->late =
q.Late +
q.TimeStamp;
526 return &
filter->source.pin;
534 if (
filter->sink.pin.peer)
535 IPin_Disconnect(
filter->sink.pin.peer);
536 IPin_Disconnect(&
filter->sink.pin.IPin_iface);
538 if (
filter->source.pin.peer)
539 IPin_Disconnect(
filter->source.pin.peer);
540 IPin_Disconnect(&
filter->source.pin.IPin_iface);
542 filter->late_cs.DebugInfo->Spare[0] = 0;
560 if (!
filter->source.pin.peer)
570 ERR(
"ICDecompressBegin() failed, error %Id.\n",
res);
575 ERR(
"Failed to commit allocator, hr %#lx.\n",
hr);
585 if (!
filter->source.pin.peer)
595 ERR(
"ICDecompressEnd() failed, error %Id.\n",
res);
600 IMemAllocator_Decommit(
filter->source.pAllocator);
617 if (!(
object =
calloc(1,
sizeof(*
object))))
630 ISeekingPassThru_Init(&
object->passthrough.ISeekingPassThru_iface,
FALSE,
631 &
object->sink.pin.IPin_iface);
634 object->late_cs.DebugInfo->Spare[0] = (
DWORD_PTR)(__FILE__
": object.late_cs");
636 TRACE(
"Created AVI decompressor %p.\n",
object);
637 *
out = &
object->filter.IUnknown_inner;
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
_In_ fcb _In_ chunk _In_ uint64_t _In_ uint64_t _In_ bool _In_opt_ void _In_opt_ PIRP _In_ LIST_ENTRY _In_ uint8_t compression
static const struct pixel_format_desc formats[]
static HRESULT avi_decompressor_sink_connect(struct strmbase_sink *iface, IPin *peer, const AM_MEDIA_TYPE *pmt)
static struct avi_decompressor * impl_from_source_IQualityControl(IQualityControl *iface)
static HRESULT WINAPI avi_decompressor_source_qc_Notify(IQualityControl *iface, IBaseFilter *sender, Quality q)
static HRESULT avi_decompressor_sink_end_flush(struct strmbase_sink *iface)
HRESULT avi_dec_create(IUnknown *outer, IUnknown **out)
static void avi_decompressor_sink_disconnect(struct strmbase_sink *iface)
static HRESULT avi_decompressor_source_query_interface(struct strmbase_pin *iface, REFIID iid, void **out)
static HRESULT avi_decompressor_source_get_media_type(struct strmbase_pin *iface, unsigned int index, AM_MEDIA_TYPE *mt)
static HRESULT WINAPI avi_decompressor_source_qc_QueryInterface(IQualityControl *iface, REFIID iid, void **out)
static HRESULT WINAPI avi_decompressor_source_qc_SetSink(IQualityControl *iface, IQualityControl *sink)
static int AVIDec_DropSample(struct avi_decompressor *This, REFERENCE_TIME tStart)
static HRESULT avi_decompressor_source_query_accept(struct strmbase_pin *iface, const AM_MEDIA_TYPE *mt)
static void avi_decompressor_destroy(struct strmbase_filter *iface)
static const IQualityControlVtbl source_qc_vtbl
static HRESULT avi_decompressor_sink_query_accept(struct strmbase_pin *iface, const AM_MEDIA_TYPE *mt)
static struct strmbase_pin * avi_decompressor_get_pin(struct strmbase_filter *iface, unsigned int index)
static HRESULT avi_decompressor_init_stream(struct strmbase_filter *iface)
static const struct strmbase_source_ops source_ops
static const struct strmbase_sink_ops sink_ops
static const struct strmbase_filter_ops filter_ops
static ULONG WINAPI avi_decompressor_source_qc_AddRef(IQualityControl *iface)
static HRESULT WINAPI avi_decompressor_sink_Receive(struct strmbase_sink *iface, IMediaSample *pSample)
static ULONG WINAPI avi_decompressor_source_qc_Release(IQualityControl *iface)
static HRESULT avi_decompressor_sink_query_interface(struct strmbase_pin *iface, REFIID iid, void **out)
static struct avi_decompressor * impl_from_strmbase_filter(struct strmbase_filter *iface)
static HRESULT WINAPI avi_decompressor_source_DecideBufferSize(struct strmbase_source *iface, IMemAllocator *pAlloc, ALLOCATOR_PROPERTIES *ppropInputRequest)
static HRESULT avi_decompressor_cleanup_stream(struct strmbase_filter *iface)
void *WINAPI CoTaskMemAlloc(SIZE_T size)
void WINAPI CoTaskMemFree(void *ptr)
BOOL WINAPI InitializeCriticalSectionEx(OUT LPCRITICAL_SECTION lpCriticalSection, IN DWORD dwSpinCount, IN DWORD flags)
_ACRTIMP int __cdecl memcmp(const void *, const void *, size_t)
struct tagVIDEOINFOHEADER VIDEOINFOHEADER
GLdouble GLdouble GLdouble GLdouble q
GLsizei GLenum GLboolean sink
#define memcpy(s1, s2, n)
#define mmioFOURCC(c0, c1, c2, c3)
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 IsEqualGUID(rguid1, rguid2)
#define IsEqualIID(riid1, riid2)
#define offsetof(TYPE, MEMBER)
static const char * debugstr_time(REFERENCE_TIME time)
HRESULT WINAPI BaseOutputPinImpl_DecideAllocator(struct strmbase_source *pin, IMemInputPin *peer, IMemAllocator **allocator)
void strmbase_passthrough_cleanup(struct strmbase_passthrough *passthrough)
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_passthrough_init(struct strmbase_passthrough *passthrough, IUnknown *outer)
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)
BITMAPINFOHEADER * pBihIn
struct strmbase_passthrough passthrough
IQualityControl source_IQualityControl_iface
IMediaSeeking IMediaSeeking_iface
struct strmbase_filter * filter
#define CONTAINING_RECORD(address, type, field)
#define ICMODE_DECOMPRESS
#define ICDecompressQuery(hic, lpbiInput, lpbiOutput)
#define ICDecompressBegin(hic, lpbiInput, lpbiOutput)
#define ICDECOMPRESS_NOTKEYFRAME
#define ICDecompressGetFormatSize(hic, lpbi)
#define ICDecompressGetFormat(hic, lpbiInput, lpbiOutput)
#define ICDecompressEnd(hic)
#define ICDECOMPRESS_PREROLL
#define ICDECOMPRESS_HURRYUP
#define VFW_E_TYPE_NOT_ACCEPTED
#define VFW_S_NO_STOP_TIME
#define VFW_E_WRONG_STATE
#define VFW_S_NO_MORE_ITEMS
#define VFW_E_NOT_CONNECTED
wchar_t tm const _CrtWcstime_Writes_and_advances_ptr_ count wchar_t ** out
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
void WINAPI DeleteCriticalSection(PCRITICAL_SECTION)
#define RTL_CRITICAL_SECTION_FLAG_FORCE_DEBUG_INFO