]> git.vomp.tv Git - vompclient.git/blob - video.h
New aspect mode change code
[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 reinit(); // for aspect change
46     int shutdown();
47
48     // Video formats - AV_SET_VID_DISP_FMT
49     const static UCHAR NTSC = 0;
50     const static UCHAR PAL = 1;
51
52     // Video connections - AV_SET_VID_OUTPUT
53     const static UCHAR COMPOSITERGB = 1;
54     const static UCHAR SVIDEO = 2;
55
56     // Video aspect ratios - AV_SET_VID_RATIO
57     const static UCHAR ASPECT4X3 = 0;
58     const static UCHAR ASPECT16X9 = 1;
59
60     // Video modes - AV_SET_VID_MODE
61     const static UCHAR NORMAL = 0;
62       // if aspect==4:3 && source==4:3, output==correct-4:3
63       // if aspect==4:3 && source==16:9, output==chop sides
64       // if aspect==16:9 && source==4:3, output==not tested, unknown
65       // if aspect==16:9 && source==16:9, output==stretch middle over all screen
66     const static UCHAR LETTERBOX = 1;
67       // if aspect==4:3 && source==4:3, output==not tested, unknown
68       // if aspect==4:3 && source==16:9, output==16:9 letterbox at top of screen
69       // if aspect==16:9 && source==4:3, output==not tested, unknown
70       // if aspect==16:9 && source==16:9 output==
71
72     // If aspect==4:3, 4:3 unknown / 16:9 letterbox at top of screen (!!)
73                                       // If aspect==16:9, 4:3 unknown / 16:9 proper 16:9 mode
74     const static UCHAR UNKNOWN2 = 2;
75     const static UCHAR QUARTER = 3;
76     const static UCHAR EIGHTH = 4;
77     const static UCHAR ZOOM = 5;
78     const static UCHAR UNKNOWN6 = 6;
79
80     int setFormat(UCHAR format);
81     int setConnection(UCHAR connection);
82     int setAspectRatio(UCHAR aspectRatio);
83     int setMode(UCHAR mode);
84     int test();
85     int test2();
86     int setSource();
87     int setPosition(int x, int y);
88     int sync();
89     int play();
90     int stop();
91     int pause();
92     int unPause();
93     int fastForward();
94     int unFastForward();
95     int reset();
96     int blank();
97     int signalOn();
98     int signalOff();
99
100     int attachFrameBuffer(); // What does this do?
101
102     int getFD();
103     UCHAR getFormat();
104     UINT getScreenWidth();
105     UINT getScreenHeight();
106
107   private:
108     int checkSCART();
109
110     static Video* instance;
111     int initted;
112
113     int fdVideo;
114
115     UCHAR format;
116     UCHAR connection;
117     UCHAR aspectRatio;
118     UCHAR mode;
119
120     UINT screenWidth;
121     UINT screenHeight;
122 };
123
124 #endif