forked from ChrisVeigl/BrainBay
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathob_avi.h
72 lines (53 loc) · 2.43 KB
/
ob_avi.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
/* -----------------------------------------------------------------------------
BrainBay Version 1.7, GPL 2003-2010, contact: [email protected]
MODULE: OB_AVI.H: declarations for the AVI-Player-Object
Author: Chris Veigl
This Object can open a standard avi-file, grab a frame
and display it in a sizeable window. the frame number is given to the object's
input port. Sound of the AVI-File is not processed.
Inspired by Jeff Molofee's Lesson 35: Playing AVI-Files with OpenGl
http://nehe.gamedev.net
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; See the
GNU General Public License for more details.
-----------------------------------------------------------------------------*/
#include "brainBay.h"
#include <vfw.h>
HWND create_AVI_Window(int left,int right, int top, int bottom, HGLRC * GLRC_FFT);
LRESULT CALLBACK AVIDlgHandler(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
class AVIOBJ : public BASE_CL
{
protected:
DWORD dwRead,dwWritten,i;
public:
float input;
int top,left,right,bottom;
long frame,old_frame,lastframe; // Frame Counter
char avifile[256];
int width; // Video Width
int height; // Video Height
char *pdata; // Pointer To Texture Data
int mpf; // Will Hold Rough Milliseconds Per Frame
HGLRC GLRC; // Handle to OPENGL-RC
AVISTREAMINFO psi; // Pointer To A Structure Containing Stream Info
PAVISTREAM pavi; // Handle To An Open Stream
PGETFRAME pgf; // Pointer To A GetFrame Object
BITMAPINFOHEADER bmih; // Header Information For DrawDibDraw Decoding
GLUquadricObj *quadratic; // Storage For Our Quadratic Objects
HDRAWDIB hdd; // Handle For Our Dib
HBITMAP hBitmap; // Handle To A Device Dependant Bitmap
HDC hdc; // Creates A Compatible Device Context
unsigned char* data; // Pointer To Our Resized Image
AVIOBJ(int num);
HWND create_AVI_Window(int left,int right, int top, int bottom,HGLRC * GLRC);
int OpenAVI(LPCSTR szFile);
void GrabAVIFrame(int,HDC); // Grabs A Frame From The Stream
void CloseAVI(void);
void make_dialog(void);
void load(HANDLE hFile);
void save(HANDLE hFile);
void incoming_data(int port, float value) ;
void work(void);
~AVIOBJ();
};