- Add mciavi32, mcicda, mciqtz32, mciseq, mciwave from Wine

svn path=/trunk/; revision=39821
This commit is contained in:
Dmitry Chapyshev 2009-03-01 11:54:06 +00:00
parent 835d718621
commit 832f03d77d
25 changed files with 8277 additions and 0 deletions

View file

@ -43,6 +43,10 @@
<property name="BASEADDRESS_QEDIT" value="0x611c0000" />
<property name="BASEADDRESS_MODEMUI" value="0x61650000" />
<property name="BASEADDRESS_MAPI32" value="0x62250000" />
<property name="BASEADDRESS_MCIWAVE" value="0x622a0000" />
<property name="BASEADDRESS_MCISEQ" value="0x622b0000" />
<property name="BASEADDRESS_MCIQTZ32" value="0x622c0000" />
<property name="BASEADDRESS_MCICDA" value="0x622e0000" />
<property name="BASEADDRESS_LOCALUI" value="0x62f70000" />
<property name="BASEADDRESS_HDWWIZ" value="0x64d40000" />
<property name="BASEADDRESS_TIMEDATE" value="0x64da0000" />
@ -119,6 +123,7 @@
<property name="BASEADDRESS_WINSPOOL" value="0x72f50000" />
<property name="BASEADDRESS_MSCAT32" value="0x732b0000" />
<property name="BASEADDRESS_MSTASK" value="0x73520000" />
<property name="BASEADDRESS_MCIAVI32" value="0x73610000" />
<property name="BASEADDRESS_MSRLE32" value="0x73660000" />
<property name="BASEADDRESS_MSDMO" value="0x73670000" />
<property name="BASEADDRESS_AVIFIL32" value="0x73ac0000" />

View file

@ -292,6 +292,11 @@ dll\win32\localui\localui.dll 1
dll\win32\lsasrv\lsasrv.dll 1
dll\win32\lz32\lz32.dll 1
dll\win32\mapi32\mapi32.dll 1
dll\win32\mciavi32\mciavi32.dll 1
dll\win32\mcicda\mcicda.dll 1
dll\win32\mciqtz32\mciqtz32.dll 1
dll\win32\mciseq\mciseq.dll 1
dll\win32\mciwave\mciwave.dll 1
dll\win32\mlang\mlang.dll 1
dll\win32\mmdrv\mmdrv.dll 1
dll\win32\modemui\modemui.dll 1

View file

