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
21 // Thanks to Jon Gettler and BtB of the MVPMC project for all the hardware information
\r
27 // FIXME - check why so many things include unistd
\r
32 #include <sys/ioctl.h>
\r
37 #include "defines.h"
\r
71 #define AV_SET_VID_STOP _IOW('v', 21, int)
\r
72 #define AV_SET_VID_PLAY _IOW('v', 22, int)
\r
73 #define AV_SET_VID_FREEZE _IOW('v', 23, int)
\r
74 #define AV_SET_VID_RESUME _IOW('v', 24, int)
\r
75 #define AV_SET_VID_SRC _IOW('v', 25, int)
\r
76 #define AV_SET_VID_FB _IOW('v', 26, int)
\r
77 #define AV_GET_VID_STATE _IOR('v', 27, vid_state_regs_t*)
\r
78 #define AV_SET_VID_PAUSE _IOW('v', 28, int)
\r
79 #define AV_SET_VID_FFWD _IOW('v', 29, int)
\r
80 #define AV_SET_VID_SLOMO _IOW('v', 30, int)
\r
81 #define AV_SET_VID_BLANK _IOW('v', 32, int)
\r
82 #define AV_SET_VID_POSITION _IOW('v', 36, vid_pos_regs_t*)
\r
83 #define AV_SET_VID_SCALE_ON _IOW('v', 37, int)
\r
84 #define AV_SET_VID_SCALE_OFF _IOW('v', 38, int)
\r
85 #define AV_GET_VID_TIMESTAMPS _IOR('v', 39, sync_data_t*)
\r
86 #define AV_SET_VID_STC _IOW('v', 40, uint64_t*)
\r
87 #define AV_SET_VID_RATIO _IOW('v', 41, int)
\r
88 #define AV_SET_VID_SYNC _IOW('v', 42, int)
\r
89 #define AV_SET_VID_DISABLE_SYNC _IOW('v', 43, int)
\r
90 #define AV_SET_VID_DISP_FMT _IOW('v', 45, int)
\r
91 #define AV_SET_VID_RESET _IOW('v', 51, int)
\r
92 #define AV_SET_VID_OUTPUT _IOW('v', 57, int)
\r
93 #define AV_SET_VID_MODE _IOW('v', 58, int)
\r
94 #define AV_GET_VID_REGS _IOR('v', 61, struct vid_regs*)
\r
95 #define AV_SET_VID_COLORBAR _IOW('v', 62, int)
\r
96 #define AV_SET_VID_DENC _IOW('v', 63, int)
\r
97 #define AV_CHK_SCART _IOW('v', 64, int)
\r
99 #define WRITE_LENGTH (32*1024) // Consume up to 32K at a time from Stream
\r
100 #define WRITE_PACKETS 16 // But no more than 16 packets
\r
102 class VideoMVP : public Video
\r
108 int init(UCHAR format);
\r
111 int setFormat(UCHAR format);
\r
112 int setConnection(UCHAR connection);
\r
113 int setAspectRatio(UCHAR aspectRatio); // This one does the pin 8 scart widescreen switching
\r
114 int setMode(UCHAR mode);
\r
115 int setTVsize(UCHAR size); // Is the TV a widescreen?
\r
116 int setDefaultAspect();
\r
118 int setPosition(int x, int y);
\r
125 int unFastForward();
\r
130 int attachFrameBuffer(); // What does this do?
\r
131 ULONG timecodeToFrameNumber(ULLONG timecode);
\r
132 ULLONG getCurrentTimestamp();
\r
133 bool displayIFrame(const UCHAR* buffer, UINT length);
\r
135 // Writing Data to Videodevice
\r
136 virtual void PrepareMediaSample(const MediaPacketList&, UINT samplepos);
\r
137 virtual UINT DeliverMediaSample( UCHAR* buffer, UINT* samplepos);
\r
138 virtual long long SetStartOffset(long long curreftime, bool *rsync)
\r
140 virtual void ResetTimeOffsets();
\r
149 void setLetterboxBorder(char* border);
\r
151 UINT deliver_start, deliver_length, deliver_count;
\r
152 UINT mediapacket_len[WRITE_PACKETS];
\r