ReactOS  0.4.14-dev-49-gfb4591c
private_mciavi.h File Reference
#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"
Include dependency graph for private_mciavi.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  MMIOPos
 
struct  WINE_MCIAVI
 

Functions

DWORD MCIAVI_ConvertTimeFormatToFrame (WINE_MCIAVI *wma, DWORD val) DECLSPEC_HIDDEN
 
DWORD MCIAVI_mciGetDevCaps (UINT wDevID, DWORD dwFlags, LPMCI_GETDEVCAPS_PARMS lpParms) DECLSPEC_HIDDEN
 
DWORD MCIAVI_mciInfo (UINT wDevID, DWORD dwFlags, LPMCI_DGV_INFO_PARMSW lpParms) DECLSPEC_HIDDEN
 
DWORD MCIAVI_mciSet (UINT wDevID, DWORD dwFlags, LPMCI_DGV_SET_PARMS lpParms) DECLSPEC_HIDDEN
 
DWORD MCIAVI_mciStatus (UINT wDevID, DWORD dwFlags, LPMCI_DGV_STATUS_PARMSW lpParms) DECLSPEC_HIDDEN
 
BOOL MCIAVI_GetInfo (WINE_MCIAVI *wma) DECLSPEC_HIDDEN
 
DWORD MCIAVI_OpenAudio (WINE_MCIAVI *wma, unsigned *nHdr, LPWAVEHDR *pWaveHdr) DECLSPEC_HIDDEN
 
BOOL MCIAVI_OpenVideo (WINE_MCIAVI *wma) DECLSPEC_HIDDEN
 
void MCIAVI_PlayAudioBlocks (WINE_MCIAVI *wma, unsigned nHdr, LPWAVEHDR waveHdr) DECLSPEC_HIDDEN
 
double MCIAVI_PaintFrame (WINE_MCIAVI *wma, HDC hDC) DECLSPEC_HIDDEN
 
WINE_MCIAVIMCIAVI_mciGetOpenDev (UINT wDevID) DECLSPEC_HIDDEN
 
DWORD MCIAVI_mciClose (UINT, DWORD, LPMCI_GENERIC_PARMS) DECLSPEC_HIDDEN
 
BOOL MCIAVI_RegisterClass (void) DECLSPEC_HIDDEN
 
BOOL MCIAVI_UnregisterClass (void) DECLSPEC_HIDDEN
 
BOOL MCIAVI_CreateWindow (WINE_MCIAVI *wma, DWORD dwFlags, LPMCI_DGV_OPEN_PARMSW lpOpenParms) DECLSPEC_HIDDEN
 
DWORD MCIAVI_mciPut (UINT wDevID, DWORD dwFlags, LPMCI_DGV_PUT_PARMS lpParms) DECLSPEC_HIDDEN
 
DWORD MCIAVI_mciWhere (UINT wDevID, DWORD dwFlags, LPMCI_DGV_RECT_PARMS lpParms) DECLSPEC_HIDDEN
 
DWORD MCIAVI_mciWindow (UINT wDevID, DWORD dwFlags, LPMCI_DGV_WINDOW_PARMSW lpParms) DECLSPEC_HIDDEN
 

Variables

HINSTANCE MCIAVI_hInstance DECLSPEC_HIDDEN
 

Function Documentation

◆ MCIAVI_ConvertTimeFormatToFrame()

DWORD MCIAVI_ConvertTimeFormatToFrame ( WINE_MCIAVI wma,
DWORD  val 
)

Definition at line 53 of file info.c.

54 {
55  DWORD ret = 0;
56 
57  switch (wma->dwMciTimeFormat) {
59  ret = (val * 1000) / wma->mah.dwMicroSecPerFrame;
60  break;
61  case MCI_FORMAT_FRAMES:
62  ret = val;
63  break;
64  default:
65  WARN("Bad time format %u!\n", wma->dwMciTimeFormat);
66  }
67  TRACE("val=%u=0x%08x [tf=%u] => ret=%u\n", val, val, wma->dwMciTimeFormat, ret);
68  return ret;
69 }
#define WARN(fmt,...)
Definition: debug.h:111
DWORD dwMicroSecPerFrame
Definition: vfw.h:941
#define MCI_FORMAT_FRAMES
Definition: mmsystem.h:704
#define MCI_FORMAT_MILLISECONDS
Definition: mmsystem.h:701
GLuint GLfloat * val
Definition: glext.h:7180
#define TRACE(s)
Definition: solgame.cpp:4
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
MainAVIHeader mah
DWORD dwMciTimeFormat

Referenced by MCIAVI_mciPlay(), and MCIAVI_mciSeek().

◆ MCIAVI_CreateWindow()

BOOL MCIAVI_CreateWindow ( WINE_MCIAVI wma,
DWORD  dwFlags,
LPMCI_DGV_OPEN_PARMSW  lpOpenParms 
)

Definition at line 112 of file wnd.c.

113 {
114  static const WCHAR captionW[] = {'W','i','n','e',' ','M','C','I','-','A','V','I',' ','p','l','a','y','e','r',0};
115  HWND hParent = 0;
116  DWORD dwStyle = WS_OVERLAPPEDWINDOW;
117  RECT rc;
118 
119  /* what should be done ? */
120  if (wma->hWnd) return TRUE;
121 
122  if (dwFlags & MCI_DGV_OPEN_PARENT) hParent = lpParms->hWndParent;
123  if (dwFlags & MCI_DGV_OPEN_WS) dwStyle = lpParms->dwStyle;
124 
125  if (wma->hic)
126  SetRect(&rc, 0, 0, wma->outbih->biWidth, wma->outbih->biHeight);
127  else
128  SetRect(&rc, 0, 0, wma->inbih->biWidth, wma->inbih->biHeight);
129 
130  AdjustWindowRect(&rc, dwStyle, FALSE);
131  if (!(dwStyle & (WS_CHILD|WS_POPUP))) /* overlapped window ? */
132  {
133  rc.right -= rc.left;
134  rc.bottom -= rc.top;
135  rc.left = rc.top = CW_USEDEFAULT;
136  }
137 
138  wma->hWnd = CreateWindowW(mciaviW, captionW,
139  dwStyle, rc.left, rc.top,
140  rc.right, rc.bottom,
142  ULongToPtr(wma->wDevID));
143  wma->hWndPaint = wma->hWnd;
144 
145  TRACE("(%04x, %08X, %p, style %x, parent %p, dimensions %dx%d, hwnd %p)\n", wma->wDevID,
146  dwFlags, lpParms, dwStyle, hParent, rc.right - rc.left, rc.bottom - rc.top, wma->hWnd);
147  return wma->hWnd != 0;
148 }
static const WCHAR mciaviW[]
Definition: wnd.c:28
#define TRUE
Definition: types.h:120
#define ULongToPtr(ul)
Definition: basetsd.h:92
LONG top
Definition: windef.h:292
#define WS_CHILD
Definition: pedump.c:617
LONG left
Definition: windef.h:291
LONG right
Definition: windef.h:293
#define CreateWindowW(a, b, c, d, e, f, g, h, i, j, k)
Definition: winuser.h:4217
BOOL WINAPI AdjustWindowRect(_Inout_ LPRECT, _In_ DWORD, _In_ BOOL)
#define CW_USEDEFAULT
Definition: winuser.h:225
#define MCI_DGV_OPEN_PARENT
Definition: digitalv.h:212
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
LPBITMAPINFOHEADER outbih
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
const DOCKBAR PVOID HWND hParent
Definition: tooldock.h:22
MCIDEVICEID wDevID
LPBITMAPINFOHEADER inbih
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)
HINSTANCE MCIAVI_hInstance
Definition: mciavi.c:53
#define WS_POPUP
Definition: pedump.c:616
#define WS_OVERLAPPEDWINDOW
Definition: pedump.c:637
LONG bottom
Definition: windef.h:294
#define MCI_DGV_OPEN_WS
Definition: digitalv.h:211

Referenced by MCIAVI_mciOpen().

◆ MCIAVI_GetInfo()

BOOL MCIAVI_GetInfo ( WINE_MCIAVI wma)

Definition at line 255 of file mmoutput.c.

