From af48bd0a3265f5bdbf8ee03efef2282ecc63e222 Mon Sep 17 00:00:00 2001 From: Vladimir Ermakov Date: Thu, 25 Sep 2025 12:53:37 +0200 Subject: [PATCH] go2rtc: update to 1.9.11 - Update version - Remove unneded patches - Add patch to drop codegen in alsa module - Rebase & refresh patches Signed-off-by: Vladimir Ermakov --- multimedia/go2rtc/Makefile | 6 +- ...n-file-to-be-able-to-build-with-CGO-.patch | 4 +- .../0002-Fix-support-linux-riscv64-1639.patch | 26 -- ...n-file-to-be-able-to-build-with-CGO-.patch | 178 +++++++++++++ ...dd-riscv64-platform-for-v4l2-package.patch | 162 ------------ .../0004-v4l2-eanble-risc-v-64-support.patch | 27 -- ...05-v4l2-fix-riscv64-build-and-go-fmt.patch | 250 ------------------ ...fix-compile-on-unsupported-arch-mips.patch | 27 -- 8 files changed, 183 insertions(+), 497 deletions(-) delete mode 100644 multimedia/go2rtc/patches/0002-Fix-support-linux-riscv64-1639.patch create mode 100644 multimedia/go2rtc/patches/0002-alsa-drop-codegen-file-to-be-able-to-build-with-CGO-.patch delete mode 100644 multimedia/go2rtc/patches/0003-add-riscv64-platform-for-v4l2-package.patch delete mode 100644 multimedia/go2rtc/patches/0004-v4l2-eanble-risc-v-64-support.patch delete mode 100644 multimedia/go2rtc/patches/0005-v4l2-fix-riscv64-build-and-go-fmt.patch delete mode 100644 multimedia/go2rtc/patches/0006-v4l2-fix-compile-on-unsupported-arch-mips.patch diff --git a/multimedia/go2rtc/Makefile b/multimedia/go2rtc/Makefile index 914282da8d..8841d3be18 100644 --- a/multimedia/go2rtc/Makefile +++ b/multimedia/go2rtc/Makefile @@ -1,12 +1,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=go2rtc -PKG_VERSION:=1.9.9 -PKG_RELEASE:=2 +PKG_VERSION:=1.9.11 +PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/AlexxIT/go2rtc/tar.gz/v$(PKG_VERSION)? -PKG_HASH:=0afb5a9f0cdbd696193288197cfb5ebf44d085f631e7326cc0465026fe3b9196 +PKG_HASH:=678ef106fd794a63587f6d55673ac138dde9ad79d96398a1bc8a13836058143b PKG_LICENSE:=MIT PKG_LICENSE_FILES:=LICENSE diff --git a/multimedia/go2rtc/patches/0001-v4l2-drop-codegen-file-to-be-able-to-build-with-CGO-.patch b/multimedia/go2rtc/patches/0001-v4l2-drop-codegen-file-to-be-able-to-build-with-CGO-.patch index 7ecdc85d96..3b230bfc9a 100644 --- a/multimedia/go2rtc/patches/0001-v4l2-drop-codegen-file-to-be-able-to-build-with-CGO-.patch +++ b/multimedia/go2rtc/patches/0001-v4l2-drop-codegen-file-to-be-able-to-build-with-CGO-.patch @@ -1,7 +1,7 @@ -From bb8b2d421a971fadd6bf08a1656d212e0103a583 Mon Sep 17 00:00:00 2001 +From 31d5d570825fc38a210d1e59789270324a9b0398 Mon Sep 17 00:00:00 2001 From: Vladimir Ermakov Date: Fri, 30 May 2025 16:57:51 +0200 -Subject: [PATCH 1/6] v4l2: drop codegen file to be able to build with CGO=0 +Subject: [PATCH 1/2] v4l2: drop codegen file to be able to build with CGO=0 Signed-off-by: Vladimir Ermakov --- diff --git a/multimedia/go2rtc/patches/0002-Fix-support-linux-riscv64-1639.patch b/multimedia/go2rtc/patches/0002-Fix-support-linux-riscv64-1639.patch deleted file mode 100644 index 92fa02f28e..0000000000 --- a/multimedia/go2rtc/patches/0002-Fix-support-linux-riscv64-1639.patch +++ /dev/null @@ -1,26 +0,0 @@ -From c6b1584b5fdcbf0a7d5b0a00defcc2d1ce71e803 Mon Sep 17 00:00:00 2001 -From: Alex X -Date: Thu, 13 Mar 2025 15:33:23 +0300 -Subject: [PATCH 2/6] Fix support linux + riscv64 #1639 - ---- - internal/v4l2/v4l2.go | 2 +- - internal/v4l2/v4l2_linux.go | 2 ++ - 2 files changed, 3 insertions(+), 1 deletion(-) - ---- a/internal/v4l2/v4l2.go -+++ b/internal/v4l2/v4l2.go -@@ -1,4 +1,4 @@ --//go:build !linux -+//go:build !(linux && (386 || arm || mipsle || amd64 || arm64)) - - package v4l2 - ---- a/internal/v4l2/v4l2_linux.go -+++ b/internal/v4l2/v4l2_linux.go -@@ -1,3 +1,5 @@ -+//go:build linux && (386 || arm || mipsle || amd64 || arm64) -+ - package v4l2 - - import ( diff --git a/multimedia/go2rtc/patches/0002-alsa-drop-codegen-file-to-be-able-to-build-with-CGO-.patch b/multimedia/go2rtc/patches/0002-alsa-drop-codegen-file-to-be-able-to-build-with-CGO-.patch new file mode 100644 index 0000000000..7cf93e30d1 --- /dev/null +++ b/multimedia/go2rtc/patches/0002-alsa-drop-codegen-file-to-be-able-to-build-with-CGO-.patch @@ -0,0 +1,178 @@ +From bc955c0d82c81e70e7855657e504a1ce743efe88 Mon Sep 17 00:00:00 2001 +From: Vladimir Ermakov +Date: Thu, 25 Sep 2025 12:50:56 +0200 +Subject: [PATCH 2/2] alsa: drop codegen file to be able to build with CGO=0 + +Signed-off-by: Vladimir Ermakov +--- + pkg/alsa/device/asound_arch.c | 163 ---------------------------------- + 1 file changed, 163 deletions(-) + delete mode 100644 pkg/alsa/device/asound_arch.c + +--- a/pkg/alsa/device/asound_arch.c ++++ /dev/null +@@ -1,163 +0,0 @@ +-#include +-#include +-#include +-#include +- +-#define print_line(text) printf("%s\n", text) +-#define print_hex_const(name) printf("\t%s = 0x%08lx\n", #name, name) +-#define print_int_const(con) printf("\t%s = %d\n", #con, con) +- +-#define print_struct_header(str) printf("type %s struct { // size %lu\n", #str, sizeof(struct str)) +-#define print_struct_member(str, mem, typ) printf("\t%s %s // offset %lu, size %lu\n", #mem == "type" ? "typ" : #mem, typ, offsetof(struct str, mem), sizeof((struct str){0}.mem)) +- +-// https://github.com/torvalds/linux/blob/master/include/uapi/sound/asound.h +-int main() { +- print_line("package device\n"); +- +- print_line("type unsigned_char = byte"); +- print_line("type signed_int = int32"); +- print_line("type unsigned_int = uint32"); +- print_line("type signed_long = int64"); +- print_line("type unsigned_long = uint64"); +- print_line("type __u32 = uint32"); +- print_line("type void__user = uintptr\n"); +- +- print_line("const ("); +- print_int_const(SNDRV_PCM_STREAM_PLAYBACK); +- print_int_const(SNDRV_PCM_STREAM_CAPTURE); +- print_line(""); +- print_int_const(SNDRV_PCM_ACCESS_MMAP_INTERLEAVED); +- print_int_const(SNDRV_PCM_ACCESS_MMAP_NONINTERLEAVED); +- print_int_const(SNDRV_PCM_ACCESS_MMAP_COMPLEX); +- print_int_const(SNDRV_PCM_ACCESS_RW_INTERLEAVED); +- print_int_const(SNDRV_PCM_ACCESS_RW_NONINTERLEAVED); +- print_line(""); +- print_int_const(SNDRV_PCM_FORMAT_S8); +- print_int_const(SNDRV_PCM_FORMAT_U8); +- print_int_const(SNDRV_PCM_FORMAT_S16_LE); +- print_int_const(SNDRV_PCM_FORMAT_S16_BE); +- print_int_const(SNDRV_PCM_FORMAT_U16_LE); +- print_int_const(SNDRV_PCM_FORMAT_U16_BE); +- print_int_const(SNDRV_PCM_FORMAT_S24_LE); +- print_int_const(SNDRV_PCM_FORMAT_S24_BE); +- print_int_const(SNDRV_PCM_FORMAT_U24_LE); +- print_int_const(SNDRV_PCM_FORMAT_U24_BE); +- print_int_const(SNDRV_PCM_FORMAT_S32_LE); +- print_int_const(SNDRV_PCM_FORMAT_S32_BE); +- print_int_const(SNDRV_PCM_FORMAT_U32_LE); +- print_int_const(SNDRV_PCM_FORMAT_U32_BE); +- print_int_const(SNDRV_PCM_FORMAT_FLOAT_LE); +- print_int_const(SNDRV_PCM_FORMAT_FLOAT_BE); +- print_int_const(SNDRV_PCM_FORMAT_FLOAT64_LE); +- print_int_const(SNDRV_PCM_FORMAT_FLOAT64_BE); +- print_int_const(SNDRV_PCM_FORMAT_MU_LAW); +- print_int_const(SNDRV_PCM_FORMAT_A_LAW); +- print_int_const(SNDRV_PCM_FORMAT_MPEG); +- print_line(""); +- print_hex_const(SNDRV_PCM_IOCTL_PVERSION); // A 0x00 +- print_hex_const(SNDRV_PCM_IOCTL_INFO); // A 0x01 +- print_hex_const(SNDRV_PCM_IOCTL_HW_REFINE); // A 0x10 +- print_hex_const(SNDRV_PCM_IOCTL_HW_PARAMS); // A 0x11 +- print_hex_const(SNDRV_PCM_IOCTL_SW_PARAMS); // A 0x13 +- print_hex_const(SNDRV_PCM_IOCTL_PREPARE); // A 0x40 +- print_hex_const(SNDRV_PCM_IOCTL_WRITEI_FRAMES); // A 0x50 +- print_hex_const(SNDRV_PCM_IOCTL_READI_FRAMES); // A 0x51 +- print_line(")\n"); +- +- print_struct_header(snd_pcm_info); +- print_struct_member(snd_pcm_info, device, "unsigned_int"); +- print_struct_member(snd_pcm_info, subdevice, "unsigned_int"); +- print_struct_member(snd_pcm_info, stream, "signed_int"); +- print_struct_member(snd_pcm_info, card, "signed_int"); +- print_struct_member(snd_pcm_info, id, "[64]unsigned_char"); +- print_struct_member(snd_pcm_info, name, "[80]unsigned_char"); +- print_struct_member(snd_pcm_info, subname, "[32]unsigned_char"); +- print_struct_member(snd_pcm_info, dev_class, "signed_int"); +- print_struct_member(snd_pcm_info, dev_subclass, "signed_int"); +- print_struct_member(snd_pcm_info, subdevices_count, "unsigned_int"); +- print_struct_member(snd_pcm_info, subdevices_avail, "unsigned_int"); +- print_line("\tpad1 [16]unsigned_char"); +- print_struct_member(snd_pcm_info, reserved, "[64]unsigned_char"); +- print_line("}\n"); +- +- print_line("type snd_pcm_uframes_t = unsigned_long"); +- print_line("type snd_pcm_sframes_t = signed_long\n"); +- +- print_struct_header(snd_xferi); +- print_struct_member(snd_xferi, result, "snd_pcm_sframes_t"); +- print_struct_member(snd_xferi, buf, "void__user"); +- print_struct_member(snd_xferi, frames, "snd_pcm_uframes_t"); +- print_line("}\n"); +- +- print_line("const ("); +- print_int_const(SNDRV_PCM_HW_PARAM_ACCESS); +- print_int_const(SNDRV_PCM_HW_PARAM_FORMAT); +- print_int_const(SNDRV_PCM_HW_PARAM_SUBFORMAT); +- print_int_const(SNDRV_PCM_HW_PARAM_FIRST_MASK); +- print_int_const(SNDRV_PCM_HW_PARAM_LAST_MASK); +- print_line(""); +- print_int_const(SNDRV_PCM_HW_PARAM_SAMPLE_BITS); +- print_int_const(SNDRV_PCM_HW_PARAM_FRAME_BITS); +- print_int_const(SNDRV_PCM_HW_PARAM_CHANNELS); +- print_int_const(SNDRV_PCM_HW_PARAM_RATE); +- print_int_const(SNDRV_PCM_HW_PARAM_PERIOD_TIME); +- print_int_const(SNDRV_PCM_HW_PARAM_PERIOD_SIZE); +- print_int_const(SNDRV_PCM_HW_PARAM_PERIOD_BYTES); +- print_int_const(SNDRV_PCM_HW_PARAM_PERIODS); +- print_int_const(SNDRV_PCM_HW_PARAM_BUFFER_TIME); +- print_int_const(SNDRV_PCM_HW_PARAM_BUFFER_SIZE); +- print_int_const(SNDRV_PCM_HW_PARAM_BUFFER_BYTES); +- print_int_const(SNDRV_PCM_HW_PARAM_TICK_TIME); +- print_int_const(SNDRV_PCM_HW_PARAM_FIRST_INTERVAL); +- print_int_const(SNDRV_PCM_HW_PARAM_LAST_INTERVAL); +- print_line(""); +- print_int_const(SNDRV_MASK_MAX); +- print_line(""); +- print_int_const(SNDRV_PCM_TSTAMP_NONE); +- print_int_const(SNDRV_PCM_TSTAMP_ENABLE); +- print_line(")\n"); +- +- print_struct_header(snd_mask); +- print_struct_member(snd_mask, bits, "[(SNDRV_MASK_MAX+31)/32]__u32"); +- print_line("}\n"); +- +- print_struct_header(snd_interval); +- print_struct_member(snd_interval, min, "unsigned_int"); +- print_struct_member(snd_interval, max, "unsigned_int"); +- print_line("\tbit unsigned_int"); +- print_line("}\n"); +- +- print_struct_header(snd_pcm_hw_params); +- print_struct_member(snd_pcm_hw_params, flags, "unsigned_int"); +- print_struct_member(snd_pcm_hw_params, masks, "[SNDRV_PCM_HW_PARAM_LAST_MASK-SNDRV_PCM_HW_PARAM_FIRST_MASK+1]snd_mask"); +- print_struct_member(snd_pcm_hw_params, mres, "[5]snd_mask"); +- print_struct_member(snd_pcm_hw_params, intervals, "[SNDRV_PCM_HW_PARAM_LAST_INTERVAL-SNDRV_PCM_HW_PARAM_FIRST_INTERVAL+1]snd_interval"); +- print_struct_member(snd_pcm_hw_params, ires, "[9]snd_interval"); +- print_struct_member(snd_pcm_hw_params, rmask, "unsigned_int"); +- print_struct_member(snd_pcm_hw_params, cmask, "unsigned_int"); +- print_struct_member(snd_pcm_hw_params, info, "unsigned_int"); +- print_struct_member(snd_pcm_hw_params, msbits, "unsigned_int"); +- print_struct_member(snd_pcm_hw_params, rate_num, "unsigned_int"); +- print_struct_member(snd_pcm_hw_params, rate_den, "unsigned_int"); +- print_struct_member(snd_pcm_hw_params, fifo_size, "snd_pcm_uframes_t"); +- print_struct_member(snd_pcm_hw_params, reserved, "[64]unsigned_char"); +- print_line("}\n"); +- +- print_struct_header(snd_pcm_sw_params); +- print_struct_member(snd_pcm_sw_params, tstamp_mode, "signed_int"); +- print_struct_member(snd_pcm_sw_params, period_step, "unsigned_int"); +- print_struct_member(snd_pcm_sw_params, sleep_min, "unsigned_int"); +- print_struct_member(snd_pcm_sw_params, avail_min, "snd_pcm_uframes_t"); +- print_struct_member(snd_pcm_sw_params, xfer_align, "snd_pcm_uframes_t"); +- print_struct_member(snd_pcm_sw_params, start_threshold, "snd_pcm_uframes_t"); +- print_struct_member(snd_pcm_sw_params, stop_threshold, "snd_pcm_uframes_t"); +- print_struct_member(snd_pcm_sw_params, silence_threshold, "snd_pcm_uframes_t"); +- print_struct_member(snd_pcm_sw_params, silence_size, "snd_pcm_uframes_t"); +- print_struct_member(snd_pcm_sw_params, boundary, "snd_pcm_uframes_t"); +- print_struct_member(snd_pcm_sw_params, proto, "unsigned_int"); +- print_struct_member(snd_pcm_sw_params, tstamp_type, "unsigned_int"); +- print_struct_member(snd_pcm_sw_params, reserved, "[56]unsigned_char"); +- print_line("}\n"); +- +- return 0; +-} +\ No newline at end of file diff --git a/multimedia/go2rtc/patches/0003-add-riscv64-platform-for-v4l2-package.patch b/multimedia/go2rtc/patches/0003-add-riscv64-platform-for-v4l2-package.patch deleted file mode 100644 index ea783d854c..0000000000 --- a/multimedia/go2rtc/patches/0003-add-riscv64-platform-for-v4l2-package.patch +++ /dev/null @@ -1,162 +0,0 @@ -From f83445984f2865d219095288c8dde548bd2020ed Mon Sep 17 00:00:00 2001 -From: nakata5321 -Date: Thu, 13 Mar 2025 15:13:50 +0200 -Subject: [PATCH 3/6] add riscv64 platform for v4l2 package - -PR: https://github.com/AlexxIT/go2rtc/pull/1651 ---- - pkg/v4l2/device/videodev2_riscv64.go | 148 +++++++++++++++++++++++++++ - 1 file changed, 148 insertions(+) - create mode 100644 pkg/v4l2/device/videodev2_riscv64.go - ---- /dev/null -+++ b/pkg/v4l2/device/videodev2_riscv64.go -@@ -0,0 +1,148 @@ -+const ( -+ VIDIOC_QUERYCAP = 0x80685600 -+ VIDIOC_ENUM_FMT = 0xc0405602 -+ VIDIOC_G_FMT = 0xc0d05604 -+ VIDIOC_S_FMT = 0xc0d05605 -+ VIDIOC_REQBUFS = 0xc0145608 -+ VIDIOC_QUERYBUF = 0xc0585609 -+ -+ VIDIOC_QBUF = 0xc058560f -+ VIDIOC_DQBUF = 0xc0585611 -+ VIDIOC_STREAMON = 0x40045612 -+ VIDIOC_STREAMOFF = 0x40045613 -+ VIDIOC_G_PARM = 0xc0cc5615 -+ VIDIOC_S_PARM = 0xc0cc5616 -+ -+ VIDIOC_ENUM_FRAMESIZES = 0xc02c564a -+ VIDIOC_ENUM_FRAMEINTERVALS = 0xc034564b -+) -+ -+const ( -+ V4L2_BUF_TYPE_VIDEO_CAPTURE = 1 -+ V4L2_COLORSPACE_DEFAULT = 0 -+ V4L2_FIELD_NONE = 1 -+ V4L2_FRMIVAL_TYPE_DISCRETE = 1 -+ V4L2_FRMSIZE_TYPE_DISCRETE = 1 -+ V4L2_MEMORY_MMAP = 1 -+) -+ -+type v4l2_capability struct { // size 104 -+ driver [16]byte // offset 0, size 16 -+ card [32]byte // offset 16, size 32 -+ bus_info [32]byte // offset 48, size 32 -+ version uint32 // offset 80, size 4 -+ capabilities uint32 // offset 84, size 4 -+ device_caps uint32 // offset 88, size 4 -+ reserved [3]uint32 // offset 92, size 12 -+} -+ -+type v4l2_format struct { // size 208 -+ typ uint32 // offset 0, size 4 -+ _ [4]byte // align -+ pix v4l2_pix_format // offset 8, size 48 -+ _ [152]byte // filler -+} -+ -+type v4l2_pix_format struct { // size 48 -+ width uint32 // offset 0, size 4 -+ height uint32 // offset 4, size 4 -+ pixelformat uint32 // offset 8, size 4 -+ field uint32 // offset 12, size 4 -+ bytesperline uint32 // offset 16, size 4 -+ sizeimage uint32 // offset 20, size 4 -+ colorspace uint32 // offset 24, size 4 -+ priv uint32 // offset 28, size 4 -+ flags uint32 // offset 32, size 4 -+ ycbcr_enc uint32 // offset 36, size 4 -+ quantization uint32 // offset 40, size 4 -+ xfer_func uint32 // offset 44, size 4 -+} -+ -+type v4l2_streamparm struct { // size 204 -+ typ uint32 // offset 0, size 4 -+ capture v4l2_captureparm // offset 4, size 40 -+ _ [160]byte // filler -+} -+ -+type v4l2_captureparm struct { // size 40 -+ capability uint32 // offset 0, size 4 -+ capturemode uint32 // offset 4, size 4 -+ timeperframe v4l2_fract // offset 8, size 8 -+ extendedmode uint32 // offset 16, size 4 -+ readbuffers uint32 // offset 20, size 4 -+ reserved [4]uint32 // offset 24, size 16 -+} -+ -+type v4l2_fract struct { // size 8 -+ numerator uint32 // offset 0, size 4 -+ denominator uint32 // offset 4, size 4 -+} -+ -+type v4l2_requestbuffers struct { // size 20 -+ count uint32 // offset 0, size 4 -+ typ uint32 // offset 4, size 4 -+ memory uint32 // offset 8, size 4 -+ capabilities uint32 // offset 12, size 4 -+ flags uint8 // offset 16, size 1 -+ reserved [3]uint8 // offset 17, size 3 -+} -+ -+type v4l2_buffer struct { // size 88 -+ index uint32 // offset 0, size 4 -+ typ uint32 // offset 4, size 4 -+ bytesused uint32 // offset 8, size 4 -+ flags uint32 // offset 12, size 4 -+ field uint32 // offset 16, size 4 -+ _ [20]byte // align -+ timecode v4l2_timecode // offset 40, size 16 -+ sequence uint32 // offset 56, size 4 -+ memory uint32 // offset 60, size 4 -+ offset uint32 // offset 64, size 4 -+ _ [4]byte // align -+ length uint32 // offset 72, size 4 -+ _ [12]byte // filler -+} -+ -+type v4l2_timecode struct { // size 16 -+ typ uint32 // offset 0, size 4 -+ flags uint32 // offset 4, size 4 -+ frames uint8 // offset 8, size 1 -+ seconds uint8 // offset 9, size 1 -+ minutes uint8 // offset 10, size 1 -+ hours uint8 // offset 11, size 1 -+ userbits [4]uint8 // offset 12, size 4 -+} -+ -+type v4l2_fmtdesc struct { // size 64 -+ index uint32 // offset 0, size 4 -+ typ uint32 // offset 4, size 4 -+ flags uint32 // offset 8, size 4 -+ description [32]byte // offset 12, size 32 -+ pixelformat uint32 // offset 44, size 4 -+ mbus_code uint32 // offset 48, size 4 -+ reserved [3]uint32 // offset 52, size 12 -+} -+ -+type v4l2_frmsizeenum struct { // size 44 -+ index uint32 // offset 0, size 4 -+ pixel_format uint32 // offset 4, size 4 -+ typ uint32 // offset 8, size 4 -+ discrete v4l2_frmsize_discrete // offset 12, size 8 -+ _ [24]byte // filler -+} -+ -+type v4l2_frmsize_discrete struct { // size 8 -+ width uint32 // offset 0, size 4 -+ height uint32 // offset 4, size 4 -+} -+ -+type v4l2_frmivalenum struct { // size 52 -+ index uint32 // offset 0, size 4 -+ pixel_format uint32 // offset 4, size 4 -+ width uint32 // offset 8, size 4 -+ height uint32 // offset 12, size 4 -+ typ uint32 // offset 16, size 4 -+ discrete v4l2_fract // offset 20, size 8 -+ _ [24]byte // filler -+} -+ diff --git a/multimedia/go2rtc/patches/0004-v4l2-eanble-risc-v-64-support.patch b/multimedia/go2rtc/patches/0004-v4l2-eanble-risc-v-64-support.patch deleted file mode 100644 index 88811a01bb..0000000000 --- a/multimedia/go2rtc/patches/0004-v4l2-eanble-risc-v-64-support.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 0343f6378994b9c45f851847062f1a1fef1bee92 Mon Sep 17 00:00:00 2001 -From: Vladimir Ermakov -Date: Sun, 1 Jun 2025 18:24:41 +0200 -Subject: [PATCH 4/6] v4l2: eanble risc-v 64 support - -Signed-off-by: Vladimir Ermakov ---- - internal/v4l2/v4l2.go | 2 +- - internal/v4l2/v4l2_linux.go | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - ---- a/internal/v4l2/v4l2.go -+++ b/internal/v4l2/v4l2.go -@@ -1,4 +1,4 @@ --//go:build !(linux && (386 || arm || mipsle || amd64 || arm64)) -+//go:build !(linux && (386 || arm || mipsle || amd64 || arm64 || riscv64)) - - package v4l2 - ---- a/internal/v4l2/v4l2_linux.go -+++ b/internal/v4l2/v4l2_linux.go -@@ -1,4 +1,4 @@ --//go:build linux && (386 || arm || mipsle || amd64 || arm64) -+//go:build linux && (386 || arm || mipsle || amd64 || arm64 || riscv64) - - package v4l2 - diff --git a/multimedia/go2rtc/patches/0005-v4l2-fix-riscv64-build-and-go-fmt.patch b/multimedia/go2rtc/patches/0005-v4l2-fix-riscv64-build-and-go-fmt.patch deleted file mode 100644 index ce6ee5ab27..0000000000 --- a/multimedia/go2rtc/patches/0005-v4l2-fix-riscv64-build-and-go-fmt.patch +++ /dev/null @@ -1,250 +0,0 @@ -From 92640089b2fcc233e3d5b12283e019a40762afbd Mon Sep 17 00:00:00 2001 -From: Vladimir Ermakov -Date: Sun, 1 Jun 2025 18:52:17 +0200 -Subject: [PATCH 5/6] v4l2: fix riscv64 build and go-fmt - -Signed-off-by: Vladimir Ermakov ---- - pkg/v4l2/device/videodev2_riscv64.go | 177 ++++++++++++++------------- - 1 file changed, 89 insertions(+), 88 deletions(-) - ---- a/pkg/v4l2/device/videodev2_riscv64.go -+++ b/pkg/v4l2/device/videodev2_riscv64.go -@@ -1,148 +1,149 @@ -+package device -+ - const ( - VIDIOC_QUERYCAP = 0x80685600 - VIDIOC_ENUM_FMT = 0xc0405602 -- VIDIOC_G_FMT = 0xc0d05604 -- VIDIOC_S_FMT = 0xc0d05605 -- VIDIOC_REQBUFS = 0xc0145608 -+ VIDIOC_G_FMT = 0xc0d05604 -+ VIDIOC_S_FMT = 0xc0d05605 -+ VIDIOC_REQBUFS = 0xc0145608 - VIDIOC_QUERYBUF = 0xc0585609 - -- VIDIOC_QBUF = 0xc058560f -- VIDIOC_DQBUF = 0xc0585611 -- VIDIOC_STREAMON = 0x40045612 -+ VIDIOC_QBUF = 0xc058560f -+ VIDIOC_DQBUF = 0xc0585611 -+ VIDIOC_STREAMON = 0x40045612 - VIDIOC_STREAMOFF = 0x40045613 -- VIDIOC_G_PARM = 0xc0cc5615 -- VIDIOC_S_PARM = 0xc0cc5616 -+ VIDIOC_G_PARM = 0xc0cc5615 -+ VIDIOC_S_PARM = 0xc0cc5616 - -- VIDIOC_ENUM_FRAMESIZES = 0xc02c564a -+ VIDIOC_ENUM_FRAMESIZES = 0xc02c564a - VIDIOC_ENUM_FRAMEINTERVALS = 0xc034564b - ) - - const ( - V4L2_BUF_TYPE_VIDEO_CAPTURE = 1 -- V4L2_COLORSPACE_DEFAULT = 0 -- V4L2_FIELD_NONE = 1 -- V4L2_FRMIVAL_TYPE_DISCRETE = 1 -- V4L2_FRMSIZE_TYPE_DISCRETE = 1 -- V4L2_MEMORY_MMAP = 1 -+ V4L2_COLORSPACE_DEFAULT = 0 -+ V4L2_FIELD_NONE = 1 -+ V4L2_FRMIVAL_TYPE_DISCRETE = 1 -+ V4L2_FRMSIZE_TYPE_DISCRETE = 1 -+ V4L2_MEMORY_MMAP = 1 - ) - - type v4l2_capability struct { // size 104 -- driver [16]byte // offset 0, size 16 -- card [32]byte // offset 16, size 32 -- bus_info [32]byte // offset 48, size 32 -- version uint32 // offset 80, size 4 -- capabilities uint32 // offset 84, size 4 -- device_caps uint32 // offset 88, size 4 -- reserved [3]uint32 // offset 92, size 12 -+ driver [16]byte // offset 0, size 16 -+ card [32]byte // offset 16, size 32 -+ bus_info [32]byte // offset 48, size 32 -+ version uint32 // offset 80, size 4 -+ capabilities uint32 // offset 84, size 4 -+ device_caps uint32 // offset 88, size 4 -+ reserved [3]uint32 // offset 92, size 12 - } - - type v4l2_format struct { // size 208 -- typ uint32 // offset 0, size 4 -- _ [4]byte // align -+ typ uint32 // offset 0, size 4 -+ _ [4]byte // align - pix v4l2_pix_format // offset 8, size 48 -- _ [152]byte // filler -+ _ [152]byte // filler - } - - type v4l2_pix_format struct { // size 48 -- width uint32 // offset 0, size 4 -- height uint32 // offset 4, size 4 -- pixelformat uint32 // offset 8, size 4 -- field uint32 // offset 12, size 4 -+ width uint32 // offset 0, size 4 -+ height uint32 // offset 4, size 4 -+ pixelformat uint32 // offset 8, size 4 -+ field uint32 // offset 12, size 4 - bytesperline uint32 // offset 16, size 4 -- sizeimage uint32 // offset 20, size 4 -- colorspace uint32 // offset 24, size 4 -- priv uint32 // offset 28, size 4 -- flags uint32 // offset 32, size 4 -- ycbcr_enc uint32 // offset 36, size 4 -+ sizeimage uint32 // offset 20, size 4 -+ colorspace uint32 // offset 24, size 4 -+ priv uint32 // offset 28, size 4 -+ flags uint32 // offset 32, size 4 -+ ycbcr_enc uint32 // offset 36, size 4 - quantization uint32 // offset 40, size 4 -- xfer_func uint32 // offset 44, size 4 -+ xfer_func uint32 // offset 44, size 4 - } - - type v4l2_streamparm struct { // size 204 -- typ uint32 // offset 0, size 4 -+ typ uint32 // offset 0, size 4 - capture v4l2_captureparm // offset 4, size 40 -- _ [160]byte // filler -+ _ [160]byte // filler - } - - type v4l2_captureparm struct { // size 40 -- capability uint32 // offset 0, size 4 -- capturemode uint32 // offset 4, size 4 -+ capability uint32 // offset 0, size 4 -+ capturemode uint32 // offset 4, size 4 - timeperframe v4l2_fract // offset 8, size 8 -- extendedmode uint32 // offset 16, size 4 -- readbuffers uint32 // offset 20, size 4 -- reserved [4]uint32 // offset 24, size 16 -+ extendedmode uint32 // offset 16, size 4 -+ readbuffers uint32 // offset 20, size 4 -+ reserved [4]uint32 // offset 24, size 16 - } - - type v4l2_fract struct { // size 8 -- numerator uint32 // offset 0, size 4 -+ numerator uint32 // offset 0, size 4 - denominator uint32 // offset 4, size 4 - } - - type v4l2_requestbuffers struct { // size 20 -- count uint32 // offset 0, size 4 -- typ uint32 // offset 4, size 4 -- memory uint32 // offset 8, size 4 -- capabilities uint32 // offset 12, size 4 -- flags uint8 // offset 16, size 1 -- reserved [3]uint8 // offset 17, size 3 -+ count uint32 // offset 0, size 4 -+ typ uint32 // offset 4, size 4 -+ memory uint32 // offset 8, size 4 -+ capabilities uint32 // offset 12, size 4 -+ flags uint8 // offset 16, size 1 -+ reserved [3]uint8 // offset 17, size 3 - } - - type v4l2_buffer struct { // size 88 -- index uint32 // offset 0, size 4 -- typ uint32 // offset 4, size 4 -- bytesused uint32 // offset 8, size 4 -- flags uint32 // offset 12, size 4 -- field uint32 // offset 16, size 4 -- _ [20]byte // align -- timecode v4l2_timecode // offset 40, size 16 -- sequence uint32 // offset 56, size 4 -- memory uint32 // offset 60, size 4 -- offset uint32 // offset 64, size 4 -- _ [4]byte // align -- length uint32 // offset 72, size 4 -- _ [12]byte // filler -+ index uint32 // offset 0, size 4 -+ typ uint32 // offset 4, size 4 -+ bytesused uint32 // offset 8, size 4 -+ flags uint32 // offset 12, size 4 -+ field uint32 // offset 16, size 4 -+ _ [20]byte // align -+ timecode v4l2_timecode // offset 40, size 16 -+ sequence uint32 // offset 56, size 4 -+ memory uint32 // offset 60, size 4 -+ offset uint32 // offset 64, size 4 -+ _ [4]byte // align -+ length uint32 // offset 72, size 4 -+ _ [12]byte // filler - } - - type v4l2_timecode struct { // size 16 -- typ uint32 // offset 0, size 4 -- flags uint32 // offset 4, size 4 -- frames uint8 // offset 8, size 1 -- seconds uint8 // offset 9, size 1 -- minutes uint8 // offset 10, size 1 -- hours uint8 // offset 11, size 1 -+ typ uint32 // offset 0, size 4 -+ flags uint32 // offset 4, size 4 -+ frames uint8 // offset 8, size 1 -+ seconds uint8 // offset 9, size 1 -+ minutes uint8 // offset 10, size 1 -+ hours uint8 // offset 11, size 1 - userbits [4]uint8 // offset 12, size 4 - } - - type v4l2_fmtdesc struct { // size 64 -- index uint32 // offset 0, size 4 -- typ uint32 // offset 4, size 4 -- flags uint32 // offset 8, size 4 -- description [32]byte // offset 12, size 32 -- pixelformat uint32 // offset 44, size 4 -- mbus_code uint32 // offset 48, size 4 -- reserved [3]uint32 // offset 52, size 12 -+ index uint32 // offset 0, size 4 -+ typ uint32 // offset 4, size 4 -+ flags uint32 // offset 8, size 4 -+ description [32]byte // offset 12, size 32 -+ pixelformat uint32 // offset 44, size 4 -+ mbus_code uint32 // offset 48, size 4 -+ reserved [3]uint32 // offset 52, size 12 - } - - type v4l2_frmsizeenum struct { // size 44 -- index uint32 // offset 0, size 4 -- pixel_format uint32 // offset 4, size 4 -- typ uint32 // offset 8, size 4 -- discrete v4l2_frmsize_discrete // offset 12, size 8 -- _ [24]byte // filler -+ index uint32 // offset 0, size 4 -+ pixel_format uint32 // offset 4, size 4 -+ typ uint32 // offset 8, size 4 -+ discrete v4l2_frmsize_discrete // offset 12, size 8 -+ _ [24]byte // filler - } - - type v4l2_frmsize_discrete struct { // size 8 -- width uint32 // offset 0, size 4 -+ width uint32 // offset 0, size 4 - height uint32 // offset 4, size 4 - } - - type v4l2_frmivalenum struct { // size 52 -- index uint32 // offset 0, size 4 -- pixel_format uint32 // offset 4, size 4 -- width uint32 // offset 8, size 4 -- height uint32 // offset 12, size 4 -- typ uint32 // offset 16, size 4 -- discrete v4l2_fract // offset 20, size 8 -- _ [24]byte // filler -+ index uint32 // offset 0, size 4 -+ pixel_format uint32 // offset 4, size 4 -+ width uint32 // offset 8, size 4 -+ height uint32 // offset 12, size 4 -+ typ uint32 // offset 16, size 4 -+ discrete v4l2_fract // offset 20, size 8 -+ _ [24]byte // filler - } -- diff --git a/multimedia/go2rtc/patches/0006-v4l2-fix-compile-on-unsupported-arch-mips.patch b/multimedia/go2rtc/patches/0006-v4l2-fix-compile-on-unsupported-arch-mips.patch deleted file mode 100644 index 5387e8136d..0000000000 --- a/multimedia/go2rtc/patches/0006-v4l2-fix-compile-on-unsupported-arch-mips.patch +++ /dev/null @@ -1,27 +0,0 @@ -From bb9f4b303a982089cafaaa5e4080d82160df8a6c Mon Sep 17 00:00:00 2001 -From: Vladimir Ermakov -Date: Sun, 1 Jun 2025 20:23:29 +0200 -Subject: [PATCH 6/6] v4l2: fix compile on unsupported arch (mips) - -Signed-off-by: Vladimir Ermakov ---- - pkg/v4l2/device/device.go | 2 +- - pkg/v4l2/producer.go | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - ---- a/pkg/v4l2/device/device.go -+++ b/pkg/v4l2/device/device.go -@@ -1,4 +1,4 @@ --//go:build linux -+//go:build linux && (386 || arm || mipsle || amd64 || arm64 || riscv64) - - package device - ---- a/pkg/v4l2/producer.go -+++ b/pkg/v4l2/producer.go -@@ -1,4 +1,4 @@ --//go:build linux -+//go:build linux && (386 || arm || mipsle || amd64 || arm64 || riscv64) - - package v4l2 -