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 int setFormat(UCHAR format);
112 int setConnection(UCHAR connection);
113 int setAspectRatio(UCHAR aspectRatio); // This one does the pin 8 scart widescreen switching
114 int setMode(UCHAR mode);
115 int setTVsize(UCHAR size); // Is the TV a widescreen?
116 int setDefaultAspect();
118 int setPosition(int x, int y);
130 int attachFrameBuffer(); // What does this do?
131 ULONG timecodeToFrameNumber(ULLONG timecode);
132 ULLONG getCurrentTimestamp();
133 void displayIFrame(const UCHAR* buffer, UINT length);
135 // Writing Data to Videodevice
136 virtual void PrepareMediaSample(const MediaPacketList&, UINT samplepos);
137 virtual UINT DeliverMediaSample(const UCHAR* buffer, UINT* samplepos);
138 virtual long long SetStartOffset(long long curreftime, bool *rsync)
140 virtual void ResetTimeOffsets();
149 void setLetterboxBorder(char* border);
151 UINT deliver_start, deliver_length, deliver_count;
152 UINT mediapacket_len[WRITE_PACKETS];