Files
libva-v4l2-request-fourier/include/h264-ctrls.h
T
test0r da9f2a55d2 include/h264-ctrls.h: passthrough to system header + CID aliases
H.264 stateless controls were upstreamed to the kernel some time after
this library went dormant. The struct names match exactly (the kernel
adopted v4l2_ctrl_h264_{sps,pps,scaling_matrix,pred_weights,slice_params,
decode_params} and v4l2_h264_{weight_factors,dpb_entry,reference}
verbatim) so the duplicated copies in include/h264-ctrls.h trigger
redefinition errors as soon as any source file pulls in
<linux/videodev2.h> (which transitively pulls in <linux/v4l2-controls.h>).

Same fix as hevc-ctrls.h in commit 4ccbfe9: replace the bundled struct
definitions with a passthrough to <linux/v4l2-controls.h>. The CID
prefix changed during upstreaming from V4L2_CID_MPEG_VIDEO_H264_* to
V4L2_CID_STATELESS_H264_*; provide compatibility aliases so h264.c keeps
compiling. V4L2_PIX_FMT_H264_SLICE is already in <linux/videodev2.h>
(same fourcc value, same name we renamed to in commit c1f5108) so no
need to redefine.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-25 21:49:26 +00:00

47 lines
1.6 KiB
C

/* SPDX-License-Identifier: GPL-2.0 */
/*
* Fourier-local: H.264 stateless controls and structs were upstreamed to
* the kernel some time after this library went dormant. Defer all of:
*
* struct v4l2_ctrl_h264_sps / pps / scaling_matrix / pred_weights /
* slice_params / decode_params
* struct v4l2_h264_weight_factors / dpb_entry / reference
* enum v4l2_*_h264_*
*
* to <linux/v4l2-controls.h>, where they now live with the same field
* names. The duplicated definitions in the original bootlin
* include/h264-ctrls.h conflict at compile time on any current kernel.
*
* The CID prefix was also renamed from V4L2_CID_MPEG_VIDEO_H264_* to
* V4L2_CID_STATELESS_H264_*. Provide compatibility aliases so h264.c
* keeps compiling without an invasive sed across that file.
*
* V4L2_PIX_FMT_H264_SLICE itself lives in <linux/videodev2.h> on current
* kernels, so no need to redefine it here.
*/
#ifndef _H264_CTRLS_H_
#define _H264_CTRLS_H_
#include <linux/videodev2.h>
#include <linux/v4l2-controls.h>
#ifndef V4L2_CID_MPEG_VIDEO_H264_SPS
#define V4L2_CID_MPEG_VIDEO_H264_SPS \
V4L2_CID_STATELESS_H264_SPS
#define V4L2_CID_MPEG_VIDEO_H264_PPS \
V4L2_CID_STATELESS_H264_PPS
#define V4L2_CID_MPEG_VIDEO_H264_SCALING_MATRIX \
V4L2_CID_STATELESS_H264_SCALING_MATRIX
#define V4L2_CID_MPEG_VIDEO_H264_SLICE_PARAMS \
V4L2_CID_STATELESS_H264_SLICE_PARAMS
#define V4L2_CID_MPEG_VIDEO_H264_DECODE_PARAMS \
V4L2_CID_STATELESS_H264_DECODE_PARAMS
#define V4L2_CID_MPEG_VIDEO_H264_DECODE_MODE \
V4L2_CID_STATELESS_H264_DECODE_MODE
#define V4L2_CID_MPEG_VIDEO_H264_START_CODE \
V4L2_CID_STATELESS_H264_START_CODE
#endif
#endif /* _H264_CTRLS_H_ */