@ -0,0 +1,473 @@
/*
* Digital video MCI Wine Driver
*
* Copyright 1999, 2000 Eric POUECH
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <string.h>
#include "private_mciavi.h"
#include "wine/debug.h"
#include "wine/unicode.h"
WINE_DEFAULT_DEBUG_CHANNEL(mciavi);
/**************************************************************************
* MCIAVI_ConvertFrameToTimeFormat [internal]
*/
static DWORD MCIAVI_ConvertFrameToTimeFormat(WINE_MCIAVI* wma, DWORD val, LPDWORD lpRet)
{
DWORD ret = 0;
switch (wma->dwMciTimeFormat) {
case MCI_FORMAT_MILLISECONDS:
ret = (val * wma->mah.dwMicroSecPerFrame) / 1000;
break;
case MCI_FORMAT_FRAMES:
ret = val;
break;
default:
WARN("Bad time format %u!\n", wma->dwMciTimeFormat);
}
TRACE("val=%u=0x%08x [tf=%u] => ret=%u\n", val, val, wma->dwMciTimeFormat, ret);
*lpRet = 0;
return ret;
}
/**************************************************************************
* MCIAVI_ConvertTimeFormatToFrame [internal]
*/
DWORD MCIAVI_ConvertTimeFormatToFrame(WINE_MCIAVI* wma, DWORD val)
{
DWORD ret = 0;
switch (wma->dwMciTimeFormat) {
case MCI_FORMAT_MILLISECONDS:
ret = (val * 1000) / wma->mah.dwMicroSecPerFrame;
break;
case MCI_FORMAT_FRAMES:
ret = val;
break;
default:
WARN("Bad time format %u!\n", wma->dwMciTimeFormat);
}
TRACE("val=%u=0x%08x [tf=%u] => ret=%u\n", val, val, wma->dwMciTimeFormat, ret);
return ret;
}
/***************************************************************************
* MCIAVI_mciGetDevCaps [internal]
*/
DWORD MCIAVI_mciGetDevCaps(UINT wDevID, DWORD dwFlags, LPMCI_GETDEVCAPS_PARMS lpParms)
{
WINE_MCIAVI* wma = MCIAVI_mciGetOpenDev(wDevID);
DWORD ret;
TRACE("(%04x, %08X, %p)\n", wDevID, dwFlags, lpParms);
if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK;
if (wma == NULL) return MCIERR_INVALID_DEVICE_ID;
EnterCriticalSection(&wma->cs);
if (dwFlags & MCI_GETDEVCAPS_ITEM) {
switch (lpParms->dwItem) {
case MCI_GETDEVCAPS_DEVICE_TYPE:
TRACE("MCI_GETDEVCAPS_DEVICE_TYPE !\n");
lpParms->dwReturn = MAKEMCIRESOURCE(MCI_DEVTYPE_DIGITAL_VIDEO, MCI_DEVTYPE_DIGITAL_VIDEO);
ret = MCI_RESOURCE_RETURNED;
break;
case MCI_GETDEVCAPS_HAS_AUDIO:
TRACE("MCI_GETDEVCAPS_HAS_AUDIO !\n");
lpParms->dwReturn = MAKEMCIRESOURCE(TRUE, MCI_TRUE);
ret = MCI_RESOURCE_RETURNED;
break;
case MCI_GETDEVCAPS_HAS_VIDEO:
TRACE("MCI_GETDEVCAPS_HAS_VIDEO !\n");
lpParms->dwReturn = MAKEMCIRESOURCE(TRUE, MCI_TRUE);
ret = MCI_RESOURCE_RETURNED;
break;
case MCI_GETDEVCAPS_USES_FILES:
TRACE("MCI_GETDEVCAPS_USES_FILES !\n");
lpParms->dwReturn = MAKEMCIRESOURCE(TRUE, MCI_TRUE);
ret = MCI_RESOURCE_RETURNED;
break;
case MCI_GETDEVCAPS_COMPOUND_DEVICE:
TRACE("MCI_GETDEVCAPS_COMPOUND_DEVICE !\n");
lpParms->dwReturn = MAKEMCIRESOURCE(TRUE, MCI_TRUE);
ret = MCI_RESOURCE_RETURNED;
break;
case MCI_GETDEVCAPS_CAN_EJECT:
TRACE("MCI_GETDEVCAPS_CAN_EJECT !\n");
lpParms->dwReturn = MAKEMCIRESOURCE(FALSE, MCI_FALSE);
ret = MCI_RESOURCE_RETURNED;
break;
case MCI_GETDEVCAPS_CAN_PLAY:
TRACE("MCI_GETDEVCAPS_CAN_PLAY !\n");
lpParms->dwReturn = MAKEMCIRESOURCE(TRUE, MCI_TRUE);
ret = MCI_RESOURCE_RETURNED;
break;
case MCI_GETDEVCAPS_CAN_RECORD:
TRACE("MCI_GETDEVCAPS_CAN_RECORD !\n");
lpParms->dwReturn = MAKEMCIRESOURCE(FALSE, MCI_FALSE);
ret = MCI_RESOURCE_RETURNED;
break;
case MCI_GETDEVCAPS_CAN_SAVE:
TRACE("MCI_GETDEVCAPS_CAN_SAVE !\n");
lpParms->dwReturn = MAKEMCIRESOURCE(FALSE, MCI_FALSE);
ret = MCI_RESOURCE_RETURNED;
break;
default:
FIXME("Unknown capability (%08x) !\n", lpParms->dwItem);
ret = MCIERR_UNRECOGNIZED_COMMAND;
break;
}
} else {
WARN("No GetDevCaps-Item !\n");
ret = MCIERR_UNRECOGNIZED_COMMAND;
}
LeaveCriticalSection(&wma->cs);
return ret;
}
/***************************************************************************
* MCIAVI_mciInfo [internal]
*/
DWORD MCIAVI_mciInfo(UINT wDevID, DWORD dwFlags, LPMCI_DGV_INFO_PARMSW lpParms)
{
LPCWSTR str = 0;
WINE_MCIAVI* wma = MCIAVI_mciGetOpenDev(wDevID);
DWORD ret = 0;
static const WCHAR wszAviPlayer[] = {'W','i','n','e','\'','s',' ','A','V','I',' ','p','l','a','y','e','r',0};
if (lpParms == NULL || lpParms->lpstrReturn == NULL)
return MCIERR_NULL_PARAMETER_BLOCK;
if (wma == NULL) return MCIERR_INVALID_DEVICE_ID;
TRACE("buf=%p, len=%u\n", lpParms->lpstrReturn, lpParms->dwRetSize);
EnterCriticalSection(&wma->cs);
if (dwFlags & MCI_INFO_PRODUCT)
str = wszAviPlayer;
else if (dwFlags & MCI_INFO_FILE)
str = wma->lpFileName;
else {
WARN("Don't know this info command (%u)\n", dwFlags);
ret = MCIERR_UNRECOGNIZED_COMMAND;
}
if (str) {
if (strlenW(str) + 1 > lpParms->dwRetSize) {
ret = MCIERR_PARAM_OVERFLOW;
} else {
lstrcpynW(lpParms->lpstrReturn, str, lpParms->dwRetSize);
}
} else {
lpParms->lpstrReturn[0] = 0;
}
LeaveCriticalSection(&wma->cs);
return ret;
}
/***************************************************************************
* MCIAVI_mciSet [internal]
*/
DWORD MCIAVI_mciSet(UINT wDevID, DWORD dwFlags, LPMCI_DGV_SET_PARMS lpParms)
{
WINE_MCIAVI* wma = MCIAVI_mciGetOpenDev(wDevID);
if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK;
if (wma == NULL) return MCIERR_INVALID_DEVICE_ID;
EnterCriticalSection(&wma->cs);
if (dwFlags & MCI_SET_TIME_FORMAT) {
switch (lpParms->dwTimeFormat) {
case MCI_FORMAT_MILLISECONDS:
TRACE("MCI_FORMAT_MILLISECONDS !\n");
wma->dwMciTimeFormat = MCI_FORMAT_MILLISECONDS;
break;
case MCI_FORMAT_FRAMES:
TRACE("MCI_FORMAT_FRAMES !\n");
wma->dwMciTimeFormat = MCI_FORMAT_FRAMES;
break;
default:
WARN("Bad time format %u!\n", lpParms->dwTimeFormat);
LeaveCriticalSection(&wma->cs);
return MCIERR_BAD_TIME_FORMAT;
}
}
if (dwFlags & MCI_SET_DOOR_OPEN) {
TRACE("No support for door open !\n");
LeaveCriticalSection(&wma->cs);
return MCIERR_UNSUPPORTED_FUNCTION;
}
if (dwFlags & MCI_SET_DOOR_CLOSED) {
TRACE("No support for door close !\n");
LeaveCriticalSection(&wma->cs);
return MCIERR_UNSUPPORTED_FUNCTION;
}
if (dwFlags & MCI_SET_ON) {
char buffer[256];
strcpy(buffer, "MCI_SET_ON:");
if (dwFlags & MCI_SET_VIDEO) {
strncat(buffer, " video", sizeof(buffer)-sizeof("MCI_SET_ON:"));
wma->dwSet |= 4;
}
if (dwFlags & MCI_SET_AUDIO) {
strncat(buffer, " audio", sizeof(buffer)-sizeof("MCI_SET_ON:"));
switch (lpParms->dwAudio) {
case MCI_SET_AUDIO_ALL:
strncat(buffer, " all", sizeof(buffer)-sizeof("MCI_SET_ON:"));
wma->dwSet |= 3;
break;
case MCI_SET_AUDIO_LEFT:
strncat(buffer, " left", sizeof(buffer)-sizeof("MCI_SET_ON:"));
wma->dwSet |= 1;
break;
case MCI_SET_AUDIO_RIGHT:
strncat(buffer, " right", sizeof(buffer)-sizeof("MCI_SET_ON:"));
wma->dwSet |= 2;
break;
default:
WARN("Unknown audio channel %u\n", lpParms->dwAudio);
break;
}
}
if (dwFlags & MCI_DGV_SET_SEEK_EXACTLY) {
strncat(buffer, " seek_exactly", sizeof(buffer));
}
FIXME("%s\n", buffer);
}
if (dwFlags & MCI_SET_OFF) {
char buffer[256];
strcpy(buffer, "MCI_SET_OFF:");
if (dwFlags & MCI_SET_VIDEO) {
strncat(buffer, " video", sizeof(buffer)-sizeof("MCI_SET_OFF:"));
wma->dwSet &= ~4;
}
if (dwFlags & MCI_SET_AUDIO) {
strncat(buffer, " audio", sizeof(buffer)-sizeof("MCI_SET_OFF:"));
switch (lpParms->dwAudio) {
case MCI_SET_AUDIO_ALL:
strncat(buffer, " all", sizeof(buffer)-sizeof("MCI_SET_OFF:"));
wma->dwSet &= ~3;
break;
case MCI_SET_AUDIO_LEFT:
strncat(buffer, " left", sizeof(buffer)-sizeof("MCI_SET_OFF:"));
wma->dwSet &= ~2;
break;
case MCI_SET_AUDIO_RIGHT:
strncat(buffer, " right", sizeof(buffer)-sizeof("MCI_SET_OFF:"));
wma->dwSet &= ~2;
break;
default:
WARN("Unknown audio channel %u\n", lpParms->dwAudio);
break;
}
}
if (dwFlags & MCI_DGV_SET_SEEK_EXACTLY) {
strncat(buffer, " seek_exactly", sizeof(buffer)-strlen(buffer)-1);
}
FIXME("%s\n", buffer);
}
if (dwFlags & MCI_DGV_SET_FILEFORMAT) {
LPCSTR str = "save";
if (dwFlags & MCI_DGV_SET_STILL)
str = "capture";
switch (lpParms->dwFileFormat) {
case MCI_DGV_FF_AVI: FIXME("Setting file format (%s) to 'AVI'\n", str); break;
case MCI_DGV_FF_AVSS: FIXME("Setting file format (%s) to 'AVSS'\n", str); break;
case MCI_DGV_FF_DIB: FIXME("Setting file format (%s) to 'DIB'\n", str); break;
case MCI_DGV_FF_JFIF: FIXME("Setting file format (%s) to 'JFIF'\n", str); break;
case MCI_DGV_FF_JPEG: FIXME("Setting file format (%s) to 'JPEG'\n", str); break;
case MCI_DGV_FF_MPEG: FIXME("Setting file format (%s) to 'MPEG'\n", str); break;
case MCI_DGV_FF_RDIB: FIXME("Setting file format (%s) to 'RLE DIB'\n", str); break;
case MCI_DGV_FF_RJPEG: FIXME("Setting file format (%s) to 'RJPEG'\n", str); break;
default: FIXME("Setting unknown file format (%s): %d\n", str, lpParms->dwFileFormat);
}
}
if (dwFlags & MCI_DGV_SET_SPEED) {
FIXME("Setting speed to %d\n", lpParms->dwSpeed);
}
LeaveCriticalSection(&wma->cs);
return 0;
}
/***************************************************************************
* MCIAVI_mciStatus [internal]
*/
DWORD MCIAVI_mciStatus(UINT wDevID, DWORD dwFlags, LPMCI_DGV_STATUS_PARMSW lpParms)
{
WINE_MCIAVI* wma = MCIAVI_mciGetOpenDev(wDevID);
DWORD ret = 0;
if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK;
if (wma == NULL) return MCIERR_INVALID_DEVICE_ID;
EnterCriticalSection(&wma->cs);
if (dwFlags & MCI_STATUS_ITEM) {
switch (lpParms->dwItem) {
case MCI_STATUS_CURRENT_TRACK:
lpParms->dwReturn = 1;
TRACE("MCI_STATUS_CURRENT_TRACK => %lu\n", lpParms->dwReturn);
break;
case MCI_STATUS_LENGTH:
if (!wma->hFile) {
lpParms->dwReturn = 0;
LeaveCriticalSection(&wma->cs);
return MCIERR_UNSUPPORTED_FUNCTION;
}
/* only one track in file is currently handled, so don't take care of MCI_TRACK flag */
lpParms->dwReturn = MCIAVI_ConvertFrameToTimeFormat(wma, wma->mah.dwTotalFrames, &ret);
TRACE("MCI_STATUS_LENGTH => %lu\n", lpParms->dwReturn);
break;
case MCI_STATUS_MODE:
lpParms->dwReturn = MAKEMCIRESOURCE(wma->dwStatus, wma->dwStatus);
ret = MCI_RESOURCE_RETURNED;
TRACE("MCI_STATUS_MODE => 0x%04x\n", LOWORD(lpParms->dwReturn));
break;
case MCI_STATUS_MEDIA_PRESENT:
TRACE("MCI_STATUS_MEDIA_PRESENT => TRUE\n");
lpParms->dwReturn = MAKEMCIRESOURCE(TRUE, MCI_TRUE);
ret = MCI_RESOURCE_RETURNED;
break;
case MCI_STATUS_NUMBER_OF_TRACKS:
lpParms->dwReturn = 1;
TRACE("MCI_STATUS_NUMBER_OF_TRACKS => %lu\n", lpParms->dwReturn);
break;
case MCI_STATUS_POSITION:
if (!wma->hFile) {
lpParms->dwReturn = 0;
LeaveCriticalSection(&wma->cs);
return MCIERR_UNSUPPORTED_FUNCTION;
}
/* only one track in file is currently handled, so don't take care of MCI_TRACK flag */
lpParms->dwReturn = MCIAVI_ConvertFrameToTimeFormat(wma,
(dwFlags & MCI_STATUS_START) ? 0 : wma->dwCurrVideoFrame,
&ret);
TRACE("MCI_STATUS_POSITION %s => %lu\n",
(dwFlags & MCI_STATUS_START) ? "start" : "current", lpParms->dwReturn);
break;
case MCI_STATUS_READY:
lpParms->dwReturn = (wma->dwStatus == MCI_MODE_NOT_READY) ?
MAKEMCIRESOURCE(FALSE, MCI_FALSE) : MAKEMCIRESOURCE(TRUE, MCI_TRUE);
ret = MCI_RESOURCE_RETURNED;
TRACE("MCI_STATUS_READY = %u\n", LOWORD(lpParms->dwReturn));
break;
case MCI_STATUS_TIME_FORMAT:
lpParms->dwReturn = MAKEMCIRESOURCE(wma->dwMciTimeFormat,
wma->dwMciTimeFormat + MCI_FORMAT_RETURN_BASE);
TRACE("MCI_STATUS_TIME_FORMAT => %u\n", LOWORD(lpParms->dwReturn));
ret = MCI_RESOURCE_RETURNED;
break;
#if 0
case MCI_AVI_STATUS_AUDIO_BREAKS:
case MCI_AVI_STATUS_FRAMES_SKIPPED:
case MCI_AVI_STATUS_LAST_PLAY_SPEED:
case MCI_DGV_STATUS_AUDIO:
case MCI_DGV_STATUS_AUDIO_INPUT:
case MCI_DGV_STATUS_AUDIO_RECORD:
case MCI_DGV_STATUS_AUDIO_SOURCE:
case MCI_DGV_SETAUDIO_AVERAGE:
case MCI_DGV_SETAUDIO_LEFT:
case MCI_DGV_SETAUDIO_RIGHT:
case MCI_DGV_SETAUDIO_STEREO:
case MCI_DGV_STATUS_AUDIO_STREAM:
case MCI_DGV_STATUS_AVGBYTESPERSEC:
case MCI_DGV_STATUS_BASS:
case MCI_DGV_STATUS_BITSPERPEL:
case MCI_DGV_STATUS_BITSPERSAMPLE:
case MCI_DGV_STATUS_BLOCKALIGN:
case MCI_DGV_STATUS_BRIGHTNESS:
case MCI_DGV_STATUS_COLOR:
case MCI_DGV_STATUS_CONTRAST:
case MCI_DGV_STATUS_FILEFORMAT:
case MCI_DGV_STATUS_FILE_MODE:
case MCI_DGV_STATUS_FILE_COMPLETION:
case MCI_DGV_STATUS_FORWARD:
case MCI_DGV_STATUS_FRAME_RATE:
case MCI_DGV_STATUS_GAMMA:
#endif
case MCI_DGV_STATUS_HPAL:
lpParms->dwReturn = 0;
TRACE("MCI_DGV_STATUS_HPAL => %lx\n", lpParms->dwReturn);
break;
case MCI_DGV_STATUS_HWND:
lpParms->dwReturn = (DWORD_PTR)wma->hWndPaint;
TRACE("MCI_DGV_STATUS_HWND => %p\n", wma->hWndPaint);
break;
#if 0
case MCI_DGV_STATUS_KEY_COLOR:
case MCI_DGV_STATUS_KEY_INDEX:
case MCI_DGV_STATUS_MONITOR:
case MCI_DGV_MONITOR_FILE:
case MCI_DGV_MONITOR_INPUT:
case MCI_DGV_STATUS_MONITOR_METHOD:
case MCI_DGV_STATUS_PAUSE_MODE:
case MCI_DGV_STATUS_SAMPLESPERSECOND:
case MCI_DGV_STATUS_SEEK_EXACTLY:
case MCI_DGV_STATUS_SHARPNESS:
case MCI_DGV_STATUS_SIZE:
case MCI_DGV_STATUS_SMPTE:
case MCI_DGV_STATUS_SPEED:
case MCI_DGV_STATUS_STILL_FILEFORMAT:
case MCI_DGV_STATUS_TINT:
case MCI_DGV_STATUS_TREBLE:
case MCI_DGV_STATUS_UNSAVED:
case MCI_DGV_STATUS_VIDEO:
case MCI_DGV_STATUS_VIDEO_RECORD:
case MCI_DGV_STATUS_VIDEO_SOURCE:
case MCI_DGV_STATUS_VIDEO_SRC_NUM:
case MCI_DGV_STATUS_VIDEO_STREAM:
case MCI_DGV_STATUS_VOLUME:
case MCI_DGV_STATUS_WINDOW_VISIBLE:
case MCI_DGV_STATUS_WINDOW_MINIMIZED:
case MCI_DGV_STATUS_WINDOW_MAXIMIZED:
case MCI_STATUS_MEDIA_PRESENT:
#endif
default:
FIXME("Unknown command %08X !\n", lpParms->dwItem);
TRACE("(%04x, %08X, %p)\n", wDevID, dwFlags, lpParms);
LeaveCriticalSection(&wma->cs);
return MCIERR_UNRECOGNIZED_COMMAND;
}
} else {
WARN("No Status-Item!\n");
LeaveCriticalSection(&wma->cs);
return MCIERR_UNRECOGNIZED_COMMAND;
}
if (dwFlags & MCI_NOTIFY) {
TRACE("MCI_NOTIFY_SUCCESSFUL %08lX !\n", lpParms->dwCallback);
mciDriverNotify(HWND_32(LOWORD(lpParms->dwCallback)),
wDevID, MCI_NOTIFY_SUCCESSFUL);
}
LeaveCriticalSection(&wma->cs);
return ret;
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,18 @@
<module name="mciavi32" type="win32dll" baseaddress="${BASEADDRESS_MCIAVI32}" installbase="system32" installname="mciavi32.dll" allowwarnings="true">
<importlibrary definition="mciavi32.spec" />
<include base="mciavi32">.</include>
<include base="ReactOS">include/reactos/wine</include>
<define name="__WINESRC__" />
<file>info.c</file>
<file>mciavi.c</file>
<file>mmoutput.c</file>
<file>wnd.c</file>
<file>mciavi_res.rc</file>
<library>wine</library>
<library>msvfw32</library>
<library>winmm</library>
<library>user32</library>
<library>gdi32</library>
<library>kernel32</library>
<library>ntdll</library>
</module>

View file

@ -0,0 +1 @@
@ stdcall -private DriverProc(long long long long long) MCIAVI_DriverProc

View file

@ -0,0 +1,565 @@
/* MciAvi resources
*
* Copyright (c) 2000, Eric Pouech
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "windef.h"
#include "winbase.h"
#include "mmddk.h"
MCIAVI RCDATA
BEGIN
L"play\0", 0x00000806L, MCI_COMMAND_HEAD,
L"notify\0", 0x00000001L, MCI_FLAG,
L"wait\0", 0x00000002L, MCI_FLAG,
L"test\0", 0x00000020L, MCI_FLAG,
L"from\0", 0x00000004L, MCI_INTEGER,
L"to\0", 0x00000008L, MCI_INTEGER,
L"repeat\0", 0x00010000L, MCI_FLAG,
L"reverse\0", 0x00020000L, MCI_FLAG,
L"window\0", 0x01000000L, MCI_FLAG,
L"fullscreen by 2\0", 0x04000000L, MCI_FLAG,
L"fullscreen\0", 0x02000000L, MCI_FLAG,
L"\0", 0x00000000L, MCI_END_COMMAND,
L"capability\0", 0x0000080bL, MCI_COMMAND_HEAD,
L"\0", 0x00000002L, MCI_RETURN,
L"notify\0", 0x00000001L, MCI_FLAG,
L"wait\0", 0x00000002L, MCI_FLAG,
L"test\0", 0x00000020L, MCI_FLAG,
L"\0", 0x00000100L, MCI_CONSTANT,
L"can record\0", 0x00000001L, MCI_INTEGER,
L"has audio\0", 0x00000002L, MCI_INTEGER,
L"has video\0", 0x00000003L, MCI_INTEGER,
L"uses files\0", 0x00000005L, MCI_INTEGER,
L"compound device\0", 0x00000006L, MCI_INTEGER,
L"device type\0", 0x00000004L, MCI_INTEGER,
L"can eject\0", 0x00000007L, MCI_INTEGER,
L"can play\0", 0x00000008L, MCI_INTEGER,
L"can save\0", 0x00000009L, MCI_INTEGER,
L"can lock\0", 0x00004000L, MCI_INTEGER,
L"can reverse\0", 0x00004004L, MCI_INTEGER,
L"can stretch input\0", 0x00004008L, MCI_INTEGER,
L"can stretch\0", 0x00004001L, MCI_INTEGER,
L"can test\0", 0x00004009L, MCI_INTEGER,
L"has still\0", 0x00004005L, MCI_INTEGER,
L"can freeze\0", 0x00004002L, MCI_INTEGER,
L"uses palettes\0", 0x00004006L, MCI_INTEGER,
L"windows\0", 0x00004003L, MCI_INTEGER,
L"maximum play rate\0", 0x0000400aL, MCI_INTEGER,
L"minimum play rate\0", 0x0000400bL, MCI_INTEGER,
L"can colorkey\0", 0x00004100L, MCI_INTEGER,
L"\0", 0x00000000L, MCI_END_CONSTANT,
L"\0", 0x00000000L, MCI_END_COMMAND,
L"capture\0", 0x00000870L, MCI_COMMAND_HEAD,
L"notify\0", 0x00000001L, MCI_FLAG,
L"wait\0", 0x00000002L, MCI_FLAG,
L"test\0", 0x00000020L, MCI_FLAG,
L"as\0", 0x00010000L, MCI_STRING,
L"at\0", 0x00020000L, MCI_RECT,
L"\0", 0x00000000L, MCI_END_COMMAND,
L"close\0", 0x00000804L, MCI_COMMAND_HEAD,
L"notify\0", 0x00000001L, MCI_FLAG,
L"wait\0", 0x00000002L, MCI_FLAG,
L"\0", 0x00000000L, MCI_END_COMMAND,
L"configure\0", 0x0000087aL, MCI_COMMAND_HEAD,
L"notify\0", 0x00000001L, MCI_FLAG,
L"wait\0", 0x00000002L, MCI_FLAG,
L"test\0", 0x00000020L, MCI_FLAG,
L"\0", 0x00000000L, MCI_END_COMMAND,
L"copy\0", 0x00000852L, MCI_COMMAND_HEAD,
L"notify\0", 0x00000001L, MCI_FLAG,
L"wait\0", 0x00000002L, MCI_FLAG,
L"test\0", 0x00000020L, MCI_FLAG,
L"from\0", 0x00000004L, MCI_INTEGER,
L"to\0", 0x00000008L, MCI_INTEGER,
L"at\0", 0x00010000L, MCI_RECT,
L"audio stream\0", 0x00020000L, MCI_INTEGER,
L"video stream\0", 0x00040000L, MCI_INTEGER,
L"\0", 0x00000000L, MCI_END_COMMAND,
L"cue\0", 0x00000830L, MCI_COMMAND_HEAD,
L"notify\0", 0x00000001L, MCI_FLAG,
L"wait\0", 0x00000002L, MCI_FLAG,
L"test\0", 0x00000020L, MCI_FLAG,
L"input\0", 0x00010000L, MCI_FLAG,
L"output\0", 0x00020000L, MCI_FLAG,
L"to\0", 0x00000008L, MCI_INTEGER,
L"noshow\0", 0x00040000L, MCI_FLAG,
L"\0", 0x00000000L, MCI_END_COMMAND,
L"cut\0", 0x00000851L, MCI_COMMAND_HEAD,
L"notify\0", 0x00000001L, MCI_FLAG,
L"wait\0", 0x00000002L, MCI_FLAG,
L"test\0", 0x00000020L, MCI_FLAG,
L"from\0", 0x00000004L, MCI_INTEGER,
L"to\0", 0x00000008L, MCI_INTEGER,
L"at\0", 0x00010000L, MCI_RECT,
L"audio stream\0", 0x00020000L, MCI_INTEGER,
L"video stream\0", 0x00040000L, MCI_INTEGER,
L"\0", 0x00000000L, MCI_END_COMMAND,
L"delete\0", 0x00000856L, MCI_COMMAND_HEAD,
L"notify\0", 0x00000001L, MCI_FLAG,
L"wait\0", 0x00000002L, MCI_FLAG,
L"test\0", 0x00000020L, MCI_FLAG,
L"from\0", 0x00000004L, MCI_INTEGER,
L"to\0", 0x00000008L, MCI_INTEGER,
L"at\0", 0x00010000L, MCI_RECT,
L"audio stream\0", 0x00020000L, MCI_INTEGER,
L"video stream\0", 0x00040000L, MCI_INTEGER,
L"\0", 0x00000000L, MCI_END_COMMAND,
L"freeze\0", 0x00000844L, MCI_COMMAND_HEAD,
L"notify\0", 0x00000001L, MCI_FLAG,
L"wait\0", 0x00000002L, MCI_FLAG,
L"test\0", 0x00000020L, MCI_FLAG,
L"at\0", 0x00010000L, MCI_RECT,
L"outside\0", 0x00020000L, MCI_FLAG,
L"\0", 0x00000000L, MCI_END_COMMAND,
L"info\0", 0x0000080aL, MCI_COMMAND_HEAD,
L"\0", 0x00000001L, MCI_RETURN,
L"notify\0", 0x00000001L, MCI_FLAG,
L"wait\0", 0x00000002L, MCI_FLAG,
L"test\0", 0x00000020L, MCI_FLAG,
L"file\0", 0x00000200L, MCI_FLAG,
L"product\0", 0x00000100L, MCI_FLAG,
L"window text\0", 0x00010000L, MCI_FLAG,
L"usage\0", 0x00004000L, MCI_FLAG,
L"version\0", 0x00000400L, MCI_FLAG,
L"\0", 0x00020000L, MCI_CONSTANT,
L"audio algorithm\0", 0x00004004L, MCI_INTEGER,
L"audio quality\0", 0x00004001L, MCI_INTEGER,
L"still algorithm\0", 0x00004005L, MCI_INTEGER,
L"still quality\0", 0x00004002L, MCI_INTEGER,
L"video algorithm\0", 0x00004006L, MCI_INTEGER,
L"video quality\0", 0x00004003L, MCI_INTEGER,
L"\0", 0x00000000L, MCI_END_CONSTANT,
L"\0", 0x00000000L, MCI_END_COMMAND,
L"list\0", 0x00000878L, MCI_COMMAND_HEAD,
L"\0", 0x00000001L, MCI_RETURN,
L"notify\0", 0x00000001L, MCI_FLAG,
L"wait\0", 0x00000002L, MCI_FLAG,
L"test\0", 0x00000020L, MCI_FLAG,
L"count\0", 0x00020000L, MCI_FLAG,
L"number\0", 0x00040000L, MCI_INTEGER,
L"\0", 0x00010000L, MCI_CONSTANT,
L"audio algorithm\0", 0x00004000L, MCI_INTEGER,
L"audio quality\0", 0x00004001L, MCI_INTEGER,
L"audio stream\0", 0x00004002L, MCI_INTEGER,
L"still algorithm\0", 0x00004003L, MCI_INTEGER,
L"still quality\0", 0x00004004L, MCI_INTEGER,
L"video algorithm\0", 0x00004005L, MCI_INTEGER,
L"video quality\0", 0x00004006L, MCI_INTEGER,
L"video source\0", 0x00004008L, MCI_INTEGER,
L"video stream\0", 0x00004007L, MCI_INTEGER,
L"\0", 0x00000000L, MCI_END_CONSTANT,
L"algorithm\0", 0x00080000L, MCI_STRING,
L"\0", 0x00000000L, MCI_END_COMMAND,
L"load\0", 0x00000850L, MCI_COMMAND_HEAD,
L"notify\0", 0x00000001L, MCI_FLAG,
L"wait\0", 0x00000002L, MCI_FLAG,
L"test\0", 0x00000020L, MCI_FLAG,
L"\0", 0x00000100L, MCI_STRING,
L"\0", 0x00000000L, MCI_END_COMMAND,
L"monitor\0", 0x00000871L, MCI_COMMAND_HEAD,
L"notify\0", 0x00000001L, MCI_FLAG,
L"wait\0", 0x00000002L, MCI_FLAG,
L"test\0", 0x00000020L, MCI_FLAG,
L"\0", 0x00020000L, MCI_CONSTANT,
L"input\0", 0x00004000L, MCI_INTEGER,
L"file\0", 0x00004001L, MCI_INTEGER,
L"\0", 0x00000000L, MCI_END_CONSTANT,
L"method\0", 0x00010000L, MCI_CONSTANT,
L"pre\0", 0x0000a000L, MCI_INTEGER,
L"post\0", 0x0000a001L, MCI_INTEGER,
L"direct\0", 0x0000a002L, MCI_INTEGER,
L"\0", 0x00000000L, MCI_END_CONSTANT,
L"\0", 0x00000000L, MCI_END_COMMAND,
L"open\0", 0x00000803L, MCI_COMMAND_HEAD,
L"\0", 0x00000002L, MCI_RETURN,
L"notify\0", 0x00000001L, MCI_FLAG,
L"wait\0", 0x00000002L, MCI_FLAG,
L"type\0", 0x00002000L, MCI_STRING,
L"element\0", 0x00000200L, MCI_STRING,
L"alias\0", 0x00000400L, MCI_STRING,
L"shareable\0", 0x00000100L, MCI_FLAG,
L"style\0", 0x00010000L, MCI_CONSTANT,
L"overlapped\0", 0x00cf0000L, MCI_INTEGER,
L"popup\0", 0x80880000L, MCI_INTEGER,
L"child\0", 0x40000000L, MCI_INTEGER,
L"\0", 0x00000000L, MCI_END_CONSTANT,
L"parent\0", 0x00020000L, MCI_INTEGER,
L"nostatic\0", 0x00040000L, MCI_FLAG,
L"\0", 0x00000000L, MCI_END_COMMAND,
L"paste\0", 0x00000853L, MCI_COMMAND_HEAD,
L"notify\0", 0x00000001L, MCI_FLAG,
L"wait\0", 0x00000002L, MCI_FLAG,
L"test\0", 0x00000020L, MCI_FLAG,
L"to\0", 0x00000008L, MCI_INTEGER,
L"at\0", 0x00010000L, MCI_RECT,
L"insert\0", 0x00080000L, MCI_FLAG,
L"overwrite\0", 0x00100000L, MCI_FLAG,
L"audio stream\0", 0x00020000L, MCI_INTEGER,
L"video stream\0", 0x00040000L, MCI_INTEGER,
L"\0", 0x00000000L, MCI_END_COMMAND,
L"pause\0", 0x00000809L, MCI_COMMAND_HEAD,
L"notify\0", 0x00000001L, MCI_FLAG,
L"wait\0", 0x00000002L, MCI_FLAG,
L"test\0", 0x00000020L, MCI_FLAG,
L"\0", 0x00000000L, MCI_END_COMMAND,
L"put\0", 0x00000842L, MCI_COMMAND_HEAD,
L"notify\0", 0x00000001L, MCI_FLAG,
L"wait\0", 0x00000002L, MCI_FLAG,
L"test\0", 0x00000020L, MCI_FLAG,
L"at\0", 0x00010000L, MCI_RECT,
L"source\0", 0x00020000L, MCI_FLAG,
L"destination\0", 0x00040000L, MCI_FLAG,
L"frame\0", 0x00080000L, MCI_FLAG,
L"video\0", 0x00100000L, MCI_FLAG,
L"window\0", 0x00200000L, MCI_FLAG,
L"client\0", 0x00400000L, MCI_FLAG,
L"\0", 0x00000000L, MCI_END_COMMAND,
L"quality\0", 0x00000877L, MCI_COMMAND_HEAD,
L"notify\0", 0x00000001L, MCI_FLAG,
L"wait\0", 0x00000002L, MCI_FLAG,
L"test\0", 0x00000020L, MCI_FLAG,
L"\0", 0x00010000L, MCI_CONSTANT,
L"audio\0", 0x00004000L, MCI_INTEGER,
L"still\0", 0x00004001L, MCI_INTEGER,
L"video\0", 0x00004002L, MCI_INTEGER,
L"\0", 0x00000000L, MCI_END_CONSTANT,
L"name\0", 0x00020000L, MCI_STRING,
L"algorithm\0", 0x00040000L, MCI_STRING,
L"dialog\0", 0x00080000L, MCI_FLAG,
L"handle\0", 0x00100000L, MCI_INTEGER,
L"\0", 0x00000000L, MCI_END_COMMAND,
L"realize\0", 0x00000840L, MCI_COMMAND_HEAD,
L"notify\0", 0x00000001L, MCI_FLAG,
L"wait\0", 0x00000002L, MCI_FLAG,
L"test\0", 0x00000020L, MCI_FLAG,
L"normal\0", 0x00010000L, MCI_FLAG,
L"background\0", 0x00020000L, MCI_FLAG,
L"\0", 0x00000000L, MCI_END_COMMAND,
L"record\0", 0x0000080fL, MCI_COMMAND_HEAD,
L"notify\0", 0x00000001L, MCI_FLAG,
L"wait\0", 0x00000002L, MCI_FLAG,
L"test\0", 0x00000020L, MCI_FLAG,
L"from\0", 0x00000004L, MCI_INTEGER,
L"to\0", 0x00000008L, MCI_INTEGER,
L"insert\0", 0x00000100L, MCI_FLAG,
L"overwrite\0", 0x00000200L, MCI_FLAG,
L"at\0", 0x00010000L, MCI_RECT,
L"hold\0", 0x00020000L, MCI_FLAG,
L"audio stream\0", 0x00040000L, MCI_INTEGER,
L"video stream\0", 0x00080000L, MCI_INTEGER,
L"\0", 0x00000000L, MCI_END_COMMAND,
L"reserve\0", 0x00000872L, MCI_COMMAND_HEAD,
L"notify\0", 0x00000001L, MCI_FLAG,
L"wait\0", 0x00000002L, MCI_FLAG,
L"test\0", 0x00000020L, MCI_FLAG,
L"in\0", 0x00010000L, MCI_STRING,
L"size\0", 0x00020000L, MCI_INTEGER,
L"\0", 0x00000000L, MCI_END_COMMAND,
L"restore\0", 0x0000087bL, MCI_COMMAND_HEAD,
L"notify\0", 0x00000001L, MCI_FLAG,
L"wait\0", 0x00000002L, MCI_FLAG,
L"test\0", 0x00000020L, MCI_FLAG,
L"from\0", 0x00010000L, MCI_STRING,
L"at\0", 0x00020000L, MCI_RECT,
L"\0", 0x00000000L, MCI_END_COMMAND,
L"resume\0", 0x00000855L, MCI_COMMAND_HEAD,
L"notify\0", 0x00000001L, MCI_FLAG,
L"wait\0", 0x00000002L, MCI_FLAG,
L"test\0", 0x00000020L, MCI_FLAG,
L"\0", 0x00000000L, MCI_END_COMMAND,
L"save\0", 0x00000813L, MCI_COMMAND_HEAD,
L"notify\0", 0x00000001L, MCI_FLAG,
L"wait\0", 0x00000002L, MCI_FLAG,
L"test\0", 0x00000020L, MCI_FLAG,
L"\0", 0x00000100L, MCI_STRING,
L"at\0", 0x00010000L, MCI_RECT,
L"abort\0", 0x00020000L, MCI_FLAG,
L"keepreserve\0", 0x00040000L, MCI_FLAG,
L"\0", 0x00000000L, MCI_END_COMMAND,
L"seek\0", 0x00000807L, MCI_COMMAND_HEAD,
L"notify\0", 0x00000001L, MCI_FLAG,
L"wait\0", 0x00000002L, MCI_FLAG,
L"test\0", 0x00000020L, MCI_FLAG,
L"to start\0", 0x00000100L, MCI_FLAG,
L"to end\0", 0x00000200L, MCI_FLAG,
L"to\0", 0x00000008L, MCI_INTEGER,
L"\0", 0x00000000L, MCI_END_COMMAND,
L"set\0", 0x0000080dL, MCI_COMMAND_HEAD,
L"notify\0", 0x00000001L, MCI_FLAG,
L"wait\0", 0x00000002L, MCI_FLAG,
L"test\0", 0x00000020L, MCI_FLAG,
L"time format\0", 0x00000400L, MCI_CONSTANT,
L"frames\0", 0x00000003L, MCI_INTEGER,
L"milliseconds\0", 0x00000000L, MCI_INTEGER,
L"ms\0", 0x00000000L, MCI_INTEGER,
L"bytes\0", 0x00000008L, MCI_INTEGER,
L"\0", 0x00000000L, MCI_END_CONSTANT,
L"door open\0", 0x00000100L, MCI_FLAG,
L"door closed\0", 0x00000200L, MCI_FLAG,
L"audio\0", 0x00000800L, MCI_CONSTANT,
L"all\0", 0x00000000L, MCI_INTEGER,
L"left\0", 0x00000001L, MCI_INTEGER,
L"right\0", 0x00000002L, MCI_INTEGER,
L"\0", 0x00000000L, MCI_END_CONSTANT,
L"video\0", 0x00001000L, MCI_FLAG,
L"seek exactly\0", 0x00010000L, MCI_FLAG,
L"file format\0", 0x00080000L, MCI_CONSTANT,
L"avss\0", 0x00004000L, MCI_INTEGER,
L"avi\0", 0x00004001L, MCI_INTEGER,
L"dib\0", 0x00004002L, MCI_INTEGER,
L"rdib\0", 0x00004003L, MCI_INTEGER,
L"jpeg\0", 0x00004004L, MCI_INTEGER,
L"rjpeg\0", 0x00004005L, MCI_INTEGER,
L"jfif\0", 0x00004006L, MCI_INTEGER,
L"mpeg\0", 0x00004007L, MCI_INTEGER,
L"\0", 0x00000000L, MCI_END_CONSTANT,
L"still\0", 0x00040000L, MCI_FLAG,
L"on\0", 0x00002000L, MCI_FLAG,
L"off\0", 0x00004000L, MCI_FLAG,
L"speed\0", 0x00020000L, MCI_INTEGER,
L"\0", 0x00000000L, MCI_END_COMMAND,
L"setaudio\0", 0x00000873L, MCI_COMMAND_HEAD,
L"notify\0", 0x00000001L, MCI_FLAG,
L"wait\0", 0x00000002L, MCI_FLAG,
L"test\0", 0x00000020L, MCI_FLAG,
L"\0", 0x00800000L, MCI_CONSTANT,
L"bass\0", 0x00004001L, MCI_INTEGER,
L"treble\0", 0x00004000L, MCI_INTEGER,
L"volume\0", 0x00004002L, MCI_INTEGER,
L"stream\0", 0x00004003L, MCI_INTEGER,
L"source\0", 0x00004004L, MCI_INTEGER,
L"samplespersec\0", 0x00004005L, MCI_INTEGER,
L"bytespersec\0", 0x00004006L, MCI_INTEGER,
L"alignment\0", 0x00004007L, MCI_INTEGER,
L"bitspersample\0", 0x00004008L, MCI_INTEGER,
L"\0", 0x00000000L, MCI_END_CONSTANT,
L"to\0", 0x01000000L, MCI_CONSTANT,
L"left\0", 0x00000001L, MCI_INTEGER,
L"right\0", 0x00000002L, MCI_INTEGER,
L"average\0", 0x00004000L, MCI_INTEGER,
L"stereo\0", 0x00000000L, MCI_INTEGER,
L"\0", 0x00000000L, MCI_END_CONSTANT,
L"over\0", 0x00010000L, MCI_INTEGER,
L"algorithm\0", 0x00040000L, MCI_STRING,
L"quality\0", 0x00080000L, MCI_STRING,
L"record\0", 0x00100000L, MCI_FLAG,
L"left\0", 0x00200000L, MCI_FLAG,
L"clocktime\0", 0x00020000L, MCI_FLAG,
L"right\0", 0x00400000L, MCI_FLAG,
L"on\0", 0x00002000L, MCI_FLAG,
L"off\0", 0x00004000L, MCI_FLAG,
L"input\0", 0x02000000L, MCI_FLAG,
L"output\0", 0x04000000L, MCI_FLAG,
L"\0", 0x00000000L, MCI_END_COMMAND,
L"setvideo\0", 0x00000876L, MCI_COMMAND_HEAD,
L"notify\0", 0x00000001L, MCI_FLAG,
L"wait\0", 0x00000002L, MCI_FLAG,
L"test\0", 0x00000020L, MCI_FLAG,
L"\0", 0x00100000L, MCI_CONSTANT,
L"frame rate\0", 0x00004008L, MCI_INTEGER,
L"brightness\0", 0x00004000L, MCI_INTEGER,
L"color\0", 0x00004001L, MCI_INTEGER,
L"contrast\0", 0x00004002L, MCI_INTEGER,
L"tint\0", 0x00004003L, MCI_INTEGER,
L"sharpness\0", 0x00004004L, MCI_INTEGER,
L"gamma\0", 0x00004005L, MCI_INTEGER,
L"palette handle\0", 0x00004007L, MCI_INTEGER,
L"stream\0", 0x00004006L, MCI_INTEGER,
L"source\0", 0x00004009L, MCI_INTEGER,
L"key index\0", 0x0000400aL, MCI_INTEGER,
L"key color\0", 0x0000400bL, MCI_INTEGER,
L"\0", 0x00000000L, MCI_END_CONSTANT,
L"to\0", 0x01000000L, MCI_CONSTANT,
L"ntsc\0", 0x00004000L, MCI_INTEGER,
L"rgb\0", 0x00004001L, MCI_INTEGER,
L"svideo\0", 0x00004002L, MCI_INTEGER,
L"pal\0", 0x00004003L, MCI_INTEGER,
L"secam\0", 0x00004004L, MCI_INTEGER,
L"\0", 0x00000000L, MCI_END_CONSTANT,
L"quality\0", 0x00010000L, MCI_STRING,
L"algorithm\0", 0x00020000L, MCI_STRING,
L"number\0", 0x00080000L, MCI_INTEGER,
L"over\0", 0x00200000L, MCI_INTEGER,
L"record\0", 0x00400000L, MCI_FLAG,
L"still\0", 0x00800000L, MCI_FLAG,
L"clocktime\0", 0x00040000L, MCI_FLAG,
L"on\0", 0x00002000L, MCI_FLAG,
L"off\0", 0x00004000L, MCI_FLAG,
L"input\0", 0x02000000L, MCI_FLAG,
L"output\0", 0x04000000L, MCI_FLAG,
L"\0", 0x00000000L, MCI_END_COMMAND,
L"signal\0", 0x00000875L, MCI_COMMAND_HEAD,
L"notify\0", 0x00000001L, MCI_FLAG,
L"wait\0", 0x00000002L, MCI_FLAG,
L"test\0", 0x00000020L, MCI_FLAG,
L"at\0", 0x00010000L, MCI_INTEGER,
L"every\0", 0x00020000L, MCI_INTEGER,
L"uservalue\0", 0x00040000L, MCI_INTEGER,
L"cancel\0", 0x00080000L, MCI_FLAG,
L"return position\0", 0x00100000L, MCI_FLAG,
L"\0", 0x00000000L, MCI_END_COMMAND,
L"status\0", 0x00000814L, MCI_COMMAND_HEAD,
L"\0", 0x00000002L, MCI_RETURN,
L"notify\0", 0x00000001L, MCI_FLAG,
L"wait\0", 0x00000002L, MCI_FLAG,
L"test\0", 0x00000020L, MCI_FLAG,
L"\0", 0x00000100L, MCI_CONSTANT,
L"frames skipped\0", 0x00008001L, MCI_INTEGER,
L"play speed\0", 0x00008002L, MCI_INTEGER,
L"audio breaks\0", 0x00008003L, MCI_INTEGER,
L"alignment\0", 0x00004029L, MCI_INTEGER,
L"audio input\0", 0x00004000L, MCI_INTEGER,
L"audio record\0", 0x0000401aL, MCI_INTEGER,
L"audio source\0", 0x00004009L, MCI_INTEGER,
L"audio stream\0", 0x0000402dL, MCI_INTEGER,
L"bass\0", 0x0000400fL, MCI_INTEGER,
L"bitsperpel\0", 0x0000402bL, MCI_INTEGER,
L"bitspersample\0", 0x0000402aL, MCI_INTEGER,
L"brightness\0", 0x00004005L, MCI_INTEGER,
L"bytespersec\0", 0x00004028L, MCI_INTEGER,
L"color\0", 0x00004006L, MCI_INTEGER,
L"contrast\0", 0x00004007L, MCI_INTEGER,
L"current track\0", 0x00000008L, MCI_INTEGER,
L"file format\0", 0x00004008L, MCI_INTEGER,
L"still file format\0", 0x0000401dL, MCI_INTEGER,
L"file mode\0", 0x0000401fL, MCI_INTEGER,
L"file completion\0", 0x00004020L, MCI_INTEGER,
L"forward\0", 0x0000402cL, MCI_INTEGER,
L"gamma\0", 0x0000400aL, MCI_INTEGER,
L"length\0", 0x00000001L, MCI_INTEGER,
L"media present\0", 0x00000005L, MCI_INTEGER,
L"mode\0", 0x00000004L, MCI_INTEGER,
L"monitor method\0", 0x0000400cL, MCI_INTEGER,
L"monitor\0", 0x0000400bL, MCI_INTEGER,
L"number of tracks\0", 0x00000003L, MCI_INTEGER,
L"palette handle\0", 0x00004004L, MCI_INTEGER,
L"pause mode\0", 0x00004026L, MCI_INTEGER,
L"position\0", 0x00000002L, MCI_INTEGER,
L"ready\0", 0x00000007L, MCI_INTEGER,
L"frame rate\0", 0x0000400eL, MCI_INTEGER,
L"reserved size\0", 0x00004010L, MCI_INTEGER,
L"samplespersec\0", 0x00004027L, MCI_INTEGER,
L"seek exactly\0", 0x00004011L, MCI_INTEGER,
L"sharpness\0", 0x00004012L, MCI_INTEGER,
L"smpte\0", 0x00004013L, MCI_INTEGER,
L"speed\0", 0x00004003L, MCI_INTEGER,
L"time format\0", 0x00000006L, MCI_INTEGER,
L"tint\0", 0x00004015L, MCI_INTEGER,
L"treble\0", 0x00004016L, MCI_INTEGER,
L"unsaved\0", 0x00004017L, MCI_INTEGER,
L"video key color\0", 0x00004025L, MCI_INTEGER,
L"video key index\0", 0x00004024L, MCI_INTEGER,
L"video source\0", 0x0000401bL, MCI_INTEGER,
L"video source number\0", 0x0000401eL, MCI_INTEGER,
L"video record\0", 0x0000401cL, MCI_INTEGER,
L"video stream\0", 0x0000402eL, MCI_INTEGER,
L"volume\0", 0x00004019L, MCI_INTEGER,
L"window handle\0", 0x00004001L, MCI_INTEGER,
L"window visible\0", 0x00004021L, MCI_INTEGER,
L"window minimized\0", 0x00004022L, MCI_INTEGER,
L"window maximized\0", 0x00004023L, MCI_INTEGER,
L"video streams\0", 0x00004100L, MCI_INTEGER,
L"video bitrate\0", 0x00004101L, MCI_INTEGER,
L"video maxbitrate\0", 0x00004102L, MCI_INTEGER,
L"audio streams\0", 0x00004103L, MCI_INTEGER,
L"audio bitrate\0", 0x00004104L, MCI_INTEGER,
L"video brush\0", 0x00004105L, MCI_INTEGER,
L"audio\0", 0x00004014L, MCI_INTEGER,
L"video\0", 0x00004018L, MCI_INTEGER,
L"\0", 0x00000000L, MCI_END_CONSTANT,
L"track\0", 0x00000010L, MCI_INTEGER,
L"start\0", 0x00000200L, MCI_FLAG,
L"left\0", 0x00080000L, MCI_FLAG,
L"right\0", 0x00100000L, MCI_FLAG,
L"nominal\0", 0x00020000L, MCI_FLAG,
L"record\0", 0x01000000L, MCI_FLAG,
L"input\0", 0x00400000L, MCI_FLAG,
L"output\0", 0x00800000L, MCI_FLAG,
L"disk space\0", 0x00200000L, MCI_STRING,
L"reference\0", 0x00040000L, MCI_INTEGER,
L"\0", 0x00000000L, MCI_END_COMMAND,
L"step\0", 0x0000080eL, MCI_COMMAND_HEAD,
L"notify\0", 0x00000001L, MCI_FLAG,
L"wait\0", 0x00000002L, MCI_FLAG,
L"test\0", 0x00000020L, MCI_FLAG,
L"reverse\0", 0x00010000L, MCI_FLAG,
L"by\0", 0x00020000L, MCI_INTEGER,
L"\0", 0x00000000L, MCI_END_COMMAND,
L"stop\0", 0x00000808L, MCI_COMMAND_HEAD,
L"notify\0", 0x00000001L, MCI_FLAG,
L"wait\0", 0x00000002L, MCI_FLAG,
L"test\0", 0x00000020L, MCI_FLAG,
L"hold\0", 0x00010000L, MCI_FLAG,
L"\0", 0x00000000L, MCI_END_COMMAND,
L"undo\0", 0x00000879L, MCI_COMMAND_HEAD,
L"notify\0", 0x00000001L, MCI_FLAG,
L"wait\0", 0x00000002L, MCI_FLAG,
L"test\0", 0x00000020L, MCI_FLAG,
L"\0", 0x00000000L, MCI_END_COMMAND,
L"unfreeze\0", 0x00000845L, MCI_COMMAND_HEAD,
L"notify\0", 0x00000001L, MCI_FLAG,
L"wait\0", 0x00000002L, MCI_FLAG,
L"test\0", 0x00000020L, MCI_FLAG,
L"at\0", 0x00010000L, MCI_RECT,
L"\0", 0x00000000L, MCI_END_COMMAND,
L"update\0", 0x00000854L, MCI_COMMAND_HEAD,
L"notify\0", 0x00000001L, MCI_FLAG,
L"wait\0", 0x00000002L, MCI_FLAG,
L"test\0", 0x00000020L, MCI_FLAG,
L"at\0", 0x00010000L, MCI_RECT,
L"hdc\0", 0x00020000L, MCI_INTEGER,
L"paint\0", 0x00040000L, MCI_FLAG,
L"\0", 0x00000000L, MCI_END_COMMAND,
L"where\0", 0x00000843L, MCI_COMMAND_HEAD,
L"\0", 0x00000007L, MCI_RETURN,
L"notify\0", 0x00000001L, MCI_FLAG,
L"wait\0", 0x00000002L, MCI_FLAG,
L"test\0", 0x00000020L, MCI_FLAG,
L"source\0", 0x00020000L, MCI_FLAG,
L"destination\0", 0x00040000L, MCI_FLAG,
L"frame\0", 0x00080000L, MCI_FLAG,
L"video\0", 0x00100000L, MCI_FLAG,
L"window\0", 0x00200000L, MCI_FLAG,
L"max\0", 0x00400000L, MCI_FLAG,
L"min\0", 0x00800000L, MCI_FLAG,
L"\0", 0x00000000L, MCI_END_COMMAND,
L"window\0", 0x00000841L, MCI_COMMAND_HEAD,
L"notify\0", 0x00000001L, MCI_FLAG,
L"wait\0", 0x00000002L, MCI_FLAG,
L"test\0", 0x00000020L, MCI_FLAG,
L"handle\0", 0x00010000L, MCI_CONSTANT,
L"default\0", 0x00000000L, MCI_INTEGER,
L"\0", 0x00000000L, MCI_END_CONSTANT,
L"state\0", 0x00040000L, MCI_CONSTANT,
L"hide\0", 0x00000000L, MCI_INTEGER,
L"minimize\0", 0x00000006L, MCI_INTEGER,
L"restore\0", 0x00000009L, MCI_INTEGER,
L"show maximized\0", 0x00000003L, MCI_INTEGER,
L"show min noactive\0", 0x00000007L, MCI_INTEGER,
L"show minimized\0", 0x00000002L, MCI_INTEGER,
L"show na\0", 0x00000008L, MCI_INTEGER,
L"show noactivate\0", 0x00000004L, MCI_INTEGER,
L"show normal\0", 0x00000001L, MCI_INTEGER,
L"show\0", 0x00000005L, MCI_INTEGER,
L"no action\0", 0x00000008L, MCI_INTEGER,
L"minimized\0", 0x00000002L, MCI_INTEGER,
L"\0", 0x00000000L, MCI_END_CONSTANT,
L"text\0", 0x00080000L, MCI_STRING,
L"\0", 0x00000000L, MCI_END_COMMAND,
L"\0", 0x00000000L, MCI_END_COMMAND_LIST
END

View file

@ -0,0 +1,650 @@
/*
* Digital video MCI Wine Driver
*
* Copyright 1999, 2000 Eric POUECH
* Copyright 2003 Dmitry Timoshkov
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "private_mciavi.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(mciavi);
static BOOL MCIAVI_GetInfoAudio(WINE_MCIAVI* wma, const MMCKINFO* mmckList, MMCKINFO *mmckStream)
{
MMCKINFO mmckInfo;
TRACE("ash.fccType='%c%c%c%c'\n", LOBYTE(LOWORD(wma->ash_audio.fccType)),
HIBYTE(LOWORD(wma->ash_audio.fccType)),
LOBYTE(HIWORD(wma->ash_audio.fccType)),
HIBYTE(HIWORD(wma->ash_audio.fccType)));
if (wma->ash_audio.fccHandler) /* not all streams specify a handler */
TRACE("ash.fccHandler='%c%c%c%c'\n", LOBYTE(LOWORD(wma->ash_audio.fccHandler)),
HIBYTE(LOWORD(wma->ash_audio.fccHandler)),
LOBYTE(HIWORD(wma->ash_audio.fccHandler)),
HIBYTE(HIWORD(wma->ash_audio.fccHandler)));
else
TRACE("ash.fccHandler=0, no handler specified\n");
TRACE("ash.dwFlags=%d\n", wma->ash_audio.dwFlags);
TRACE("ash.wPriority=%d\n", wma->ash_audio.wPriority);
TRACE("ash.wLanguage=%d\n", wma->ash_audio.wLanguage);
TRACE("ash.dwInitialFrames=%d\n", wma->ash_audio.dwInitialFrames);
TRACE("ash.dwScale=%d\n", wma->ash_audio.dwScale);
TRACE("ash.dwRate=%d\n", wma->ash_audio.dwRate);
TRACE("ash.dwStart=%d\n", wma->ash_audio.dwStart);
TRACE("ash.dwLength=%d\n", wma->ash_audio.dwLength);
TRACE("ash.dwSuggestedBufferSize=%d\n", wma->ash_audio.dwSuggestedBufferSize);
TRACE("ash.dwQuality=%d\n", wma->ash_audio.dwQuality);
TRACE("ash.dwSampleSize=%d\n", wma->ash_audio.dwSampleSize);
TRACE("ash.rcFrame=(%d,%d,%d,%d)\n", wma->ash_audio.rcFrame.top, wma->ash_audio.rcFrame.left,
wma->ash_audio.rcFrame.bottom, wma->ash_audio.rcFrame.right);
/* rewind to the start of the stream */
mmioAscend(wma->hFile, mmckStream, 0);
mmckInfo.ckid = ckidSTREAMFORMAT;
if (mmioDescend(wma->hFile, &mmckInfo, mmckList, MMIO_FINDCHUNK) != 0) {
WARN("Can't find 'strf' chunk\n");
return FALSE;
}
if (mmckInfo.cksize < sizeof(WAVEFORMAT)) {
WARN("Size of strf chunk (%d) < audio format struct\n", mmckInfo.cksize);
return FALSE;
}
wma->lpWaveFormat = HeapAlloc(GetProcessHeap(), 0, mmckInfo.cksize);
if (!wma->lpWaveFormat) {
WARN("Can't alloc WaveFormat\n");
return FALSE;
}
mmioRead(wma->hFile, (LPSTR)wma->lpWaveFormat, mmckInfo.cksize);
TRACE("waveFormat.wFormatTag=%d\n", wma->lpWaveFormat->wFormatTag);
TRACE("waveFormat.nChannels=%d\n", wma->lpWaveFormat->nChannels);
TRACE("waveFormat.nSamplesPerSec=%d\n", wma->lpWaveFormat->nSamplesPerSec);
TRACE("waveFormat.nAvgBytesPerSec=%d\n", wma->lpWaveFormat->nAvgBytesPerSec);
TRACE("waveFormat.nBlockAlign=%d\n", wma->lpWaveFormat->nBlockAlign);
TRACE("waveFormat.wBitsPerSample=%d\n", wma->lpWaveFormat->wBitsPerSample);
if (mmckInfo.cksize >= sizeof(WAVEFORMATEX))
TRACE("waveFormat.cbSize=%d\n", wma->lpWaveFormat->cbSize);
return TRUE;
}
static BOOL MCIAVI_GetInfoVideo(WINE_MCIAVI* wma, const MMCKINFO* mmckList, MMCKINFO* mmckStream)
{
MMCKINFO mmckInfo;
TRACE("ash.fccType='%c%c%c%c'\n", LOBYTE(LOWORD(wma->ash_video.fccType)),
HIBYTE(LOWORD(wma->ash_video.fccType)),
LOBYTE(HIWORD(wma->ash_video.fccType)),
HIBYTE(HIWORD(wma->ash_video.fccType)));
TRACE("ash.fccHandler='%c%c%c%c'\n", LOBYTE(LOWORD(wma->ash_video.fccHandler)),
HIBYTE(LOWORD(wma->ash_video.fccHandler)),
LOBYTE(HIWORD(wma->ash_video.fccHandler)),
HIBYTE(HIWORD(wma->ash_video.fccHandler)));
TRACE("ash.dwFlags=%d\n", wma->ash_video.dwFlags);
TRACE("ash.wPriority=%d\n", wma->ash_video.wPriority);
TRACE("ash.wLanguage=%d\n", wma->ash_video.wLanguage);
TRACE("ash.dwInitialFrames=%d\n", wma->ash_video.dwInitialFrames);
TRACE("ash.dwScale=%d\n", wma->ash_video.dwScale);
TRACE("ash.dwRate=%d\n", wma->ash_video.dwRate);
TRACE("ash.dwStart=%d\n", wma->ash_video.dwStart);
TRACE("ash.dwLength=%d\n", wma->ash_video.dwLength);
TRACE("ash.dwSuggestedBufferSize=%d\n", wma->ash_video.dwSuggestedBufferSize);
TRACE("ash.dwQuality=%d\n", wma->ash_video.dwQuality);
TRACE("ash.dwSampleSize=%d\n", wma->ash_video.dwSampleSize);
TRACE("ash.rcFrame=(%d,%d,%d,%d)\n", wma->ash_video.rcFrame.top, wma->ash_video.rcFrame.left,
wma->ash_video.rcFrame.bottom, wma->ash_video.rcFrame.right);
/* rewind to the start of the stream */
mmioAscend(wma->hFile, mmckStream, 0);
mmckInfo.ckid = ckidSTREAMFORMAT;
if (mmioDescend(wma->hFile, &mmckInfo, mmckList, MMIO_FINDCHUNK) != 0) {
WARN("Can't find 'strf' chunk\n");
return FALSE;
}
wma->inbih = HeapAlloc(GetProcessHeap(), 0, mmckInfo.cksize);
if (!wma->inbih) {
WARN("Can't alloc input BIH\n");
return FALSE;
}
mmioRead(wma->hFile, (LPSTR)wma->inbih, mmckInfo.cksize);
TRACE("bih.biSize=%d\n", wma->inbih->biSize);
TRACE("bih.biWidth=%d\n", wma->inbih->biWidth);
TRACE("bih.biHeight=%d\n", wma->inbih->biHeight);
TRACE("bih.biPlanes=%d\n", wma->inbih->biPlanes);
TRACE("bih.biBitCount=%d\n", wma->inbih->biBitCount);
TRACE("bih.biCompression=%x\n", wma->inbih->biCompression);
TRACE("bih.biSizeImage=%d\n", wma->inbih->biSizeImage);
TRACE("bih.biXPelsPerMeter=%d\n", wma->inbih->biXPelsPerMeter);
TRACE("bih.biYPelsPerMeter=%d\n", wma->inbih->biYPelsPerMeter);
TRACE("bih.biClrUsed=%d\n", wma->inbih->biClrUsed);
TRACE("bih.biClrImportant=%d\n", wma->inbih->biClrImportant);
wma->source.left = 0;
wma->source.top = 0;
wma->source.right = wma->inbih->biWidth;
wma->source.bottom = wma->inbih->biHeight;
wma->dest = wma->source;
return TRUE;
}
struct AviListBuild {
DWORD numVideoFrames;
DWORD numAudioAllocated;
DWORD numAudioBlocks;
DWORD inVideoSize;
DWORD inAudioSize;
};
static BOOL MCIAVI_AddFrame(WINE_MCIAVI* wma, LPMMCKINFO mmck,
struct AviListBuild* alb)
{
const BYTE *p;
DWORD stream_n;
DWORD twocc;
if (mmck->ckid == ckidAVIPADDING) return TRUE;
p = (const BYTE *)&mmck->ckid;
if (!isxdigit(p[0]) || !isxdigit(p[1]))
{
WARN("wrongly encoded stream #\n");
return FALSE;
}
stream_n = (p[0] <= '9') ? (p[0] - '0') : (tolower(p[0]) - 'a' + 10);
stream_n <<= 4;
stream_n |= (p[1] <= '9') ? (p[1] - '0') : (tolower(p[1]) - 'a' + 10);
TRACE("ckid %4.4s (stream #%d)\n", (LPSTR)&mmck->ckid, stream_n);
/* Some (rare?) AVI files have video streams name XXYY where XX = stream number and YY = TWOCC
* of the last 2 characters of the biCompression member of the BITMAPINFOHEADER structure.
* Ex: fccHandler = IV32 & biCompression = IV32 => stream name = XX32
* fccHandler = MSVC & biCompression = CRAM => stream name = XXAM
* Another possibility is that these TWOCC are simply ignored.
* Default to cktypeDIBcompressed when this case happens.
*/
twocc = TWOCCFromFOURCC(mmck->ckid);
if (twocc == TWOCCFromFOURCC(wma->inbih->biCompression))
twocc = cktypeDIBcompressed;
switch (twocc) {
case cktypeDIBbits:
case cktypeDIBcompressed:
case cktypePALchange:
if (stream_n != wma->video_stream_n)
{
TRACE("data belongs to another video stream #%d\n", stream_n);
return FALSE;
}
TRACE("Adding video frame[%d]: %d bytes\n",
alb->numVideoFrames, mmck->cksize);
if (alb->numVideoFrames < wma->dwPlayableVideoFrames) {
wma->lpVideoIndex[alb->numVideoFrames].dwOffset = mmck->dwDataOffset;
wma->lpVideoIndex[alb->numVideoFrames].dwSize = mmck->cksize;
if (alb->inVideoSize < mmck->cksize)
alb->inVideoSize = mmck->cksize;
alb->numVideoFrames++;
} else {
WARN("Too many video frames\n");
}
break;
case cktypeWAVEbytes:
if (stream_n != wma->audio_stream_n)
{
TRACE("data belongs to another audio stream #%d\n", stream_n);
return FALSE;
}
TRACE("Adding audio frame[%d]: %d bytes\n",
alb->numAudioBlocks, mmck->cksize);
if (wma->lpWaveFormat) {
if (alb->numAudioBlocks >= alb->numAudioAllocated) {
alb->numAudioAllocated += 32;
if (!wma->lpAudioIndex)
wma->lpAudioIndex = HeapAlloc(GetProcessHeap(), 0,
alb->numAudioAllocated * sizeof(struct MMIOPos));
else
wma->lpAudioIndex = HeapReAlloc(GetProcessHeap(), 0, wma->lpAudioIndex,
alb->numAudioAllocated * sizeof(struct MMIOPos));
if (!wma->lpAudioIndex) return FALSE;
}
wma->lpAudioIndex[alb->numAudioBlocks].dwOffset = mmck->dwDataOffset;
wma->lpAudioIndex[alb->numAudioBlocks].dwSize = mmck->cksize;
if (alb->inAudioSize < mmck->cksize)
alb->inAudioSize = mmck->cksize;
alb->numAudioBlocks++;
} else {
WARN("Wave chunk without wave format... discarding\n");
}
break;
default:
WARN("Unknown frame type %4.4s\n", (LPSTR)&mmck->ckid);
break;
}
return TRUE;
}
BOOL MCIAVI_GetInfo(WINE_MCIAVI* wma)
{
MMCKINFO ckMainRIFF;
MMCKINFO mmckHead;
MMCKINFO mmckList;
MMCKINFO mmckInfo;
AVIStreamHeader strh;
struct AviListBuild alb;
DWORD stream_n;
if (mmioDescend(wma->hFile, &ckMainRIFF, NULL, 0) != 0) {
WARN("Can't find 'RIFF' chunk\n");
return FALSE;
}
if ((ckMainRIFF.ckid != FOURCC_RIFF) || (ckMainRIFF.fccType != formtypeAVI)) {
WARN("Can't find 'AVI ' chunk\n");
return FALSE;
}
mmckHead.fccType = listtypeAVIHEADER;
if (mmioDescend(wma->hFile, &mmckHead, &ckMainRIFF, MMIO_FINDLIST) != 0) {
WARN("Can't find 'hdrl' list\n");
return FALSE;
}
mmckInfo.ckid = ckidAVIMAINHDR;
if (mmioDescend(wma->hFile, &mmckInfo, &mmckHead, MMIO_FINDCHUNK) != 0) {
WARN("Can't find 'avih' chunk\n");
return FALSE;
}
mmioRead(wma->hFile, (LPSTR)&wma->mah, sizeof(wma->mah));
TRACE("mah.dwMicroSecPerFrame=%d\n", wma->mah.dwMicroSecPerFrame);
TRACE("mah.dwMaxBytesPerSec=%d\n", wma->mah.dwMaxBytesPerSec);
TRACE("mah.dwPaddingGranularity=%d\n", wma->mah.dwPaddingGranularity);
TRACE("mah.dwFlags=%d\n", wma->mah.dwFlags);
TRACE("mah.dwTotalFrames=%d\n", wma->mah.dwTotalFrames);
TRACE("mah.dwInitialFrames=%d\n", wma->mah.dwInitialFrames);
TRACE("mah.dwStreams=%d\n", wma->mah.dwStreams);
TRACE("mah.dwSuggestedBufferSize=%d\n", wma->mah.dwSuggestedBufferSize);
TRACE("mah.dwWidth=%d\n", wma->mah.dwWidth);
TRACE("mah.dwHeight=%d\n", wma->mah.dwHeight);
mmioAscend(wma->hFile, &mmckInfo, 0);
TRACE("Start of streams\n");
wma->video_stream_n = 0;
wma->audio_stream_n = 0;
for (stream_n = 0; stream_n < wma->mah.dwStreams; stream_n++)
{
MMCKINFO mmckStream;
mmckList.fccType = listtypeSTREAMHEADER;
if (mmioDescend(wma->hFile, &mmckList, &mmckHead, MMIO_FINDLIST) != 0)
break;
mmckStream.ckid = ckidSTREAMHEADER;
if (mmioDescend(wma->hFile, &mmckStream, &mmckList, MMIO_FINDCHUNK) != 0)
{
WARN("Can't find 'strh' chunk\n");
continue;
}
mmioRead(wma->hFile, (LPSTR)&strh, sizeof(strh));
TRACE("Stream #%d fccType %4.4s\n", stream_n, (LPSTR)&strh.fccType);
if (strh.fccType == streamtypeVIDEO)
{
TRACE("found video stream\n");
if (wma->inbih)
WARN("ignoring another video stream\n");
else
{
wma->ash_audio = strh;
if (!MCIAVI_GetInfoVideo(wma, &mmckList, &mmckStream))
return FALSE;
wma->video_stream_n = stream_n;
}
}
else if (strh.fccType == streamtypeAUDIO)
{
TRACE("found audio stream\n");
if (wma->lpWaveFormat)
WARN("ignoring another audio stream\n");
else
{
wma->ash_video = strh;
if (!MCIAVI_GetInfoAudio(wma, &mmckList, &mmckStream))
return FALSE;
wma->audio_stream_n = stream_n;
}
}
else
TRACE("Unsupported stream type %4.4s\n", (LPSTR)&strh.fccType);
mmioAscend(wma->hFile, &mmckList, 0);
}
TRACE("End of streams\n");
mmioAscend(wma->hFile, &mmckHead, 0);
/* no need to read optional JUNK chunk */
mmckList.fccType = listtypeAVIMOVIE;
if (mmioDescend(wma->hFile, &mmckList, &ckMainRIFF, MMIO_FINDLIST) != 0) {
WARN("Can't find 'movi' list\n");
return FALSE;
}
wma->dwPlayableVideoFrames = wma->mah.dwTotalFrames;
wma->lpVideoIndex = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
wma->dwPlayableVideoFrames * sizeof(struct MMIOPos));
if (!wma->lpVideoIndex) {
WARN("Can't alloc video index array\n");
return FALSE;
}
wma->dwPlayableAudioBlocks = 0;
wma->lpAudioIndex = NULL;
alb.numAudioBlocks = alb.numVideoFrames = 0;
alb.inVideoSize = alb.inAudioSize = 0;
alb.numAudioAllocated = 0;
while (mmioDescend(wma->hFile, &mmckInfo, &mmckList, 0) == 0) {
if (mmckInfo.fccType == listtypeAVIRECORD) {
MMCKINFO tmp;
while (mmioDescend(wma->hFile, &tmp, &mmckInfo, 0) == 0) {
MCIAVI_AddFrame(wma, &tmp, &alb);
mmioAscend(wma->hFile, &tmp, 0);
}
} else {
MCIAVI_AddFrame(wma, &mmckInfo, &alb);
}
mmioAscend(wma->hFile, &mmckInfo, 0);
}
if (alb.numVideoFrames != wma->dwPlayableVideoFrames) {
WARN("Found %d video frames (/%d), reducing playable frames\n",
alb.numVideoFrames, wma->dwPlayableVideoFrames);
wma->dwPlayableVideoFrames = alb.numVideoFrames;
}
wma->dwPlayableAudioBlocks = alb.numAudioBlocks;
if (alb.inVideoSize > wma->ash_video.dwSuggestedBufferSize) {
WARN("inVideoSize=%d suggestedSize=%d\n", alb.inVideoSize, wma->ash_video.dwSuggestedBufferSize);
wma->ash_video.dwSuggestedBufferSize = alb.inVideoSize;
}
if (alb.inAudioSize > wma->ash_audio.dwSuggestedBufferSize) {
WARN("inAudioSize=%d suggestedSize=%d\n", alb.inAudioSize, wma->ash_audio.dwSuggestedBufferSize);
wma->ash_audio.dwSuggestedBufferSize = alb.inAudioSize;
}
wma->indata = HeapAlloc(GetProcessHeap(), 0, wma->ash_video.dwSuggestedBufferSize);
if (!wma->indata) {
WARN("Can't alloc input buffer\n");
return FALSE;
}
return TRUE;
}
BOOL MCIAVI_OpenVideo(WINE_MCIAVI* wma)
{
HDC hDC;
DWORD outSize;
FOURCC fcc = wma->ash_video.fccHandler;
TRACE("fcc %4.4s\n", (LPSTR)&fcc);
wma->dwCachedFrame = -1;
/* get the right handle */
if (fcc == mmioFOURCC('C','R','A','M')) fcc = mmioFOURCC('M','S','V','C');
/* try to get a decompressor for that type */
wma->hic = ICLocate(ICTYPE_VIDEO, fcc, wma->inbih, NULL, ICMODE_DECOMPRESS);
if (!wma->hic) {
/* check for builtin DIB compressions */
fcc = wma->inbih->biCompression;
if ((fcc == mmioFOURCC('D','I','B',' ')) ||
(fcc == mmioFOURCC('R','L','E',' ')) ||
(fcc == BI_RGB) || (fcc == BI_RLE8) ||
(fcc == BI_RLE4) || (fcc == BI_BITFIELDS))
goto paint_frame;
WARN("Can't locate codec for the file\n");
return FALSE;
}
outSize = sizeof(BITMAPINFOHEADER) + 256 * sizeof(RGBQUAD);
wma->outbih = HeapAlloc(GetProcessHeap(), 0, outSize);
if (!wma->outbih) {
WARN("Can't alloc output BIH\n");
return FALSE;
}
if (!ICGetDisplayFormat(wma->hic, wma->inbih, wma->outbih, 0, 0, 0)) {
WARN("Can't open decompressor\n");
return FALSE;
}
TRACE("bih.biSize=%d\n", wma->outbih->biSize);
TRACE("bih.biWidth=%d\n", wma->outbih->biWidth);
TRACE("bih.biHeight=%d\n", wma->outbih->biHeight);
TRACE("bih.biPlanes=%d\n", wma->outbih->biPlanes);
TRACE("bih.biBitCount=%d\n", wma->outbih->biBitCount);
TRACE("bih.biCompression=%x\n", wma->outbih->biCompression);
TRACE("bih.biSizeImage=%d\n", wma->outbih->biSizeImage);
TRACE("bih.biXPelsPerMeter=%d\n", wma->outbih->biXPelsPerMeter);
TRACE("bih.biYPelsPerMeter=%d\n", wma->outbih->biYPelsPerMeter);
TRACE("bih.biClrUsed=%d\n", wma->outbih->biClrUsed);
TRACE("bih.biClrImportant=%d\n", wma->outbih->biClrImportant);
wma->outdata = HeapAlloc(GetProcessHeap(), 0, wma->outbih->biSizeImage);
if (!wma->outdata) {
WARN("Can't alloc output buffer\n");
return FALSE;
}
if (ICSendMessage(wma->hic, ICM_DECOMPRESS_BEGIN,
(DWORD_PTR)wma->inbih, (DWORD_PTR)wma->outbih) != ICERR_OK) {
WARN("Can't begin decompression\n");
return FALSE;
}
paint_frame:
hDC = wma->hWndPaint ? GetDC(wma->hWndPaint) : 0;
if (hDC)
{
MCIAVI_PaintFrame(wma, hDC);
ReleaseDC(wma->hWndPaint, hDC);
}
return TRUE;
}
static void CALLBACK MCIAVI_waveCallback(HWAVEOUT hwo, UINT uMsg, DWORD_PTR dwInstance,
DWORD_PTR dwParam1, DWORD_PTR dwParam2)
{
WINE_MCIAVI *wma = MCIAVI_mciGetOpenDev(dwInstance);
if (!wma) return;
EnterCriticalSection(&wma->cs);
switch (uMsg) {
case WOM_OPEN:
case WOM_CLOSE:
break;
case WOM_DONE:
InterlockedIncrement(&wma->dwEventCount);
TRACE("Returning waveHdr=%lx\n", dwParam1);
SetEvent(wma->hEvent);
break;
default:
ERR("Unknown uMsg=%d\n", uMsg);
}
LeaveCriticalSection(&wma->cs);
}
DWORD MCIAVI_OpenAudio(WINE_MCIAVI* wma, unsigned* nHdr, LPWAVEHDR* pWaveHdr)
{
DWORD dwRet;
LPWAVEHDR waveHdr;
unsigned i;
dwRet = waveOutOpen((HWAVEOUT *)&wma->hWave, WAVE_MAPPER, wma->lpWaveFormat,
(DWORD_PTR)MCIAVI_waveCallback, wma->wDevID, CALLBACK_FUNCTION);
if (dwRet != 0) {
TRACE("Can't open low level audio device %d\n", dwRet);
dwRet = MCIERR_DEVICE_OPEN;
wma->hWave = 0;
goto cleanUp;
}
/* FIXME: should set up a heuristic to compute the number of wave headers
* to be used...
*/
*nHdr = 7;
waveHdr = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
*nHdr * (sizeof(WAVEHDR) + wma->ash_audio.dwSuggestedBufferSize));
if (!waveHdr) {
TRACE("Can't alloc wave headers\n");
dwRet = MCIERR_DEVICE_OPEN;
goto cleanUp;
}
for (i = 0; i < *nHdr; i++) {
/* other fields are zero:ed on allocation */
waveHdr[i].lpData = (char*)waveHdr +
*nHdr * sizeof(WAVEHDR) + i * wma->ash_audio.dwSuggestedBufferSize;
waveHdr[i].dwBufferLength = wma->ash_audio.dwSuggestedBufferSize;
if (waveOutPrepareHeader(wma->hWave, &waveHdr[i], sizeof(WAVEHDR))) {
dwRet = MCIERR_INTERNAL;
goto cleanUp;
}
}
if (wma->dwCurrVideoFrame != 0 && wma->lpWaveFormat) {
FIXME("Should recompute dwCurrAudioBlock, except unsynchronized sound & video\n");
}
wma->dwCurrAudioBlock = 0;
wma->hEvent = CreateEventW(NULL, FALSE, FALSE, NULL);
wma->dwEventCount = *nHdr - 1;
*pWaveHdr = waveHdr;
cleanUp:
return dwRet;
}
void MCIAVI_PlayAudioBlocks(WINE_MCIAVI* wma, unsigned nHdr, LPWAVEHDR waveHdr)
{
if (!wma->lpAudioIndex)
return;
TRACE("%d (ec=%u)\n", wma->lpAudioIndex[wma->dwCurrAudioBlock].dwOffset, wma->dwEventCount);
/* push as many blocks as possible => audio gets priority */
while (wma->dwStatus != MCI_MODE_STOP && wma->dwStatus != MCI_MODE_NOT_READY &&
wma->dwCurrAudioBlock < wma->dwPlayableAudioBlocks) {
unsigned whidx = wma->dwCurrAudioBlock % nHdr;
ResetEvent(wma->hEvent);
if (InterlockedDecrement(&wma->dwEventCount) < 0 ||
!wma->lpAudioIndex[wma->dwCurrAudioBlock].dwOffset)
{
InterlockedIncrement(&wma->dwEventCount);
break;
}
mmioSeek(wma->hFile, wma->lpAudioIndex[wma->dwCurrAudioBlock].dwOffset, SEEK_SET);
mmioRead(wma->hFile, waveHdr[whidx].lpData, wma->lpAudioIndex[wma->dwCurrAudioBlock].dwSize);
waveHdr[whidx].dwFlags &= ~WHDR_DONE;
waveHdr[whidx].dwBufferLength = wma->lpAudioIndex[wma->dwCurrAudioBlock].dwSize;
waveOutWrite(wma->hWave, &waveHdr[whidx], sizeof(WAVEHDR));
wma->dwCurrAudioBlock++;
}
}
LRESULT MCIAVI_PaintFrame(WINE_MCIAVI* wma, HDC hDC)
{
void* pBitmapData;
LPBITMAPINFO pBitmapInfo;
if (!hDC || !wma->inbih)
return TRUE;
TRACE("Painting frame %u (cached %u)\n", wma->dwCurrVideoFrame, wma->dwCachedFrame);
if (wma->dwCurrVideoFrame != wma->dwCachedFrame)
{
if (!wma->lpVideoIndex[wma->dwCurrVideoFrame].dwOffset)
return FALSE;
if (wma->lpVideoIndex[wma->dwCurrVideoFrame].dwSize)
{
mmioSeek(wma->hFile, wma->lpVideoIndex[wma->dwCurrVideoFrame].dwOffset, SEEK_SET);
mmioRead(wma->hFile, wma->indata, wma->lpVideoIndex[wma->dwCurrVideoFrame].dwSize);
wma->inbih->biSizeImage = wma->lpVideoIndex[wma->dwCurrVideoFrame].dwSize;
if (wma->hic && ICDecompress(wma->hic, 0, wma->inbih, wma->indata,
wma->outbih, wma->outdata) != ICERR_OK)
{
WARN("Decompression error\n");
return FALSE;
}
}
wma->dwCachedFrame = wma->dwCurrVideoFrame;
}
if (wma->hic) {
pBitmapData = wma->outdata;
pBitmapInfo = (LPBITMAPINFO)wma->outbih;
} else {
pBitmapData = wma->indata;
pBitmapInfo = (LPBITMAPINFO)wma->inbih;
}
StretchDIBits(hDC,
wma->dest.left, wma->dest.top,
wma->dest.right - wma->dest.left, wma->dest.bottom - wma->dest.top,
wma->source.left, wma->source.top,
wma->source.right - wma->source.left, wma->source.bottom - wma->source.top,
pBitmapData, pBitmapInfo, DIB_RGB_COLORS, SRCCOPY);
return TRUE;
}

