]> git.vomp.tv Git - vompclient.git/blob - video.h
Clean up of all video init system, NTSC/PAL, screen size functions.
[vompclient.git] / video.h
1 /*
2     Copyright 2004-2005 Chris Tallon
3
4     This file is part of VOMP.
5
6     VOMP is free software; you can redistribute it and/or modify
7     it under the terms of the GNU General Public License as published by
8     the Free Software Foundation; either version 2 of the License, or
9     (at your option) any later version.
10
11     VOMP 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
14     GNU General Public License for more details.
15
16     You should have received a copy of the GNU General Public License
17     along with VOMP; if not, write to the Free Software
18     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19 */
20
21 // Thanks to Jon Gettler and BtB of the MVPMC project for all the hardware information
22
23
24 #ifndef VIDEO_H
25 #define VIDEO_H
26
27 // FIXME - check why so many things include unistd
28
29 #include <stdio.h>
30 #include <unistd.h>
31 #include <fcntl.h>
32 #include <sys/ioctl.h>
33
34 #include "defines.h"
35 #include "stb.h"
36
37 class Video
38 {
39   public:
40     Video();
41     ~Video();
42     static Video* getInstance();
43
44     int init(UCHAR format);
45     int shutdown();
46
47     // Video formats - AV_SET_VID_DISP_FMT
48     const static UCHAR NTSC = 0;
49     const static UCHAR PAL = 1;
50
51     // Video connections - AV_SET_VID_OUTPUT
52     const static UCHAR COMPOSITERGB = 1;
53     const static UCHAR SVIDEO = 2;
54
55     // Video aspect ratios - AV_SET_VID_RATIO
56     const static UCHAR ASPECT4X3 = 0;
57     const static UCHAR ASPECT16X9 = 1;
58
59     // Video modes - AV_SET_VID_MODE
60     const static UCHAR NORMAL = 0; // If aspect==4:3, 4:3 unknown / 16:9 chop sides
61                                    // If aspect==16:9, 4:3 unknown / 16:9 stretch middle over all screen
62     const static UCHAR LETTERBOX = 1; // If aspect==4:3, 4:3 unknown / 16:9 letterbox at top of screen (!!)
63                                       // If aspect==16:9, 4:3 unknown / 16:9 proper 16:9 mode
64     const static UCHAR UNKNOWN2 = 2;
65     const static UCHAR QUARTER = 3;
66     const static UCHAR EIGHTH = 4;
67     const static UCHAR ZOOM = 5;
68     const static UCHAR UNKNOWN6 = 6;
69
70     int setFormat(UCHAR format);
71     int setConnection(UCHAR connection);
72     int setAspectRatio(UCHAR aspectRatio);
73     int setMode(UCHAR mode);
74     int test();
75     int test2();
76     int setSource();
77     int setPosition(int x, int y);
78     int sync();
79     int play();
80     int stop();
81     int pause();
82     int unPause();
83     int fastForward();
84     int unFastForward();
85     int reset();
86     int blank();
87     int signalOn();
88     int signalOff();
89
90     int attachFrameBuffer(); // What does this do?
91
92     int write(char *buf, int len);
93
94     int getFD();
95     UCHAR getFormat();
96     UINT getScreenWidth();
97     UINT getScreenHeight();
98
99   private:
100     int checkSCART();
101
102     static Video* instance;
103     int initted;
104
105     int fdVideo;
106
107     UCHAR format;
108     UCHAR connection;
109     UCHAR aspectRatio;
110     UCHAR mode;
111
112     UINT screenWidth;
113     UINT screenHeight;
114 };
115
116 #endif