256 {
257  MMCKINFO ckMainRIFF;
258  MMCKINFO mmckHead;
259  MMCKINFO mmckList;
260  MMCKINFO mmckInfo;
261  AVIStreamHeader strh;
262  struct AviListBuild alb;
263  DWORD stream_n;
264 
265  if (mmioDescend(wma->hFile, &ckMainRIFF, NULL, 0) != 0) {
266  WARN("Can't find 'RIFF' chunk\n");
267  return FALSE;
268  }
269 
270  if ((ckMainRIFF.ckid != FOURCC_RIFF) || (ckMainRIFF.fccType != formtypeAVI)) {
271  WARN("Can't find 'AVI ' chunk\n");
272  return FALSE;
273  }
274 
275  mmckHead.fccType = listtypeAVIHEADER;
276  if (mmioDescend(wma->hFile, &mmckHead, &ckMainRIFF, MMIO_FINDLIST) != 0) {
277  WARN("Can't find 'hdrl' list\n");
278  return FALSE;
279  }
280 
281  mmckInfo.ckid = ckidAVIMAINHDR;
282  if (mmioDescend(wma->hFile, &mmckInfo, &mmckHead, MMIO_FINDCHUNK) != 0) {
283  WARN("Can't find 'avih' chunk\n");
284  return FALSE;
285  }
286 
287  mmioRead(wma->hFile, (LPSTR)&wma->mah, sizeof(wma->mah));
288 
289  TRACE("mah.dwMicroSecPerFrame=%d\n", wma->mah.dwMicroSecPerFrame);
290  TRACE("mah.dwMaxBytesPerSec=%d\n", wma->mah.dwMaxBytesPerSec);
291  TRACE("mah.dwPaddingGranularity=%d\n", wma->mah.dwPaddingGranularity);
292  TRACE("mah.dwFlags=%d\n", wma->mah.dwFlags);
293  TRACE("mah.dwTotalFrames=%d\n", wma->mah.dwTotalFrames);
294  TRACE("mah.dwInitialFrames=%d\n", wma->mah.dwInitialFrames);
295  TRACE("mah.dwStreams=%d\n", wma->mah.dwStreams);
296  TRACE("mah.dwSuggestedBufferSize=%d\n", wma->mah.dwSuggestedBufferSize);
297  TRACE("mah.dwWidth=%d\n", wma->mah.dwWidth);
298  TRACE("mah.dwHeight=%d\n", wma->mah.dwHeight);
299 
300  mmioAscend(wma->hFile, &mmckInfo, 0);
301 
302  TRACE("Start of streams\n");
303  wma->video_stream_n = 0;
304  wma->audio_stream_n = 0;
305 
306  for (stream_n = 0; stream_n < wma->mah.dwStreams; stream_n++)
307  {
308  MMCKINFO mmckStream;
309 
310  mmckList.fccType = listtypeSTREAMHEADER;
311  if (mmioDescend(wma->hFile, &mmckList, &mmckHead, MMIO_FINDLIST) != 0)
312  break;
313 
314  mmckStream.ckid = ckidSTREAMHEADER;
315  if (mmioDescend(wma->hFile, &mmckStream, &mmckList, MMIO_FINDCHUNK) != 0)
316  {
317  WARN("Can't find 'strh' chunk\n");
318  continue;
319  }
320 
321  mmioRead(wma->hFile, (LPSTR)&strh, sizeof(strh));
322 
323  TRACE("Stream #%d fccType %4.4s\n", stream_n, (LPSTR)&strh.fccType);
324 
325  if (strh.fccType == streamtypeVIDEO)
326  {
327  TRACE("found video stream\n");
328  if (wma->inbih)
329  WARN("ignoring another video stream\n");
330  else
331  {
332  wma->ash_video = strh;
333 
334  if (!MCIAVI_GetInfoVideo(wma, &mmckList, &mmckStream))
335  return FALSE;
336  wma->video_stream_n = stream_n;
337  wma->dwSet |= 4;
338  }
339  }
340  else if (strh.fccType == streamtypeAUDIO)
341  {
342  TRACE("found audio stream\n");
343  if (wma->lpWaveFormat)
344  WARN("ignoring another audio stream\n");
345  else
346  {
347  wma->ash_audio = strh;
348 
349  if (!MCIAVI_GetInfoAudio(wma, &mmckList, &mmckStream))
350  return FALSE;
351  wma->audio_stream_n = stream_n;
352  wma->dwSet |= 3;
353  }
354  }
355  else
356  TRACE("Unsupported stream type %4.4s\n", (LPSTR)&strh.fccType);
357 
358  mmioAscend(wma->hFile, &mmckList, 0);
359  }
360 
361  TRACE("End of streams\n");
362 
363  mmioAscend(wma->hFile, &mmckHead, 0);
364 
365  /* no need to read optional JUNK chunk */
366 
367  mmckList.fccType = listtypeAVIMOVIE;
368  if (mmioDescend(wma->hFile, &mmckList, &ckMainRIFF, MMIO_FINDLIST) != 0) {
369  WARN("Can't find 'movi' list\n");
370  return FALSE;
371  }
372 
375  wma->dwPlayableVideoFrames * sizeof(struct MMIOPos));
376  if (!wma->lpVideoIndex) {
377  WARN("Can't alloc video index array\n");
378  return FALSE;
379  }
380  wma->dwPlayableAudioBlocks = 0;
381  wma->lpAudioIndex = NULL;
382 
383  alb.numAudioBlocks = alb.numVideoFrames = 0;
384  alb.inVideoSize = alb.inAudioSize = 0;
385  alb.numAudioAllocated = 0;
386 
387  while (mmioDescend(wma->hFile, &mmckInfo, &mmckList, 0) == 0) {
388  if (mmckInfo.fccType == listtypeAVIRECORD) {
389  MMCKINFO tmp;
390 
391  while (mmioDescend(wma->hFile, &tmp, &mmckInfo, 0) == 0) {
392  MCIAVI_AddFrame(wma, &tmp, &alb);
393  mmioAscend(wma->hFile, &tmp, 0);
394  }
395  } else {
396  MCIAVI_AddFrame(wma, &mmckInfo, &alb);
397  }
398 
399  mmioAscend(wma->hFile, &mmckInfo, 0);
400  }
401  if (alb.numVideoFrames != wma->dwPlayableVideoFrames) {
402  WARN("AVI header says %d frames, we found %d video frames, reducing playable frames\n",
403  wma->dwPlayableVideoFrames, alb.numVideoFrames);
404  wma->dwPlayableVideoFrames = alb.numVideoFrames;
405  }
406  wma->dwPlayableAudioBlocks = alb.numAudioBlocks;
407 
408  if (alb.inVideoSize > wma->ash_video.dwSuggestedBufferSize) {
409  WARN("inVideoSize=%d suggestedSize=%d\n", alb.inVideoSize, wma->ash_video.dwSuggestedBufferSize);
410  wma->ash_video.dwSuggestedBufferSize = alb.inVideoSize;
411  }
412  if (alb.inAudioSize > wma->ash_audio.dwSuggestedBufferSize) {
413  WARN("inAudioSize=%d suggestedSize=%d\n", alb.inAudioSize, wma->ash_audio.dwSuggestedBufferSize);
414  wma->ash_audio.dwSuggestedBufferSize = alb.inAudioSize;
415  }
416 
418  if (!wma->indata) {
419  WARN("Can't alloc input buffer\n");
420  return FALSE;
421  }
422 
423  return TRUE;
424 }
DWORD dwFlags
Definition: vfw.h:944
#define TRUE
Definition: types.h:120
#define listtypeSTREAMHEADER
Definition: vfw.h:892
DWORD dwInitialFrames
Definition: vfw.h:946
#define listtypeAVIHEADER
Definition: vfw.h:890
MMRESULT WINAPI mmioAscend(HMMIO hmmio, LPMMCKINFO lpck, UINT uFlags)
Definition: mmio.c:1204
#define WARN(fmt,...)
Definition: debug.h:111
LPWAVEFORMATEX lpWaveFormat
static BOOL MCIAVI_AddFrame(WINE_MCIAVI *wma, LPMMCKINFO mmck, struct AviListBuild *alb)
Definition: mmoutput.c:157
AVIStreamHeader ash_audio
#define ckidSTREAMHEADER
Definition: aviriff.h:88
char * LPSTR
Definition: xmlstorage.h:182
DWORD dwPlayableAudioBlocks
DWORD dwMicroSecPerFrame
Definition: vfw.h:941
AVIStreamHeader ash_video
smooth NULL
Definition: ftsmooth.c:416
#define MMIO_FINDCHUNK
Definition: mmsystem.h:551
FOURCC fccType
Definition: vfw.h:959
FOURCC fccType
Definition: mmsystem.h:1509
DWORD dwStreams
Definition: vfw.h:947
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
DWORD dwSuggestedBufferSize
Definition: vfw.h:969
unsigned long DWORD
Definition: ntddk_ex.h:95
#define listtypeAVIRECORD
Definition: vfw.h:899
DWORD dwMaxBytesPerSec
Definition: vfw.h:942
#define FOURCC_RIFF
Definition: mmsystem.h:564
#define streamtypeAUDIO
Definition: aviriff.h:93
DWORD dwTotalFrames
Definition: vfw.h:945
DWORD dwSuggestedBufferSize
Definition: vfw.h:948
MainAVIHeader mah
struct MMIOPos * lpVideoIndex
#define streamtypeVIDEO
Definition: aviriff.h:92
LPBITMAPINFOHEADER inbih
DWORD audio_stream_n
FOURCC ckid
Definition: mmsystem.h:1507
MMRESULT WINAPI mmioDescend(HMMIO hmmio, LPMMCKINFO lpck, const MMCKINFO *lpckParent, UINT uFlags)
Definition: mmio.c:1106
#define formtypeAVI
Definition: vfw.h:889
#define listtypeAVIMOVIE
Definition: vfw.h:898
DWORD dwWidth
Definition: vfw.h:949
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
#define ckidAVIMAINHDR
Definition: vfw.h:891
DWORD dwPlayableVideoFrames
struct MMIOPos * lpAudioIndex
DWORD video_stream_n
DWORD dwPaddingGranularity
Definition: vfw.h:943
#define MMIO_FINDLIST
Definition: mmsystem.h:553
DWORD dwHeight
Definition: vfw.h:950
static BOOL MCIAVI_GetInfoAudio(WINE_MCIAVI *wma, const MMCKINFO *mmckList, MMCKINFO *mmckStream)
Definition: mmoutput.c:27
LONG WINAPI mmioRead(HMMIO hmmio, HPSTR pch, LONG cch)
Definition: mmio.c:732
static BOOL MCIAVI_GetInfoVideo(WINE_MCIAVI *wma, const MMCKINFO *mmckList, MMCKINFO *mmckStream)
Definition: mmoutput.c:88

Referenced by MCIAVI_mciOpen().

◆ MCIAVI_mciClose()

DWORD MCIAVI_mciClose ( UINT  ,
DWORD  ,
LPMCI_GENERIC_PARMS   
)

Definition at line 306 of file mciavi.c.