View file

@ -0,0 +1,113 @@
/*
* Digital video MCI Wine Driver
*
* Copyright 1999, 2000 Eric POUECH
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef __WINE_PRIVATE_MCIAVI_H
#define __WINE_PRIVATE_MCIAVI_H
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "mmddk.h"
#include "digitalv.h"
#include "vfw.h"
#include "wownt32.h"
#include "mciavi.h"
struct MMIOPos {
DWORD dwOffset;
DWORD dwSize;
};
typedef struct {
MCIDEVICEID wDevID;
int nUseCount; /* Incremented for each shared open */
BOOL fShareable; /* TRUE if first open was shareable */
WORD wCommandTable; /* custom MCI command table */
DWORD dwStatus; /* One of MCI_MODE_XXX */
LPWSTR lpFileName;
DWORD dwMciTimeFormat; /* current time format */
DWORD dwSet; /* what's turned on: video & audio l&r */
/* information on the loaded AVI file */
HMMIO hFile; /* mmio file handle open as Element */
DWORD video_stream_n, audio_stream_n; /* stream #s */
MainAVIHeader mah;
AVIStreamHeader ash_video;
AVIStreamHeader ash_audio;
LPBITMAPINFOHEADER inbih;
struct MMIOPos* lpVideoIndex;
LPWAVEFORMATEX lpWaveFormat;
struct MMIOPos* lpAudioIndex;
/* computed data from the file */
DWORD dwPlayableVideoFrames; /* max number of frames to be played. Takes care of truncated files and audio skew */
DWORD dwPlayableAudioBlocks;
/* data for the AVI decompressor */
HIC hic;
LPBITMAPINFOHEADER outbih;
LPVOID indata;
LPVOID outdata;
HBITMAP hbmFrame;
/* data for playing the audio part */
HANDLE hWave;
HANDLE hEvent; /* for synchronization */
LONG dwEventCount; /* for synchronization */
/* data for play back */
HWND hWnd, hWndPaint;
DWORD dwCachedFrame; /* buffered frame */
DWORD dwCurrVideoFrame; /* video frame to display and current position */
DWORD dwToVideoFrame; /* play to */
DWORD dwCurrAudioBlock; /* current audio block being played */
RECT source, dest;
/* data for the background mechanism */
CRITICAL_SECTION cs;
HANDLE hStopEvent;
HANDLE ack_event; /* acknowledge that an async command has started */
} WINE_MCIAVI;
extern HINSTANCE MCIAVI_hInstance;
/* info.c */
DWORD MCIAVI_ConvertTimeFormatToFrame(WINE_MCIAVI* wma, DWORD val);
DWORD MCIAVI_mciGetDevCaps(UINT wDevID, DWORD dwFlags, LPMCI_GETDEVCAPS_PARMS lpParms);
DWORD MCIAVI_mciInfo(UINT wDevID, DWORD dwFlags, LPMCI_DGV_INFO_PARMSW lpParms);
DWORD MCIAVI_mciSet(UINT wDevID, DWORD dwFlags, LPMCI_DGV_SET_PARMS lpParms);
DWORD MCIAVI_mciStatus(UINT wDevID, DWORD dwFlags, LPMCI_DGV_STATUS_PARMSW lpParms);
/* mmoutput.c */
BOOL MCIAVI_GetInfo(WINE_MCIAVI* wma);
DWORD MCIAVI_OpenAudio(WINE_MCIAVI* wma, unsigned* nHdr, LPWAVEHDR* pWaveHdr);
BOOL MCIAVI_OpenVideo(WINE_MCIAVI* wma);
void MCIAVI_PlayAudioBlocks(WINE_MCIAVI* wma, unsigned nHdr, LPWAVEHDR waveHdr);
LRESULT MCIAVI_PaintFrame(WINE_MCIAVI* wma, HDC hDC);
/* mciavi.c */
WINE_MCIAVI* MCIAVI_mciGetOpenDev(UINT wDevID);
DWORD MCIAVI_mciClose(UINT, DWORD, LPMCI_GENERIC_PARMS);
/* wnd.c */
BOOL MCIAVI_RegisterClass(void);
BOOL MCIAVI_UnregisterClass(void);
BOOL MCIAVI_CreateWindow(WINE_MCIAVI* wma, DWORD dwFlags, LPMCI_DGV_OPEN_PARMSW lpOpenParms);
DWORD MCIAVI_mciPut(UINT wDevID, DWORD dwFlags, LPMCI_DGV_PUT_PARMS lpParms);
DWORD MCIAVI_mciWhere(UINT wDevID, DWORD dwFlags, LPMCI_DGV_RECT_PARMS lpParms);
DWORD MCIAVI_mciWindow(UINT wDevID, DWORD dwFlags, LPMCI_DGV_WINDOW_PARMSW lpParms);
#endif /* __WINE_PRIVATE_MCIAVI_H */

