]> git.vomp.tv Git - vompclient-marten.git/blob - videovpeogl.h
Remove old code
[vompclient-marten.git] / videovpeogl.h
1 /*\r
2     Copyright 2004-2005 Chris Tallon 2009 Marten Richter\r
3 \r
4     This file is part of VOMP.\r
5 \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
10 \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
15 \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
19 */\r
20 \r
21 \r
22 #ifndef VIDEOVPEOGL_H\r
23 #define VIDEOVPEOGL_H\r
24 \r
25 #include "mutex.h"\r
26 \r
27 #include <stdio.h>\r
28 #include <unistd.h>\r
29 #include <fcntl.h>\r
30 #include <sys/ioctl.h>\r
31 #include <string.h>\r
32 \r
33 #include <stdint.h>\r
34 \r
35 #include "defines.h"\r
36 #include "video.h"\r
37 \r
38 #define WRITE_PACKETS 16\r
39 #define WRITE_LENGTH (32*1024)\r
40 \r
41 \r
42 class VideoVPEOGL : public Video\r
43 {\r
44   public:\r
45     VideoVPEOGL();\r
46     virtual ~VideoVPEOGL();\r
47 \r
48     int init(UCHAR format);\r
49     int shutdown();\r
50 \r
51     int setFormat(UCHAR format);\r
52     int setConnection(UCHAR connection);\r
53     int setAspectRatio(UCHAR aspectRatio);   // This one does the pin 8 scart widescreen switching\r
54     int setMode(UCHAR mode);\r
55     int setTVsize(UCHAR size);               // Is the TV a widescreen?\r
56     int setDefaultAspect();\r
57     int setSource();\r
58     int setPosition(int x, int y);\r
59     int sync();\r
60     int play();\r
61     int stop();\r
62     int pause();\r
63     int unPause();\r
64     int fastForward();\r
65     int unFastForward();\r
66     int reset();\r
67     int blank();\r
68     int signalOn();\r
69     int signalOff();\r
70     int attachFrameBuffer(); // What does this do?\r
71     ULONG timecodeToFrameNumber(ULLONG timecode);\r
72     ULLONG getCurrentTimestamp();\r
73     bool displayIFrame(const UCHAR* buffer, UINT length);\r
74 \r
75     // Writing Data to Videodevice\r
76     virtual void PrepareMediaSample(const MediaPacketList&, UINT samplepos);\r
77     virtual UINT DeliverMediaSample(UCHAR* buffer, UINT* samplepos);\r
78     virtual long long SetStartOffset(long long curreftime, bool *rsync)\r
79     { return 0; };\r
80     virtual void ResetTimeOffsets();\r
81 \r
82         virtual bool supportsh264(){return true;};\r
83 \r
84         int WriteOutTS(const unsigned char *buffer,int length, int type);\r
85         void WriteOutPATPMT();\r
86 \r
87 \r
88         Mutex *getMuxMutex() {return &filemutex;}; //File must be pointer of pointer Thread safety!\r
89         FILE *getMuxFile() {return muxout;}; //File must be pointer of pointer Thread safety!\r
90         void initMuxer(bool iframe=false);\r
91         void deinitMuxer();\r
92 \r
93         int getLastPacketNum() {return lastpacketnum;}; \r
94 #ifdef DEV\r
95     int test();\r
96     int test2();\r
97 #endif\r
98 \r
99   private:\r
100            int EnterIframePlayback();\r
101            bool iframemode;\r
102         \r
103           FILE* muxout;\r
104           int muxnumber;\r
105           Mutex filemutex;\r
106           int lastpacketnum;\r
107           unsigned char audioconti,videoconti;\r
108           unsigned int patversion,pmtversion;\r
109     \r
110         MediaPacket mediapacket;\r
111 };\r
112 \r
113 #endif\r