307 {
308  WINE_MCIAVI *wma;
309  DWORD dwRet = 0;
310 
311  TRACE("(%04x, %08X, %p)\n", wDevID, dwFlags, lpParms);
312 
313  wma = MCIAVI_mciGetOpenDev(wDevID);
314  if (wma == NULL) return MCIERR_INVALID_DEVICE_ID;
315 
316  MCIAVI_mciStop(wDevID, MCI_WAIT, NULL);
317 
318  EnterCriticalSection(&wma->cs);
319 
320  if (wma->nUseCount == 1) {
321  MCIAVI_CleanUp(wma);
322 
323  if ((dwFlags & MCI_NOTIFY) && lpParms) {
324  mciDriverNotify(HWND_32(LOWORD(lpParms->dwCallback)),
325  wDevID,
327  }
328  LeaveCriticalSection(&wma->cs);
329  return dwRet;
330  }
331  wma->nUseCount--;
332 
333  LeaveCriticalSection(&wma->cs);
334  return dwRet;
335 }
static void MCIAVI_CleanUp(WINE_MCIAVI *wma)
Definition: mciavi.c:169
#define MCI_WAIT
Definition: mmsystem.h:730
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
BOOL WINAPI mciDriverNotify(HWND hwndCallback, UINT uDeviceID, UINT uStatus)
Definition: mci.c:2056
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
unsigned long DWORD
Definition: ntddk_ex.h:95
#define MCI_NOTIFY_SUCCESSFUL
Definition: mmsystem.h:725
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
static DWORD MCIAVI_mciStop(UINT, DWORD, LPMCI_GENERIC_PARMS)
Definition: mciavi.c:626
WINE_MCIAVI * MCIAVI_mciGetOpenDev(UINT wDevID)
Definition: mciavi.c:158
#define HWND_32(h16)
Definition: wownt32.h:29
CRITICAL_SECTION cs
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
#define MCIERR_INVALID_DEVICE_ID
Definition: mmsystem.h:569
#define MCI_NOTIFY
Definition: mmsystem.h:729
#define LOWORD(l)
Definition: pedump.c:82

Referenced by MCIAVI_DriverProc(), MCIAVI_drvClose(), and MCIAVI_WindowProc().

◆ MCIAVI_mciGetDevCaps()

DWORD MCIAVI_mciGetDevCaps ( UINT  wDevID,
DWORD  dwFlags,
LPMCI_GETDEVCAPS_PARMS  lpParms 
)

Definition at line 74 of file info.c.

75 {
76  WINE_MCIAVI* wma = MCIAVI_mciGetOpenDev(wDevID);
78 
79  TRACE("(%04x, %08X, %p)\n", wDevID, dwFlags, lpParms);
80 
81  if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK;
82  if (wma == NULL) return MCIERR_INVALID_DEVICE_ID;
84  if (dwFlags & MCI_TEST) return 0;
85 
86  EnterCriticalSection(&wma->cs);
87 
89  switch (lpParms->dwItem) {
91  TRACE("MCI_GETDEVCAPS_DEVICE_TYPE !\n");
94  break;
96  TRACE("MCI_GETDEVCAPS_HAS_AUDIO !\n");
99  break;
101  TRACE("MCI_GETDEVCAPS_HAS_VIDEO !\n");
102  lpParms->dwReturn = MAKEMCIRESOURCE(TRUE, MCI_TRUE);
104  break;
106  TRACE("MCI_GETDEVCAPS_USES_FILES !\n");
107  lpParms->dwReturn = MAKEMCIRESOURCE(TRUE, MCI_TRUE);
109  break;
111  TRACE("MCI_GETDEVCAPS_COMPOUND_DEVICE !\n");
112  lpParms->dwReturn = MAKEMCIRESOURCE(TRUE, MCI_TRUE);
114  break;
116  TRACE("MCI_GETDEVCAPS_CAN_EJECT !\n");
119  break;
121  TRACE("MCI_GETDEVCAPS_CAN_PLAY !\n");
122  lpParms->dwReturn = MAKEMCIRESOURCE(TRUE, MCI_TRUE);
124  break;
126  TRACE("MCI_GETDEVCAPS_CAN_RECORD !\n");
129  break;
131  TRACE("MCI_GETDEVCAPS_CAN_SAVE !\n");
134  break;
136  TRACE("MCI_DGV_GETDEVCAPS_CAN_REVERSE !\n");
137  lpParms->dwReturn = MAKEMCIRESOURCE(FALSE, MCI_FALSE); /* FIXME */
139  break;
141  TRACE("MCI_DGV_GETDEVCAPS_CAN_STRETCH !\n");
142  lpParms->dwReturn = MAKEMCIRESOURCE(FALSE, MCI_FALSE); /* FIXME */
144  break;
146  TRACE("MCI_DGV_GETDEVCAPS_CAN_LOCK !\n");
149  break;
151  TRACE("MCI_DGV_GETDEVCAPS_CAN_FREEZE !\n");
154  break;
156  TRACE("MCI_DGV_GETDEVCAPS_CAN_STRETCH_INPUT !\n");
159  break;
161  TRACE("MCI_DGV_GETDEVCAPS_HAS_STILL !\n");
164  break;
166  TRACE("MCI_DGV_GETDEVCAPS_CAN_TEST !\n");
167  lpParms->dwReturn = MAKEMCIRESOURCE(TRUE, MCI_TRUE);
169  break;
171  TRACE("MCI_DGV_GETDEVCAPS_PALETTES !\n");
172  lpParms->dwReturn = MAKEMCIRESOURCE(FALSE, MCI_FALSE); /* FIXME */
174  break;
175  /* w2k does not know MAX_WINDOWS or MAX/MINIMUM_RATE */
176  default:
177  FIXME("Unknown capability (%08x) !\n", lpParms->dwItem);
178  break;
179  }
180  }
181 
182  LeaveCriticalSection(&wma->cs);
183  return ret;
184 }
#define TRUE
Definition: types.h:120
#define MCI_GETDEVCAPS_CAN_SAVE
Definition: mmsystem.h:767
#define MCIERR_UNSUPPORTED_FUNCTION
Definition: mmsystem.h:584
#define MCI_DEVTYPE_DIGITAL_VIDEO
Definition: mmsystem.h:687
#define MCI_GETDEVCAPS_COMPOUND_DEVICE
Definition: mmsystem.h:764
#define MCI_DGV_GETDEVCAPS_PALETTES
Definition: digitalv.h:122
#define MCI_RESOURCE_RETURNED
Definition: mmddk.h:369
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
#define MCI_GETDEVCAPS_CAN_RECORD
Definition: mmsystem.h:759
#define MAKEMCIRESOURCE(wRet, wRes)
Definition: mmddk.h:388
#define MCI_DGV_GETDEVCAPS_CAN_LOCK
Definition: digitalv.h:116
#define MCI_GETDEVCAPS_USES_FILES
Definition: mmsystem.h:763
#define FIXME(fmt,...)
Definition: debug.h:110
#define MCI_GETDEVCAPS_DEVICE_TYPE
Definition: mmsystem.h:762
smooth NULL
Definition: ftsmooth.c:416
#define MCIERR_MISSING_PARAMETER
Definition: mmsystem.h:583
#define MCI_GETDEVCAPS_HAS_VIDEO
Definition: mmsystem.h:761
#define TRACE(s)
Definition: solgame.cpp:4
#define MCI_DGV_GETDEVCAPS_CAN_TEST
Definition: digitalv.h:124
#define MCI_TEST
Definition: digitalv.h:32
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
#define MCI_DGV_GETDEVCAPS_HAS_STILL
Definition: digitalv.h:121
#define MCI_GETDEVCAPS_HAS_AUDIO
Definition: mmsystem.h:760
#define MCI_GETDEVCAPS_ITEM
Definition: mmsystem.h:758
#define MCI_FALSE
Definition: mmddk.h:340
WINE_MCIAVI * MCIAVI_mciGetOpenDev(UINT wDevID)
Definition: mciavi.c:158
#define MCI_DGV_GETDEVCAPS_CAN_REVERSE
Definition: digitalv.h:120
#define MCI_DGV_GETDEVCAPS_CAN_STRETCH
Definition: digitalv.h:117
#define MCI_TRUE
Definition: mmddk.h:341
CRITICAL_SECTION cs
#define MCI_DGV_GETDEVCAPS_CAN_STR_IN
Definition: digitalv.h:123
#define MCI_GETDEVCAPS_CAN_EJECT
Definition: mmsystem.h:765
#define MCI_DGV_GETDEVCAPS_CAN_FREEZE
Definition: digitalv.h:118
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
#define MCIERR_INVALID_DEVICE_ID
Definition: mmsystem.h:569
#define MCIERR_NULL_PARAMETER_BLOCK
Definition: mmsystem.h:605
#define MCI_GETDEVCAPS_CAN_PLAY
Definition: mmsystem.h:766

Referenced by MCIAVI_DriverProc().

◆ MCIAVI_mciGetOpenDev()

WINE_MCIAVI* MCIAVI_mciGetOpenDev ( UINT  wDevID)

Definition at line 158 of file mciavi.c.

159 {
160  WINE_MCIAVI* wma = (WINE_MCIAVI*)mciGetDriverData(wDevID);
161 
162  if (wma == NULL || wma->nUseCount == 0) {
163  WARN("Invalid wDevID=%u\n", wDevID);
164  return 0;
165  }
166  return wma;
167 }
DWORD WINAPI mciGetDriverData(UINT uDeviceID)
Definition: mci.c:2066
#define WARN(fmt,...)
Definition: debug.h:111
smooth NULL
Definition: ftsmooth.c:416

Referenced by MCIAVI_mciBreak(), MCIAVI_mciClose(), MCIAVI_mciConfigure(), MCIAVI_mciCue(), MCIAVI_mciGetDevCaps(), MCIAVI_mciInfo(), MCIAVI_mciLoad(), MCIAVI_mciPause(), MCIAVI_mciPlay(), MCIAVI_mciPut(), MCIAVI_mciRealize(), MCIAVI_mciResume(), MCIAVI_mciSeek(), MCIAVI_mciSet(), MCIAVI_mciSetAudio(), MCIAVI_mciSetVideo(), MCIAVI_mciSignal(), MCIAVI_mciStatus(), MCIAVI_mciStep(), MCIAVI_mciStop(), MCIAVI_mciUpdate(), MCIAVI_mciWhere(), MCIAVI_mciWindow(), and MCIAVI_waveCallback().

◆ MCIAVI_mciInfo()

DWORD MCIAVI_mciInfo ( UINT  wDevID,
DWORD  dwFlags,
LPMCI_DGV_INFO_PARMSW  lpParms 
)

Definition at line 189 of file info.c.

190 {
191  LPCWSTR str = 0;
192  WINE_MCIAVI* wma = MCIAVI_mciGetOpenDev(wDevID);
193  DWORD ret = 0;
194  static const WCHAR wszAviPlayer[] = {'W','i','n','e','\'','s',' ','A','V','I',' ','p','l','a','y','e','r',0};
195  static const WCHAR wszVersion[] = {'1','.','1',0};
196 
197  if (lpParms == NULL || lpParms->lpstrReturn == NULL)
199  if (wma == NULL) return MCIERR_INVALID_DEVICE_ID;
200  if (dwFlags & MCI_TEST) return 0;
201 
202  TRACE("buf=%p, len=%u\n", lpParms->lpstrReturn, lpParms->dwRetSize);
203 
204  EnterCriticalSection(&wma->cs);
205 
207  str = wszAviPlayer;
208  else if (dwFlags & MCI_INFO_VERSION)
209  str = wszVersion;
210  else if (dwFlags & MCI_INFO_FILE)
211  str = wma->lpFileName;
212  else {
213  WARN("Don't know this info command (%u)\n", dwFlags);
215  }
216  if (!ret) {
217  WCHAR zero = 0;
218  /* Only mciwave, mciseq and mcicda set dwRetSize (since NT). */
219  lstrcpynW(lpParms->lpstrReturn, str ? str : &zero, lpParms->dwRetSize);
220  }
221  LeaveCriticalSection(&wma->cs);
222  return ret;
223 }
#define MCI_INFO_PRODUCT
Definition: mmsystem.h:752
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
#define WARN(fmt,...)
Definition: debug.h:111
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
#define lstrcpynW
Definition: compat.h:397
const WCHAR * str
#define MCI_INFO_FILE
Definition: mmsystem.h:753
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MCI_TEST
Definition: digitalv.h:32
unsigned long DWORD
Definition: ntddk_ex.h:95
static double zero
Definition: j0_y0.c:96
int ret
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
WINE_MCIAVI * MCIAVI_mciGetOpenDev(UINT wDevID)
Definition: mciavi.c:158
#define MCI_INFO_VERSION
Definition: digitalv.h:169
CRITICAL_SECTION cs
#define MCIERR_UNRECOGNIZED_COMMAND
Definition: mmsystem.h:571
LPWSTR lpFileName
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
#define MCIERR_INVALID_DEVICE_ID
Definition: mmsystem.h:569
#define MCIERR_NULL_PARAMETER_BLOCK
Definition: mmsystem.h:605

Referenced by MCIAVI_DriverProc().

◆ MCIAVI_mciPut()

DWORD MCIAVI_mciPut ( UINT  wDevID,
DWORD  dwFlags,
LPMCI_DGV_PUT_PARMS  lpParms 
)

Definition at line 153 of file wnd.c.

