Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Enable building 0.24-fixes without system V4L1 support.

This patch retrieves videodev_myth.h from revision 6ff252d
(the revision before it was removed in bf7225c ), and
modifies the MythTV code to use it, instead of the system
linux/videodev.h header, so that MythTV will compile and work properly,
even on systems based on the Linux 2.6.38+ kernel headers.
  • Loading branch information...
commit a163dc82268d418939a7bd5fe782b82d7b55b7c7 1 parent 8e4a3c3
Michael T. Dean sphery authored
3  mythtv/configure
@@ -1714,7 +1714,7 @@ mythtranscode_deps="backend frontend"
1714 1714 opengl_deps_any="agl_h GL_gl_h darwin windows x11"
1715 1715 opengl_video_deps="opengl"
1716 1716 opengl_vsync_deps="opengl"
1717   -v4l_deps="backend linux_videodev_h linux_videodev2_h"
  1717 +v4l_deps="backend linux_videodev2_h"
1718 1718 vdpau_deps="opengl vdpau_vdpau_h vdpau_vdpau_x11_h"
1719 1719 xrandr_deps="x11"
1720 1720 xv_deps="x11"
@@ -3773,7 +3773,6 @@ if enabled network; then
3773 3773 fi
3774 3774 fi
3775 3775
3776   -check_header linux/videodev.h
3777 3776 check_header linux/videodev2.h
3778 3777 check_header sys/videoio.h
3779 3778
2  mythtv/libs/libmythtv/NuppelVideoRecorder.cpp
@@ -43,7 +43,7 @@ extern "C" {
43 43 }
44 44
45 45 #ifdef USING_V4L
46   -#include <linux/videodev.h>
  46 +#include "videodev_myth.h"
47 47 #include <linux/videodev2.h>
48 48
49 49 #include "go7007_myth.h"
2  mythtv/libs/libmythtv/analogsignalmonitor.cpp
@@ -6,7 +6,7 @@
6 6 #include <sys/ioctl.h>
7 7 #include <poll.h>
8 8
9   -#include <linux/videodev.h>
  9 +#include "videodev_myth.h"
10 10
11 11 #include "mythverbose.h"
12 12 #include "analogsignalmonitor.h"
2  mythtv/libs/libmythtv/cardutil.cpp
@@ -27,7 +27,7 @@
27 27 #endif
28 28
29 29 #ifdef USING_V4L
30   -#include <linux/videodev.h>
  30 +#include "videodev_myth.h"
31 31 #include <linux/videodev2.h>
32 32 #endif
33 33
2  mythtv/libs/libmythtv/v4lchannel.cpp
@@ -16,7 +16,7 @@
16 16 #include <iostream>
17 17 using namespace std;
18 18
19   -#include <linux/videodev.h>
  19 +#include "videodev_myth.h"
20 20 #include <linux/videodev2.h>
21 21
22 22 // MythTV headers
2  mythtv/libs/libmythtv/vbitext/vbi.c
@@ -14,7 +14,7 @@
14 14 // compiling with -std=c99. We could remove this in the .pro file,
15 15 // but that would disable it for all .c files.
16 16 #undef __STRICT_ANSI__
17   -#include <linux/videodev.h>
  17 +#include "videodev_myth.h"
