ReactOS 0.4.17-dev-923-g4c9a150
avidec.c
Go to the documentation of this file.
1/*
2 * AVI Decompressor (VFW decompressors wrapper)
3 *
4 * Copyright 2004-2005 Christian Costa
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 */
20
21#include "quartz_private.h"
22
23#include "uuids.h"
24#include "amvideo.h"
25#include "windef.h"
26#include "winbase.h"
27#include "dshow.h"
28#include "strmif.h"
29#include "vfwmsgs.h"
30#include "vfw.h"
31#include "dvdmedia.h"
32
33#include <assert.h>
34
35#include "wine/debug.h"
36
38
40{
42
46
48
49 HIC hvid;
51
54};
55
57{
58 return CONTAINING_RECORD(iface, struct avi_decompressor, filter);
59}
60
62{
64
65 if (IsEqualGUID(iid, &IID_IMemInputPin))
66 *out = &filter->sink.IMemInputPin_iface;
67 else
68 return E_NOINTERFACE;
69
70 IUnknown_AddRef((IUnknown *)*out);
71 return S_OK;
72}
73
75{
76 return S_OK;
77}
78
80{
83 filter->late = -1;
85 if (filter->source.pin.peer)
86 return IPin_EndFlush(filter->source.pin.peer);
87 return S_OK;
88}
89
91{
92 if (This->late < 0)
93 return 0;
94
95 if (tStart < This->late) {
96 TRACE("Dropping sample\n");
97 return 1;
98 }
99 This->late = -1;
100 return 0;
101}
102
104{
105 struct avi_decompressor *This = impl_from_strmbase_filter(iface->pin.filter);
106 VIDEOINFOHEADER *source_format;
107 HRESULT hr;
108 IMediaSample* pOutSample = NULL;
109 LONG cbDstStream, cbSrcStream;
110 LPBYTE pbDstStream;
111 LPBYTE pbSrcStream;
112 LONGLONG tStart, tStop;
113 DWORD flags = 0;
114 LRESULT res;
115
116 /* We do not expect pin connection state to change while the filter is
117 * running. This guarantee is necessary, since otherwise we would have to
118 * take the filter lock, and we can't take the filter lock from a streaming
119 * thread. */
120 if (!This->source.pMemInputPin)
121 {
122 WARN("Source is not connected, returning VFW_E_NOT_CONNECTED.\n");
123 return VFW_E_NOT_CONNECTED;
124 }
125
126 source_format = (VIDEOINFOHEADER *)This->source.pin.mt.pbFormat;
127
128 if (This->filter.state == State_Stopped)
129 return VFW_E_WRONG_STATE;
130
131 if (This->sink.flushing)
132 return S_FALSE;
133
134 hr = IMediaSample_GetPointer(pSample, &pbSrcStream);
135 if (FAILED(hr))
136 {
137 ERR("Failed to get input buffer pointer, hr %#lx.\n", hr);
138 return hr;
139 }
140
141 cbSrcStream = IMediaSample_GetActualDataLength(pSample);
142
143 /* Update input size to match sample size */
144 This->pBihIn->biSizeImage = cbSrcStream;
145
146 if (FAILED(hr = IMemAllocator_GetBuffer(This->source.pAllocator, &pOutSample, NULL, NULL, 0)))
147 {
148 ERR("Failed to get sample, hr %#lx.\n", hr);
149 return hr;
150 }
151
152 hr = IMediaSample_SetActualDataLength(pOutSample, 0);
153 assert(hr == S_OK);
154
155 hr = IMediaSample_GetPointer(pOutSample, &pbDstStream);
156 if (FAILED(hr)) {
157 ERR("Failed to get output buffer pointer, hr %#lx.\n", hr);
158 IMediaSample_Release(pOutSample);
159 return hr;
160 }
161 cbDstStream = IMediaSample_GetSize(pOutSample);
162 if (cbDstStream < source_format->bmiHeader.biSizeImage)
163 {
164 ERR("Sample size is too small (%ld < %lu).\n", cbDstStream, source_format->bmiHeader.biSizeImage);
165 IMediaSample_Release(pOutSample);
166 return E_FAIL;
167 }
168
169 if (IMediaSample_IsPreroll(pSample) == S_OK)
171 if (IMediaSample_IsSyncPoint(pSample) != S_OK)
173 hr = IMediaSample_GetTime(pSample, &tStart, &tStop);
174 EnterCriticalSection(&This->late_cs);
175 if (hr == S_OK && AVIDec_DropSample(This, tStart))
177 LeaveCriticalSection(&This->late_cs);
178
179 res = ICDecompress(This->hvid, flags, This->pBihIn, pbSrcStream, &source_format->bmiHeader, pbDstStream);
180 if (res != ICERR_OK)
181 ERR("Failed to decompress, error %Id.\n", res);
182
183 /* Drop sample if it's intended to be dropped */
185 IMediaSample_Release(pOutSample);
186 return S_OK;
187 }
188
189 IMediaSample_SetActualDataLength(pOutSample, source_format->bmiHeader.biSizeImage);
190
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));
194
195 if (hr == S_OK)
196 IMediaSample_SetTime(pOutSample, &tStart, &tStop);
197 else if (hr == VFW_S_NO_STOP_TIME)
198 IMediaSample_SetTime(pOutSample, &tStart, NULL);
199 else
200 IMediaSample_SetTime(pOutSample, NULL, NULL);
201
202 hr = IMemInputPin_Receive(This->source.pMemInputPin, pOutSample);
203 if (hr != S_OK && hr != VFW_E_NOT_CONNECTED)
204 ERR("Failed to send sample, hr %#lx.\n", hr);
205
206 IMediaSample_Release(pOutSample);
207 return hr;
208}
209
211{
212 struct avi_decompressor *This = impl_from_strmbase_filter(iface->pin.filter);
214
215 /* Check root (GUID w/o FOURCC) */
216 if ((IsEqualIID(&pmt->majortype, &MEDIATYPE_Video)) &&
217 (!memcmp(((const char *)&pmt->subtype)+4, ((const char *)&MEDIATYPE_Video)+4, sizeof(GUID)-4)))
218 {
219 VIDEOINFOHEADER *format1 = (VIDEOINFOHEADER *)pmt->pbFormat;
220 VIDEOINFOHEADER2 *format2 = (VIDEOINFOHEADER2 *)pmt->pbFormat;
221 BITMAPINFOHEADER *bmi;
222
223 if (IsEqualIID(&pmt->formattype, &FORMAT_VideoInfo))
224 bmi = &format1->bmiHeader;
225 else if (IsEqualIID(&pmt->formattype, &FORMAT_VideoInfo2))
226 bmi = &format2->bmiHeader;
227 else
228 goto failed;
229
230 This->hvid = ICLocate(pmt->majortype.Data1, pmt->subtype.Data1, bmi, NULL, ICMODE_DECOMPRESS);
231 if (This->hvid)
232 {
233 DWORD bih_size;
235
236 /* Copy bitmap header from media type to 1 for input and 1 for output */
237 bih_size = bmi->biSize + bmi->biClrUsed * 4;
238 This->pBihIn = CoTaskMemAlloc(bih_size);
239 if (!This->pBihIn)
240 {
242 goto failed;
243 }
244 memcpy(This->pBihIn, bmi, bih_size);
245
246 if ((result = ICDecompressQuery(This->hvid, This->pBihIn, NULL)))
247 {
248 WARN("No decompressor found, error %Id.\n", result);
250 }
251
252 TRACE("Connection accepted\n");
253 return S_OK;
254 }
255 TRACE("Unable to find a suitable VFW decompressor\n");
256 }
257
258failed:
259
260 TRACE("Connection refused\n");
261 return hr;
262}
263
265{
266 struct avi_decompressor *filter = impl_from_strmbase_filter(iface->pin.filter);
267
268 if (filter->hvid)
269 ICClose(filter->hvid);
270 CoTaskMemFree(filter->pBihIn);
271 filter->hvid = NULL;
272 filter->pBihIn = NULL;
273}
274
275static const struct strmbase_sink_ops sink_ops =
276{
277 .base.pin_query_interface = avi_decompressor_sink_query_interface,
278 .base.pin_query_accept = avi_decompressor_sink_query_accept,
279 .pfnReceive = avi_decompressor_sink_Receive,
280 .sink_connect = avi_decompressor_sink_connect,
281 .sink_disconnect = avi_decompressor_sink_disconnect,
282 .sink_end_flush = avi_decompressor_sink_end_flush,
283};
284
286{
288
289 if (IsEqualGUID(iid, &IID_IQualityControl))
290 *out = &filter->source_IQualityControl_iface;
291 else if (IsEqualGUID(iid, &IID_IMediaSeeking))
292 *out = &filter->passthrough.IMediaSeeking_iface;
293 else
294 return E_NOINTERFACE;
295
296 IUnknown_AddRef((IUnknown *)*out);
297 return S_OK;
298}
299
301{
303 VIDEOINFOHEADER *sink_format, *format;
304
305 if (!filter->sink.pin.peer || !IsEqualGUID(&mt->formattype, &FORMAT_VideoInfo))
306 return S_FALSE;
307
308 sink_format = (VIDEOINFOHEADER *)filter->sink.pin.mt.pbFormat;
309 format = (VIDEOINFOHEADER *)mt->pbFormat;
310
311 if (ICDecompressQuery(filter->hvid, &sink_format->bmiHeader, &format->bmiHeader))
312 return S_FALSE;
313
314 return S_OK;
315}
316
318 unsigned int index, AM_MEDIA_TYPE *mt)
319{
320 static const struct
321 {
322 const GUID *subtype;
324 WORD bpp;
325 }
326 formats[] =
327 {
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},
333 {&MEDIASUBTYPE_RGB565, BI_BITFIELDS, 16},
334 {&MEDIASUBTYPE_RGB555, BI_RGB, 16},
335 {&MEDIASUBTYPE_RGB8, BI_RGB, 8},
336 };
337
339 const VIDEOINFOHEADER *sink_format;
341
342 if (!filter->sink.pin.peer)
343 return VFW_S_NO_MORE_ITEMS;
344
345 sink_format = (VIDEOINFOHEADER *)filter->sink.pin.mt.pbFormat;
346
347 memset(mt, 0, sizeof(AM_MEDIA_TYPE));
348
349 if (index < ARRAY_SIZE(formats))
350 {
351 /* In theory we could allocate less than this, but gcc generates
352 * -Warray-bounds warnings if we access the structure through a
353 * VIDEOINFO pointer, even if we only access valid fields. */
354 if (!(format = CoTaskMemAlloc(sizeof(*format))))
355 return E_OUTOFMEMORY;
356 memset(format, 0, sizeof(*format));
357
358 format->rcSource = sink_format->rcSource;
359 format->rcTarget = sink_format->rcTarget;
360 format->dwBitRate = sink_format->dwBitRate;
361 format->dwBitErrorRate = sink_format->dwBitErrorRate;
362 format->AvgTimePerFrame = sink_format->AvgTimePerFrame;
363
364 format->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
365 format->bmiHeader.biWidth = sink_format->bmiHeader.biWidth;
366 format->bmiHeader.biHeight = sink_format->bmiHeader.biHeight;
367 format->bmiHeader.biPlanes = sink_format->bmiHeader.biPlanes;
368 format->bmiHeader.biBitCount = formats[index].bpp;
369 format->bmiHeader.biCompression = formats[index].compression;
370 format->bmiHeader.biSizeImage = format->bmiHeader.biHeight * (((format->bmiHeader.biWidth
371 * formats[index].bpp + 31) / 8) & ~3);
372
373 if (IsEqualGUID(formats[index].subtype, &MEDIASUBTYPE_RGB565))
374 {
375 format->dwBitMasks[iRED] = 0xf800;
376 format->dwBitMasks[iGREEN] = 0x07e0;
377 format->dwBitMasks[iBLUE] = 0x001f;
378 mt->cbFormat = offsetof(VIDEOINFO, dwBitMasks[3]);
379 }
380 else
381 mt->cbFormat = sizeof(VIDEOINFOHEADER);
382
383 mt->majortype = MEDIATYPE_Video;
384 mt->subtype = *formats[index].subtype;
385 mt->bFixedSizeSamples = TRUE;
386 mt->lSampleSize = format->bmiHeader.biSizeImage;
387 mt->formattype = FORMAT_VideoInfo;
388 mt->pbFormat = (BYTE *)format;
389
390 return S_OK;
391 }
392
393 if (index == ARRAY_SIZE(formats))
394 {
395 size_t size = ICDecompressGetFormatSize(filter->hvid, &sink_format->bmiHeader);
396
397 if (!size)
398 return VFW_S_NO_MORE_ITEMS;
399
400 mt->cbFormat = offsetof(VIDEOINFOHEADER, bmiHeader) + size;
401 if (!(format = CoTaskMemAlloc(mt->cbFormat)))
402 return E_OUTOFMEMORY;
403 memset(format, 0, mt->cbFormat);
404
405 format->rcSource = sink_format->rcSource;
406 format->rcTarget = sink_format->rcTarget;
407 format->dwBitRate = sink_format->dwBitRate;
408 format->dwBitErrorRate = sink_format->dwBitErrorRate;
409 format->AvgTimePerFrame = sink_format->AvgTimePerFrame;
410
411 if (ICDecompressGetFormat(filter->hvid, &sink_format->bmiHeader, &format->bmiHeader))
412 {
414 return VFW_S_NO_MORE_ITEMS;
415 }
416
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;
423 mt->pbFormat = (BYTE *)format;
424
425 return S_OK;
426 }
427
428 return VFW_S_NO_MORE_ITEMS;
429}
430
432 IMemAllocator *pAlloc, ALLOCATOR_PROPERTIES *ppropInputRequest)
433{
434 const VIDEOINFOHEADER *source_format = (VIDEOINFOHEADER *)iface->pin.mt.pbFormat;
436
437 if (!ppropInputRequest->cbAlign)
438 ppropInputRequest->cbAlign = 1;
439
440 if (ppropInputRequest->cbBuffer < source_format->bmiHeader.biSizeImage)
441 ppropInputRequest->cbBuffer = source_format->bmiHeader.biSizeImage;
442
443 if (!ppropInputRequest->cBuffers)
444 ppropInputRequest->cBuffers = 1;
445
446 return IMemAllocator_SetProperties(pAlloc, ppropInputRequest, &actual);
447}
448
449static const struct strmbase_source_ops source_ops =
450{
451 .base.pin_query_interface = avi_decompressor_source_query_interface,
452 .base.pin_query_accept = avi_decompressor_source_query_accept,
453 .base.pin_get_media_type = avi_decompressor_source_get_media_type,
454 .pfnAttemptConnection = BaseOutputPinImpl_AttemptConnection,
455 .pfnDecideAllocator = BaseOutputPinImpl_DecideAllocator,
456 .pfnDecideBufferSize = avi_decompressor_source_DecideBufferSize,
457};
458
460{
462}
463
465 REFIID iid, void **out)
466{
468 return IPin_QueryInterface(&filter->source.pin.IPin_iface, iid, out);
469}
470
472{
474 return IPin_AddRef(&filter->source.pin.IPin_iface);
475}
476
478{
480 return IPin_Release(&filter->source.pin.IPin_iface);
481}
482
484 IBaseFilter *sender, Quality q)
485{
487
488 TRACE("filter %p, sender %p, type %#x, proportion %ld, late %s, timestamp %s.\n",
489 filter, sender, q.Type, q.Proportion, debugstr_time(q.Late), debugstr_time(q.TimeStamp));
490
491 /* can't take the stream CS here, Submarine Titans calls this function from a foreign thread while inside sink_Receive */
492 EnterCriticalSection(&filter->late_cs);
493 if (q.Late > 0)
494 filter->late = q.Late + q.TimeStamp;
495 else
496 filter->late = -1;
497 LeaveCriticalSection(&filter->late_cs);
498 return S_OK;
499}
500
502{
504
505 TRACE("filter %p, sink %p.\n", filter, sink);
506
507 return S_OK;
508}
509
510static const IQualityControlVtbl source_qc_vtbl =
511{
517};
518
519static struct strmbase_pin *avi_decompressor_get_pin(struct strmbase_filter *iface, unsigned int index)
520{
522
523 if (index == 0)
524 return &filter->sink.pin;
525 else if (index == 1)
526 return &filter->source.pin;
527 return NULL;
528}
529
531{
533
534 if (filter->sink.pin.peer)
535 IPin_Disconnect(filter->sink.pin.peer);
536 IPin_Disconnect(&filter->sink.pin.IPin_iface);
537
538 if (filter->source.pin.peer)
539 IPin_Disconnect(filter->source.pin.peer);
540 IPin_Disconnect(&filter->source.pin.IPin_iface);
541
542 filter->late_cs.DebugInfo->Spare[0] = 0;
543 DeleteCriticalSection(&filter->late_cs);
544
548
550 free(filter);
551}
552
554{
556 VIDEOINFOHEADER *source_format;
557 LRESULT res;
558 HRESULT hr;
559
560 if (!filter->source.pin.peer)
561 return S_OK;
562
563 EnterCriticalSection(&filter->late_cs);
564 filter->late = -1;
565 LeaveCriticalSection(&filter->late_cs);
566
567 source_format = (VIDEOINFOHEADER *)filter->source.pin.mt.pbFormat;
568 if ((res = ICDecompressBegin(filter->hvid, filter->pBihIn, &source_format->bmiHeader)))
569 {
570 ERR("ICDecompressBegin() failed, error %Id.\n", res);
571 return E_FAIL;
572 }
573
574 if (FAILED(hr = IMemAllocator_Commit(filter->source.pAllocator)))
575 ERR("Failed to commit allocator, hr %#lx.\n", hr);
576
577 return S_OK;
578}
579
581{
583 LRESULT res;
584
585 if (!filter->source.pin.peer)
586 return S_OK;
587
588 if (filter->hvid)
589 {
591 res = ICDecompressEnd(filter->hvid);
593 if (res)
594 {
595 ERR("ICDecompressEnd() failed, error %Id.\n", res);
596 return E_FAIL;
597 }
598 }
599
600 IMemAllocator_Decommit(filter->source.pAllocator);
601
602 return S_OK;
603}
604
605static const struct strmbase_filter_ops filter_ops =
606{
607 .filter_get_pin = avi_decompressor_get_pin,
608 .filter_destroy = avi_decompressor_destroy,
609 .filter_init_stream = avi_decompressor_init_stream,
610 .filter_cleanup_stream = avi_decompressor_cleanup_stream,
611};
612
614{
615 struct avi_decompressor *object;
616
617 if (!(object = calloc(1, sizeof(*object))))
618 return E_OUTOFMEMORY;
619
620 strmbase_filter_init(&object->filter, outer, &CLSID_AVIDec, &filter_ops);
621
622 strmbase_sink_init(&object->sink, &object->filter, L"In", &sink_ops, NULL);
623 wcscpy(object->sink.pin.name, L"XForm In");
624
625 strmbase_source_init(&object->source, &object->filter, L"Out", &source_ops);
626 wcscpy(object->source.pin.name, L"XForm Out");
627
628 object->source_IQualityControl_iface.lpVtbl = &source_qc_vtbl;
629 strmbase_passthrough_init(&object->passthrough, (IUnknown *)&object->source.pin.IPin_iface);
630 ISeekingPassThru_Init(&object->passthrough.ISeekingPassThru_iface, FALSE,
631 &object->sink.pin.IPin_iface);
632
634 object->late_cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": object.late_cs");
635
636 TRACE("Created AVI decompressor %p.\n", object);
637 *out = &object->filter.IUnknown_inner;
638
639 return S_OK;
640}
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
#define index(s, c)
Definition: various.h:29
#define ARRAY_SIZE(A)
Definition: main.h:20
#define WARN(fmt,...)
Definition: precomp.h:61
#define ERR(fmt,...)
Definition: precomp.h:57
_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
Definition: btrfs_drv.h:1365
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define E_FAIL
Definition: ddrawi.h:102
#define free
Definition: debug_ros.c:5
HRESULT hr
Definition: delayimp.cpp:582
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
static const struct pixel_format_desc formats[]
Definition: util.c:31
static HRESULT avi_decompressor_sink_connect(struct strmbase_sink *iface, IPin *peer, const AM_MEDIA_TYPE *pmt)
Definition: avidec.c:210
static struct avi_decompressor * impl_from_source_IQualityControl(IQualityControl *iface)
Definition: avidec.c:459
static HRESULT WINAPI avi_decompressor_source_qc_Notify(IQualityControl *iface, IBaseFilter *sender, Quality q)
Definition: avidec.c:483
static HRESULT avi_decompressor_sink_end_flush(struct strmbase_sink *iface)
Definition: avidec.c:79
HRESULT avi_dec_create(IUnknown *outer, IUnknown **out)
Definition: avidec.c:613
static void avi_decompressor_sink_disconnect(struct strmbase_sink *iface)
Definition: avidec.c:264
static HRESULT avi_decompressor_source_query_interface(struct strmbase_pin *iface, REFIID iid, void **out)
Definition: avidec.c:285
static HRESULT avi_decompressor_source_get_media_type(struct strmbase_pin *iface, unsigned int index, AM_MEDIA_TYPE *mt)
Definition: avidec.c:317
static HRESULT WINAPI avi_decompressor_source_qc_QueryInterface(IQualityControl *iface, REFIID iid, void **out)
Definition: avidec.c:464
static HRESULT WINAPI avi_decompressor_source_qc_SetSink(IQualityControl *iface, IQualityControl *sink)
Definition: avidec.c:501
static int AVIDec_DropSample(struct avi_decompressor *This, REFERENCE_TIME tStart)
Definition: avidec.c:90
static HRESULT avi_decompressor_source_query_accept(struct strmbase_pin *iface, const AM_MEDIA_TYPE *mt)
Definition: avidec.c:300
static void avi_decompressor_destroy(struct strmbase_filter *iface)
Definition: avidec.c:530
static const IQualityControlVtbl source_qc_vtbl
Definition: avidec.c:510
static HRESULT avi_decompressor_sink_query_accept(struct strmbase_pin *iface, const AM_MEDIA_TYPE *mt)
Definition: avidec.c:74
static struct strmbase_pin * avi_decompressor_get_pin(struct strmbase_filter *iface, unsigned int index)
Definition: avidec.c:519
static HRESULT avi_decompressor_init_stream(struct strmbase_filter *iface)
Definition: avidec.c:553
static const struct strmbase_source_ops source_ops
Definition: avidec.c:449
static const struct strmbase_sink_ops sink_ops
Definition: avidec.c:275
static const struct strmbase_filter_ops filter_ops
Definition: avidec.c:605
static ULONG WINAPI avi_decompressor_source_qc_AddRef(IQualityControl *iface)
Definition: avidec.c:471
static HRESULT WINAPI avi_decompressor_sink_Receive(struct strmbase_sink *iface, IMediaSample *pSample)
Definition: avidec.c:103
static ULONG WINAPI avi_decompressor_source_qc_Release(IQualityControl *iface)
Definition: avidec.c:477
static HRESULT avi_decompressor_sink_query_interface(struct strmbase_pin *iface, REFIID iid, void **out)
Definition: avidec.c:61
static struct avi_decompressor * impl_from_strmbase_filter(struct strmbase_filter *iface)
Definition: avidec.c:56
static HRESULT WINAPI avi_decompressor_source_DecideBufferSize(struct strmbase_source *iface, IMemAllocator *pAlloc, ALLOCATOR_PROPERTIES *ppropInputRequest)
Definition: avidec.c:431
static HRESULT avi_decompressor_cleanup_stream(struct strmbase_filter *iface)
Definition: avidec.c:580
void *WINAPI CoTaskMemAlloc(SIZE_T size)
Definition: malloc.c:381
void WINAPI CoTaskMemFree(void *ptr)
Definition: malloc.c:389
BOOL WINAPI InitializeCriticalSectionEx(OUT LPCRITICAL_SECTION lpCriticalSection, IN DWORD dwSpinCount, IN DWORD flags)
Definition: sync.c:107
#define assert(_expr)
Definition: assert.h:32
_ACRTIMP int __cdecl memcmp(const void *, const void *, size_t)
Definition: string.c:2807
LONGLONG REFERENCE_TIME
Definition: dmusicks.h:9
#define L(x)
Definition: resources.c:13
struct tagVIDEOINFOHEADER VIDEOINFOHEADER
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned long DWORD
Definition: ntddk_ex.h:95
GLdouble GLdouble GLdouble GLdouble q
Definition: gl.h:2063
GLuint res
Definition: glext.h:9613
GLsizeiptr size
Definition: glext.h:5919
GLuint index
Definition: glext.h:6031
GLbitfield flags
Definition: glext.h:7161
GLsizei GLenum GLboolean sink
Definition: glext.h:5672
GLuint64EXT * result
Definition: glext.h:11304
Definition: axcore.idl:92
#define S_OK
Definition: intsafe.h:52
#define FAILED(hr)
Definition: intsafe.h:51
if(dx< 0)
Definition: linetemp.h:194
LONG_PTR LRESULT
Definition: minwindef.h:176
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define BI_BITFIELDS
Definition: mmreg.h:507
#define mmioFOURCC(c0, c1, c2, c3)
Definition: mmsystem.h:38
static IUnknown * outer
Definition: compobj.c:82
const GUID * subtype
Definition: mpegvideo.c:120
DWORD VFWAPIV ICDecompress(HIC hic, DWORD dwFlags, LPBITMAPINFOHEADER lpbiFormat, LPVOID lpData, LPBITMAPINFOHEADER lpbi, LPVOID lpBits)
Definition: msvideo_main.c:814
HIC VFWAPI ICLocate(DWORD type, DWORD handler, BITMAPINFOHEADER *in, BITMAPINFOHEADER *out, WORD mode)
Definition: msvideo_main.c:620
LRESULT WINAPI ICClose(HIC hic)
long LONG
Definition: pedump.c:60
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95
#define REFIID
Definition: guiddef.h:118
#define calloc
Definition: rosglue.h:14
#define offsetof(TYPE, MEMBER)
wcscpy
#define memset(x, y, z)
Definition: compat.h:39
#define TRACE(s)
Definition: solgame.cpp:4
static const char * debugstr_time(REFERENCE_TIME time)
Definition: strmbase.h:32
HRESULT WINAPI BaseOutputPinImpl_DecideAllocator(struct strmbase_source *pin, IMemInputPin *peer, IMemAllocator **allocator)
Definition: pin.c:680
void strmbase_passthrough_cleanup(struct strmbase_passthrough *passthrough)
Definition: pospass.c:738
void strmbase_source_init(struct strmbase_source *pin, struct strmbase_filter *filter, const WCHAR *name, const struct strmbase_source_ops *func_table)
Definition: pin.c:765
void strmbase_sink_cleanup(struct strmbase_sink *pin)
Definition: pin.c:1185
void strmbase_sink_init(struct strmbase_sink *pin, struct strmbase_filter *filter, const WCHAR *name, const struct strmbase_sink_ops *ops, IMemAllocator *allocator)
Definition: pin.c:1168
void strmbase_filter_cleanup(struct strmbase_filter *filter)
Definition: filter.c:540
void strmbase_passthrough_init(struct strmbase_passthrough *passthrough, IUnknown *outer)
Definition: pospass.c:725
void strmbase_source_cleanup(struct strmbase_source *pin)
Definition: pin.c:778
void strmbase_filter_init(struct strmbase_filter *filter, IUnknown *outer, const CLSID *clsid, const struct strmbase_filter_ops *func_table)
Definition: filter.c:517
HRESULT WINAPI BaseOutputPinImpl_AttemptConnection(struct strmbase_source *pin, IPin *peer, const AM_MEDIA_TYPE *mt)
Definition: pin.c:710
DWORD biSizeImage
Definition: amvideo.idl:36
REFERENCE_TIME late
Definition: avidec.c:53
BITMAPINFOHEADER * pBihIn
Definition: avidec.c:50
CRITICAL_SECTION late_cs
Definition: avidec.c:52
struct strmbase_passthrough passthrough
Definition: avidec.c:45
IQualityControl source_IQualityControl_iface
Definition: avidec.c:44
Definition: filter.c:165
IBaseFilter * filter
Definition: filtergraph.c:75
IMediaSeeking IMediaSeeking_iface
Definition: filter.c:167
struct strmbase_filter * filter
Definition: strmbase.h:58
struct strmbase_pin pin
Definition: strmbase.h:106
struct strmbase_pin pin
Definition: strmbase.h:79
BITMAPINFOHEADER bmiHeader
Definition: amvideo.idl:189
REFERENCE_TIME AvgTimePerFrame
Definition: amvideo.idl:187
#define DWORD_PTR
Definition: treelist.c:76
unsigned char * LPBYTE
Definition: typedefs.h:53
int64_t LONGLONG
Definition: typedefs.h:68
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
uint32_t ULONG
Definition: typedefs.h:59
#define BI_RGB
Definition: uefivid.c:46
#define ICMODE_DECOMPRESS
Definition: vfw.h:269
#define ICDecompressQuery(hic, lpbiInput, lpbiOutput)
Definition: vfw.h:377
#define ICERR_OK
Definition: vfw.h:50
#define ICDecompressBegin(hic, lpbiInput, lpbiOutput)
Definition: vfw.h:371
#define ICDECOMPRESS_NOTKEYFRAME
Definition: vfw.h:331
#define ICDecompressGetFormatSize(hic, lpbi)
Definition: vfw.h:389
#define ICDecompressGetFormat(hic, lpbiInput, lpbiOutput)
Definition: vfw.h:383
#define ICDecompressEnd(hic)
Definition: vfw.h:404
#define ICDECOMPRESS_PREROLL
Definition: vfw.h:329
#define ICDECOMPRESS_HURRYUP
Definition: vfw.h:327
#define VFW_E_TYPE_NOT_ACCEPTED
Definition: vfwmsgs.h:81
#define VFW_S_NO_STOP_TIME
Definition: vfwmsgs.h:34
#define VFW_E_WRONG_STATE
Definition: vfwmsgs.h:78
#define VFW_S_NO_MORE_ITEMS
Definition: vfwmsgs.h:19
#define VFW_E_NOT_CONNECTED
Definition: vfwmsgs.h:48
wchar_t tm const _CrtWcstime_Writes_and_advances_ptr_ count wchar_t ** out
Definition: wcsftime.cpp:383
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
void WINAPI DeleteCriticalSection(PCRITICAL_SECTION)
#define WINAPI
Definition: msvc.h:6
#define S_FALSE
Definition: winerror.h:3451
#define E_NOINTERFACE
Definition: winerror.h:3479
#define RTL_CRITICAL_SECTION_FLAG_FORCE_DEBUG_INFO
Definition: winnt_old.h:1156
ULONG bpp[]
Definition: xlate.c:19
unsigned char BYTE
Definition: xxhash.c:193