154 {
155  WINE_MCIAVI* wma = MCIAVI_mciGetOpenDev(wDevID);
156  RECT rc;
157 
158  TRACE("(%04x, %08X, %p)\n", wDevID, dwFlags, lpParms);
159 
160  if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK;
161  if (wma == NULL) return MCIERR_INVALID_DEVICE_ID;
162  if (dwFlags & MCI_TEST) return 0;
163 
164  EnterCriticalSection(&wma->cs);
165 
166  if (dwFlags & MCI_DGV_RECT) {
167  /* In MCI, RECT structure is used differently: rc.right = width & rc.bottom = height
168  * So convert input MCI RECT into a normal RECT */
169  SetRect(&rc, lpParms->rc.left, lpParms->rc.top, lpParms->rc.left + lpParms->rc.right,
170  lpParms->rc.top + lpParms->rc.bottom);
171  } else {
172  GetClientRect(wma->hWndPaint, &rc);
173  }
174 
175  if (dwFlags & MCI_DGV_PUT_CLIENT) {
176  FIXME("PUT_CLIENT %s\n", wine_dbgstr_rect(&rc));
177  LeaveCriticalSection(&wma->cs);
179  }
181  TRACE("PUT_DESTINATION %s\n", wine_dbgstr_rect(&rc));
182  wma->dest = rc;
183  }
184  if (dwFlags & MCI_DGV_PUT_FRAME) {
185  FIXME("PUT_FRAME %s\n", wine_dbgstr_rect(&rc));
186  LeaveCriticalSection(&wma->cs);
188  }
189  if (dwFlags & MCI_DGV_PUT_SOURCE) {
190  TRACE("PUT_SOURCE %s\n", wine_dbgstr_rect(&rc));
191  wma->source = rc;
192  }
193  if (dwFlags & MCI_DGV_PUT_VIDEO) {
194  FIXME("PUT_VIDEO %s\n", wine_dbgstr_rect(&rc));
195  LeaveCriticalSection(&wma->cs);
197  }
198  if (dwFlags & MCI_DGV_PUT_WINDOW) {
199  TRACE("PUT_WINDOW %s\n", wine_dbgstr_rect(&rc));
200  SetWindowPos(wma->hWndPaint, NULL, rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top, SWP_NOZORDER);
201  }
202  LeaveCriticalSection(&wma->cs);
203  return 0;
204 }
#define MCI_DGV_PUT_SOURCE
Definition: digitalv.h:233
#define MCI_DGV_PUT_DESTINATION
Definition: digitalv.h:234
#define MCI_DGV_PUT_CLIENT
Definition: digitalv.h:238
LONG top
Definition: windef.h:292
LONG left
Definition: windef.h:291
#define SWP_NOZORDER
Definition: winuser.h:1232
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
LONG right
Definition: windef.h:293
#define FIXME(fmt,...)
Definition: debug.h:110
smooth NULL
Definition: ftsmooth.c:416
#define MCI_DGV_PUT_FRAME
Definition: digitalv.h:235
#define TRACE(s)
Definition: solgame.cpp:4
#define MCI_TEST
Definition: digitalv.h:32
const char * wine_dbgstr_rect(const RECT *rect)
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
WINE_MCIAVI * MCIAVI_mciGetOpenDev(UINT wDevID)
Definition: mciavi.c:158
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)
#define MCI_DGV_PUT_WINDOW
Definition: digitalv.h:237
CRITICAL_SECTION cs
#define MCIERR_UNRECOGNIZED_COMMAND
Definition: mmsystem.h:571
LONG bottom
Definition: windef.h:294
#define MCI_DGV_RECT
Definition: digitalv.h:232
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
#define MCIERR_INVALID_DEVICE_ID
Definition: mmsystem.h:569
#define MCIERR_NULL_PARAMETER_BLOCK
Definition: mmsystem.h:605
#define MCI_DGV_PUT_VIDEO
Definition: digitalv.h:236

Referenced by MCIAVI_DriverProc().

◆ MCIAVI_mciSet()

DWORD MCIAVI_mciSet ( UINT  wDevID,
DWORD  dwFlags,
LPMCI_DGV_SET_PARMS  lpParms 
)

Definition at line 228 of file info.c.

229 {
230  WINE_MCIAVI* wma = MCIAVI_mciGetOpenDev(wDevID);
231 
232  if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK;
233  if (wma == NULL) return MCIERR_INVALID_DEVICE_ID;
234  if (dwFlags & MCI_TEST) return 0;
235 
236  EnterCriticalSection(&wma->cs);
237 
239  switch (lpParms->dwTimeFormat) {
241  TRACE("MCI_FORMAT_MILLISECONDS !\n");
243  break;
244  case MCI_FORMAT_FRAMES:
245  TRACE("MCI_FORMAT_FRAMES !\n");
247  break;
248  default:
249  WARN("Bad time format %u!\n", lpParms->dwTimeFormat);
250  LeaveCriticalSection(&wma->cs);
251  return MCIERR_BAD_TIME_FORMAT;
252  }
253  }
254 
255  if (dwFlags & MCI_SET_DOOR_OPEN) {
256  TRACE("No support for door open !\n");
257  LeaveCriticalSection(&wma->cs);
259  }
261  TRACE("No support for door close !\n");
262  LeaveCriticalSection(&wma->cs);
264  }
265 
266  if (dwFlags & MCI_SET_ON) {
267  const char *szVideo="";
268  const char *szAudio="";
269  const char *szSeek="";
270 
271  if (dwFlags & MCI_SET_VIDEO) {
272  szVideo = " video";
273  wma->dwSet |= 4;
274  }
275  if (dwFlags & MCI_SET_AUDIO) {
276  switch (lpParms->dwAudio) {
277  case MCI_SET_AUDIO_ALL:
278  szAudio = " audio all";
279  wma->dwSet |= 3;
280  break;
281  case MCI_SET_AUDIO_LEFT:
282  szAudio = " audio left";
283  wma->dwSet |= 1;
284  break;
285  case MCI_SET_AUDIO_RIGHT:
286  szAudio = " audio right";
287  wma->dwSet |= 2;
288  break;
289  default:
290  szAudio = " audio unknown";
291  WARN("Unknown audio channel %u\n", lpParms->dwAudio);
292  break;
293  }
294  }
296  szSeek = " seek_exactly";
297  }
298  FIXME("MCI_SET_ON:%s%s%s\n", szVideo, szAudio, szSeek);
299  }
300 
301  if (dwFlags & MCI_SET_OFF) {
302  const char *szVideo="";
303  const char *szAudio="";
304  const char *szSeek="";
305 
306  if (dwFlags & MCI_SET_VIDEO) {
307  szVideo = " video";
308  wma->dwSet &= ~4;
309  }
310  if (dwFlags & MCI_SET_AUDIO) {
311  switch (lpParms->dwAudio) {
312  case MCI_SET_AUDIO_ALL:
313  szAudio = " audio all";
314  wma->dwSet &= ~3;
315  break;
316  case MCI_SET_AUDIO_LEFT:
317  szAudio = " audio left";
318  wma->dwSet &= ~2;
319  break;
320  case MCI_SET_AUDIO_RIGHT:
321  szAudio = " audio right";
322  wma->dwSet &= ~2;
323  break;
324  default:
325  szAudio = " audio unknown";
326  WARN("Unknown audio channel %u\n", lpParms->dwAudio);
327  break;
328  }
329  }
331  szSeek = " seek_exactly";
332  }
333  FIXME("MCI_SET_OFF:%s%s%s\n", szVideo, szAudio, szSeek);
334  }
336  LPCSTR str = "save";
338  str = "capture";
339 
340  switch (lpParms->dwFileFormat) {
341  case MCI_DGV_FF_AVI: FIXME("Setting file format (%s) to 'AVI'\n", str); break;
342  case MCI_DGV_FF_AVSS: FIXME("Setting file format (%s) to 'AVSS'\n", str); break;
343  case MCI_DGV_FF_DIB: FIXME("Setting file format (%s) to 'DIB'\n", str); break;
344  case MCI_DGV_FF_JFIF: FIXME("Setting file format (%s) to 'JFIF'\n", str); break;
345  case MCI_DGV_FF_JPEG: FIXME("Setting file format (%s) to 'JPEG'\n", str); break;
346  case MCI_DGV_FF_MPEG: FIXME("Setting file format (%s) to 'MPEG'\n", str); break;
347  case MCI_DGV_FF_RDIB: FIXME("Setting file format (%s) to 'RLE DIB'\n", str); break;
348  case MCI_DGV_FF_RJPEG: FIXME("Setting file format (%s) to 'RJPEG'\n", str); break;
349  default: FIXME("Setting unknown file format (%s): %d\n", str, lpParms->dwFileFormat);
350  }
351  }
352 
353  if (dwFlags & MCI_DGV_SET_SPEED) {
354  FIXME("Setting speed to %d\n", lpParms->dwSpeed);
355  }
356 
357  LeaveCriticalSection(&wma->cs);
358  return 0;
359 }
#define MCI_DGV_FF_RJPEG
Definition: digitalv.h:110
DWORD dwTimeFormat
Definition: digitalv.h:733
#define MCIERR_UNSUPPORTED_FUNCTION
Definition: mmsystem.h:584
#define WARN(fmt,...)
Definition: debug.h:111
#define MCI_DGV_FF_JFIF
Definition: digitalv.h:111
#define MCI_SET_OFF
Definition: mmsystem.h:778
#define MCI_SET_AUDIO
Definition: mmsystem.h:775
DWORD dwFileFormat
Definition: digitalv.h:735
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
#define MCI_SET_DOOR_CLOSED
Definition: mmsystem.h:773
#define MCI_DGV_SET_FILEFORMAT
Definition: digitalv.h:285
#define MCI_FORMAT_FRAMES
Definition: mmsystem.h:704
#define MCI_FORMAT_MILLISECONDS
Definition: mmsystem.h:701
#define MCI_DGV_FF_MPEG
Definition: digitalv.h:112
#define FIXME(fmt,...)
Definition: debug.h:110
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
const char * LPCSTR
Definition: xmlstorage.h:183
#define TRACE(s)
Definition: solgame.cpp:4
#define MCI_SET_ON
Definition: mmsystem.h:777
#define MCI_DGV_FF_AVSS
Definition: digitalv.h:105
#define MCI_SET_TIME_FORMAT
Definition: mmsystem.h:774
#define MCI_TEST
Definition: digitalv.h:32
#define MCI_SET_AUDIO_LEFT
Definition: mmsystem.h:780
#define MCIERR_BAD_TIME_FORMAT
Definition: mmsystem.h:601
#define MCI_SET_AUDIO_RIGHT
Definition: mmsystem.h:781
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
#define MCI_DGV_FF_DIB
Definition: digitalv.h:107
#define MCI_DGV_SET_STILL
Definition: digitalv.h:284
WINE_MCIAVI * MCIAVI_mciGetOpenDev(UINT wDevID)
Definition: mciavi.c:158
#define MCI_DGV_FF_AVI
Definition: digitalv.h:106
#define MCI_SET_VIDEO
Definition: mmsystem.h:776
#define MCI_DGV_FF_RDIB
Definition: digitalv.h:108
CRITICAL_SECTION cs
#define MCI_DGV_FF_JPEG
Definition: digitalv.h:109
#define MCI_DGV_SET_SPEED
Definition: digitalv.h:283
DWORD dwMciTimeFormat
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
#define MCIERR_INVALID_DEVICE_ID
Definition: mmsystem.h:569
#define MCI_SET_AUDIO_ALL
Definition: mmsystem.h:779
#define MCIERR_NULL_PARAMETER_BLOCK
Definition: mmsystem.h:605
#define MCI_DGV_SET_SEEK_EXACTLY
Definition: digitalv.h:282
#define MCI_SET_DOOR_OPEN
Definition: mmsystem.h:772

