2 Copyright 2004-2005 Chris Tallon
4 This file is part of VOMP.
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.
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.
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21 // Thanks to Jon Gettler and BtB of the MVPMC project for all the hardware information
27 // FIXME - check why so many things include unistd
32 #include <sys/ioctl.h>
71 #define AV_SET_VID_STOP _IOW('v', 21, int)
72 #define AV_SET_VID_PLAY _IOW('v', 22, int)
73 #define AV_SET_VID_FREEZE _IOW('v', 23, int)
74 #define AV_SET_VID_RESUME _IOW('v', 24, int)
75 #define AV_SET_VID_SRC _IOW('v', 25, int)
76 #define AV_SET_VID_FB _IOW('v', 26, int)
77 #define AV_GET_VID_STATE _IOR('v', 27, vid_state_regs_t*)
78 #define AV_SET_VID_PAUSE _IOW('v', 28, int)
79 #define AV_SET_VID_FFWD _IOW('v', 29, int)
80 #define AV_SET_VID_SLOMO _IOW('v', 30, int)
81 #define AV_SET_VID_BLANK _IOW('v', 32, int)
82 #define AV_SET_VID_POSITION _IOW('v', 36, vid_pos_regs_t*)
83 #define AV_SET_VID_SCALE_ON _IOW('v', 37, int)
84 #define AV_SET_VID_SCALE_OFF _IOW('v', 38, int)
85 #define AV_GET_VID_TIMESTAMPS _IOR('v', 39, sync_data_t*)
86 #define AV_SET_VID_STC _IOW('v', 40, uint64_t*)
87 #define AV_SET_VID_RATIO _IOW('v', 41, int)
88 #define AV_SET_VID_SYNC _IOW('v', 42, int)
89 #define AV_SET_VID_DISABLE_SYNC _IOW('v', 43, int)
90 #define AV_SET_VID_DISP_FMT _IOW('v', 45, int)
91 #define AV_SET_VID_RESET _IOW('v', 51, int)
92 #define AV_SET_VID_OUTPUT _IOW('v', 57, int)
93 #define AV_SET_VID_MODE _IOW('v', 58, int)
94 #define AV_GET_VID_REGS _IOR('v', 61, struct vid_regs*)
95 #define AV_SET_VID_COLORBAR _IOW('v', 62, int)
96 #define AV_SET_VID_DENC _IOW('v', 63, int)
97 #define AV_CHK_SCART _IOW('v', 64, int)
99 #define WRITE_LENGTH (32*1024) // Consume up to 32K at a time from Stream
100 #define WRITE_PACKETS 16 // But no more than 16 packets
102 class VideoMVP : public Video
108 int init(UCHAR format);
111 UCHAR getSupportedFormats() { return COMPOSITERGB | SVIDEO;};
112 UINT supportedTVsize() { return ASPECT4X3|ASPECT16X9;};
113 UCHAR supportedTVFormats() { return 0;}; // We cannot change this here
115 int setFormat(UCHAR format);
116 int setConnection(UCHAR connection);
117 int setAspectRatio(UCHAR aspectRatio, int tparx,int tpary); // This one does the pin 8 scart widescreen switching
118 int setMode(UCHAR mode);
119 int setTVsize(UCHAR size); // Is the TV a widescreen?
120 int setDefaultAspect();
122 int setPosition(int x, int y);
134 int attachFrameBuffer(); // What does this do?
135 ULONG timecodeToFrameNumber(ULLONG timecode);
136 ULLONG getCurrentTimestamp();
137 bool displayIFrame(const UCHAR* buffer, UINT length);
139 // Writing Data to Videodevice
140 virtual void PrepareMediaSample(const MediaPacketList&, UINT samplepos);
141 virtual UINT DeliverMediaSample( UCHAR* buffer, UINT* samplepos);
142 virtual long long SetStartOffset(long long curreftime, bool *rsync)
144 virtual void ResetTimeOffsets();
153 void setLetterboxBorder(char* border);
155 UINT deliver_start, deliver_length, deliver_count;
156 UINT mediapacket_len[WRITE_PACKETS];