Ticket #8337: vbi_videodev_sync.diff

File vbi_videodev_sync.diff, 2.0 KB (added by mrechberger@…, 10 years ago)

VBI cleanup

  • mythtv/libs/libmythtv/vbitext/vbi.c

     
    1616#include "vt.h"
    1717#include "vbi.h"
    1818#include "hamm.h"
     19#include "videodev_myth.h"
     20#include "videodev2_myth.h"
    1921
    2022#define FAC    (1<<16)         // factor for fix-point arithmetic
    2123
    2224static unsigned char *rawbuf;          // one common buffer for raw vbi data.
    2325static int rawbuf_size;                // its current size
    2426
    25 
    2627/***** bttv api *****/
    2728
    2829#define BASE_VIDIOCPRIVATE     192
    2930#define BTTV_VERSION           _IOR('v' , BASE_VIDIOCPRIVATE+6, int)
    3031#define BTTV_VBISIZE           _IOR('v' , BASE_VIDIOCPRIVATE+8, int)
    3132
    32 /***** v4l2 vbi-api *****/
    33 
    34 /* #include "/usr/src/linux/include/linux/videodev2.h" */
    35 
    36 enum v4l2_buf_type {
    37         V4L2_BUF_TYPE_VIDEO_CAPTURE  = 1,
    38         V4L2_BUF_TYPE_VIDEO_OUTPUT   = 2,
    39         V4L2_BUF_TYPE_VIDEO_OVERLAY  = 3,
    40         V4L2_BUF_TYPE_VBI_CAPTURE    = 4,
    41         V4L2_BUF_TYPE_VBI_OUTPUT     = 5,
    42         V4L2_BUF_TYPE_PRIVATE        = 0x80,
    43 };
    44 
    45 struct v4l2_vbi_format
    46 {
    47     unsigned int sampling_rate;                /* in 1 Hz */
    48     unsigned int offset;                       /* sampling starts # samples after rising hs */
    49     unsigned int samples_per_line;
    50     unsigned int sample_format;                /* V4L2_VBI_SF_* */
    51     signed int start[2];
    52     unsigned int count[2];
    53     unsigned int flags;                        /* V4L2_VBI_* */
    54     unsigned int reserved2;            /* must be zero */
    55 };
    56 
    57 struct v4l2_format
    58 {
    59     enum v4l2_buf_type type;                   /* V4L2_BUF_TYPE_* */
    60     union
    61     {
    62        struct v4l2_vbi_format vbi;     /*  VBI data  */
    63        unsigned char raw_data[200];            /* user-defined */
    64     } fmt;
    65 };
    66 
    67 #define V4L2_PIX_FMT_GREY     0x59455247 /* v4l2_fourcc('G','R','E','Y') *//*  8  Greyscale     */
    68 #define VIDIOC_G_FMT           _IOWR('V',  4, struct v4l2_format)
    69 
    7033/***** end of api definitions *****/
    7134
    7235static void