Referenced by MCIAVI_DriverProc().

◆ MCIAVI_mciStatus()

DWORD MCIAVI_mciStatus ( UINT  wDevID,
DWORD  dwFlags,
LPMCI_DGV_STATUS_PARMSW  lpParms 
)

Definition at line 364 of file info.c.

365 {
366  WINE_MCIAVI* wma = MCIAVI_mciGetOpenDev(wDevID);
367  DWORD ret = 0;
368 
369  if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK;
370  if (wma == NULL) return MCIERR_INVALID_DEVICE_ID;
372  if (dwFlags & MCI_TEST) return 0;
373 
374  EnterCriticalSection(&wma->cs);
375 
376  if (dwFlags & MCI_STATUS_ITEM) {
377  switch (lpParms->dwItem) {
379  lpParms->dwReturn = 1;
380  TRACE("MCI_STATUS_CURRENT_TRACK => %lu\n", lpParms->dwReturn);
381  break;
382  case MCI_STATUS_LENGTH:
383  if (!wma->hFile) {
384  lpParms->dwReturn = 0;
385  LeaveCriticalSection(&wma->cs);
387  }
388  /* only one track in file is currently handled, so don't take care of MCI_TRACK flag */
390  TRACE("MCI_STATUS_LENGTH => %lu\n", lpParms->dwReturn);
391  break;
392  case MCI_STATUS_MODE:
393  lpParms->dwReturn = MAKEMCIRESOURCE(wma->dwStatus, wma->dwStatus);
395  TRACE("MCI_STATUS_MODE => 0x%04x\n", LOWORD(lpParms->dwReturn));
396  break;
398  TRACE("MCI_STATUS_MEDIA_PRESENT => TRUE\n");
399  lpParms->dwReturn = MAKEMCIRESOURCE(TRUE, MCI_TRUE);
401  break;
403  lpParms->dwReturn = 1;
404  TRACE("MCI_STATUS_NUMBER_OF_TRACKS => %lu\n", lpParms->dwReturn);
405  break;
406  case MCI_STATUS_POSITION:
407  if (!wma->hFile) {
408  lpParms->dwReturn = 0;
409  LeaveCriticalSection(&wma->cs);
411  }
412  /* only one track in file is currently handled, so don't take care of MCI_TRACK flag */
415  &ret);
416  TRACE("MCI_STATUS_POSITION %s => %lu\n",
417  (dwFlags & MCI_STATUS_START) ? "start" : "current", lpParms->dwReturn);
418  break;
419  case MCI_STATUS_READY:
420  lpParms->dwReturn = (wma->dwStatus == MCI_MODE_NOT_READY) ?
423  TRACE("MCI_STATUS_READY = %u\n", LOWORD(lpParms->dwReturn));
424  break;
426  lpParms->dwReturn = MAKEMCIRESOURCE(wma->dwMciTimeFormat,
428  TRACE("MCI_STATUS_TIME_FORMAT => %u\n", LOWORD(lpParms->dwReturn));
430  break;
432  lpParms->dwReturn = (wma->dwSet & 3) ?
435  TRACE("MCI_STATUS_AUDIO = %u\n", LOWORD(lpParms->dwReturn));
436  break;
438  lpParms->dwReturn = (wma->dwSet & 4) ?
441  TRACE("MCI_STATUS_VIDEO = %u\n", LOWORD(lpParms->dwReturn));
442  break;
443 
444 #if 0
452  case MCI_DGV_STATUS_BASS:
462 #endif
464  lpParms->dwReturn = wma->inbih->biBitCount;
465  TRACE("MCI_DGV_STATUS_BITSPERPEL => %lu\n", lpParms->dwReturn);
466  break;
467  case MCI_DGV_STATUS_HPAL:
468  lpParms->dwReturn = 0;
469  TRACE("MCI_DGV_STATUS_HPAL => %lx\n", lpParms->dwReturn);
470  break;
471  case MCI_DGV_STATUS_HWND:
472  lpParms->dwReturn = (DWORD_PTR)wma->hWndPaint;
473  TRACE("MCI_DGV_STATUS_HWND => %p\n", wma->hWndPaint);
474  break;
476  lpParms->dwReturn = IsWindowVisible(wma->hWndPaint) ?
479  TRACE("MCI_STATUS_WINDOW_VISIBLE = %u\n", LOWORD(lpParms->dwReturn));
480  break;
482  lpParms->dwReturn = IsIconic(wma->hWndPaint) ?
485  TRACE("MCI_STATUS_WINDOW_MINIMIZED = %u\n", LOWORD(lpParms->dwReturn));
486  break;
488  lpParms->dwReturn = IsZoomed(wma->hWndPaint) ?
491  TRACE("MCI_STATUS_WINDOW_MMAXIMIZED = %u\n", LOWORD(lpParms->dwReturn));
492  break;
494  lpParms->dwReturn = 1000;
495  TRACE("MCI_DGV_STATUS_SPEED = %lu\n", lpParms->dwReturn);
496  break;
498  /* FIXME: 1000 is a settable speed multiplier */
499  lpParms->dwReturn = MulDiv(1000000,1000,wma->mah.dwMicroSecPerFrame);
500  TRACE("MCI_DGV_STATUS_FRAME_RATE = %lu\n", lpParms->dwReturn);
501  break;
503  lpParms->dwReturn = MAKEMCIRESOURCE(TRUE, MCI_TRUE);
505  TRACE("MCI_DGV_STATUS_FORWARD = %u\n", LOWORD(lpParms->dwReturn));
506  break;
508  if (wma->dwStatus != MCI_MODE_PAUSE) {
509  LeaveCriticalSection(&wma->cs);
511  }
514  TRACE("MCI_STATUS_MODE => 0x%04x\n", LOWORD(lpParms->dwReturn));
515  break;
517  lpParms->dwReturn = wma->audio_stream_n;
518  TRACE("MCI_DGV_STATUS_AUDIO_STREAM => %lu\n", lpParms->dwReturn);
519  break;
520 #if 0
527  case MCI_DGV_STATUS_SAMPLESPERSECOND:
530  case MCI_DGV_STATUS_SIZE:
533  case MCI_DGV_STATUS_TINT:
541 #endif
542  default:
543  FIXME("Unknown command %08X !\n", lpParms->dwItem);
544  TRACE("(%04x, %08X, %p)\n", wDevID, dwFlags, lpParms);
545  LeaveCriticalSection(&wma->cs);
547  }
548  }
549 
550  if (dwFlags & MCI_NOTIFY) {
551  TRACE("MCI_NOTIFY_SUCCESSFUL %08lX !\n", lpParms->dwCallback);
553  wDevID, MCI_NOTIFY_SUCCESSFUL);
554  }
555  LeaveCriticalSection(&wma->cs);
556  return ret;
557 }
#define MCI_DGV_MONITOR_FILE
Definition: digitalv.h:207
DWORD_PTR dwCallback
Definition: digitalv.h:808
#define MCIERR_NONAPPLICABLE_FUNCTION
Definition: mmsystem.h:610
#define MCI_DGV_STATUS_SPEED
Definition: digitalv.h:384
#define MCI_DGV_STATUS_AUDIO_STREAM
Definition: digitalv.h:425
#define MCI_DGV_STATUS_PAUSE_MODE
Definition: digitalv.h:418
#define TRUE
Definition: types.h:120
#define MCI_DGV_STATUS_FILE_COMPLETION
Definition: digitalv.h:412
#define MCI_DGV_STATUS_SIZE
Definition: digitalv.h:396
#define MCI_DGV_STATUS_BRIGHTNESS
Definition: digitalv.h:386
#define MCI_DGV_STATUS_VOLUME
Definition: digitalv.h:405
#define MCI_RESOURCE_DRIVER
Definition: mmddk.h:373
#define MCI_STATUS_ITEM
Definition: mmsystem.h:742
#define DWORD_PTR
Definition: treelist.c:76
#define MCI_OFF_S
Definition: digitalv.h:61
#define MCI_DGV_STATUS_COLOR
Definition: digitalv.h:387
#define MCI_STATUS_NUMBER_OF_TRACKS
Definition: mmsystem.h:746
#define MCI_DGV_STATUS_AUDIO
Definition: digitalv.h:400
#define MCIERR_UNSUPPORTED_FUNCTION
Definition: mmsystem.h:584
#define MCI_DGV_STATUS_AUDIO_RECORD
Definition: digitalv.h:406
#define MCI_DGV_STATUS_VIDEO
Definition: digitalv.h:404
#define MCI_RESOURCE_RETURNED
Definition: mmddk.h:369
#define MCI_DGV_STATUS_FILE_MODE
Definition: digitalv.h:411
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
#define MCI_DGV_STATUS_FRAME_RATE
Definition: digitalv.h:394
#define MAKEMCIRESOURCE(wRet, wRes)
Definition: mmddk.h:388
BOOL WINAPI IsIconic(_In_ HWND)
#define MCI_STATUS_POSITION
Definition: mmsystem.h:745
#define MCI_DGV_STATUS_FORWARD
Definition: digitalv.h:424
#define MCI_DGV_STATUS_TINT
Definition: digitalv.h:401
#define MCI_DGV_MONITOR_INPUT
Definition: digitalv.h:206
DWORD dwMicroSecPerFrame
Definition: vfw.h:941
BOOL WINAPI mciDriverNotify(HWND hwndCallback, UINT uDeviceID, UINT uStatus)
Definition: mci.c:2056
static DWORD MCIAVI_ConvertFrameToTimeFormat(WINE_MCIAVI *wma, DWORD val, LPDWORD lpRet)
Definition: info.c:31
#define MCI_DGV_STATUS_HPAL
Definition: digitalv.h:385
#define MCI_ON
Definition: digitalv.h:50
#define MCI_MODE_PLAY
Definition: mmsystem.h:696
#define FIXME(fmt,...)
Definition: debug.h:110
#define MCI_OFF
Definition: digitalv.h:51
#define MCI_AVI_STATUS_LAST_PLAY_SPEED
Definition: mciavi.h:8
smooth NULL
Definition: ftsmooth.c:416
#define MCI_DGV_STATUS_STILL_FILEFORMAT
Definition: digitalv.h:409
#define MCIERR_MISSING_PARAMETER
Definition: mmsystem.h:583
#define MCI_AVI_STATUS_AUDIO_BREAKS
Definition: mciavi.h:9
#define MCI_DGV_STATUS_BITSPERPEL
Definition: digitalv.h:423
#define MCI_DGV_STATUS_HWND
Definition: digitalv.h:383
#define MCI_DGV_STATUS_BASS
Definition: digitalv.h:395
#define MCI_ON_S
Definition: digitalv.h:60
#define TRACE(s)
Definition: solgame.cpp:4
#define MCI_DGV_STATUS_VIDEO_SRC_NUM
Definition: digitalv.h:410
#define MCI_STATUS_LENGTH
Definition: mmsystem.h:744
#define MCI_DGV_STATUS_MONITOR_METHOD
Definition: digitalv.h:393
#define MCI_TEST
Definition: digitalv.h:32
#define MCI_DGV_STATUS_KEY_INDEX
Definition: digitalv.h:416
DWORD dwCurrVideoFrame
unsigned long DWORD
Definition: ntddk_ex.h:95
#define MCI_DGV_STATUS_SHARPNESS
Definition: digitalv.h:398
#define MCI_STATUS_MODE
Definition: mmsystem.h:747
#define MCI_STATUS_START
Definition: mmsystem.h:743
#define MCI_NOTIFY_SUCCESSFUL
Definition: mmsystem.h:725
int ret
#define MCI_DGV_STATUS_AUDIO_SOURCE
Definition: digitalv.h:390
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
#define MCI_STATUS_CURRENT_TRACK
Definition: mmsystem.h:751
#define MCI_DGV_STATUS_WINDOW_MAXIMIZED
Definition: digitalv.h:415
DWORD_PTR dwReturn
Definition: digitalv.h:809
DWORD dwTotalFrames
Definition: vfw.h:945
#define MCI_FALSE
Definition: mmddk.h:340
#define MCI_DGV_STATUS_SEEK_EXACTLY
Definition: digitalv.h:397
#define MCI_DGV_STATUS_MONITOR
Definition: digitalv.h:392
MainAVIHeader mah
WINE_MCIAVI * MCIAVI_mciGetOpenDev(UINT wDevID)
Definition: mciavi.c:158
#define HWND_32(h16)
Definition: wownt32.h:29
LPBITMAPINFOHEADER inbih
DWORD audio_stream_n
#define MCI_AVI_STATUS_FRAMES_SKIPPED
Definition: mciavi.h:7
#define MCI_MODE_NOT_READY
Definition: mmsystem.h:694
#define MCI_DGV_STATUS_FILEFORMAT
Definition: digitalv.h:389
#define MCI_DGV_STATUS_BITSPERSAMPLE
Definition: digitalv.h:422
BOOL WINAPI IsZoomed(_In_ HWND)
#define MCI_DGV_STATUS_VIDEO_RECORD
Definition: digitalv.h:408
#define MCI_DGV_STATUS_KEY_COLOR
Definition: digitalv.h:417
#define MCI_TRUE
Definition: mmddk.h:341
#define MCI_DGV_STATUS_GAMMA
Definition: digitalv.h:391
CRITICAL_SECTION cs
#define MCI_DGV_STATUS_WINDOW_MINIMIZED
Definition: digitalv.h:414
#define MCI_MODE_PAUSE
Definition: mmsystem.h:699
#define MCI_DGV_STATUS_AUDIO_INPUT
Definition: digitalv.h:382
#define MCI_DGV_STATUS_WINDOW_VISIBLE
Definition: digitalv.h:413
BOOL WINAPI IsWindowVisible(_In_ HWND)
#define MCI_DGV_STATUS_AVGBYTESPERSEC
Definition: digitalv.h:420
#define MCI_DGV_STATUS_VIDEO_SOURCE
Definition: digitalv.h:407
DWORD dwMciTimeFormat
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
#define MCIERR_INVALID_DEVICE_ID
Definition: mmsystem.h:569
#define MCI_DGV_STATUS_UNSAVED
Definition: digitalv.h:403
#define MCI_DGV_STATUS_BLOCKALIGN
Definition: digitalv.h:421
#define MCI_STATUS_TIME_FORMAT
Definition: mmsystem.h:749
#define MCI_NOTIFY
Definition: mmsystem.h:729
#define MCI_DGV_STATUS_CONTRAST
Definition: digitalv.h:388
#define MCI_STATUS_MEDIA_PRESENT
Definition: mmsystem.h:748
#define MCI_DGV_STATUS_SMPTE
Definition: digitalv.h:399
#define MCIERR_NULL_PARAMETER_BLOCK
Definition: mmsystem.h:605
#define MCI_DGV_STATUS_TREBLE
Definition: digitalv.h:402
#define LOWORD(l)
Definition: pedump.c:82
#define MulDiv(x, y, z)
Definition: gdifloat.h:86
#define MCI_DGV_STATUS_VIDEO_STREAM
Definition: digitalv.h:426
#define MCI_FORMAT_RETURN_BASE
Definition: mmddk.h:343
#define MCI_STATUS_READY
Definition: mmsystem.h:750

