xref: /linux/include/uapi/linux/ivtv.h (revision 498495dba268b20e8eadd7fe93c140c68b6cc9d2)
1*e2be04c7SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2607ca46eSDavid Howells /*
3607ca46eSDavid Howells     Public ivtv API header
4607ca46eSDavid Howells     Copyright (C) 2003-2004  Kevin Thayer <nufan_wfk at yahoo.com>
5607ca46eSDavid Howells     Copyright (C) 2004-2007  Hans Verkuil <hverkuil@xs4all.nl>
6607ca46eSDavid Howells 
7607ca46eSDavid Howells     This program is free software; you can redistribute it and/or modify
8607ca46eSDavid Howells     it under the terms of the GNU General Public License as published by
9607ca46eSDavid Howells     the Free Software Foundation; either version 2 of the License, or
10607ca46eSDavid Howells     (at your option) any later version.
11607ca46eSDavid Howells 
12607ca46eSDavid Howells     This program is distributed in the hope that it will be useful,
13607ca46eSDavid Howells     but WITHOUT ANY WARRANTY; without even the implied warranty of
14607ca46eSDavid Howells     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15607ca46eSDavid Howells     GNU General Public License for more details.
16607ca46eSDavid Howells 
17607ca46eSDavid Howells     You should have received a copy of the GNU General Public License
18607ca46eSDavid Howells     along with this program; if not, write to the Free Software
19607ca46eSDavid Howells     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
20607ca46eSDavid Howells  */
21607ca46eSDavid Howells 
22607ca46eSDavid Howells #ifndef __LINUX_IVTV_H__
23607ca46eSDavid Howells #define __LINUX_IVTV_H__
24607ca46eSDavid Howells 
25607ca46eSDavid Howells #include <linux/compiler.h>
26607ca46eSDavid Howells #include <linux/types.h>
27607ca46eSDavid Howells #include <linux/videodev2.h>
28607ca46eSDavid Howells 
29607ca46eSDavid Howells /* ivtv knows several distinct output modes: MPEG streaming,
30607ca46eSDavid Howells    YUV streaming, YUV updates through user DMA and the passthrough
31607ca46eSDavid Howells    mode.
32607ca46eSDavid Howells 
33607ca46eSDavid Howells    In order to clearly tell the driver that we are in user DMA
34607ca46eSDavid Howells    YUV mode you need to call IVTV_IOC_DMA_FRAME with y_source == NULL
35607ca46eSDavid Howells    first (althrough if you don't then the first time
36607ca46eSDavid Howells    DMA_FRAME is called the mode switch is done automatically).
37607ca46eSDavid Howells 
38607ca46eSDavid Howells    When you close the file handle the user DMA mode is exited again.
39607ca46eSDavid Howells 
40607ca46eSDavid Howells    While in one mode, you cannot use another mode (EBUSY is returned).
41607ca46eSDavid Howells 
42607ca46eSDavid Howells    All this means that if you want to change the YUV interlacing
43607ca46eSDavid Howells    for the user DMA YUV mode you first need to do call IVTV_IOC_DMA_FRAME
44607ca46eSDavid Howells    with y_source == NULL before you can set the correct format using
45607ca46eSDavid Howells    VIDIOC_S_FMT.
46607ca46eSDavid Howells 
47607ca46eSDavid Howells    Eventually all this should be replaced with a proper V4L2 API,
48607ca46eSDavid Howells    but for now we have to do it this way. */
49607ca46eSDavid Howells 
50607ca46eSDavid Howells struct ivtv_dma_frame {
51607ca46eSDavid Howells 	enum v4l2_buf_type type; /* V4L2_BUF_TYPE_VIDEO_OUTPUT */
52607ca46eSDavid Howells 	__u32 pixelformat;	 /* 0 == same as destination */
53607ca46eSDavid Howells 	void __user *y_source;   /* if NULL and type == V4L2_BUF_TYPE_VIDEO_OUTPUT,
54607ca46eSDavid Howells 				    then just switch to user DMA YUV output mode */
55607ca46eSDavid Howells 	void __user *uv_source;  /* Unused for RGB pixelformats */
56607ca46eSDavid Howells 	struct v4l2_rect src;
57607ca46eSDavid Howells 	struct v4l2_rect dst;
58607ca46eSDavid Howells 	__u32 src_width;
59607ca46eSDavid Howells 	__u32 src_height;
60607ca46eSDavid Howells };
61607ca46eSDavid Howells 
62607ca46eSDavid Howells #define IVTV_IOC_DMA_FRAME		_IOW ('V', BASE_VIDIOC_PRIVATE+0, struct ivtv_dma_frame)
63607ca46eSDavid Howells 
64607ca46eSDavid Howells /* Select the passthrough mode (if the argument is non-zero). In the passthrough
65607ca46eSDavid Howells    mode the output of the encoder is passed immediately into the decoder. */
66607ca46eSDavid Howells #define IVTV_IOC_PASSTHROUGH_MODE	_IOW ('V', BASE_VIDIOC_PRIVATE+1, int)
67607ca46eSDavid Howells 
68607ca46eSDavid Howells /* Deprecated defines: applications should use the defines from videodev2.h */
69607ca46eSDavid Howells #define IVTV_SLICED_TYPE_TELETEXT_B     V4L2_MPEG_VBI_IVTV_TELETEXT_B
70607ca46eSDavid Howells #define IVTV_SLICED_TYPE_CAPTION_525    V4L2_MPEG_VBI_IVTV_CAPTION_525
71607ca46eSDavid Howells #define IVTV_SLICED_TYPE_WSS_625        V4L2_MPEG_VBI_IVTV_WSS_625
72607ca46eSDavid Howells #define IVTV_SLICED_TYPE_VPS            V4L2_MPEG_VBI_IVTV_VPS
73607ca46eSDavid Howells 
74607ca46eSDavid Howells #endif /* _LINUX_IVTV_H */
75