(root)/
strace-6.5/
src/
kernel_v4l2_types.h
       1  /*
       2   * Copyright (c) 2020-2021 Dmitry V. Levin <ldv@strace.io>
       3   * All rights reserved.
       4   *
       5   * SPDX-License-Identifier: LGPL-2.1-or-later
       6   */
       7  
       8  #ifndef STRACE_KERNEL_V4L2_BUFFER_H
       9  # define STRACE_KERNEL_V4L2_BUFFER_H
      10  
      11  # include <linux/videodev2.h>
      12  # include "kernel_timeval.h"
      13  # include "kernel_timespec.h"
      14  
      15  # if defined __sparc__ && defined __arch64__
      16  typedef struct {
      17  	long long tv_sec;
      18  	int tv_usec;
      19  	int pad;
      20  } kernel_v4l2_timeval_t;
      21  # else
      22  typedef kernel_timeval64_t kernel_v4l2_timeval_t;
      23  # endif
      24  
      25  typedef struct {
      26  	uint32_t			index;
      27  	uint32_t			type;
      28  	uint32_t			bytesused;
      29  	uint32_t			flags;
      30  	uint32_t			field;
      31  	kernel_v4l2_timeval_t		timestamp;
      32  	struct v4l2_timecode		timecode;
      33  	uint32_t			sequence;
      34  	uint32_t			memory;
      35  	union {
      36  		uint32_t		offset;
      37  		unsigned long		userptr;
      38  		struct v4l2_plane	*planes;
      39  		int32_t			fd;
      40  	} m;
      41  	uint32_t			length;
      42  	uint32_t			reserved2;
      43  	union {
      44  		int32_t			request_fd;
      45  		uint32_t		reserved;
      46  	};
      47  } kernel_v4l2_buffer_t;
      48  
      49  typedef struct {
      50  	uint32_t				type;
      51  	union {
      52  		uint64_t			data[8];
      53  	} u;
      54  	uint32_t				pending;
      55  	uint32_t				sequence;
      56  	kernel_timespec64_t			timestamp;
      57  	uint32_t				id;
      58  	uint32_t				reserved[8];
      59  } kernel_v4l2_event_t;
      60  
      61  /* Removed by Linux kernel commit v3.6-rc1~28^2~240.  */
      62  # define V4L2_BUF_FLAG_INPUT	0x0200
      63  
      64  /* Removed by Linux kernel commit v3.9-rc1~93^2~237.  */
      65  # define V4L2_CID_HCENTER	(V4L2_CID_BASE+22)
      66  # define V4L2_CID_VCENTER	(V4L2_CID_BASE+23)
      67  
      68  /* Removed by Linux kernel commit v4.20-rc7~16^2~2.  */
      69  # define V4L2_CID_MPEG_VIDEO_MPEG2_SLICE_PARAMS         (V4L2_CID_CODEC_BASE + 250)
      70  # define V4L2_CID_MPEG_VIDEO_MPEG2_QUANTIZATION         (V4L2_CID_CODEC_BASE + 251)
      71  
      72  /*
      73   * Constants based on struct v4l2_buffer are unreliable
      74   * as the latter uses struct timeval.
      75   */
      76  # undef VIDIOC_QUERYBUF
      77  # define VIDIOC_QUERYBUF	_IOWR('V',   9, kernel_v4l2_buffer_t)
      78  
      79  # undef VIDIOC_QBUF
      80  # define VIDIOC_QBUF		_IOWR('V',  15, kernel_v4l2_buffer_t)
      81  
      82  # undef VIDIOC_DQBUF
      83  # define VIDIOC_DQBUF		_IOWR('V',  17, kernel_v4l2_buffer_t)
      84  
      85  # undef VIDIOC_PREPARE_BUF
      86  # define VIDIOC_PREPARE_BUF	_IOWR('V',  93, kernel_v4l2_buffer_t)
      87  
      88  /*
      89   * Constants based on struct v4l2_event are unreliable
      90   * as the latter uses struct timespec.
      91   */
      92  # undef VIDIOC_DQEVENT
      93  # define VIDIOC_DQEVENT		_IOR ('V',  89, kernel_v4l2_event_t)
      94  
      95  #endif /* !STRACE_KERNEL_V4L2_BUFFER_H */