Referenced by MCIAVI_DriverProc().

◆ MCIAVI_mciWhere()

DWORD MCIAVI_mciWhere ( UINT  wDevID,
DWORD  dwFlags,
LPMCI_DGV_RECT_PARMS  lpParms 
)

Definition at line 209 of file wnd.c.

210 {
211  WINE_MCIAVI* wma = MCIAVI_mciGetOpenDev(wDevID);
212  RECT rc;
213 
214  TRACE("(%04x, %08x, %p)\n", wDevID, dwFlags, lpParms);
215 
216  if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK;
217  if (wma == NULL) return MCIERR_INVALID_DEVICE_ID;
218  /* Ignore MCI_TEST flag. */
219 
220  EnterCriticalSection(&wma->cs);
221 
223  if (dwFlags & MCI_DGV_WHERE_MAX) {
224  GetClientRect(wma->hWndPaint, &rc);
225  TRACE("WHERE_DESTINATION_MAX %s\n", wine_dbgstr_rect(&rc));
226  } else {
227  TRACE("WHERE_DESTINATION %s\n", wine_dbgstr_rect(&wma->dest));
228  rc = wma->dest;
229  }
230  }
233  FIXME("MCI_DGV_WHERE_FRAME_MAX\n");
234  else
235  FIXME("MCI_DGV_WHERE_FRAME\n");
236  LeaveCriticalSection(&wma->cs);
238  }
240  if (dwFlags & MCI_DGV_WHERE_MAX) {
241  SetRect(&rc, 0, 0, wma->inbih->biWidth, wma->inbih->biHeight);
242  TRACE("WHERE_SOURCE_MAX %s\n", wine_dbgstr_rect(&rc));
243  } else {
244  TRACE("WHERE_SOURCE %s\n", wine_dbgstr_rect(&wma->source));
245  rc = wma->source;
246  }
247  }
250  FIXME("WHERE_VIDEO_MAX\n");
251  else
252  FIXME("WHERE_VIDEO\n");
253  LeaveCriticalSection(&wma->cs);
255  }
257  if (dwFlags & MCI_DGV_WHERE_MAX) {
259  TRACE("WHERE_WINDOW_MAX %s\n", wine_dbgstr_rect(&rc));
260  } else {
261  GetWindowRect(wma->hWndPaint, &rc);
262  TRACE("WHERE_WINDOW %s\n", wine_dbgstr_rect(&rc));
263  }
264  }
265 
266  /* In MCI, RECT structure is used differently: rc.right = width & rc.bottom = height
267  * So convert the normal RECT into a MCI RECT before returning */
268  SetRect(&lpParms->rc, rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top);
269 
270  LeaveCriticalSection(&wma->cs);
271  return 0;
272 }
#define MCI_DGV_WHERE_VIDEO
Definition: digitalv.h:447
#define MCI_DGV_WHERE_DESTINATION
Definition: digitalv.h:445
#define MCI_DGV_WHERE_MAX
Definition: digitalv.h:449
LONG top
Definition: windef.h:292
LONG left
Definition: windef.h:291
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
LONG right
Definition: windef.h:293
#define FIXME(fmt,...)
Definition: debug.h:110
#define MCI_DGV_WHERE_SOURCE
Definition: digitalv.h:444
smooth NULL
Definition: ftsmooth.c:416
HWND WINAPI GetDesktopWindow(void)
Definition: window.c:652
#define TRACE(s)
Definition: solgame.cpp:4
const char * wine_dbgstr_rect(const RECT *rect)
#define MCI_DGV_WHERE_FRAME
Definition: digitalv.h:446
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
WINE_MCIAVI * MCIAVI_mciGetOpenDev(UINT wDevID)
Definition: mciavi.c:158
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
LPBITMAPINFOHEADER inbih
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)
CRITICAL_SECTION cs
#define MCIERR_UNRECOGNIZED_COMMAND
Definition: mmsystem.h:571
LONG bottom
Definition: windef.h:294
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
#define MCIERR_INVALID_DEVICE_ID
Definition: mmsystem.h:569
#define MCIERR_NULL_PARAMETER_BLOCK
Definition: mmsystem.h:605
#define MCI_DGV_WHERE_WINDOW
Definition: digitalv.h:448

Referenced by MCIAVI_DriverProc().

◆ MCIAVI_mciWindow()

DWORD MCIAVI_mciWindow ( UINT  wDevID,
DWORD  dwFlags,
LPMCI_DGV_WINDOW_PARMSW  lpParms 
)

Definition at line 277 of file wnd.c.

