Prepare dlls/{comctl32,gdi,msvideo,setupapi,shell32,twain,winmm} for
[wine] / dlls / winmm / mciavi / private_mciavi.h
1 /* -*- tab-width: 8; c-basic-offset: 4 -*- */
2
3 /*
4  * Digital video MCI Wine Driver
5  *
6  * Copyright 1999, 2000 Eric POUECH
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2.1 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with this library; if not, write to the Free Software
20  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
21  */
22
23 #include "windef.h"
24 #include "winbase.h"
25 #include "wingdi.h"
26 #include "winuser.h"
27 #include "mmddk.h"
28 #include "digitalv.h"
29 #include "vfw.h"
30 #include "mciavi.h"
31
32 struct MMIOPos {
33     DWORD       dwOffset;
34     DWORD       dwSize;
35 };
36
37 typedef struct {
38     UINT                wDevID;
39     int                 nUseCount;              /* Incremented for each shared open          */
40     BOOL16              fShareable;             /* TRUE if first open was shareable          */
41     HANDLE16            hCallback;              /* Callback handle for pending notification  */
42     WORD                wCommandTable;          /* custom MCI command table */
43     volatile DWORD      dwStatus;               /* One of MCI_MODE_XXX                       */
44     MCI_OPEN_PARMSA     openParms;
45     DWORD               dwMciTimeFormat;        /* current time format */
46     DWORD               dwSet;                  /* what's turned on: video & audio l&r */
47     /* information on the loaded AVI file */
48     HMMIO               hFile;                  /* mmio file handle open as Element          */
49     MainAVIHeader       mah;
50     AVIStreamHeader     ash_video;
51     AVIStreamHeader     ash_audio;
52     LPBITMAPINFOHEADER  inbih;
53     struct MMIOPos*     lpVideoIndex;
54     LPWAVEFORMATEX      lpWaveFormat;
55     struct MMIOPos*     lpAudioIndex;
56     /* computed data from the file */
57     DWORD               dwPlayableVideoFrames;  /* max number of frames to be played. Takes care of truncated files and audio skew */
58     DWORD               dwPlayableAudioBlocks;
59     /* data for the AVI decompressor */
60     HIC                 hic;
61     LPBITMAPINFOHEADER  outbih;
62     LPVOID              indata;
63     LPVOID              outdata;
64     HBITMAP             hbmFrame;
65     /* data for playing the audio part */
66     HANDLE              hWave;
67     HANDLE              hEvent;                 /* for synchronization */
68     DWORD               dwEventCount;           /* for synchronization */
69     /* data for play back */
70     HWND                hWnd;
71     DWORD               dwCurrVideoFrame;       /* video frame to display and current position */
72     DWORD               dwCurrAudioBlock;       /* current audio block being played */
73     /* data for the background mechanism */
74     CRITICAL_SECTION    cs;
75 } WINE_MCIAVI;
76
77 extern HINSTANCE MCIAVI_hInstance;
78
79 /* info.c */
80 DWORD   MCIAVI_ConvertFrameToTimeFormat(WINE_MCIAVI* wma, DWORD val, LPDWORD lpRet);
81 DWORD   MCIAVI_ConvertTimeFormatToFrame(WINE_MCIAVI* wma, DWORD val);
82 DWORD   MCIAVI_mciGetDevCaps(UINT wDevID, DWORD dwFlags,  LPMCI_GETDEVCAPS_PARMS lpParms);
83 DWORD   MCIAVI_mciInfo(UINT wDevID, DWORD dwFlags, LPMCI_DGV_INFO_PARMSA lpParms);
84 DWORD   MCIAVI_mciSet(UINT wDevID, DWORD dwFlags, LPMCI_DGV_SET_PARMS lpParms);
85 DWORD   MCIAVI_mciStatus(UINT wDevID, DWORD dwFlags, LPMCI_DGV_STATUS_PARMSA lpParms);
86
87 /* mmoutput.c */
88 BOOL    MCIAVI_GetInfo(WINE_MCIAVI* wma);
89 DWORD   MCIAVI_OpenAudio(WINE_MCIAVI* wma, unsigned* nHdr, LPWAVEHDR* pWaveHdr);
90 BOOL    MCIAVI_OpenVideo(WINE_MCIAVI* wma);
91 void    MCIAVI_PlayAudioBlocks(WINE_MCIAVI* wma, unsigned nHdr, LPWAVEHDR waveHdr);
92 LRESULT MCIAVI_DrawFrame(WINE_MCIAVI* wma);
93 LRESULT MCIAVI_PaintFrame(WINE_MCIAVI* wma, HDC hDC);
94
95 /* mciavi.c */
96 WINE_MCIAVI*    MCIAVI_mciGetOpenDev(UINT wDevID);
97
98 /* window.c */
99 BOOL    MCIAVI_CreateWindow(WINE_MCIAVI* wma, DWORD dwFlags, LPMCI_DGV_OPEN_PARMSA lpOpenParms);
100 DWORD   MCIAVI_mciPut(UINT wDevID, DWORD dwFlags, LPMCI_DGV_PUT_PARMS lpParms);
101 DWORD   MCIAVI_mciWhere(UINT wDevID, DWORD dwFlags, LPMCI_DGV_RECT_PARMS lpParms);
102 DWORD   MCIAVI_mciWindow(UINT wDevID, DWORD dwFlags, LPMCI_DGV_WINDOW_PARMSA lpParms);
103
104 /* handle conversions */
105 #define HWND_32(h16)            ((HWND)(ULONG_PTR)(h16))