18 18 #include <linux/videodev2.h>
19 19
20 20 // vbitext headers
358 mythtv/libs/libmythtv/videodev_myth.h
... ... @@ -0,0 +1,358 @@
  1 +#ifndef __LINUX_VIDEODEV_H
  2 +#define __LINUX_VIDEODEV_H
  3 +
  4 +#include "mythconfig.h"
  5 +
  6 +#if defined(__FreeBSD__) || CONFIG_DARWIN || defined(USING_MINGW)
  7 +#include <sys/types.h>
  8 +#include <stdint.h>
  9 +typedef uint32_t __u32;
  10 +typedef uint16_t __u16;
  11 +typedef int32_t __s32;
  12 +typedef uint8_t __u8;
  13 +typedef uint32_t __u64;
  14 +typedef int32_t __s64; // HACK. Non 64bit FreeBSD kernels require this for ioctls
  15 +#else
  16 +#undef __STRICT_ANSI__ // HACK. Broken kernel headers < 2.6.25 fail compile in videodev2_myth.h
  17 +#include <linux/types.h>
  18 +#include <linux/version.h>
  19 +#endif /* __FreeBSD__ */
  20 +
  21 +#include <linux/videodev2.h>
  22 +
  23 +struct video_capability
  24 +{
  25 + char name[32];
  26 + int type;
  27 + int channels; /* Num channels */
  28 + int audios; /* Num audio devices */
  29 + int maxwidth; /* Supported width */
  30 + int maxheight; /* And height */
  31 + int minwidth; /* Supported width */
  32 + int minheight; /* And height */
  33 +};
  34 +
  35 +#define VIDEO_RF_AUX_INPUT 0x100 /* dtv */
  36 +
  37 +struct video_channel
  38 +{
  39 + int channel;
  40 + char name[32];
  41 + int tuners;
  42 + __u32 flags;
  43 +#define VIDEO_VC_TUNER 1 /* Channel has a tuner */
  44 +#define VIDEO_VC_AUDIO 2 /* Channel has audio */
  45 + __u16 type;
  46 +#define VIDEO_TYPE_TV 1
  47 +#define VIDEO_TYPE_CAMERA 2
  48 + __u16 norm; /* Norm set by channel */
  49 +};
  50 +
  51 +struct video_tuner
  52 +{
  53 + int tuner;
  54 + char name[32];
  55 + unsigned long rangelow, rangehigh; /* Tuner range */
  56 + __u32 flags;
  57 +#define VIDEO_TUNER_PAL 1
  58 +#define VIDEO_TUNER_NTSC 2
  59 +#define VIDEO_TUNER_SECAM 4
  60 +#define VIDEO_TUNER_LOW 8 /* Uses KHz not MHz */
  61 +#define VIDEO_TUNER_NORM 16 /* Tuner can set norm */
  62 +#define VIDEO_TUNER_STEREO_ON 128 /* Tuner is seeing stereo */
  63 +#define VIDEO_TUNER_RDS_ON 256 /* Tuner is seeing an RDS datastream */
  64 +#define VIDEO_TUNER_MBS_ON 512 /* Tuner is seeing an MBS datastream */
  65 + __u16 mode; /* PAL/NTSC/SECAM/OTHER */
  66 +#define VIDEO_MODE_PAL 0
  67 +#define VIDEO_MODE_NTSC 1
  68 +#define VIDEO_MODE_SECAM 2
  69 +#define VIDEO_MODE_AUTO 3
  70 +#define VIDEO_MODE_ATSC 4 /* dtv */
  71 + __u16 signal; /* Signal strength 16bit scale */
  72 +};
  73 +
  74 +struct video_picture
  75 +{
  76 + __u16 brightness;
  77 + __u16 hue;
  78 + __u16 colour;
  79 + __u16 contrast;
  80 + __u16 whiteness; /* Black and white only */
  81 + __u16 depth; /* Capture depth */
  82 + __u16 palette; /* Palette in use */
  83 +#define VIDEO_PALETTE_GREY 1 /* Linear greyscale */
  84 +#define VIDEO_PALETTE_HI240 2 /* High 240 cube (BT848) */
  85 +#define VIDEO_PALETTE_RGB565 3 /* 565 16 bit RGB */
  86 +#define VIDEO_PALETTE_RGB24 4 /* 24bit RGB */
  87 +#define VIDEO_PALETTE_RGB32 5 /* 32bit RGB */
  88 +#define VIDEO_PALETTE_RGB555 6 /* 555 15bit RGB */
  89 +#define VIDEO_PALETTE_YUV422 7 /* YUV422 capture */
  90 +#define VIDEO_PALETTE_YUYV 8
  91 +#define VIDEO_PALETTE_UYVY 9 /* The great thing about standards is ... */
  92 +#define VIDEO_PALETTE_YUV420 10
  93 +#define VIDEO_PALETTE_YUV411 11 /* YUV411 capture */
  94 +#define VIDEO_PALETTE_RAW 12 /* RAW capture (BT848) */
  95 +#define VIDEO_PALETTE_YUV422P 13 /* YUV 4:2:2 Planar */
  96 +#define VIDEO_PALETTE_YUV411P 14 /* YUV 4:1:1 Planar */
  97 +#define VIDEO_PALETTE_YUV420P 15 /* YUV 4:2:0 Planar */
  98 +#define VIDEO_PALETTE_YUV410P 16 /* YUV 4:1:0 Planar */
  99 +#define VIDEO_PALETTE_PLANAR 13 /* start of planar entries */
  100 +#define VIDEO_PALETTE_COMPONENT 7 /* start of component entries */
  101 +};
  102 +
  103 +struct video_audio
  104 +{
  105 + int audio; /* Audio channel */
  106 + __u16 volume; /* If settable */
  107 + __u16 bass, treble;
  108 + __u32 flags;
  109 +#define VIDEO_AUDIO_MUTE 1
  110 +#define VIDEO_AUDIO_MUTABLE 2
  111 +#define VIDEO_AUDIO_VOLUME 4
  112 +#define VIDEO_AUDIO_BASS 8
  113 +#define VIDEO_AUDIO_TREBLE 16
  114 +#define VIDEO_AUDIO_BALANCE 32
  115 + char name[16];
  116 +#define VIDEO_SOUND_MONO 1
  117 +#define VIDEO_SOUND_STEREO 2
  118 +#define VIDEO_SOUND_LANG1 4
  119 +#define VIDEO_SOUND_LANG2 8
  120 + __u16 mode;
  121 + __u16 balance; /* Stereo balance */
  122 + __u16 step; /* Step actual volume uses */
  123 +};
  124 +
  125 +struct video_clip
  126 +{
  127 + __s32 x,y;
  128 + __s32 width, height;
  129 + struct video_clip *next; /* For user use/driver use only */
  130 +};
  131 +
  132 +struct video_window
  133 +{
  134 + __u32 x,y; /* Position of window */
  135 + __u32 width,height; /* Its size */
  136 + __u32 chromakey;
  137 + __u32 flags;
  138 + struct video_clip *clips; /* Set only */
  139 + int clipcount;
  140 +#define VIDEO_WINDOW_INTERLACE 1
  141 +#define VIDEO_WINDOW_CHROMAKEY 16 /* Overlay by chromakey */
  142 +#define VIDEO_CLIP_BITMAP -1
  143 +/* bitmap is 1024x625, a '1' bit represents a clipped pixel */
  144 +#define VIDEO_CLIPMAP_SIZE (128 * 625)
  145 +};
  146 +
  147 +struct video_capture
  148 +{
  149 + __u32 x,y; /* Offsets into image */
  150 + __u32 width, height; /* Area to capture */
  151 + __u16 decimation; /* Decimation divider */
  152 + __u16 flags; /* Flags for capture */
  153 +#define VIDEO_CAPTURE_ODD 0 /* Temporal */
  154 +#define VIDEO_CAPTURE_EVEN 1
  155 +};
  156 +
  157 +struct video_buffer
  158 +{
  159 + void *base;
  160 + int height,width;
  161 + int depth;
  162 + int bytesperline;
  163 +};
  164 +
  165 +struct video_mmap
  166 +{
  167 + unsigned int frame; /* Frame (0 - n) for double buffer */
  168 + int height,width;
  169 + unsigned int format; /* should be VIDEO_PALETTE_* */
  170 +};
  171 +
  172 +struct video_key
  173 +{
  174 + __u8 key[8];
  175 + __u32 flags;
  176 +};
  177 +
  178 +struct video_mbuf
  179 +{
  180 + int size; /* Total memory to map */
  181 + int frames; /* Frames */
  182 + int offsets[VIDEO_MAX_FRAME];
  183 +};
  184 +
  185 +#define VIDEO_NO_UNIT (-1)
  186 +
  187 +struct video_unit
  188 +{
  189 + int video; /* Video minor */
  190 + int vbi; /* VBI minor */
  191 + int radio; /* Radio minor */
  192 + int audio; /* Audio minor */
  193 + int teletext; /* Teletext minor */
  194 + int dtv; /* Digital video minor */
  195 +};
  196 +
  197 +struct video_signal
  198 +{
  199 + int strength; /* signal strength */
  200 + int aux; /* aux signal strength */
  201 +};
  202 +
  203 +struct vbi_format {
  204 + __u32 sampling_rate; /* in Hz */
  205 + __u32 samples_per_line;
  206 + __u32 sample_format; /* VIDEO_PALETTE_RAW only (1 byte) */
  207 + __s32 start[2]; /* starting line for each frame */
  208 + __u32 count[2]; /* count of lines for each frame */
  209 + __u32 flags;
  210 +#define VBI_UNSYNC 1 /* can distingues between top/bottom field */
  211 +#define VBI_INTERLACED 2 /* lines are interlaced */
  212 +};
  213 +
  214 +/* video_info is biased towards hardware mpeg encode/decode */
  215 +/* but it could apply generically to any hardware compressor/decompressor */
  216 +struct video_info
  217 +{
  218 + __u32 frame_count; /* frames output since decode/encode began */
  219 + __u32 h_size; /* current unscaled horizontal size */
  220 + __u32 v_size; /* current unscaled veritcal size */
  221 + __u32 smpte_timecode; /* current SMPTE timecode (for current GOP) */
  222 + __u32 picture_type; /* current picture type */
  223 + __u32 temporal_reference; /* current temporal reference */
  224 + __u8 user_data[256]; /* user data last found in compressed stream */
  225 + /* user_data[0] contains user data flags, user_data[1] has count */
  226 +};
  227 +
  228 +/* generic structure for setting playback modes */
  229 +struct video_play_mode
  230 +{
  231 + int mode;
  232 + int p1;
  233 + int p2;
  234 +};
  235 +
  236 +/* for loading microcode / fpga programming */
  237 +struct video_code
  238 +{
  239 + char loadwhat[16]; /* name or tag of file being passed */
  240 + int datasize;
  241 + __u8 *data;
  242 +};
  243 +
  244 +#define VIDIOCGCAP _IOR('v',1,struct video_capability) /* Get capabilities */
  245 +#define VIDIOCGCHAN _IOWR('v',2,struct video_channel) /* Get channel info (sources) */
  246 +#define VIDIOCSCHAN _IOW('v',3,struct video_channel) /* Set channel */
  247 +#define VIDIOCGTUNER _IOWR('v',4,struct video_tuner) /* Get tuner abilities */
  248 +#define VIDIOCSTUNER _IOW('v',5,struct video_tuner) /* Tune the tuner for the current channel */
  249 +#define VIDIOCGPICT _IOR('v',6,struct video_picture) /* Get picture properties */
  250 +#define VIDIOCSPICT _IOW('v',7,struct video_picture) /* Set picture properties */
  251 +#define VIDIOCCAPTURE _IOW('v',8,int) /* Start, end capture */
  252 +#define VIDIOCGWIN _IOR('v',9, struct video_window) /* Get the video overlay window */
  253 +#define VIDIOCSWIN _IOW('v',10, struct video_window) /* Set the video overlay window - passes clip list for hardware smarts , chromakey etc */
  254 +#define VIDIOCGFBUF _IOR('v',11, struct video_buffer) /* Get frame buffer */
  255 +#define VIDIOCSFBUF _IOW('v',12, struct video_buffer) /* Set frame buffer - root only */
  256 +#define VIDIOCKEY _IOR('v',13, struct video_key) /* Video key event - to dev 255 is to all - cuts capture on all DMA windows with this key (0xFFFFFFFF == all) */
  257 +#define VIDIOCGFREQ _IOR('v',14, unsigned long) /* Set tuner */
  258 +#define VIDIOCSFREQ _IOW('v',15, unsigned long) /* Set tuner */
  259 +#define VIDIOCGAUDIO _IOR('v',16, struct video_audio) /* Get audio info */
  260 +#define VIDIOCSAUDIO _IOW('v',17, struct video_audio) /* Audio source, mute etc */
  261 +#define VIDIOCSYNC _IOW('v',18, int) /* Sync with mmap grabbing */
  262 +#define VIDIOCMCAPTURE _IOW('v',19, struct video_mmap) /* Grab frames */
  263 +#define VIDIOCGMBUF _IOR('v',20, struct video_mbuf) /* Memory map buffer info */
  264 +#define VIDIOCGUNIT _IOR('v',21, struct video_unit) /* Get attached units */
  265 +#define VIDIOCGCAPTURE _IOR('v',22, struct video_capture) /* Get subcapture */
  266 +#define VIDIOCSCAPTURE _IOW('v',23, struct video_capture) /* Set subcapture */
  267 +#define VIDIOCSPLAYMODE _IOW('v',24, struct video_play_mode) /* Set output video mode/feature */
  268 +#define VIDIOCSWRITEMODE _IOW('v',25, int) /* Set write mode */
  269 +#define VIDIOCGPLAYINFO _IOR('v',26, struct video_info) /* Get current playback info from hardware */
  270 +#define VIDIOCSMICROCODE _IOW('v',27, struct video_code) /* Load microcode into hardware */
  271 +#define VIDIOCGVBIFMT _IOR('v',28, struct vbi_format) /* Get VBI information */
  272 +#define VIDIOCSVBIFMT _IOW('v',29, struct vbi_format) /* Set VBI information */
  273 +#define VIDIOCGSIGNAL _IOR('v',30, struct video_signal) /* Get signal strength */
  274 +
  275 +
  276 +#define BASE_VIDIOCPRIVATE 192 /* 192-255 are private */
  277 +
  278 +/* VIDIOCSWRITEMODE */
  279 +#define VID_WRITE_MPEG_AUD 0
  280 +#define VID_WRITE_MPEG_VID 1
  281 +#define VID_WRITE_OSD 2
  282 +#define VID_WRITE_TTX 3
  283 +#define VID_WRITE_CC 4
  284 +#define VID_WRITE_MJPEG 5
  285 +
  286 +/* VIDIOCSPLAYMODE */
  287 +#define VID_PLAY_VID_OUT_MODE 0
  288 + /* p1: = VIDEO_MODE_PAL, VIDEO_MODE_NTSC, etc ... */
  289 +#define VID_PLAY_GENLOCK 1
  290 + /* p1: 0 = OFF, 1 = ON */
  291 + /* p2: GENLOCK FINE DELAY value */
  292 +#define VID_PLAY_NORMAL 2
  293 +#define VID_PLAY_PAUSE 3
  294 +#define VID_PLAY_SINGLE_FRAME 4
  295 +#define VID_PLAY_FAST_FORWARD 5
  296 +#define VID_PLAY_SLOW_MOTION 6
  297 +#define VID_PLAY_IMMEDIATE_NORMAL 7
  298 +#define VID_PLAY_SWITCH_CHANNELS 8
  299 +#define VID_PLAY_FREEZE_FRAME 9
  300 +#define VID_PLAY_STILL_MODE 10
  301 +#define VID_PLAY_MASTER_MODE 11
  302 + /* p1: see below */
  303 +#define VID_PLAY_MASTER_NONE 1
  304 +#define VID_PLAY_MASTER_VIDEO 2
  305 +#define VID_PLAY_MASTER_AUDIO 3
  306 +#define VID_PLAY_ACTIVE_SCANLINES 12
  307 + /* p1 = first active; p2 = last active */
  308 +#define VID_PLAY_RESET 13
  309 +#define VID_PLAY_END_MARK 14
  310 +
  311 +
  312 +
  313 +#define VID_HARDWARE_BT848 1
  314 +#define VID_HARDWARE_QCAM_BW 2
  315 +#define VID_HARDWARE_PMS 3
  316 +#define VID_HARDWARE_QCAM_C 4
  317 +#define VID_HARDWARE_PSEUDO 5
  318 +#define VID_HARDWARE_SAA5249 6
  319 +#define VID_HARDWARE_AZTECH 7
  320 +#define VID_HARDWARE_SF16MI 8
  321 +#define VID_HARDWARE_RTRACK 9
  322 +#define VID_HARDWARE_ZOLTRIX 10
  323 +#define VID_HARDWARE_SAA7146 11
  324 +#define VID_HARDWARE_VIDEUM 12 /* Reserved for Winnov videum */
  325 +#define VID_HARDWARE_RTRACK2 13
  326 +#define VID_HARDWARE_PERMEDIA2 14 /* Reserved for Permedia2 */
  327 +#define VID_HARDWARE_RIVA128 15 /* Reserved for RIVA 128 */
  328 +#define VID_HARDWARE_PLANB 16 /* PowerMac motherboard video-in */
  329 +#define VID_HARDWARE_BROADWAY 17 /* Broadway project */
  330 +#define VID_HARDWARE_GEMTEK 18
  331 +#define VID_HARDWARE_TYPHOON 19
  332 +#define VID_HARDWARE_VINO 20 /* SGI Indy Vino */
  333 +#define VID_HARDWARE_CADET 21 /* Cadet radio */
  334 +#define VID_HARDWARE_TRUST 22 /* Trust FM Radio */
  335 +#define VID_HARDWARE_TERRATEC 23 /* TerraTec ActiveRadio */
  336 +#define VID_HARDWARE_CPIA 24
  337 +#define VID_HARDWARE_ZR36120 25 /* Zoran ZR36120/ZR36125 */
  338 +#define VID_HARDWARE_ZR36067 26 /* Zoran ZR36067/36060 */
  339 +#define VID_HARDWARE_OV511 27
  340 +#define VID_HARDWARE_ZR356700 28 /* Zoran 36700 series */
  341 +#define VID_HARDWARE_W9966 29
  342 +#define VID_HARDWARE_SE401 30 /* SE401 USB webcams */
  343 +#define VID_HARDWARE_PWC 31 /* Philips webcams */
  344 +#define VID_HARDWARE_MEYE 32 /* Sony Vaio MotionEye cameras */
  345 +#define VID_HARDWARE_CPIA2 33
  346 +#define VID_HARDWARE_VICAM 34
  347 +#define VID_HARDWARE_SF16FMR2 35
  348 +#define VID_HARDWARE_W9968CF 36
  349 +#define VID_HARDWARE_SAA7114H 37
  350 +#define VID_HARDWARE_SN9C102 38
  351 +#define VID_HARDWARE_ARV 39
  352 +#endif /* __LINUX_VIDEODEV_H */
  353 +
  354 +/*
  355 + * Local variables:
  356 + * c-basic-offset: 8
  357 + * End:
  358 + */

0 comments on commit a163dc8

Please sign in to comment.
Something went wrong with that request. Please try again.