278 {
279  WINE_MCIAVI* wma = MCIAVI_mciGetOpenDev(wDevID);
280 
281  TRACE("(%04x, %08X, %p)\n", wDevID, dwFlags, lpParms);
282 
283  if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK;
284  if (wma == NULL) return MCIERR_INVALID_DEVICE_ID;
285  if (dwFlags & MCI_TEST) return 0;
286 
287  EnterCriticalSection(&wma->cs);
288 
290  if (IsWindow(lpParms->hWnd))
291  {
292  TRACE("Setting hWnd to %p\n", lpParms->hWnd);
293  if (wma->hWnd) ShowWindow(wma->hWnd, SW_HIDE);
294  wma->hWndPaint = (lpParms->hWnd == MCI_DGV_WINDOW_DEFAULT) ? wma->hWnd : lpParms->hWnd;
295  }
296  }
298  TRACE("Setting nCmdShow to %d\n", lpParms->nCmdShow);
299  ShowWindow(wma->hWndPaint, lpParms->nCmdShow);
300  }
302  TRACE("Setting caption to %s\n", debugstr_w(lpParms->lpstrText));
303  SetWindowTextW(wma->hWndPaint, lpParms->lpstrText);
304  }
305 
306  LeaveCriticalSection(&wma->cs);
307  return 0;
308 }
BOOL WINAPI IsWindow(_In_opt_ HWND)
#define SW_HIDE
Definition: winuser.h:762
BOOL WINAPI SetWindowTextW(_In_ HWND, _In_opt_ LPCWSTR)
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
#define debugstr_w
Definition: kernel32.h:32
#define MCI_DGV_WINDOW_DEFAULT
Definition: digitalv.h:459
smooth NULL
Definition: ftsmooth.c:416
#define MCI_DGV_WINDOW_TEXT
Definition: digitalv.h:455
#define MCI_DGV_WINDOW_HWND
Definition: digitalv.h:453
#define TRACE(s)
Definition: solgame.cpp:4
#define MCI_TEST
Definition: digitalv.h:32
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
WINE_MCIAVI * MCIAVI_mciGetOpenDev(UINT wDevID)
Definition: mciavi.c:158
#define MCI_DGV_WINDOW_STATE
Definition: digitalv.h:454
CRITICAL_SECTION cs
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
#define MCIERR_INVALID_DEVICE_ID
Definition: mmsystem.h:569
#define MCIERR_NULL_PARAMETER_BLOCK
Definition: mmsystem.h:605

Referenced by MCIAVI_DriverProc().

◆ MCIAVI_OpenAudio()

DWORD MCIAVI_OpenAudio ( WINE_MCIAVI wma,
unsigned *  nHdr,
LPWAVEHDR pWaveHdr 
)

Definition at line 525 of file mmoutput.c.

526 {
527  DWORD dwRet;
528  LPWAVEHDR waveHdr;
529  unsigned i;
530 
531  dwRet = waveOutOpen((HWAVEOUT *)&wma->hWave, WAVE_MAPPER, wma->lpWaveFormat,
533  if (dwRet != 0) {
534  TRACE("Can't open low level audio device %d\n", dwRet);
535  dwRet = MCIERR_DEVICE_OPEN;
536  wma->hWave = 0;
537  goto cleanUp;
538  }
539 
540  /* FIXME: should set up a heuristic to compute the number of wave headers
541  * to be used...
542  */
543  *nHdr = 7;
545  *nHdr * (sizeof(WAVEHDR) + wma->ash_audio.dwSuggestedBufferSize));
546  if (!waveHdr) {
547  TRACE("Can't alloc wave headers\n");
548  dwRet = MCIERR_DEVICE_OPEN;
549  goto cleanUp;
550  }
551 
552  for (i = 0; i < *nHdr; i++) {
553  /* other fields are zero:ed on allocation */
554  waveHdr[i].lpData = (char*)waveHdr +
555  *nHdr * sizeof(WAVEHDR) + i * wma->ash_audio.dwSuggestedBufferSize;
557  if (waveOutPrepareHeader(wma->hWave, &waveHdr[i], sizeof(WAVEHDR))) {
558  dwRet = MCIERR_INTERNAL;
559  goto cleanUp;
560  }
561  }
562 
563  if (wma->dwCurrVideoFrame != 0 && wma->lpWaveFormat) {
564  FIXME("Should recompute dwCurrAudioBlock, except unsynchronized sound & video\n");
565  }
566  wma->dwCurrAudioBlock = 0;
567 
568  wma->hEvent = CreateEventW(NULL, FALSE, FALSE, NULL);
569  wma->dwEventCount = *nHdr - 1;
570  *pWaveHdr = waveHdr;
571  cleanUp:
572  return dwRet;
573 }
LPWAVEFORMATEX lpWaveFormat
AVIStreamHeader ash_audio
LPSTR lpData
Definition: mmsystem.h:1014
HANDLE WINAPI DECLSPEC_HOTPATCH CreateEventW(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL, IN BOOL bManualReset, IN BOOL bInitialState, IN LPCWSTR lpName OPTIONAL)
Definition: synch.c:651
UINT WINAPI waveOutPrepareHeader(HWAVEOUT hWaveOut, WAVEHDR *lpWaveOutHdr, UINT uSize)
Definition: winmm.c:2280
static void CALLBACK MCIAVI_waveCallback(HWAVEOUT hwo, UINT uMsg, DWORD_PTR dwInstance, DWORD_PTR dwParam1, DWORD_PTR dwParam2)
Definition: mmoutput.c:500
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
Definition: glfuncs.h:248
#define CALLBACK_FUNCTION
Definition: mmsystem.h:150
#define FIXME(fmt,...)
Definition: debug.h:110
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
#define WAVE_MAPPER
Definition: mmsystem.h:187
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
DWORD dwSuggestedBufferSize
Definition: vfw.h:969
DWORD dwCurrVideoFrame
unsigned long DWORD
Definition: ntddk_ex.h:95
DWORD dwBufferLength
Definition: mmsystem.h:1015
#define MCIERR_INTERNAL
Definition: mmsystem.h:587
DWORD dwCurrAudioBlock
uint32_t DWORD_PTR
Definition: typedefs.h:63
MCIDEVICEID wDevID
MMRESULT WINAPI waveOutOpen(LPHWAVEOUT lphWaveOut, UINT uDeviceID, LPCWAVEFORMATEX lpFormat, DWORD_PTR dwCallback, DWORD_PTR dwInstance, DWORD dwFlags)
Definition: winmm.c:2249
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
#define MCIERR_DEVICE_OPEN
Definition: mmsystem.h:575
void cleanUp()
Definition: main.cpp:472

Referenced by MCIAVI_player().

◆ MCIAVI_OpenVideo()

BOOL MCIAVI_OpenVideo ( WINE_MCIAVI wma)

Definition at line 426 of file mmoutput.c.

427 {
428  HDC hDC;
429  DWORD outSize;
430  FOURCC fcc = wma->ash_video.fccHandler;
431 
432  TRACE("fcc %4.4s\n", (LPSTR)&fcc);
433 
434  wma->dwCachedFrame = -1;
435 
436  /* get the right handle */
437  if (fcc == mmioFOURCC('C','R','A','M')) fcc = mmioFOURCC('M','S','V','C');
438 
439  /* try to get a decompressor for that type */
440  wma->hic = ICLocate(ICTYPE_VIDEO, fcc, wma->inbih, NULL, ICMODE_DECOMPRESS);
441  if (!wma->hic) {
442  /* check for builtin DIB compressions */
443  fcc = wma->inbih->biCompression;
444  if ((fcc == mmioFOURCC('D','I','B',' ')) ||
445  (fcc == mmioFOURCC('R','L','E',' ')) ||
446  (fcc == BI_RGB) || (fcc == BI_RLE8) ||
447  (fcc == BI_RLE4) || (fcc == BI_BITFIELDS))
448  goto paint_frame;
449 
450  WARN("Can't locate codec for the file\n");
451  return FALSE;
452  }
453 
454  outSize = sizeof(BITMAPINFOHEADER) + 256 * sizeof(RGBQUAD);
455 
456  wma->outbih = HeapAlloc(GetProcessHeap(), 0, outSize);
457  if (!wma->outbih) {
458  WARN("Can't alloc output BIH\n");
459  return FALSE;
460  }
461  if (!ICGetDisplayFormat(wma->hic, wma->inbih, wma->outbih, 0, 0, 0)) {
462  WARN("Can't open decompressor\n");
463  return FALSE;
464  }
465 
466  TRACE("bih.biSize=%d\n", wma->outbih->biSize);
467  TRACE("bih.biWidth=%d\n", wma->outbih->biWidth);
468  TRACE("bih.biHeight=%d\n", wma->outbih->biHeight);
469  TRACE("bih.biPlanes=%d\n", wma->outbih->biPlanes);
470  TRACE("bih.biBitCount=%d\n", wma->outbih->biBitCount);
471  TRACE("bih.biCompression=%x\n", wma->outbih->biCompression);
472  TRACE("bih.biSizeImage=%d\n", wma->outbih->biSizeImage);
473  TRACE("bih.biXPelsPerMeter=%d\n", wma->outbih->biXPelsPerMeter);
474  TRACE("bih.biYPelsPerMeter=%d\n", wma->outbih->biYPelsPerMeter);
475  TRACE("bih.biClrUsed=%d\n", wma->outbih->biClrUsed);
476  TRACE("bih.biClrImportant=%d\n", wma->outbih->biClrImportant);
477 
478  wma->outdata = HeapAlloc(GetProcessHeap(), 0, wma->outbih->biSizeImage);
479  if (!wma->outdata) {
480  WARN("Can't alloc output buffer\n");
481  return FALSE;
482  }
483 
485  (DWORD_PTR)wma->inbih, (DWORD_PTR)wma->outbih) != ICERR_OK) {
486  WARN("Can't begin decompression\n");
487  return FALSE;
488  }
489 
490 paint_frame:
491  hDC = wma->hWndPaint ? GetDC(wma->hWndPaint) : 0;
492  if (hDC)
493  {
494  MCIAVI_PaintFrame(wma, hDC);
495  ReleaseDC(wma->hWndPaint, hDC);
496  }
497  return TRUE;
498 }
#define TRUE
Definition: types.h:120
DWORD biClrImportant
Definition: amvideo.idl:40
HDC WINAPI GetDC(_In_opt_ HWND)
LRESULT VFWAPI ICSendMessage(HIC hic, UINT msg, DWORD_PTR lParam1, DWORD_PTR lParam2)
LONG biXPelsPerMeter
Definition: amvideo.idl:37
struct tagBITMAPINFOHEADER BITMAPINFOHEADER
#define WARN(fmt,...)
Definition: debug.h:111
static HDC
Definition: imagelist.c:92
#define ICERR_OK
Definition: vfw.h:50
char * LPSTR
Definition: xmlstorage.h:182
LONG biYPelsPerMeter
Definition: amvideo.idl:38
#define BI_BITFIELDS
Definition: mmreg.h:507
FOURCC fccHandler
Definition: vfw.h:960
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
DWORD biCompression
Definition: amvideo.idl:35
AVIStreamHeader ash_video
DWORD dwCachedFrame
smooth NULL
Definition: ftsmooth.c:416
HIC VFWAPI ICLocate(DWORD fccType, DWORD fccHandler, LPBITMAPINFOHEADER lpbiIn, LPBITMAPINFOHEADER lpbiOut, WORD wMode)
Definition: msvideo_main.c:671
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define ICMODE_DECOMPRESS
Definition: vfw.h:269
#define ICTYPE_VIDEO
Definition: mmreg.h:531
LPVOID outdata
unsigned long DWORD
Definition: ntddk_ex.h:95
DWORD biSizeImage
Definition: amvideo.idl:36
LPBITMAPINFOHEADER outbih
#define mmioFOURCC(c0, c1, c2, c3)
Definition: mmsystem.h:38
uint32_t DWORD_PTR
Definition: typedefs.h:63
#define ICM_DECOMPRESS_BEGIN
Definition: vfw.h:108
DWORD FOURCC
Definition: dmdls.h:25
HIC VFWAPI ICGetDisplayFormat(HIC hic, BITMAPINFOHEADER *in, BITMAPINFOHEADER *out, int depth, int width, int height)
Definition: msvideo_main.c:726
static HDC hDC
Definition: 3dtext.c:33
LPBITMAPINFOHEADER inbih
#define BI_RLE4
Definition: precomp.h:35
#define BI_RLE8
Definition: wingdi.h:35
#define BI_RGB
Definition: precomp.h:34
double MCIAVI_PaintFrame(WINE_MCIAVI *wma, HDC hDC)
Definition: mmoutput.c:604

