38 #include "wine/winternl.h" 45 #include "wine/list.h" 48 #define HKLM_DRIVERS32 "Software\\Microsoft\\Windows NT\\CurrentVersion\\Drivers32" 53 #define fourcc_to_string(str, fcc) do { \ 54 (str)[0] = LOBYTE(LOWORD(fcc)); \ 55 (str)[1] = HIBYTE(LOWORD(fcc)); \ 56 (str)[2] = LOBYTE(HIWORD(fcc)); \ 57 (str)[3] = HIBYTE(HIWORD(fcc)); \ 77 #define XX(x) case (x): str = #x; break 141 #define XX(x) case x: TRACE("(%p,"#x",0x%08lx,0x%08lx)\n",whic,lParam1,lParam2); break 202 FIXME(
"(%p,0x%08x,0x%08lx,0x%08lx) unknown message\n",whic,
msg,lParam1,lParam2);
272 char name_buf[10],
buf[2048];
273 DWORD ret_type, ret_handler;
279 TRACE(
"type %s, handler %s, info %p.\n",
283 info->dwSize =
sizeof(*info);
296 if (name_len != 9 || name_buf[4] !=
'.')
continue;
302 info->fccType = ret_type;
303 info->fccHandler = ret_handler;
316 if (
s[4] !=
'.' ||
s[9] !=
'=')
continue;
322 info->fccType = ret_type;
323 info->fccHandler = ret_handler;
353 TRACE(
"type %s, handler %s, lparam %#lx, desc %s, flags %#x.\n",
408 TRACE(
"type %s, handler %s, flags %#x.\n",
446 static const WCHAR drv32W[] = {
'd',
'r',
'i',
'v',
'e',
'r',
's',
'3',
'2',
'\0'};
466 TRACE(
"Returning %s as default handler for %s\n",
540 TRACE(
"(%s,%s,%d,%p)\n",
567 WARN(
"DRV_LOAD failed for hic %p\n", whic->
hic);
581 WARN(
"DRV_OPEN failed for hic %p\n", whic->
hic);
599 TRACE(
"(%p,%p,%d)\n", hic, picinfo,
cb);
617 if (
cb >=
sizeof(
ICINFO) && picinfo->szDriver[0] == 0)
621 memset(&ii, 0,
sizeof(ii));
623 ICInfo(picinfo->fccType, picinfo->fccHandler, &ii);
641 TRACE(
"type %s, handler %s, in %p, out %p, mode %u.\n",
690 WARN(
"Could not find a driver for codec %s.%s.\n",
704 TRACE(
"(%p, %p, %p, %d, %d, %d)\n", hic,
in,
out,
depth,
width,
height);
726 out->biSize =
sizeof(*out);
745 out->biBitCount = 16;
759 out->biBitCount = 24;
768 out->biBitCount = 32;
775 out->biWidth =
in->biWidth;
776 out->biHeight =
in->biHeight;
777 out->biBitCount = 32;
805 TRACE(
"(%p,%d,%p,%p,%p,%p,...)\n",hic,
dwFlags,lpbiOutput,lpData,lpbiInput,lpBits);
810 iccmp.lpOutput = lpData;
812 iccmp.lpInput = lpBits;
820 iccmp.lpPrev = lpPrev;
833 TRACE(
"(%p,%d,%p,%p,%p,%p)\n",hic,
dwFlags,lpbiFormat,lpData,lpbi,lpBits);
837 icd.lpInput = lpData;
840 icd.lpOutput = lpBits;
885 if (!enum_all && pcv->
lpbiIn)
889 TRACE(
"fccHandler %s doesn't support input DIB format %d\n",
927 if (choose_comp->
title)
990 can_configure =
TRUE;
1103 TRACE(
"(%p,%08x,%p,%p,%p,%s)\n",
hwnd, uiFlags, pvIn, lpData, pc, lpszTitle);
1125 choose_comp.
cv = *pc;
1126 choose_comp.
flags = uiFlags;
1127 choose_comp.
title = lpszTitle;
1134 *pc = choose_comp.cv;
1147 TRACE(
"(%p)\n", pc);
1203 TRACE(
"(%p,%d,%p,%p,%p,%u,%u,%u,%u,%p,%u,%u,%u,%u,%d,%d)\n",
1205 lpbi, xSrc, ySrc, dxSrc, dySrc, dwRate, dwScale);
1231 TRACE(
"(%p,%d,%p,%p,%d,%d)\n",hic,
dwFlags,
lpFormat,lpData,cbData,lTime);
1250 TRACE(
"(%p)\n",hic);
1285 HIC hic,
UINT uiFlags,
1290 FIXME(
"(%p,%08x,%p,%p,%p,%d,%p)\n",
1291 hic, uiFlags, lpbiIn, lpBits, lpbiOut, lQuality, plSize);
1313 TRACE(
"(%p,%08x,%p,%p,%p)\n",
1314 hic, uiFlags, lpbiIn, lpBits, lpbiOut);
1321 WARN(
"no handler\n" );
1328 FIXME(
"unknown flag %08x\n", uiFlags );
1331 if ( lpbiIn ==
NULL || lpBits ==
NULL )
1333 WARN(
"invalid argument\n");
1337 if ( lpbiOut !=
NULL )
1343 cbHdr +=
sizeof(
DWORD)*3;
1355 TRACE(
"get format\n" );
1360 if (!(pHdr = heap_alloc_zero(cbHdr +
sizeof(
RGBQUAD) * 256)))
1383 if ( biSizeImage == 0 )
1386 TRACE(
"call ICDecompressBegin\n" );
1390 bInDecompress =
TRUE;
1392 TRACE(
"cbHdr %d, biSizeImage %d\n", cbHdr, biSizeImage );
1397 WARN(
"out of memory\n" );
1403 memcpy( pMem, lpbiOut, cbHdr );
1405 TRACE(
"call ICDecompress\n" );
1411 if ( bInDecompress )
1418 if ( !bSucceeded && hMem !=
NULL )
1433 TRACE(
"(%p, 0x%08x, %p, %p, %p)\n", pc, uiFlags, lpBits, pfKey, plSize);
1451 icComp->lpInput = lpBits;
1465 TRACE(
"Key frame\n");
1470 *plSize = icComp->lpbiOutput->biSizeImage;
1478 TRACE(
"returning: %p, compressed frame size %u\n", icComp->lpOutput, *plSize);
1479 return icComp->lpOutput;
1504 TRACE(
"(%p)\n", pc);
1515 if (
src->bmiHeader.biClrUsed)
1516 num_colors =
min(
src->bmiHeader.biClrUsed, 256);
1518 num_colors =
src->bmiHeader.biBitCount > 8 ? 0 : 1 <<
src->bmiHeader.biBitCount;
1567 ERR(
"Could not get output format from compressor\n");
1578 ERR(
"Bad codec! Invalid output frame size, guessing from input\n");
1582 TRACE(
"Input: %ux%u, fcc %s, bpp %u, size %u\n",
1587 TRACE(
"Output: %ux%u, fcc %s, bpp %u, size %u\n",
1608 "\tkey/data/quality: %i/%i/%i\n",
1641 CHAR szFunctionName[20];
1646 FIXME(
"(%p,%d,%d), semi-stub!\n",lpofn,bSave,bUnicode);
1648 lstrcpyA(szFunctionName, (bSave ?
"GetSaveFileName" :
"GetOpenFileName"));
1649 lstrcatA(szFunctionName, (bUnicode ?
"W" :
"A"));
1652 if (hComdlg32 ==
NULL)
1656 if (fnGetFileName ==
NULL)
1663 ret = fnGetFileName(lpofn);
1674 FIXME(
"(%p), semi-stub!\n", lpofn);
1684 FIXME(
"(%p), semi-stub!\n", lpofn);
1694 FIXME(
"(%p), semi-stub!\n", lpofn);
1704 FIXME(
"(%p), semi-stub!\n", lpofn);
#define ICM_DECOMPRESSEX_QUERY
LRESULT(CALLBACK * DRIVERPROC)(DWORD_PTR, HDRVR, UINT, LPARAM, LPARAM)
#define ICM_DECOMPRESSEX_BEGIN
#define ICDecompressEnd(hic)
#define ICMF_CHOOSE_ALLCOMPRESSORS
LRESULT WINAPI SendDriverMessage(HDRVR hDriver, UINT msg, LPARAM lParam1, LPARAM lParam2)
GLint GLint GLsizei width
static LRESULT MSVIDEO_SendMessage(WINE_HIC *whic, UINT msg, DWORD_PTR lParam1, DWORD_PTR lParam2)
HGLOBAL NTAPI GlobalAlloc(UINT uFlags, SIZE_T dwBytes)
HIC VFWAPI ICOpen(DWORD fccType, DWORD fccHandler, UINT wMode)
LPBITMAPINFOHEADER lpbiInput
INT_PTR WINAPI DialogBoxParamW(_In_opt_ HINSTANCE, _In_ LPCWSTR, _In_opt_ HWND, _In_opt_ DLGPROC, _In_ LPARAM)
#define ICM_COMPRESS_BEGIN
BITMAPINFOHEADER bmiHeader
#define ERROR_NO_MORE_ITEMS
#define ICCOMPRESS_KEYFRAME
#define ICDecompressQuery(hic, lpbiInput, lpbiOutput)
#define ICM_DECOMPRESS_SET_PALETTE
ACPI_SIZE strlen(const char *String)
LRESULT VFWAPI ICSendMessage(HIC hic, UINT msg, DWORD_PTR lParam1, DWORD_PTR lParam2)
struct tagBITMAPINFOHEADER BITMAPINFOHEADER
GLuint GLuint GLsizei count
#define ICM_GETDEFAULTQUALITY
static const char * wine_dbgstr_icerr(int ret)
#define ICM_DECOMPRESSEX_END
struct tagWINE_HIC * next
LRESULT WINAPI CloseDriver(HDRVR hDrvr, LPARAM lParam1, LPARAM lParam2)
LPBITMAPINFOHEADER lpbiInput
BOOL WINAPI DisableThreadLibraryCalls(IN HMODULE hLibModule)
LONG WINAPI RegOpenKeyExA(_In_ HKEY hKey, _In_ LPCSTR lpSubKey, _In_ DWORD ulOptions, _In_ REGSAM samDesired, _Out_ PHKEY phkResult)
HWND WINAPI SetFocus(_In_opt_ HWND)
#define DLL_PROCESS_ATTACH
#define ICMF_COMPVARS_VALID
struct @1653::@1654 driver
#define GetWindowLongPtrW
static WINE_HIC * MSVIDEO_FirstHic
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
#define ICDecompressGetFormat(hic, lpbiInput, lpbiOutput)
_Check_return_ _CRTIMP int __cdecl isalnum(_In_ int _C)
HDRVR WINAPI OpenDriver(LPCWSTR lpDriverName, LPCWSTR lpSectionName, LPARAM lParam)
static BITMAPINFO * copy_bitmapinfo(const BITMAPINFO *src)
#define ICM_COMPRESS_QUERY
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
#define IDC_QUALITY_SCROLL
#define ICMODE_FASTDECOMPRESS
HIC VFWAPI ICOpenFunction(DWORD fccType, DWORD fccHandler, UINT wMode, DRIVERPROC lpfnHandler)
static void * heap_alloc(size_t len)
DWORD VFWAPIV ICDrawBegin(HIC hic, DWORD dwFlags, HPALETTE hpal, HWND hwnd, HDC hdc, INT xDst, INT yDst, INT dxDst, INT dyDst, LPBITMAPINFOHEADER lpbi, INT xSrc, INT ySrc, INT dxSrc, INT dySrc, DWORD dwRate, DWORD dwScale)
const char * wine_dbg_sprintf(const char *format,...)
__WINE_SERVER_LIST_INLINE void list_add_tail(struct list *list, struct list *elem)
GLenum GLuint GLenum GLsizei const GLchar * buf
#define ICM_DECOMPRESS_QUERY
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
static BOOL enum_compressors(HWND list, COMPVARS *pcv, BOOL enum_all)
LPBITMAPINFOHEADER lpbiOutput
DWORD VFWAPIV ICDecompress(HIC hic, DWORD dwFlags, LPBITMAPINFOHEADER lpbiFormat, LPVOID lpData, LPBITMAPINFOHEADER lpbi, LPVOID lpBits)
LRESULT WINAPI ICClose(HIC hic)
#define ICQUALITY_DEFAULT
#define ICCompressQuery(hic, lpbiInput, lpbiOutput)
static const WCHAR desc[]
static UINT WPARAM LPARAM lparam
static struct _test_info info[]
#define ICM_COMPRESS_FRAMES_INFO
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryA(LPCSTR lpLibFileName)
#define ICMF_CHOOSE_DATARATE
HANDLE VFWAPI ICImageCompress(HIC hic, UINT uiFlags, LPBITMAPINFO lpbiIn, LPVOID lpBits, LPBITMAPINFO lpbiOut, LONG lQuality, LONG *plSize)
LPBITMAPINFOHEADER lpbiPrev
DWORD VFWAPIV ICDraw(HIC hic, DWORD dwFlags, LPVOID lpFormat, LPVOID lpData, DWORD cbData, LONG lTime)
BOOL VFWAPI ICInstall(DWORD type, DWORD handler, LPARAM lparam, char *desc, UINT flags)
WINE_DEFAULT_DEBUG_CHANNEL(msvideo)
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 ICM_DRAW_STOP_PLAY
#define ICERR_BADIMAGESIZE
#define ICM_DRAW_START_PLAY
DWORD WINAPI VideoForWindowsVersion(void)
static void clear_compvars(PCOMPVARS pc)
#define ICINSTALL_FUNCTION
FOURCC WINAPI mmioStringToFOURCCA(LPCSTR sz, UINT uFlags)
#define ICM_DRAW_SUGGESTFORMAT
BOOL WINAPI GetOpenFileNamePreviewA(LPOPENFILENAMEA lpofn)
__WINE_SERVER_LIST_INLINE void list_remove(struct list *elem)
LPSTR WINAPI lstrcatA(LPSTR lpString1, LPCSTR lpString2)
static struct list reg_driver_list
LRESULT VFWAPI ICGetInfo(HIC hic, ICINFO *picinfo, DWORD cb)
LONG WINAPI RegEnumValueA(_In_ HKEY hKey, _In_ DWORD dwIndex, _Out_ LPSTR lpName, _Inout_ LPDWORD lpcbName, _Reserved_ LPDWORD lpdwReserved, _Out_opt_ LPDWORD lpdwType, _Out_opt_ LPBYTE lpData, _Inout_opt_ LPDWORD lpcbData)
#define ICDecompressOpen(fccType, fccHandler, lpbiIn, lpbiOut)
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define ICM_DECOMPRESS_GET_PALETTE
#define ICMODE_DECOMPRESS
BOOL WINAPI SetWindowTextA(_In_ HWND, _In_opt_ LPCSTR)
#define ICDecompressGetPalette(hic, lpbiInput, lpbiOutput)
static INT_PTR CALLBACK icm_choose_compressor_dlgproc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lparam)
#define ICM_DECOMPRESS_GET_FORMAT
HANDLE VFWAPI ICImageDecompress(HIC hic, UINT uiFlags, LPBITMAPINFO lpbiIn, LPVOID lpBits, LPBITMAPINFO lpbiOut)
#define ICM_DECOMPRESS_END
#define ICERR_BADBITDEPTH
#define _strnicmp(_String1, _String2, _MaxCount)
HGLOBAL NTAPI GlobalFree(HGLOBAL hMem)
LRESULT WINAPI SendDlgItemMessageW(_In_ HWND, _In_ int, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define ICQueryConfigure(hic)
#define ICMODE_FASTCOMPRESS
LPSTR WINAPI lstrcpyA(LPSTR lpString1, LPCSTR lpString2)
static WCHAR reason[MAX_STRING_RESOURCE_LEN]
#define ICQueryAbout(hic)
GLint GLint GLsizei GLsizei GLsizei depth
#define ICM_GETBUFFERSWANTED
#define ICAbout(hic, hwnd)
#define ICERR_STOPDRAWING
#define ICERR_UNSUPPORTED
LPVOID NTAPI GlobalLock(HGLOBAL hMem)
BOOL WINAPI GetSaveFileNamePreviewW(LPOPENFILENAMEW lpofn)
static __inline const char * debugstr_an(const char *s, int n)
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
#define ICDecompressGetFormatSize(hic, lpbi)
BOOL WINAPI DllMain(HINSTANCE hinst, DWORD reason, LPVOID reserved)
#define memcpy(s1, s2, n)
static DWORD IC_HandleRef
static const char * wine_dbgstr_fcc(DWORD fcc)
BOOL VFWAPI ICInfo(DWORD type, DWORD handler, ICINFO *info)
#define ICM_DECOMPRESS_BEGIN
LPVOID VFWAPI ICSeqCompressFrame(PCOMPVARS pc, UINT uiFlags, LPVOID lpBits, BOOL *pfKey, LONG *plSize)
#define ICDecompressBegin(hic, lpbiInput, lpbiOutput)
GLint GLint GLsizei GLsizei height
#define ICM_SET_STATUS_PROC
#define ICConfigure(hic, hwnd)
static BOOL GetFileNamePreview(LPVOID lpofn, BOOL bSave, BOOL bUnicode)
HIC VFWAPI ICGetDisplayFormat(HIC hic, BITMAPINFOHEADER *in, BITMAPINFOHEADER *out, int depth, int width, int height)
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
#define ICM_COMPRESS_GET_FORMAT
#define ICMF_CHOOSE_KEYFRAME
BOOL WINAPI GetOpenFileNamePreviewW(LPOPENFILENAMEW lpofn)
void VFWAPI ICCompressorFree(PCOMPVARS pc)
BOOL WINAPI GetSaveFileNamePreviewA(LPOPENFILENAMEA lpofn)
#define IDC_KEYFRAME_FRAMES
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
#define fourcc_to_string(str, fcc)
LPBITMAPINFOHEADER lpbiOutput
#define MMSYSERR_INVALPARAM
BOOL VFWAPI ICSeqCompressFrameStart(PCOMPVARS pc, LPBITMAPINFO lpbiIn)
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
LONG WINAPI RegDeleteValueA(HKEY hKey, LPCSTR lpValueName)
#define FIELD_OFFSET(t, f)
#define IDC_DATARATE_CHECKBOX
BOOL NTAPI GlobalUnlock(HGLOBAL hMem)
#define MultiByteToWideChar
static HMODULE MODULEINFO DWORD cb
HIC VFWAPI ICLocate(DWORD type, DWORD handler, BITMAPINFOHEADER *in, BITMAPINFOHEADER *out, WORD mode)
void VFWAPI ICSeqCompressFrameEnd(PCOMPVARS pc)
BOOL VFWAPI ICCompressorChoose(HWND hwnd, UINT uiFlags, LPVOID pvIn, LPVOID lpData, PCOMPVARS pc, LPSTR lpszTitle)
#define ICM_DRAW_RENDERBUFFER
static int compare_fourcc(DWORD fcc1, DWORD fcc2)
BOOL VFWAPI ICRemove(DWORD type, DWORD handler, UINT flags)
#define GetProcAddress(x, y)
#define SetWindowLongPtrW
#define MAKEINTRESOURCEW(i)
GLuint GLuint GLsizei GLenum type
LONG WINAPI RegSetValueExA(HKEY hKey, LPCSTR lpValueName, DWORD Reserved, DWORD dwType, CONST BYTE *lpData, DWORD cbData)
UINT(* handler)(MSIPACKAGE *)
#define IDC_KEYFRAME_CHECKBOX
#define ICERR_GOTOKEYFRAME
static WINE_HIC * MSVIDEO_GetHicPtr(HIC hic)
#define ICM_GETDEFAULTKEYFRAMERATE
#define RegCloseKey(hKey)
static DWORD get_size_image(LONG width, LONG height, WORD depth)
#define ICM_DRAW_GET_PALETTE
static UINT WPARAM wparam
#define ICM_CHOOSE_COMPRESSOR
INT WINAPI GetPrivateProfileSectionA(LPCSTR section, LPSTR buffer, DWORD len, LPCSTR filename)
static BOOL heap_free(void *mem)
#define ICM_COMPRESS_GET_SIZE
#define ICM_DRAW_CHANGEPALETTE
#define HKEY_LOCAL_MACHINE