MythTV  master
ivtv_myth.h
Go to the documentation of this file.
1 /*
2  Public ivtv API header
3  Copyright (C) 2003-2004 Kevin Thayer <nufan_wfk at yahoo.com>
4 
5  VBI portions:
6  Copyright (C) 2004 Hans Verkuil <hverkuil@xs4all.nl>
7 
8  This program is free software; you can redistribute it and/or modify
9  it under the terms of the GNU General Public License as published by
10  the Free Software Foundation; either version 2 of the License, or
11  (at your option) any later version.
12 
13  This program is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  GNU General Public License for more details.
17 
18  You should have received a copy of the GNU General Public License
19  along with this program; if not, write to the Free Software
20  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21  */
22 
23 #ifndef _LINUX_IVTV_H
24 #define _LINUX_IVTV_H
25 
26 #define __u32 uint32_t
27 #define __u64 uint64_t
28 
29 /* NOTE: the ioctls in this file will eventually be replaced by v4l2 API
30  ioctls. */
31 
32 /* device ioctls should use the range 29-199 */
33 #define IVTV_IOC_START_DECODE _IOW ('@', 29, struct ivtv_cfg_start_decode)
34 #define IVTV_IOC_STOP_DECODE _IOW ('@', 30, struct ivtv_cfg_stop_decode)
35 #define IVTV_IOC_G_SPEED _IOR ('@', 31, struct ivtv_speed)
36 #define IVTV_IOC_S_SPEED _IOW ('@', 32, struct ivtv_speed)
37 #define IVTV_IOC_DEC_STEP _IOW ('@', 33, int)
38 #define IVTV_IOC_DEC_FLUSH _IOW ('@', 34, int)
39 #define IVTV_IOC_PAUSE_BLACK _IO ('@', 35)
40 #define IVTV_IOC_STOP _IO ('@', 36)
41 #define IVTV_IOC_PLAY _IO ('@', 37)
42 #define IVTV_IOC_PAUSE _IO ('@', 38)
43 #define IVTV_IOC_FRAMESYNC _IOR ('@', 39, struct ivtv_ioctl_framesync)
44 #define IVTV_IOC_GET_TIMING _IOR ('@', 40, struct ivtv_ioctl_framesync)
45 #define IVTV_IOC_S_SLOW_FAST _IOW ('@', 41, struct ivtv_slow_fast)
46 #define IVTV_IOC_GET_FB _IOR ('@', 44, int)
47 #define IVTV_IOC_S_GOP_END _IOWR('@', 50, int)
48 #define IVTV_IOC_S_VBI_PASSTHROUGH _IOW ('@', 51, int)
49 #define IVTV_IOC_G_VBI_PASSTHROUGH _IOR ('@', 52, int)
50 #define IVTV_IOC_PASSTHROUGH _IOW ('@', 53, int)
51 #define IVTV_IOC_PAUSE_ENCODE _IO ('@', 56)
52 #define IVTV_IOC_RESUME_ENCODE _IO ('@', 57)
53 #define IVTV_IOC_DEC_SPLICE _IOW ('@', 58, int)
54 #define IVTV_IOC_DEC_FAST_STOP _IOW ('@', 59, int)
55 #define IVTV_IOC_PREP_FRAME_YUV _IOW ('@', 60, struct ivtvyuv_ioctl_dma_host_to_ivtv_args)
56 #define IVTV_IOC_G_YUV_INTERLACE _IOR ('@', 61, struct ivtv_ioctl_yuv_interlace)
57 #define IVTV_IOC_S_YUV_INTERLACE _IOW ('@', 62, struct ivtv_ioctl_yuv_interlace)
58 #define IVTV_IOC_G_PTS _IOR ('@', 63, u64)
59 
60 /* Custom v4l controls */
61 #ifndef V4L2_CID_PRIVATE_BASE
62 #define V4L2_CID_PRIVATE_BASE 0x08000000
63 #endif /* V4L2_CID_PRIVATE_BASE */
64 
65 #define V4L2_CID_IVTV_FREQ (V4L2_CID_PRIVATE_BASE + 0) /* old control */
66 #define V4L2_CID_IVTV_ENC (V4L2_CID_PRIVATE_BASE + 1) /* old control */
67 #define V4L2_CID_IVTV_BITRATE (V4L2_CID_PRIVATE_BASE + 2) /* old control */
68 #define V4L2_CID_IVTV_MONO (V4L2_CID_PRIVATE_BASE + 3) /* old control */
69 #define V4L2_CID_IVTV_JOINT (V4L2_CID_PRIVATE_BASE + 4) /* old control */
70 #define V4L2_CID_IVTV_EMPHASIS (V4L2_CID_PRIVATE_BASE + 5) /* old control */
71 #define V4L2_CID_IVTV_CRC (V4L2_CID_PRIVATE_BASE + 6) /* old control */
72 #define V4L2_CID_IVTV_COPYRIGHT (V4L2_CID_PRIVATE_BASE + 7) /* old control */
73 #define V4L2_CID_IVTV_GEN (V4L2_CID_PRIVATE_BASE + 8) /* old control */
74 
75 #define V4L2_CID_IVTV_DEC_SMOOTH_FF (V4L2_CID_PRIVATE_BASE + 9)
76 #define V4L2_CID_IVTV_DEC_FR_MASK (V4L2_CID_PRIVATE_BASE + 10)
77 #define V4L2_CID_IVTV_DEC_SP_MUTE (V4L2_CID_PRIVATE_BASE + 11)
78 #define V4L2_CID_IVTV_DEC_FR_FIELD (V4L2_CID_PRIVATE_BASE + 12)
79 #define V4L2_CID_IVTV_DEC_AUD_SKIP (V4L2_CID_PRIVATE_BASE + 13)
80 #define V4L2_CID_IVTV_DEC_NUM_BUFFERS (V4L2_CID_PRIVATE_BASE + 14)
81 #define V4L2_CID_IVTV_DEC_PREBUFFER (V4L2_CID_PRIVATE_BASE + 15)
82 
87 };
88 
89 struct ivtv_speed {
90  int scale; /* 1-?? (50 for now) */
91  int smooth; /* Smooth mode when in slow/fast mode */
92  int speed; /* 0 = slow, 1 = fast */
93  int direction; /* 0 = forward, 1 = reverse (not supportd */
94  int fr_mask; /* 0 = I, 1 = I,P, 2 = I,P,B 2 = default! */
95  int b_per_gop; /* frames per GOP (reverse only) */
96  int aud_mute; /* Mute audio while in slow/fast mode */
97  int fr_field; /* 1 = show every field, 0 = show every frame */
98  int mute; /* # of audio frames to mute on playback resume */
99 };
100 
102  int speed; /* 0 = slow, 1 = fast */
103  int scale; /* 1-?? (50 for now) */
104 };
105 
107  __u32 gop_offset; /*Frames in GOP to skip before starting */
108  __u32 muted_audio_frames; /* #of audio frames to mute */
109 };
110 
112  int hide_last; /* 1 = show black after stop,
113  0 = show last frame */
114  __u64 pts_stop; /* PTS to stop at */
115 };
116 
118  int interlace_mode; /* Takes one of IVTV_YUV_MODE_xxxxxx values */
119  int threshold; /* If mode is auto then if src_height <= this value treat as progressive otherwise treat as interlaced */
120 };
121 #define IVTV_YUV_MODE_INTERLACED 0
122 #define IVTV_YUV_MODE_PROGRESSIVE 1
123 #define IVTV_YUV_MODE_AUTO 2
124 
125 /* Framebuffer external API */
126 
128  unsigned long status;
129  unsigned long alpha;
130 };
131 
133  int state;
135 };
136 
139 };
140 
143  unsigned int destPixelMask, colour;
144 
145 };
146 
148  void *source;
149  unsigned long dest_offset;
150  int count;
151 };
152 
154  void *y_source;
155  void *uv_source;
156  unsigned int yuv_type;
157  int src_x;
158  int src_y;
159  unsigned int src_w;
160  unsigned int src_h;
161  int dst_x;
162  int dst_y;
163  unsigned int dst_w;
164  unsigned int dst_h;
167 };
168 
170  void *mem;
171  int size;
172  int sizex;
173  int sizey;
174 };
175 
177  unsigned long offset;
178  unsigned long max_offset;
180  int lines;
181  int x;
182  int y;
183 };
184 
185 struct rectangle {
186  int x0;
187  int y0;
188  int x1;
189  int y1;
190 };
191 
193  int width;
194  int height;
195  int left;
196  int top;
197 };
198 
199 
200 
201 /* Framebuffer ioctls should use the range 1 - 28 */
202 #define IVTVFB_IOCTL_GET_STATE _IOR('@', 1, struct ivtvfb_ioctl_state_info)
203 #define IVTVFB_IOCTL_SET_STATE _IOW('@', 2, struct ivtvfb_ioctl_state_info)
204 #define IVTVFB_IOCTL_PREP_FRAME _IOW('@', 3, struct ivtvfb_ioctl_dma_host_to_ivtv_args)
205 #define IVTVFB_IOCTL_BLT_COPY _IOW('@', 4, struct ivtvfb_ioctl_blt_copy_args)
206 #define IVTVFB_IOCTL_GET_ACTIVE_BUFFER _IOR('@', 5, struct ivtv_osd_coords)
207 #define IVTVFB_IOCTL_SET_ACTIVE_BUFFER _IOW('@', 6, struct ivtv_osd_coords)
208 #define IVTVFB_IOCTL_GET_FRAME_BUFFER _IOR('@', 7, struct ivtvfb_ioctl_get_frame_buffer)
209 #define IVTVFB_IOCTL_BLT_FILL _IOW('@', 8, struct ivtvfb_ioctl_blt_fill_args)
210 #define IVTVFB_IOCTL_PREP_FRAME_BUF _IOW('@', 9, struct ivtvfb_ioctl_dma_host_to_ivtv_args)
211 #define IVTVFB_IOCTL_SET_WINDOW _IOW('@', 11, struct ivtvfb_ioctl_set_window)
212 #define IVTVFB_IOCTL_GET_COLORKEY _IOW('@', 12, struct ivtvfb_ioctl_colorkey)
213 #define IVTVFB_IOCTL_SET_COLORKEY _IOW('@', 13, struct ivtvfb_ioctl_colorkey)
214 
215 #define IVTVFB_STATUS_ENABLED (1 << 0)
216 #define IVTVFB_STATUS_GLOBAL_ALPHA (1 << 1)
217 #define IVTVFB_STATUS_LOCAL_ALPHA (1 << 2)
218 #define IVTVFB_STATUS_FLICKER_REDUCTION (1 << 3)
219 
220 /********************************************************************/
221 /* Old stuff */
222 
223 /* Good for versions 0.2.0 through 0.7.x */
224 #define IVTV_IOC_G_CODEC _IOR ('@', 48, struct ivtv_ioctl_codec)
225 #define IVTV_IOC_S_CODEC _IOW ('@', 49, struct ivtv_ioctl_codec)
226 
227 /* For use with IVTV_IOC_G_CODEC and IVTV_IOC_S_CODEC */
244 };
245 
246 /********************************************************************/
247 
248 /* Good for versions 0.2.0 through 0.3.x */
249 #define IVTV_IOC_S_VBI_MODE _IOWR('@', 35, struct ivtv_sliced_vbi_format)
250 #define IVTV_IOC_G_VBI_MODE _IOR ('@', 36, struct ivtv_sliced_vbi_format)
251 
252 /* Good for version 0.2.0 through 0.3.7 */
253 #define IVTV_IOC_S_VBI_EMBED _IOW ('@', 54, int)
254 #define IVTV_IOC_G_VBI_EMBED _IOR ('@', 55, int)
255 
256 /* Good for version 0.2.0 through 0.3.7 */
258  unsigned long service_set; /* one or more of the IVTV_SLICED_ defines */
259  unsigned long packet_size; /* the size in bytes of the ivtv_sliced_data packet */
260  unsigned long io_size; /* maximum number of bytes passed by one read() call */
261  unsigned long reserved;
262 };
263 
264 /* Good for version 0.2.0 through 0.3.7 */
266  unsigned long id;
267  unsigned long line;
268  unsigned char *data;
269 };
270 
271 /* Good for version 0.2.0 through 0.3.7 for IVTV_IOC_G_VBI_MODE */
272 /* Good for version 0.3.8 through 0.7.x for IVTV_IOC_S_VBI_PASSTHROUGH */
273 #define VBI_TYPE_TELETEXT 0x1 // Teletext (uses lines 6-22 for PAL, 10-21 for NTSC)
274 #define VBI_TYPE_CC 0x4 // Closed Captions (line 21 NTSC, line 22 PAL)
275 #define VBI_TYPE_WSS 0x5 // Wide Screen Signal (line 20 NTSC, line 23 PAL)
276 #define VBI_TYPE_VPS 0x7 // Video Programming System (PAL) (line 16)
277 #ifdef ANDROID
278 #undef __u64
279 #endif
280 #endif /* _LINUX_IVTV_H */
__u32 bitrate_peak
Definition: ivtv_myth.h:234
int speed
Definition: ivtv_myth.h:92
unsigned long id
Definition: ivtv_myth.h:266
int fr_mask
Definition: ivtv_myth.h:94
unsigned char * data
Definition: ivtv_myth.h:268
__u32 bitrate_mode
Definition: ivtv_myth.h:232
int mute
Definition: ivtv_myth.h:98
int direction
Definition: ivtv_myth.h:93
unsigned long max_offset
Definition: ivtv_myth.h:178
unsigned long offset
Definition: ivtv_myth.h:177
unsigned long packet_size
Definition: ivtv_myth.h:259
int smooth
Definition: ivtv_myth.h:91
__u32 framespergop
Definition: ivtv_myth.h:240
__u32 dnr_temporal
Definition: ivtv_myth.h:237
unsigned long io_size
Definition: ivtv_myth.h:260
int scale
Definition: ivtv_myth.h:90
int aud_mute
Definition: ivtv_myth.h:96
unsigned long alpha
Definition: ivtv_myth.h:129
unsigned long reserved
Definition: ivtv_myth.h:261
#define __u64
Definition: ivtv_myth.h:27
#define __u32
Definition: ivtv_myth.h:26
unsigned int destPixelMask
Definition: ivtv_myth.h:143
int b_per_gop
Definition: ivtv_myth.h:95
unsigned long line
Definition: ivtv_myth.h:267
unsigned long status
Definition: ivtv_myth.h:128
unsigned long service_set
Definition: ivtv_myth.h:258
int fr_field
Definition: ivtv_myth.h:97
__u32 audio_bitmask
Definition: ivtv_myth.h:230