Referenced by MCIAVI_mciOpen().

◆ MCIAVI_PaintFrame()

double MCIAVI_PaintFrame ( WINE_MCIAVI wma,
HDC  hDC 
)

Definition at line 604 of file mmoutput.c.

605 {
606  void* pBitmapData;
607  LPBITMAPINFO pBitmapInfo;
608 
609  if (!hDC || !wma->inbih)
610  return 0;
611 
612  TRACE("Painting frame %u (cached %u)\n", wma->dwCurrVideoFrame, wma->dwCachedFrame);
613 
614  if (wma->dwCurrVideoFrame != wma->dwCachedFrame)
615  {
616  if (!wma->lpVideoIndex[wma->dwCurrVideoFrame].dwOffset)
617  return 0;
618 
619  if (wma->lpVideoIndex[wma->dwCurrVideoFrame].dwSize)
620  {
621  mmioSeek(wma->hFile, wma->lpVideoIndex[wma->dwCurrVideoFrame].dwOffset, SEEK_SET);
622  mmioRead(wma->hFile, wma->indata, wma->lpVideoIndex[wma->dwCurrVideoFrame].dwSize);
623 
624  wma->inbih->biSizeImage = wma->lpVideoIndex[wma->dwCurrVideoFrame].dwSize;
625 
626  if (wma->hic && ICDecompress(wma->hic, 0, wma->inbih, wma->indata,
627  wma->outbih, wma->outdata) != ICERR_OK)
628  {
629  WARN("Decompression error\n");
630  return 0;
631  }
632  }
633 
634  wma->dwCachedFrame = wma->dwCurrVideoFrame;
635  }
636 
637  if (wma->hic) {
638  pBitmapData = wma->outdata;
639  pBitmapInfo = (LPBITMAPINFO)wma->outbih;
640  } else {
641  pBitmapData = wma->indata;
642  pBitmapInfo = (LPBITMAPINFO)wma->inbih;
643  }
644 
646  wma->dest.left, wma->dest.top,
647  wma->dest.right - wma->dest.left, wma->dest.bottom - wma->dest.top,
648  wma->source.left, wma->source.top,
649  wma->source.right - wma->source.left, wma->source.bottom - wma->source.top,
650  pBitmapData, pBitmapInfo, DIB_RGB_COLORS, SRCCOPY);
651 
652  return (wma->ash_video.dwScale / (double)wma->ash_video.dwRate) * 1000000;
653 }
int WINAPI StretchDIBits(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int, _In_ int, _In_ int, _In_ int, _In_ int, _In_opt_ const VOID *, _In_ const BITMAPINFO *, _In_ UINT, _In_ DWORD)
struct tagBITMAPINFO * LPBITMAPINFO
#define WARN(fmt,...)
Definition: debug.h:111
LONG top
Definition: windef.h:292
LONG left
Definition: windef.h:291
#define ICERR_OK
Definition: vfw.h:50
LONG right
Definition: windef.h:293
LONG WINAPI mmioSeek(HMMIO hmmio, LONG lOffset, INT iOrigin)
Definition: mmio.c:835
DWORD VFWAPIV ICDecompress(HIC hic, DWORD dwFlags, LPBITMAPINFOHEADER lpbiFormat, LPVOID lpData, LPBITMAPINFOHEADER lpbi, LPVOID lpBits)
Definition: msvideo_main.c:854
AVIStreamHeader ash_video
DWORD dwCachedFrame
#define SEEK_SET
Definition: jmemansi.c:26
#define TRACE(s)
Definition: solgame.cpp:4
LPVOID outdata
DWORD dwCurrVideoFrame
DWORD biSizeImage
Definition: amvideo.idl:36
LPBITMAPINFOHEADER outbih
struct MMIOPos * lpVideoIndex
static HDC hDC
Definition: 3dtext.c:33
LPBITMAPINFOHEADER inbih
DWORD dwScale
Definition: vfw.h:965
LONG bottom
Definition: windef.h:294
#define DIB_RGB_COLORS
Definition: wingdi.h:366
#define SRCCOPY
Definition: wingdi.h:332
DWORD dwRate
Definition: vfw.h:966
LONG WINAPI mmioRead(HMMIO hmmio, HPSTR pch, LONG cch)
Definition: mmio.c:732

Referenced by MCIAVI_mciUpdate(), MCIAVI_OpenVideo(), MCIAVI_player(), and MCIAVI_WindowProc().

◆ MCIAVI_PlayAudioBlocks()

void MCIAVI_PlayAudioBlocks ( WINE_MCIAVI wma,
unsigned  nHdr,
LPWAVEHDR  waveHdr 
)

Definition at line 575 of file mmoutput.c.

576 {
577  if (!wma->lpAudioIndex)
578  return;
579  TRACE("%d (ec=%u)\n", wma->lpAudioIndex[wma->dwCurrAudioBlock].dwOffset, wma->dwEventCount);
580 
581  /* push as many blocks as possible => audio gets priority */
582  while (wma->dwStatus != MCI_MODE_STOP && wma->dwStatus != MCI_MODE_NOT_READY &&
584  unsigned whidx = wma->dwCurrAudioBlock % nHdr;
585 
586  ResetEvent(wma->hEvent);
587  if (InterlockedDecrement(&wma->dwEventCount) < 0 ||
588  !wma->lpAudioIndex[wma->dwCurrAudioBlock].dwOffset)
589  {
591  break;
592  }
593 
594  mmioSeek(wma->hFile, wma->lpAudioIndex[wma->dwCurrAudioBlock].dwOffset, SEEK_SET);
595  mmioRead(wma->hFile, waveHdr[whidx].lpData, wma->lpAudioIndex[wma->dwCurrAudioBlock].dwSize);
596 
597  waveHdr[whidx].dwFlags &= ~WHDR_DONE;
598  waveHdr[whidx].dwBufferLength = wma->lpAudioIndex[wma->dwCurrAudioBlock].dwSize;
599  waveOutWrite(wma->hWave, &waveHdr[whidx], sizeof(WAVEHDR));
600  wma->dwCurrAudioBlock++;
601  }
602 }
#define MCI_MODE_STOP
Definition: mmsystem.h:695
DWORD dwPlayableAudioBlocks
LONG WINAPI mmioSeek(HMMIO hmmio, LONG lOffset, INT iOrigin)
Definition: mmio.c:835
DWORD dwFlags
Definition: mmsystem.h:1018
#define SEEK_SET
Definition: jmemansi.c:26
#define TRACE(s)
Definition: solgame.cpp:4
UINT WINAPI waveOutWrite(HWAVEOUT hWaveOut, LPWAVEHDR lpWaveOutHdr, UINT uSize)
Definition: winmm.c:2344
#define InterlockedDecrement
Definition: armddk.h:52
DWORD dwBufferLength
Definition: mmsystem.h:1015
DWORD dwCurrAudioBlock
#define InterlockedIncrement
Definition: armddk.h:53
#define MCI_MODE_NOT_READY
Definition: mmsystem.h:694
BOOL WINAPI DECLSPEC_HOTPATCH ResetEvent(IN HANDLE hEvent)
Definition: synch.c:714
#define WHDR_DONE
Definition: mmsystem.h:193
struct MMIOPos * lpAudioIndex
LONG WINAPI mmioRead(HMMIO hmmio, HPSTR pch, LONG cch)
Definition: mmio.c:732

Referenced by MCIAVI_player().

◆ MCIAVI_RegisterClass()

BOOL MCIAVI_RegisterClass ( void  )

Definition at line 93 of file wnd.c.

94 {
95  WNDCLASSW wndClass;
96 
97  ZeroMemory(&wndClass, sizeof(WNDCLASSW));
98  wndClass.style = CS_DBLCLKS;
99  wndClass.lpfnWndProc = MCIAVI_WindowProc;
100  wndClass.cbWndExtra = sizeof(MCIDEVICEID);
101  wndClass.hInstance = MCIAVI_hInstance;
102  wndClass.hCursor = LoadCursorW(0, (LPCWSTR)IDC_ARROW);
103  wndClass.hbrBackground = (HBRUSH)(COLOR_3DFACE + 1);
104  wndClass.lpszClassName = mciaviW;
105 
106  if (RegisterClassW(&wndClass)) return TRUE;
108 
109  return FALSE;
110 }
static const WCHAR mciaviW[]
Definition: wnd.c:28
#define TRUE
Definition: types.h:120
UINT style
Definition: winuser.h:3150
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
static LRESULT WINAPI MCIAVI_WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: wnd.c:30
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
#define ZeroMemory
Definition: winbase.h:1635
ATOM WINAPI RegisterClassW(_In_ CONST WNDCLASSW *)
#define COLOR_3DFACE
Definition: winuser.h:919
WNDPROC lpfnWndProc
Definition: winuser.h:3151
#define ERROR_CLASS_ALREADY_EXISTS
Definition: winerror.h:891
LPCWSTR lpszClassName
Definition: winuser.h:3159
int cbWndExtra
Definition: winuser.h:3153
HCURSOR WINAPI LoadCursorW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2074
#define CS_DBLCLKS
Definition: winuser.h:646
HCURSOR hCursor
Definition: winuser.h:3156
HBRUSH hbrBackground
Definition: winuser.h:3157
HINSTANCE MCIAVI_hInstance
Definition: mciavi.c:53
UINT MCIDEVICEID
Definition: mmsystem.h:959
HINSTANCE hInstance
Definition: winuser.h:3154
#define IDC_ARROW
Definition: winuser.h:682

Referenced by MCIAVI_drvOpen().

◆ MCIAVI_UnregisterClass()

BOOL MCIAVI_UnregisterClass ( void  )

Definition at line 88 of file wnd.c.

89 {
91 }
static const WCHAR mciaviW[]
Definition: wnd.c:28
BOOL WINAPI UnregisterClassW(_In_ LPCWSTR, HINSTANCE)
HINSTANCE MCIAVI_hInstance
Definition: mciavi.c:53

Referenced by MCIAVI_drvClose().

Variable Documentation

◆ DECLSPEC_HIDDEN

HINSTANCE MCIAVI_hInstance DECLSPEC_HIDDEN

Definition at line 155 of file crypt32_private.h.