2 Copyright 2004-2005 Chris Tallon
\r
4 This file is part of VOMP.
\r
6 VOMP is free software; you can redistribute it and/or modify
\r
7 it under the terms of the GNU General Public License as published by
\r
8 the Free Software Foundation; either version 2 of the License, or
\r
9 (at your option) any later version.
\r
11 VOMP is distributed in the hope that it will be useful,
\r
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
14 GNU General Public License for more details.
\r
16 You should have received a copy of the GNU General Public License
\r
17 along with VOMP; if not, write to the Free Software
\r
18 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
\r
25 #include "defines.h"
\r
26 #include "draintarget.h"
\r
27 #include "abstractoption.h"
\r
29 typedef struct _hmsf
\r
37 class Video: public DrainTarget, public AbstractOption
\r
42 static Video* getInstance();
\r
43 //static void setInstance(Video*);
\r
45 virtual int init(UCHAR format)=0;
\r
46 virtual int shutdown()=0;
\r
47 virtual int setFormat(UCHAR format)=0;
\r
48 virtual int setConnection(UCHAR connection)=0;
\r
49 virtual int setAspectRatio(UCHAR aspectRatio)=0; // This one does the pin 8 scart widescreen switching
\r
50 virtual int setMode(UCHAR mode)=0;
\r
51 virtual int setTVsize(UCHAR size)=0; // Is the TV a widescreen?
\r
52 virtual int setDefaultAspect()=0;
\r
53 virtual int setSource()=0;
\r
54 virtual int setPosition(int x, int y)=0;
\r
55 virtual int sync()=0;
\r
56 virtual int play()=0;
\r
57 virtual int stop()=0;
\r
58 virtual int pause()=0;
\r
59 virtual int unPause()=0;
\r
60 virtual int fastForward()=0;
\r
61 virtual int unFastForward()=0;
\r
62 virtual int reset()=0;
\r
63 virtual int blank()=0;
\r
64 virtual int signalOn()=0;
\r
65 virtual int signalOff()=0;
\r
66 virtual int attachFrameBuffer()=0; // What does this do?
\r
67 // virtual ULONG timecodeToFrameNumber(ULLONG timecode)=0; //Obsolete and not HD compatible
\r
68 virtual ULLONG getCurrentTimestamp()=0;
\r
69 virtual bool displayIFrame(const UCHAR* buffer, UINT length)=0;
\r
70 virtual int EnterIframePlayback() {return 1;}; // Must not be implemented
\r
72 virtual bool supportsh264(){return false;};
\r
73 virtual void seth264mode(bool ish264) {h264=ish264;};
\r
74 virtual int getTeletextBufferFaktor(){return 1;};
\r
76 virtual bool independentAVStartUp() {return true;};
\r
79 //Tells, if the device allows an independent startup of audio and video
\r
80 // this needs internal buffers in device and is possible for windows and mvp
\r
82 virtual bool PTSIFramePlayback() {return false;};
\r
83 // Tells, if the iframe playback is realized using a manipulation of the pts of the packets
\r
84 //android does it like this...
\r
86 virtual bool blockingDrainTarget() { return false;};
\r
87 // if the draintargets blocks, the feed has to be stop when pausing
\r
90 virtual void turnVideoOn(){};
\r
91 virtual void turnVideoOff(){};
\r
92 // virtual ULLONG frameNumberToTimecode(ULONG timecode) { return 0; };//Obsolete and not HD compatible
\r
95 virtual int test() { return 0; }
\r
96 virtual int test2() { return 0; }
\r
99 int getMode() { return mode; }
\r
100 UCHAR getFormat() { return format; }
\r
101 UINT getScreenWidth() { return screenWidth; }
\r
102 UINT getScreenHeight() { return screenHeight; }
\r
103 UCHAR getTVsize() { return tvsize; }
\r
105 //hmsf framesToHMSF(ULONG frames,double fps);
\r
106 // UINT getFPS(); //removed
\r
108 // Video formats - AV_SET_VID_DISP_FMT
\r
109 const static UCHAR NTSC = 0;
\r
110 const static UCHAR PAL = 1;
\r
112 // Video connections - AV_SET_VID_OUTPUT
\r
113 const static UCHAR COMPOSITERGB = 1;
\r
114 const static UCHAR SVIDEO = 2;
\r
116 // Video aspect ratios - AV_SET_VID_RATIO
\r
117 const static UCHAR ASPECT4X3 = 0;
\r
118 const static UCHAR ASPECT16X9 = 1;
\r
120 // Video modes - AV_SET_VID_MODE
\r
121 const static UCHAR NORMAL = 0;
\r
122 const static UCHAR LETTERBOX = 1;
\r
124 Actual Source Aspect Aspect IOCTL Mode IOCTL MODE A MODE B
\r
126 4:3 4:3 NORMAL fullframe43 fullframe43
\r
127 4:3 16:9 NORMAL fullframe43 fullframe43 -- invalid?
\r
128 4:3 4:3 LETTERBOX fullframe43 fullframe43
\r
129 4:3 16:9 LETTERBOX fullframe43 fullframe43 -- invalid?
\r
130 16:9 4:3 NORMAL chop sides fullframe169
\r
131 16:9 16:9 NORMAL chop sides fullframe169
\r
132 16:9 4:3 LETTERBOX letterbox letterbox
\r
133 16:9 16:9 LETTERBOX chop sides fullframe169
\r
137 1. There are two chip modes - accessible by reopening the fd
\r
138 2. The video chip knows the aspect ratio purely from the incoming MPEG
\r
139 3. MODE A is for 4:3 TVs, MODE B is for 16:9 TVs
\r
141 To switch to MODE A, set the aspect ioctl to 4:3 and reopen the FD.
\r
142 To switch to MODE B, set the aspect ioctl to 16:9 and reopen the FD.
\r
145 const static UCHAR UNKNOWN2 = 2;
\r
146 const static UCHAR QUARTER = 3;
\r
147 const static UCHAR EIGHTH = 4;
\r
148 const static UCHAR ZOOM = 5;
\r
149 const static UCHAR UNKNOWN6 = 6;
\r
152 static Video* instance;
\r