View file

@ -0,0 +1,308 @@
/*
* Digital video MCI Wine Driver
*
* Copyright 1999, 2000 Eric POUECH
* Copyright 2003 Dmitry Timoshkov
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <string.h>
#include "private_mciavi.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(mciavi);
static const WCHAR mciaviW[] = {'M','C','I','A','V','I',0};
static LRESULT WINAPI MCIAVI_WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
TRACE("hwnd=%p msg=%x wparam=%lx lparam=%lx\n", hWnd, uMsg, wParam, lParam);
switch (uMsg) {
case WM_CREATE:
SetWindowLongW(hWnd, 0, (LPARAM)((CREATESTRUCTW *)lParam)->lpCreateParams);
return DefWindowProcW(hWnd, uMsg, wParam, lParam);
case WM_DESTROY:
MCIAVI_mciClose(GetWindowLongW(hWnd, 0), MCI_WAIT, NULL);
SetWindowLongW(hWnd, 0, 0);
return DefWindowProcW(hWnd, uMsg, wParam, lParam);
case WM_ERASEBKGND:
{
RECT rect;
GetClientRect(hWnd, &rect);
FillRect((HDC)wParam, &rect, GetStockObject(BLACK_BRUSH));
}
return 1;
case WM_PAINT:
{
WINE_MCIAVI *wma = (WINE_MCIAVI *)mciGetDriverData(GetWindowLongW(hWnd, 0));
if (!wma)
return DefWindowProcW(hWnd, uMsg, wParam, lParam);
EnterCriticalSection(&wma->cs);
/* the animation isn't playing, don't paint */
if (wma->dwStatus == MCI_MODE_NOT_READY)
{
LeaveCriticalSection(&wma->cs);
/* default paint handling */
return DefWindowProcW(hWnd, uMsg, wParam, lParam);
}
if (wParam)
MCIAVI_PaintFrame(wma, (HDC)wParam);
else
{
PAINTSTRUCT ps;
BeginPaint(hWnd, &ps);
MCIAVI_PaintFrame(wma, ps.hdc);
EndPaint(hWnd, &ps);
}
LeaveCriticalSection(&wma->cs);
}
return 1;
default:
return DefWindowProcW(hWnd, uMsg, wParam, lParam);
}
}
BOOL MCIAVI_UnregisterClass(void)
{
return UnregisterClassW(mciaviW, MCIAVI_hInstance);
}
BOOL MCIAVI_RegisterClass(void)
{
WNDCLASSW wndClass;
ZeroMemory(&wndClass, sizeof(WNDCLASSW));
wndClass.style = CS_DBLCLKS;
wndClass.lpfnWndProc = MCIAVI_WindowProc;
wndClass.cbWndExtra = sizeof(MCIDEVICEID);
wndClass.hInstance = MCIAVI_hInstance;
wndClass.hCursor = LoadCursorW(0, (LPCWSTR)IDC_ARROW);
wndClass.hbrBackground = (HBRUSH)(COLOR_3DFACE + 1);
wndClass.lpszClassName = mciaviW;
if (RegisterClassW(&wndClass)) return TRUE;
if (GetLastError() == ERROR_CLASS_ALREADY_EXISTS) return TRUE;
return FALSE;
}
BOOL MCIAVI_CreateWindow(WINE_MCIAVI* wma, DWORD dwFlags, LPMCI_DGV_OPEN_PARMSW lpOpenParms)
{
static const WCHAR captionW[] = {'W','i','n','e',' ','M','C','I','-','A','V','I',' ','p','l','a','y','e','r',0};
HWND hParent = 0;
DWORD dwStyle = WS_OVERLAPPEDWINDOW;
RECT rc;
/* what should be done ? */
if (wma->hWnd) return TRUE;
if (dwFlags & MCI_DGV_OPEN_PARENT) hParent = lpOpenParms->hWndParent;
if (dwFlags & MCI_DGV_OPEN_WS) dwStyle = lpOpenParms->dwStyle;
rc.left = rc.top = 0;
rc.right = (wma->hic ? wma->outbih : wma->inbih)->biWidth;
rc.bottom = (wma->hic ? wma->outbih : wma->inbih)->biHeight;
AdjustWindowRect(&rc, dwStyle, FALSE);
if (!(dwStyle & (WS_CHILD|WS_POPUP))) /* overlapped window ? */
{
rc.right -= rc.left;
rc.bottom -= rc.top;
rc.left = rc.top = CW_USEDEFAULT;
}
wma->hWnd = CreateWindowW(mciaviW, captionW,
dwStyle, rc.left, rc.top,
rc.right, rc.bottom,
hParent, 0, MCIAVI_hInstance,
ULongToPtr(wma->wDevID));
wma->hWndPaint = wma->hWnd;
return wma->hWnd != 0;
}
/***************************************************************************
* MCIAVI_mciPut [internal]
*/
DWORD MCIAVI_mciPut(UINT wDevID, DWORD dwFlags, LPMCI_DGV_PUT_PARMS lpParms)
{
WINE_MCIAVI* wma = MCIAVI_mciGetOpenDev(wDevID);
RECT rc;
TRACE("(%04x, %08X, %p)\n", wDevID, dwFlags, lpParms);
if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK;
if (wma == NULL) return MCIERR_INVALID_DEVICE_ID;
EnterCriticalSection(&wma->cs);
if (dwFlags & MCI_DGV_RECT) {
/* In MCI, RECT structure is used differently: rc.right = width & rc.bottom = height
* So convert input MCI RECT into a normal RECT */
rc.left = lpParms->rc.left;
rc.top = lpParms->rc.top;
rc.right = lpParms->rc.left + lpParms->rc.right;
rc.bottom = lpParms->rc.top + lpParms->rc.bottom;
} else {
GetClientRect(wma->hWndPaint, &rc);
}
if (dwFlags & MCI_DGV_PUT_CLIENT) {
FIXME("PUT_CLIENT %s\n", wine_dbgstr_rect(&rc));
LeaveCriticalSection(&wma->cs);
return MCIERR_UNRECOGNIZED_COMMAND;
}
if (dwFlags & MCI_DGV_PUT_DESTINATION) {
TRACE("PUT_DESTINATION %s\n", wine_dbgstr_rect(&rc));
wma->dest = rc;
}
if (dwFlags & MCI_DGV_PUT_FRAME) {
FIXME("PUT_FRAME %s\n", wine_dbgstr_rect(&rc));
LeaveCriticalSection(&wma->cs);
return MCIERR_UNRECOGNIZED_COMMAND;
}
if (dwFlags & MCI_DGV_PUT_SOURCE) {
TRACE("PUT_SOURCE %s\n", wine_dbgstr_rect(&rc));
wma->source = rc;
}
if (dwFlags & MCI_DGV_PUT_VIDEO) {
FIXME("PUT_VIDEO %s\n", wine_dbgstr_rect(&rc));
LeaveCriticalSection(&wma->cs);
return MCIERR_UNRECOGNIZED_COMMAND;
}
if (dwFlags & MCI_DGV_PUT_WINDOW) {
TRACE("PUT_WINDOW %s\n", wine_dbgstr_rect(&rc));
SetWindowPos(wma->hWndPaint, NULL, rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top, SWP_NOZORDER);
}
LeaveCriticalSection(&wma->cs);
return 0;
}
/******************************************************************************
* MCIAVI_mciWhere [internal]
*/
DWORD MCIAVI_mciWhere(UINT wDevID, DWORD dwFlags, LPMCI_DGV_RECT_PARMS lpParms)
{
WINE_MCIAVI* wma = MCIAVI_mciGetOpenDev(wDevID);
RECT rc;
TRACE("(%04x, %08x, %p)\n", wDevID, dwFlags, lpParms);
if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK;
if (wma == NULL) return MCIERR_INVALID_DEVICE_ID;
EnterCriticalSection(&wma->cs);
if (dwFlags & MCI_DGV_WHERE_DESTINATION) {
if (dwFlags & MCI_DGV_WHERE_MAX) {
GetClientRect(wma->hWndPaint, &rc);
TRACE("WHERE_DESTINATION_MAX %s\n", wine_dbgstr_rect(&rc));
} else {
TRACE("WHERE_DESTINATION %s\n", wine_dbgstr_rect(&wma->dest));
rc = wma->dest;
}
}
if (dwFlags & MCI_DGV_WHERE_FRAME) {
if (dwFlags & MCI_DGV_WHERE_MAX)
FIXME("MCI_DGV_WHERE_FRAME_MAX\n");
else
FIXME("MCI_DGV_WHERE_FRAME\n");
LeaveCriticalSection(&wma->cs);
return MCIERR_UNRECOGNIZED_COMMAND;
}
if (dwFlags & MCI_DGV_WHERE_SOURCE) {
if (dwFlags & MCI_DGV_WHERE_MAX) {
rc.left = 0;
rc.top = 0;
rc.right = wma->inbih->biWidth;
rc.bottom = wma->inbih->biHeight;
TRACE("WHERE_SOURCE_MAX %s\n", wine_dbgstr_rect(&rc));
} else {
TRACE("WHERE_SOURCE %s\n", wine_dbgstr_rect(&wma->source));
rc = wma->source;
}
}
if (dwFlags & MCI_DGV_WHERE_VIDEO) {
if (dwFlags & MCI_DGV_WHERE_MAX)
FIXME("WHERE_VIDEO_MAX\n");
else
FIXME("WHERE_VIDEO\n");
LeaveCriticalSection(&wma->cs);
return MCIERR_UNRECOGNIZED_COMMAND;
}
if (dwFlags & MCI_DGV_WHERE_WINDOW) {
if (dwFlags & MCI_DGV_WHERE_MAX) {
GetWindowRect(GetDesktopWindow(), &rc);
TRACE("WHERE_WINDOW_MAX %s\n", wine_dbgstr_rect(&rc));
} else {
GetWindowRect(wma->hWndPaint, &rc);
TRACE("WHERE_WINDOW %s\n", wine_dbgstr_rect(&rc));
}
}
/* In MCI, RECT structure is used differently: rc.right = width & rc.bottom = height
* So convert the normal RECT into a MCI RECT before returning */
lpParms->rc.left = rc.left;
lpParms->rc.top = rc.top;
lpParms->rc.right = rc.right - rc.left;
lpParms->rc.bottom = rc.bottom - rc.top;
LeaveCriticalSection(&wma->cs);
return 0;
}
/***************************************************************************
* MCIAVI_mciWindow [internal]
*/
DWORD MCIAVI_mciWindow(UINT wDevID, DWORD dwFlags, LPMCI_DGV_WINDOW_PARMSW lpParms)
{
WINE_MCIAVI* wma = MCIAVI_mciGetOpenDev(wDevID);
TRACE("(%04x, %08X, %p)\n", wDevID, dwFlags, lpParms);
if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK;
if (wma == NULL) return MCIERR_INVALID_DEVICE_ID;
EnterCriticalSection(&wma->cs);
if (dwFlags & MCI_DGV_WINDOW_HWND) {
if (IsWindow(lpParms->hWnd))
{
TRACE("Setting hWnd to %p\n", lpParms->hWnd);
if (wma->hWnd) ShowWindow(wma->hWnd, SW_HIDE);
wma->hWndPaint = (lpParms->hWnd == MCI_DGV_WINDOW_DEFAULT) ? wma->hWnd : lpParms->hWnd;
}
}
if (dwFlags & MCI_DGV_WINDOW_STATE) {
TRACE("Setting nCmdShow to %d\n", lpParms->nCmdShow);
ShowWindow(wma->hWndPaint, lpParms->nCmdShow);
}
if (dwFlags & MCI_DGV_WINDOW_TEXT) {
TRACE("Setting caption to %s\n", debugstr_w(lpParms->lpstrText));
SetWindowTextW(wma->hWndPaint, lpParms->lpstrText);
}
LeaveCriticalSection(&wma->cs);
return 0;
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,12 @@
<module name="mcicda" type="win32dll" baseaddress="${BASEADDRESS_MCICDA}" installbase="system32" installname="mcicda.dll" allowwarnings="true" entrypoint="0">
<importlibrary definition="mcicda.spec" />
<include base="mcicda">.</include>
<include base="ReactOS">include/reactos/wine</include>
<define name="__WINESRC__" />
<file>mcicda.c</file>
<library>wine</library>
<library>winmm</library>
<library>user32</library>
<library>kernel32</library>
<library>ntdll</library>
</module>

View file

@ -0,0 +1 @@
@ stdcall -private DriverProc(long long long long long) MCICDA_DriverProc

View file

@ -0,0 +1,63 @@
/*
* DirectShow MCI Driver
*
* Copyright 2009 Christian Costa
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "mmddk.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(mciqtz);
/*======================================================================*
* MCI QTZ implementation *
*======================================================================*/
HINSTANCE MCIQTZ_hInstance = 0;
/***********************************************************************
* DllMain (MCIQTZ.0)
*/
BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID fImpLoad)
{
switch (fdwReason) {
case DLL_PROCESS_ATTACH:
DisableThreadLibraryCalls(hInstDLL);
MCIQTZ_hInstance = hInstDLL;
break;
}
return TRUE;
}
/*======================================================================*
* MCI QTZ entry points *
*======================================================================*/
/**************************************************************************
* DriverProc (MCIQTZ.@)
*/
LRESULT CALLBACK MCIQTZ_DriverProc(DWORD_PTR dwDevID, HDRVR hDriv, UINT wMsg,
LPARAM dwParam1, LPARAM dwParam2)
{
FIXME("(%08lX, %p, %08X, %08lX, %08lX): Stub!\n",
dwDevID, hDriv, wMsg, dwParam1, dwParam2);
return MCIERR_UNRECOGNIZED_COMMAND;
}

