From eda7957a449fd6db24e17557fc4425eed1fcd1f2 Mon Sep 17 00:00:00 2001 From: bluenviron-bot <214245907+bluenviron-bot@users.noreply.github.com> Date: Mon, 18 May 2026 22:27:17 +0200 Subject: [PATCH] bump mediamtx-rpicamera to v2.6.0 (#5780) --- .../staticsources/rpicamera/camera_arm_.go | 40 ++++--------------- .../HASH_MTXRPICAM_32_TAR_GZ | 2 +- .../HASH_MTXRPICAM_64_TAR_GZ | 2 +- .../rpicamera/mtxrpicamdownloader/VERSION | 2 +- 4 files changed, 11 insertions(+), 35 deletions(-) diff --git a/internal/staticsources/rpicamera/camera_arm_.go b/internal/staticsources/rpicamera/camera_arm_.go index 7c7b90a2..d0e86f24 100644 --- a/internal/staticsources/rpicamera/camera_arm_.go +++ b/internal/staticsources/rpicamera/camera_arm_.go @@ -14,7 +14,6 @@ import ( "sync" "syscall" "time" - "unsafe" "github.com/bluenviron/mediacommon/v2/pkg/codecs/h264" ) @@ -31,17 +30,6 @@ var ( dumpPath = "" ) -func ntpTime() syscall.Timespec { - var t syscall.Timespec - syscall.Syscall(syscall.SYS_CLOCK_GETTIME, 0, uintptr(unsafe.Pointer(&t)), 0) - return t -} - -func monotonicTime() syscall.Timespec { - var t syscall.Timespec - syscall.Syscall(syscall.SYS_CLOCK_GETTIME, 1, uintptr(unsafe.Pointer(&t)), 0) - return t -} func multiplyAndDivide(v, m, d int64) int64 { secs := v / d @@ -345,42 +333,30 @@ outer: case 'd': dts := int64(buf[8])<<56 | int64(buf[7])<<48 | int64(buf[6])<<40 | int64(buf[5])<<32 | int64(buf[4])<<24 | int64(buf[3])<<16 | int64(buf[2])<<8 | int64(buf[1]) + ntpUs := int64(buf[16])<<56 | int64(buf[15])<<48 | int64(buf[14])<<40 | int64(buf[13])<<32 | + int64(buf[12])<<24 | int64(buf[11])<<16 | int64(buf[10])<<8 | int64(buf[9]) var nalus h264.AnnexB - err = nalus.Unmarshal(buf[9:]) + err = nalus.Unmarshal(buf[17:]) if err != nil { return err } - unixNTP := ntpTime() - unixMono := monotonicTime() - - // subtract from NTP the delay from now to the moment the frame was taken - ntp := time.Unix(int64(unixNTP.Sec), int64(unixNTP.Nsec)) - deltaT := time.Duration(unixMono.Nano()-dts*1e3) * time.Nanosecond - ntp = ntp.Add(-deltaT) - c.onData( multiplyAndDivide(dts, 90000, 1e6), - ntp, + time.Unix(ntpUs/1e6, (ntpUs%1e6)*1000), nalus) case 's': dts := int64(buf[8])<<56 | int64(buf[7])<<48 | int64(buf[6])<<40 | int64(buf[5])<<32 | int64(buf[4])<<24 | int64(buf[3])<<16 | int64(buf[2])<<8 | int64(buf[1]) - - unixNTP := ntpTime() - unixMono := monotonicTime() - - // subtract from NTP the delay from now to the moment the frame was taken - ntp := time.Unix(int64(unixNTP.Sec), int64(unixNTP.Nsec)) - deltaT := time.Duration(unixMono.Nano()-dts*1e3) * time.Nanosecond - ntp = ntp.Add(-deltaT) + ntpUs := int64(buf[16])<<56 | int64(buf[15])<<48 | int64(buf[14])<<40 | int64(buf[13])<<32 | + int64(buf[12])<<24 | int64(buf[11])<<16 | int64(buf[10])<<8 | int64(buf[9]) c.onDataSecondary( multiplyAndDivide(dts, 90000, 1e6), - ntp, - buf[9:]) + time.Unix(ntpUs/1e6, (ntpUs%1e6)*1000), + buf[17:]) default: return fmt.Errorf("unexpected data from pipe: '0x%.2x'", buf[0]) diff --git a/internal/staticsources/rpicamera/mtxrpicamdownloader/HASH_MTXRPICAM_32_TAR_GZ b/internal/staticsources/rpicamera/mtxrpicamdownloader/HASH_MTXRPICAM_32_TAR_GZ index caa33e14..b3f3ee28 100644 --- a/internal/staticsources/rpicamera/mtxrpicamdownloader/HASH_MTXRPICAM_32_TAR_GZ +++ b/internal/staticsources/rpicamera/mtxrpicamdownloader/HASH_MTXRPICAM_32_TAR_GZ @@ -1 +1 @@ -ef57fc22e19efc17d86c279aa4ae9aa72b8fcc4ab8707fea363609c1e39ed62c +4d9f7785e225af4c84d54dc36a5e44fc255188e3a2db291ccf7fa3093adc549d diff --git a/internal/staticsources/rpicamera/mtxrpicamdownloader/HASH_MTXRPICAM_64_TAR_GZ b/internal/staticsources/rpicamera/mtxrpicamdownloader/HASH_MTXRPICAM_64_TAR_GZ index 159c8a25..da1080d7 100644 --- a/internal/staticsources/rpicamera/mtxrpicamdownloader/HASH_MTXRPICAM_64_TAR_GZ +++ b/internal/staticsources/rpicamera/mtxrpicamdownloader/HASH_MTXRPICAM_64_TAR_GZ @@ -1 +1 @@ -2a8c7232110e411176dbc0fe5af30b56226869753aa6147564b9ca7cf3bc784d +8448f91064c9d659aa28dd22141ab4b82918d5990a8c3939cebcb2013a58f346 diff --git a/internal/staticsources/rpicamera/mtxrpicamdownloader/VERSION b/internal/staticsources/rpicamera/mtxrpicamdownloader/VERSION index df4e0e61..8a965c11 100644 --- a/internal/staticsources/rpicamera/mtxrpicamdownloader/VERSION +++ b/internal/staticsources/rpicamera/mtxrpicamdownloader/VERSION @@ -1 +1 @@ -v2.5.7 +v2.6.0