[MCIAVI32] Sync with Wine Staging 2.9. CORE-13362

c59dcfa mciavi32: Implement MCI_BREAK.
d3c25df mciavi32: Trace MCIAVI_CreateWindow.
1b57f07 mciavi32: Report version as 1.1.

svn path=/trunk/; revision=74813
This commit is contained in:
Amine Khaldi 2017-06-03 22:28:56 +00:00
parent dac59d58ed
commit 3f34a77f7b
5 changed files with 66 additions and 11 deletions

View file

@ -187,6 +187,7 @@ DWORD MCIAVI_mciInfo(UINT wDevID, DWORD dwFlags, LPMCI_DGV_INFO_PARMSW lpParms)
WINE_MCIAVI* wma = MCIAVI_mciGetOpenDev(wDevID); WINE_MCIAVI* wma = MCIAVI_mciGetOpenDev(wDevID);
DWORD ret = 0; DWORD ret = 0;
static const WCHAR wszAviPlayer[] = {'W','i','n','e','\'','s',' ','A','V','I',' ','p','l','a','y','e','r',0}; static const WCHAR wszAviPlayer[] = {'W','i','n','e','\'','s',' ','A','V','I',' ','p','l','a','y','e','r',0};
static const WCHAR wszVersion[] = {'1','.','1',0};
if (lpParms == NULL || lpParms->lpstrReturn == NULL) if (lpParms == NULL || lpParms->lpstrReturn == NULL)
return MCIERR_NULL_PARAMETER_BLOCK; return MCIERR_NULL_PARAMETER_BLOCK;
@ -199,6 +200,8 @@ DWORD MCIAVI_mciInfo(UINT wDevID, DWORD dwFlags, LPMCI_DGV_INFO_PARMSW lpParms)
if (dwFlags & MCI_INFO_PRODUCT) if (dwFlags & MCI_INFO_PRODUCT)
str = wszAviPlayer; str = wszAviPlayer;
else if (dwFlags & MCI_INFO_VERSION)
str = wszVersion;
else if (dwFlags & MCI_INFO_FILE) else if (dwFlags & MCI_INFO_FILE)
str = wma->lpFileName; str = wma->lpFileName;
else { else {

View file

@ -351,6 +351,7 @@ static DWORD MCIAVI_player(WINE_MCIAVI *wma, DWORD dwFlags, LPMCI_PLAY_PARMS lpP
DWORD numEvents = 1; DWORD numEvents = 1;
HANDLE events[2]; HANDLE events[2];
double next_frame_us; double next_frame_us;
BOOL wait_audio = TRUE;
EnterCriticalSection(&wma->cs); EnterCriticalSection(&wma->cs);
@ -417,19 +418,37 @@ static DWORD MCIAVI_player(WINE_MCIAVI *wma, DWORD dwFlags, LPMCI_PLAY_PARMS lpP
else else
delta = 0; delta = 0;
/* check if the playback was cancelled */
if ((wma->mci_break.flags & MCI_BREAK_KEY) &&
(GetAsyncKeyState(wma->mci_break.parms.nVirtKey) & 0x8000))
{
if (!(wma->mci_break.flags & MCI_BREAK_HWND) ||
GetForegroundWindow() == wma->mci_break.parms.hwndBreak)
{
/* we queue audio blocks ahead so ignore them otherwise the audio
* will keep playing until the buffer is empty */
wait_audio = FALSE;
TRACE("playback cancelled using break key\n");
break;
}
}
LeaveCriticalSection(&wma->cs); LeaveCriticalSection(&wma->cs);
ret = WaitForMultipleObjects(numEvents, events, FALSE, delta / 1000); ret = WaitForMultipleObjects(numEvents, events, FALSE, delta / 1000);
EnterCriticalSection(&wma->cs); EnterCriticalSection(&wma->cs);
if (ret == WAIT_OBJECT_0 || wma->dwStatus != MCI_MODE_PLAY) break; if (ret == WAIT_OBJECT_0 || wma->dwStatus != MCI_MODE_PLAY) break;
} }
if (wma->lpWaveFormat) { if (wma->lpWaveFormat)
while (wma->dwEventCount != nHdr - 1) {
{ if (wait_audio)
LeaveCriticalSection(&wma->cs); while (wma->dwEventCount != nHdr - 1)
Sleep(100); {
EnterCriticalSection(&wma->cs); LeaveCriticalSection(&wma->cs);
} Sleep(100);
EnterCriticalSection(&wma->cs);
}
/* just to get rid of some race conditions between play, stop and pause */ /* just to get rid of some race conditions between play, stop and pause */
LeaveCriticalSection(&wma->cs); LeaveCriticalSection(&wma->cs);
@ -868,6 +887,30 @@ static DWORD MCIAVI_mciCue(UINT wDevID, DWORD dwFlags, LPMCI_DGV_CUE_PARMS lpPar
return 0; return 0;
} }
/******************************************************************************
* MCIAVI_mciBreak [internal]
*/
static DWORD MCIAVI_mciBreak(UINT wDevID, DWORD dwFlags, LPMCI_BREAK_PARMS lpParms)
{
WINE_MCIAVI *wma;
TRACE("(%04x, %08x, %p)\n", wDevID, dwFlags, lpParms);
if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK;
wma = MCIAVI_mciGetOpenDev(wDevID);
if (wma == NULL) return MCIERR_INVALID_DEVICE_ID;
EnterCriticalSection(&wma->cs);
wma->mci_break.flags = dwFlags;
wma->mci_break.parms = *lpParms;
LeaveCriticalSection(&wma->cs);
return 0;
}
/****************************************************************************** /******************************************************************************
* MCIAVI_mciSetAudio [internal] * MCIAVI_mciSetAudio [internal]
*/ */
@ -986,6 +1029,7 @@ LRESULT CALLBACK MCIAVI_DriverProc(DWORD_PTR dwDevID, HDRVR hDriv, UINT wMsg,
case MCI_WHERE: return MCIAVI_mciWhere (dwDevID, dwParam1, (LPMCI_DGV_RECT_PARMS) dwParam2); case MCI_WHERE: return MCIAVI_mciWhere (dwDevID, dwParam1, (LPMCI_DGV_RECT_PARMS) dwParam2);
case MCI_STEP: return MCIAVI_mciStep (dwDevID, dwParam1, (LPMCI_DGV_STEP_PARMS) dwParam2); case MCI_STEP: return MCIAVI_mciStep (dwDevID, dwParam1, (LPMCI_DGV_STEP_PARMS) dwParam2);
case MCI_CUE: return MCIAVI_mciCue (dwDevID, dwParam1, (LPMCI_DGV_CUE_PARMS) dwParam2); case MCI_CUE: return MCIAVI_mciCue (dwDevID, dwParam1, (LPMCI_DGV_CUE_PARMS) dwParam2);
case MCI_BREAK: return MCIAVI_mciBreak (dwDevID, dwParam1, (LPMCI_BREAK_PARMS) dwParam2);
/* Digital Video specific */ /* Digital Video specific */
case MCI_SETAUDIO: return MCIAVI_mciSetAudio (dwDevID, dwParam1, (LPMCI_DGV_SETAUDIO_PARMSW) dwParam2); case MCI_SETAUDIO: return MCIAVI_mciSetAudio (dwDevID, dwParam1, (LPMCI_DGV_SETAUDIO_PARMSW) dwParam2);
case MCI_SIGNAL: return MCIAVI_mciSignal (dwDevID, dwParam1, (LPMCI_DGV_SIGNAL_PARMS) dwParam2); case MCI_SIGNAL: return MCIAVI_mciSignal (dwDevID, dwParam1, (LPMCI_DGV_SIGNAL_PARMS) dwParam2);

View file

@ -81,6 +81,11 @@ typedef struct {
DWORD dwToVideoFrame; /* play to */ DWORD dwToVideoFrame; /* play to */
DWORD dwCurrAudioBlock; /* current audio block being played */ DWORD dwCurrAudioBlock; /* current audio block being played */
RECT source, dest; RECT source, dest;
struct
{
DWORD flags;
MCI_BREAK_PARMS parms;
} mci_break;
/* data for the background mechanism */ /* data for the background mechanism */
CRITICAL_SECTION cs; CRITICAL_SECTION cs;
HANDLE hStopEvent; HANDLE hStopEvent;

View file

@ -105,7 +105,7 @@ BOOL MCIAVI_RegisterClass(void)
return FALSE; return FALSE;
} }
BOOL MCIAVI_CreateWindow(WINE_MCIAVI* wma, DWORD dwFlags, LPMCI_DGV_OPEN_PARMSW lpOpenParms) BOOL MCIAVI_CreateWindow(WINE_MCIAVI* wma, DWORD dwFlags, LPMCI_DGV_OPEN_PARMSW lpParms)
{ {
static const WCHAR captionW[] = {'W','i','n','e',' ','M','C','I','-','A','V','I',' ','p','l','a','y','e','r',0}; static const WCHAR captionW[] = {'W','i','n','e',' ','M','C','I','-','A','V','I',' ','p','l','a','y','e','r',0};
HWND hParent = 0; HWND hParent = 0;
@ -115,8 +115,8 @@ BOOL MCIAVI_CreateWindow(WINE_MCIAVI* wma, DWORD dwFlags, LPMCI_DGV_OPEN_PARM
/* what should be done ? */ /* what should be done ? */
if (wma->hWnd) return TRUE; if (wma->hWnd) return TRUE;
if (dwFlags & MCI_DGV_OPEN_PARENT) hParent = lpOpenParms->hWndParent; if (dwFlags & MCI_DGV_OPEN_PARENT) hParent = lpParms->hWndParent;
if (dwFlags & MCI_DGV_OPEN_WS) dwStyle = lpOpenParms->dwStyle; if (dwFlags & MCI_DGV_OPEN_WS) dwStyle = lpParms->dwStyle;
if (wma->hic) if (wma->hic)
SetRect(&rc, 0, 0, wma->outbih->biWidth, wma->outbih->biHeight); SetRect(&rc, 0, 0, wma->outbih->biWidth, wma->outbih->biHeight);
@ -137,6 +137,9 @@ BOOL MCIAVI_CreateWindow(WINE_MCIAVI* wma, DWORD dwFlags, LPMCI_DGV_OPEN_PARM
hParent, 0, MCIAVI_hInstance, hParent, 0, MCIAVI_hInstance,
ULongToPtr(wma->wDevID)); ULongToPtr(wma->wDevID));
wma->hWndPaint = wma->hWnd; wma->hWndPaint = wma->hWnd;
TRACE("(%04x, %08X, %p, style %x, parent %p, dimensions %dx%d, hwnd %p)\n", wma->wDevID,
dwFlags, lpParms, dwStyle, hParent, rc.right - rc.left, rc.bottom - rc.top, wma->hWnd);
return wma->hWnd != 0; return wma->hWnd != 0;
} }

View file

@ -90,7 +90,7 @@ reactos/dll/win32/jsproxy # Synced to WineStaging-2.2
reactos/dll/win32/loadperf # Synced to WineStaging-2.2 reactos/dll/win32/loadperf # Synced to WineStaging-2.2
reactos/dll/win32/lz32 # Synced to WineStaging-1.9.11 reactos/dll/win32/lz32 # Synced to WineStaging-1.9.11
reactos/dll/win32/mapi32 # Synced to WineStaging-2.2 reactos/dll/win32/mapi32 # Synced to WineStaging-2.2
reactos/dll/win32/mciavi32 # Synced to WineStaging-1.9.16 reactos/dll/win32/mciavi32 # Synced to WineStaging-2.9
reactos/dll/win32/mcicda # Synced to WineStaging-1.9.16 reactos/dll/win32/mcicda # Synced to WineStaging-1.9.16
reactos/dll/win32/mciqtz32 # Synced to WineStaging-2.2 reactos/dll/win32/mciqtz32 # Synced to WineStaging-2.2
reactos/dll/win32/mciseq # Synced to WineStaging-1.9.11 reactos/dll/win32/mciseq # Synced to WineStaging-1.9.11