View file

@ -0,0 +1,11 @@
<module name="mciqtz32" type="win32dll" baseaddress="${BASEADDRESS_MCIQTZ32}" installbase="system32" installname="mciqtz32.dll" allowwarnings="true">
<importlibrary definition="mciqtz32.spec" />
<include base="mciqtz32">.</include>
<include base="ReactOS">include/reactos/wine</include>
<define name="__WINESRC__" />
<file>mciqtz.c</file>
<file>version.rc</file>
<library>wine</library>
<library>kernel32</library>
<library>ntdll</library>
</module>

View file

@ -0,0 +1 @@
@ stdcall -private DriverProc(long long long long long) MCIQTZ_DriverProc

View file

@ -0,0 +1,27 @@
/*
* Copyright (c) 2009 Christian Costa
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#define WINE_OLESELFREGISTER
#define WINE_FILEDESCRIPTION_STR "Wine DirectShow MCI Driver"
#define WINE_FILENAME_STR "mciqtz32.dll"
#define WINE_FILEVERSION 6,5,1,900
#define WINE_FILEVERSION_STR "6.5.1.900"
#define WINE_PRODUCTVERSION 6,5,1,900
#define WINE_PRODUCTVERSION_STR "6.5"
#include "wine/wine_common_ver.rc"

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,12 @@
<module name="mciseq" type="win32dll" baseaddress="${BASEADDRESS_MCISEQ}" installbase="system32" installname="mciseq.dll" allowwarnings="true" entrypoint="0">
<importlibrary definition="mciseq.spec" />
<include base="mciseq">.</include>
<include base="ReactOS">include/reactos/wine</include>
<define name="__WINESRC__" />
<file>mcimidi.c</file>
<library>wine</library>
<library>winmm</library>
<library>user32</library>
<library>kernel32</library>
<library>ntdll</library>
</module>

View file

@ -0,0 +1 @@
@ stdcall -private DriverProc(long long long long long) MCIMIDI_DriverProc

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,12 @@
<module name="mciwave" type="win32dll" baseaddress="${BASEADDRESS_MCIWAVE}" installbase="system32" installname="mciwave.dll" allowwarnings="true" entrypoint="0">
<importlibrary definition="mciwave.spec" />
<include base="mciwave">.</include>
<include base="ReactOS">include/reactos/wine</include>
<define name="__WINESRC__" />
<file>mciwave.c</file>
<library>wine</library>
<library>winmm</library>
<library>user32</library>
<library>kernel32</library>
<library>ntdll</library>
</module>

View file

@ -0,0 +1 @@
@ stdcall -private DriverProc(long long long long long) MCIWAVE_DriverProc

View file

@ -175,6 +175,21 @@
<directory name="mapi32">
<xi:include href="mapi32/mapi32.rbuild" />
</directory>
<directory name="mciavi32">
<xi:include href="mciavi32/mciavi32.rbuild" />
</directory>
<directory name="mcicda">
<xi:include href="mcicda/mcicda.rbuild" />
</directory>
<directory name="mciqtz32">
<xi:include href="mciqtz32/mciqtz32.rbuild" />
</directory>
<directory name="mciseq">
<xi:include href="mciseq/mciseq.rbuild" />
</directory>
<directory name="mciwave">
<xi:include href="mciwave/mciwave.rbuild" />
</directory>
<directory name="modemui">
<xi:include href="modemui/modemui.rbuild" />
</directory>

View file

@ -63,6 +63,11 @@ reactos/dll/win32/localspl # Autosync
reactos/dll/win32/localui # Autosync
reactos/dll/win32/lz32 # Autosync
reactos/dll/win32/mapi32 # Autosync
reactos/dll/win32/mciavi32 # Autosync
reactos/dll/win32/mcicda # Autosync
reactos/dll/win32/mciqtz32 # Autosync
reactos/dll/win32/mciseq # Autosync
reactos/dll/win32/mciwave # Autosync
reactos/dll/win32/mlang # Autosync
reactos/dll/win32/mpr # Autosync
reactos/dll/win32/msacm32 # Out of sync