36 #define MAX_FRAMESIZE (16 * 1024 * 1024) 37 #define MAX_FRAMESIZE_DIFF 512 88 This->dwUnusedBytes = 0;
100 *
obj = &
This->IAVIStream_iface;
190 TRACE(
"(%p,0x%08lX,0x%08lX)\n", iface, lParam1, lParam2);
209 This->sInfo.fccHandler =
pco->fccHandler;
216 if (
pco->cbParms > 0 &&
pco->lpParms !=
NULL) {
221 This->sInfo.dwQuality =
pco->dwQuality;
232 This->lKeyFrameEvery =
pco->dwKeyFrameEvery;
234 This->lKeyFrameEvery = 1;
245 This->sInfo.dwScale,
This->sInfo.dwRate);
247 pco->dwBytesPerSecond = 0;
248 This->dwBytesPerFrame = 0;
252 memset(&icFrames, 0,
sizeof(icFrames));
303 WARN(
": FIND_RET flags will be ignored!\n");
311 if (
This->lLastKey <=
pos || pos < This->lCurrent)
314 return This->lLastKey;
336 if (formatsize ==
NULL)
368 if (*formatsize < This->cbOutput)
373 *formatsize =
This->cbOutput;
390 WARN(
": need RGB data as input\n");
397 if (
This->cbInput != formatsize)
409 if (
This->sInfo.dwLength +
This->sInfo.dwStart >
pos)
413 if (
This->sInfo.fccHandler == 0 ||
431 This->cbInput = formatsize;
446 This->sInfo.rcFrame.right =
447 This->sInfo.rcFrame.left +
This->lpbiOutput->biWidth;
448 This->sInfo.rcFrame.bottom =
449 This->sInfo.rcFrame.top +
This->lpbiOutput->biHeight;
464 if (
This->lKeyFrameEvery != 1 &&
473 if (
This->lpbiPrev->biSizeImage == 0) {
474 This->lpbiPrev->biSizeImage =
479 size +=
This->lpbiPrev->biSizeImage;
493 if (lpbi->
biSize !=
This->lpbiInput->biSize ||
512 if (
This->lKeyFrameEvery != 1 &&
536 TRACE(
"(%p,%d,%d,%p,%d,%p,%p)\n", iface,
start,
samples,
buffer,
537 buffersize, bytesread, samplesread);
540 if (bytesread !=
NULL)
542 if (samplesread !=
NULL)
570 if (buffersize < lpbi->biSizeImage)
577 if (bytesread !=
NULL)
602 if (
This->lpbiCur->biSizeImage > buffersize)
609 if (bytesread !=
NULL)
610 *bytesread =
This->lpbiCur->biSizeImage;
614 if (samplesread !=
NULL)
630 TRACE(
"(%p,%d,%d,%p,%d,0x%08X,%p,%p)\n", iface,
start,
samples,
631 buffer, buffersize,
flags, sampwritten, byteswritten);
634 if (sampwritten !=
NULL)
636 if (byteswritten !=
NULL)
648 flags, sampwritten, byteswritten);
663 This->lpbiCur->biSizeImage,
flags, byteswritten,
683 TRACE(
"(%p,0x%08X,%p,%p)\n", iface, fcc, lp, lpread);
695 TRACE(
"(%p,0x%08x,%p,%d)\n", iface, fcc, lp,
size);
705 FIXME(
"(%p,%p,%d): stub\n", iface,
info, infolen);
710 static const struct IAVIStreamVtbl
iicmst = {
755 DWORD dwMinQual, dwMaxQual, dwCurQual;
764 if ((
This->lKeyFrameEvery != 0 &&
765 (
This->lCurrent -
This->lLastKey) >=
This->lKeyFrameEvery) ||
766 This->lCurrent ==
This->sInfo.dwStart) {
771 if (
This->lKeyFrameEvery != 0) {
772 if (
This->lCurrent ==
This->sInfo.dwStart) {
775 dwRequest =
This->dwBytesPerFrame +
This->dwUnusedBytes;
776 This->dwUnusedBytes = 0;
782 if (
This->dwBytesPerFrame >=
This->dwUnusedBytes)
783 tmp1 =
This->dwBytesPerFrame /
This->lKeyFrameEvery;
784 tmp2 = (
This->dwUnusedBytes + tmp1) /
This->lKeyFrameEvery;
786 dwRequest =
This->dwBytesPerFrame - tmp1 + tmp2;
787 This->dwUnusedBytes -= tmp2;
793 if (
This->lCurrent ==
This->sInfo.dwStart) {
794 dwRequest =
This->dwBytesPerFrame +
This->dwUnusedBytes;
795 This->dwUnusedBytes = 0;
804 dwMaxQual = dwCurQual =
This->sInfo.dwQuality;
817 &idxCkid, &idxFlags,
This->lCurrent, dwRequest, dwCurQual,
820 FIXME(
": codec has changed palette -- unhandled!\n");
828 if (dwRequest >=
This->lpbiCur->biSizeImage) {
830 if (dwMaxQual - dwCurQual > 10) {
831 DWORD tmp = dwRequest / 8;
836 if (tmp < dwRequest - This->lpbiCur->biSizeImage && bDecreasedQual) {
838 dwCurQual = (dwMinQual + dwMaxQual) / 2;
844 }
else if (dwMaxQual - dwMinQual <= 1) {
847 dwMaxQual = dwCurQual;
849 if (bDecreasedQual || dwCurQual ==
This->dwLastQuality)
850 dwCurQual = (dwMinQual + dwMaxQual) / 2;
852 FIXME(
": no new quality computed min=%u cur=%u max=%u last=%u\n",
853 dwMinQual, dwCurQual, dwMaxQual,
This->dwLastQuality);
855 bDecreasedQual =
TRUE;
860 This->dwLastQuality = dwCurQual;
861 This->dwUnusedBytes = dwRequest -
This->lpbiCur->biSizeImage;
912 This->sInfo.rcFrame.right =
913 This->sInfo.rcFrame.left +
This->lpbiOutput->biWidth;
914 This->sInfo.rcFrame.bottom =
915 This->sInfo.rcFrame.top +
This->lpbiOutput->biHeight;
916 This->sInfo.dwSuggestedBufferSize =
924 size +=
This->sInfo.dwSuggestedBufferSize;
932 if (
This->lKeyFrameEvery != 1 &&
941 if (
This->lpbiPrev->biSizeImage == 0) {
942 This->lpbiPrev->biSizeImage =
947 size +=
This->lpbiPrev->biSizeImage;
#define AVICOMPRESSF_DATARATE
#define ICDecompressEnd(hic)
#define AVIERR_NOCOMPRESSOR
static HRESULT WINAPI ICMStream_fnDelete(IAVIStream *iface, LONG start, LONG samples)
HIC VFWAPI ICOpen(DWORD fccType, DWORD fccHandler, UINT wMode)
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
#define ICCompressGetSize(hic, lpbiInput, lpbiOutput)
#define ICCOMPRESS_KEYFRAME
LRESULT VFWAPI ICSendMessage(HIC hic, UINT msg, DWORD_PTR lParam1, DWORD_PTR lParam2)
#define AVIERR_COMPRESSOR
#define IAVIStream_Info(p, a, b)
static HRESULT WINAPI ICMStream_fnWrite(IAVIStream *iface, LONG start, LONG samples, LPVOID buffer, LONG buffersize, DWORD flags, LPLONG sampwritten, LPLONG byteswritten)
#define IAVIStream_Release(p)
#define MAX_FRAMESIZE_DIFF
static HRESULT WINAPI ICMStream_fnRead(IAVIStream *iface, LONG start, LONG samples, LPVOID buffer, LONG buffersize, LPLONG bytesread, LPLONG samplesread)
struct IGetFrame * PGETFRAME
#define ICDecompressGetFormat(hic, lpbiInput, lpbiOutput)
INT WINAPI MulDiv(INT nNumber, INT nNumerator, INT nDenominator)
#define OLE_E_ENUM_NOMORE
LPBITMAPINFOHEADER lpbiInput
#define IAVIStream_ReadData(p, a, b, c)
static const WCHAR avifile[]
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
#define ICCompressGetFormat(hic, lpbiInput, lpbiOutput)
static LONG WINAPI ICMStream_fnFindSample(IAVIStream *iface, LONG pos, LONG flags)
#define ICCompressBegin(hic, lpbiInput, lpbiOutput)
static ULONG WINAPI ICMStream_fnRelease(IAVIStream *iface)
static HRESULT WINAPI ICMStream_fnReadFormat(IAVIStream *iface, LONG pos, LPVOID format, LONG *formatsize)
static HRESULT WINAPI ICMStream_fnReadData(IAVIStream *iface, DWORD fcc, LPVOID lp, LPLONG lpread)
#define DIBWIDTHBYTES(bi)
#define VIDCF_COMPRESSFRAMES
DWORD VFWAPIV ICDecompress(HIC hic, DWORD dwFlags, LPBITMAPINFOHEADER lpbiFormat, LPVOID lpData, LPBITMAPINFOHEADER lpbi, LPVOID lpBits)
#define ICQUALITY_DEFAULT
LPBITMAPINFOHEADER lpbiInput
#define ICM_COMPRESS_FRAMES_INFO
#define AVICOMPRESSF_KEYFRAMES
#define IAVIStream_AddRef(p)
static HRESULT WINAPI ICMStream_fnWriteData(IAVIStream *iface, DWORD fcc, LPVOID lp, LONG size)
#define ICSetState(hic, pv, cb)
struct IAVIStream * PAVISTREAM
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)
#define AVIFILECAPS_CANWRITE
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)
#define AVIERR_BUFFERTOOSMALL
#define ICCompressGetFormatSize(hic, lpbi)
#define AVIERR_UNSUPPORTED
#define ICCompressEnd(hic)
#define IAVIStream_Write(p, a, b, c, d, e, f, g)
static HRESULT AVIFILE_EncodeFrame(IAVIStreamImpl *This, LPBITMAPINFOHEADER lpbi, LPVOID lpBits)
LRESULT VFWAPI ICGetInfo(HIC hic, ICINFO *picinfo, DWORD cb)
#define IAVIStream_Read(p, a, b, c, d, e, f)
static HRESULT WINAPI ICMStream_fnSetInfo(IAVIStream *iface, LPAVISTREAMINFOW info, LONG infolen)
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define IAVIStream_SetFormat(p, a, b, c)
LPVOID WINAPI AVIStreamGetFrame(PGETFRAME pg, LONG pos)
WINE_DEFAULT_DEBUG_CHANNEL(avifile)
#define VIDCF_FASTTEMPORALC
struct AVICOMPRESSOPTIONS * LPAVICOMPRESSOPTIONS
struct _IAVIStreamImpl IAVIStreamImpl
static void AVIFILE_Reset(IAVIStreamImpl *This)
#define InterlockedDecrement
#define IAVIStream_WriteData(p, a, b, c)
#define ICDecompressGetFormatSize(hic, lpbi)
#define mmioFOURCC(c0, c1, c2, c3)
#define memcpy(s1, s2, n)
_In_ SURFOBJ _In_ CLIPOBJ * pco
IAVIStream IAVIStream_iface
#define IAVIStream_QueryInterface(p, a, b)
#define ICDecompressBegin(hic, lpbiInput, lpbiOutput)
LPBITMAPINFOHEADER lpbiCur
static ULONG WINAPI ICMStream_fnAddRef(IAVIStream *iface)
#define InterlockedIncrement
HRESULT WINAPI AVIStreamGetFrameClose(PGETFRAME pg)
static HRESULT WINAPI ICMStream_fnInfo(IAVIStream *iface, LPAVISTREAMINFOW psi, LONG size)
#define IAVIStream_Delete(p, a, b)
LPBITMAPINFOHEADER lpbiOutput
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
static HRESULT WINAPI ICMStream_fnQueryInterface(IAVIStream *iface, REFIID refiid, LPVOID *obj)
static HRESULT AVIFILE_OpenGetFrame(IAVIStreamImpl *This)
HRESULT AVIFILE_CreateICMStream(REFIID riid, LPVOID *ppv)
static HRESULT WINAPI ICMStream_fnCreate(IAVIStream *iface, LPARAM lParam1, LPARAM lParam2)
static IAVIStreamImpl * impl_from_IAVIStream(IAVIStream *iface)
LPBITMAPINFOHEADER lpbiOutput
static HRESULT WINAPI ICMStream_fnSetFormat(IAVIStream *iface, LONG pos, LPVOID format, LONG formatsize)
static const struct IAVIStreamVtbl iicmst
#define HeapFree(x, y, z)
static DWORD ICGetDefaultQuality(HIC hic)
LPBITMAPINFOHEADER lpbiPrev
PGETFRAME WINAPI AVIStreamGetFrameOpen(PAVISTREAM pstream, LPBITMAPINFOHEADER lpbiWanted)