* Sync up to trunk head (r60691).
[reactos.git] / dll / win32 / mciavi32 / private_mciavi.h
1 /*
2 * Digital video MCI Wine Driver
3 *
4 * Copyright 1999, 2000 Eric POUECH
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 */
20
21 #ifndef __WINE_PRIVATE_MCIAVI_H
22 #define __WINE_PRIVATE_MCIAVI_H
23
24 #define WIN32_NO_STATUS
25 #define _INC_WINDOWS
26 #define COM_NO_WINDOWS_H
27
28 #include <stdarg.h>
29 #include <windef.h>
30 //#include "winbase.h"
31 #include <wingdi.h>
32 //#include "winuser.h"
33 #include <mmddk.h>
34 #include <digitalv.h>
35 #include <vfw.h>
36 #include <wownt32.h>
37 #include <mciavi.h>
38
39 struct MMIOPos {
40 DWORD dwOffset;
41 DWORD dwSize;
42 };
43
44 typedef struct {
45 MCIDEVICEID wDevID;
46 int nUseCount; /* Incremented for each shared open */
47 BOOL fShareable; /* TRUE if first open was shareable */
48 WORD wCommandTable; /* custom MCI command table */
49 DWORD dwStatus; /* One of MCI_MODE_XXX */
50 LPWSTR lpFileName;
51 DWORD dwMciTimeFormat; /* current time format */
52 DWORD dwSet; /* what's turned on: video & audio l&r */
53 /* information on the loaded AVI file */
54 HMMIO hFile; /* mmio file handle open as Element */
55 DWORD video_stream_n, audio_stream_n; /* stream #s */
56 MainAVIHeader mah;
57 AVIStreamHeader ash_video;
58 AVIStreamHeader ash_audio;
59 LPBITMAPINFOHEADER inbih;
60 struct MMIOPos* lpVideoIndex;
61 LPWAVEFORMATEX lpWaveFormat;
62 struct MMIOPos* lpAudioIndex;
63 /* computed data from the file */
64 DWORD dwPlayableVideoFrames; /* max number of frames to be played. Takes care of truncated files and audio skew */
65 DWORD dwPlayableAudioBlocks;
66 /* data for the AVI decompressor */
67 HIC hic;
68 LPBITMAPINFOHEADER outbih;
69 LPVOID indata;
70 LPVOID outdata;
71 HBITMAP hbmFrame;
72 /* data for playing the audio part */
73 HANDLE hWave;
74 HANDLE hEvent; /* for synchronization */
75 LONG dwEventCount; /* for synchronization */
76 /* data for play back */
77 HWND hWnd, hWndPaint;
78 DWORD dwCachedFrame; /* buffered frame */
79 DWORD dwCurrVideoFrame; /* video frame to display and current position */
80 DWORD dwToVideoFrame; /* play to */
81 DWORD dwCurrAudioBlock; /* current audio block being played */
82 RECT source, dest;
83 /* data for the background mechanism */
84 CRITICAL_SECTION cs;
85 HANDLE hStopEvent;
86 } WINE_MCIAVI;
87
88 extern HINSTANCE MCIAVI_hInstance DECLSPEC_HIDDEN;
89
90 /* info.c */
91 DWORD MCIAVI_ConvertTimeFormatToFrame(WINE_MCIAVI* wma, DWORD val) DECLSPEC_HIDDEN;
92 DWORD MCIAVI_mciGetDevCaps(UINT wDevID, DWORD dwFlags, LPMCI_GETDEVCAPS_PARMS lpParms) DECLSPEC_HIDDEN;
93 DWORD MCIAVI_mciInfo(UINT wDevID, DWORD dwFlags, LPMCI_DGV_INFO_PARMSW lpParms) DECLSPEC_HIDDEN;
94 DWORD MCIAVI_mciSet(UINT wDevID, DWORD dwFlags, LPMCI_DGV_SET_PARMS lpParms) DECLSPEC_HIDDEN;
95 DWORD MCIAVI_mciStatus(UINT wDevID, DWORD dwFlags, LPMCI_DGV_STATUS_PARMSW lpParms) DECLSPEC_HIDDEN;
96
97 /* mmoutput.c */
98 BOOL MCIAVI_GetInfo(WINE_MCIAVI* wma) DECLSPEC_HIDDEN;
99 DWORD MCIAVI_OpenAudio(WINE_MCIAVI* wma, unsigned* nHdr, LPWAVEHDR* pWaveHdr) DECLSPEC_HIDDEN;
100 BOOL MCIAVI_OpenVideo(WINE_MCIAVI* wma) DECLSPEC_HIDDEN;
101 void MCIAVI_PlayAudioBlocks(WINE_MCIAVI* wma, unsigned nHdr, LPWAVEHDR waveHdr) DECLSPEC_HIDDEN;
102 double MCIAVI_PaintFrame(WINE_MCIAVI* wma, HDC hDC) DECLSPEC_HIDDEN;
103
104 /* mciavi.c */
105 WINE_MCIAVI* MCIAVI_mciGetOpenDev(UINT wDevID) DECLSPEC_HIDDEN;
106 DWORD MCIAVI_mciClose(UINT, DWORD, LPMCI_GENERIC_PARMS) DECLSPEC_HIDDEN;
107
108 /* wnd.c */
109 BOOL MCIAVI_RegisterClass(void) DECLSPEC_HIDDEN;
110 BOOL MCIAVI_UnregisterClass(void) DECLSPEC_HIDDEN;
111 BOOL MCIAVI_CreateWindow(WINE_MCIAVI* wma, DWORD dwFlags, LPMCI_DGV_OPEN_PARMSW lpOpenParms) DECLSPEC_HIDDEN;
112 DWORD MCIAVI_mciPut(UINT wDevID, DWORD dwFlags, LPMCI_DGV_PUT_PARMS lpParms) DECLSPEC_HIDDEN;
113 DWORD MCIAVI_mciWhere(UINT wDevID, DWORD dwFlags, LPMCI_DGV_RECT_PARMS lpParms) DECLSPEC_HIDDEN;
114 DWORD MCIAVI_mciWindow(UINT wDevID, DWORD dwFlags, LPMCI_DGV_WINDOW_PARMSW lpParms) DECLSPEC_HIDDEN;
115
116 #endif /* __WINE_PRIVATE_MCIAVI_H */