Skip to content

Conversation

@ayufan
Copy link
Owner

@ayufan ayufan commented Jun 8, 2025

This does that by trying to parse value,
and then advancing pointer. It checks if the
string ends or is split by comma.

Replaces the #170.

@ayufan
Copy link
Owner Author

ayufan commented Jun 8, 2025

@arekm Can you check this? I have not yet tested it, but this is different take on options split to resolve array.

@ayufan ayufan force-pushed the parse-control-arrays branch 2 times, most recently from dd932c9 to 5ebc86f Compare June 8, 2025 17:41
This does that by trying to parse value,
and then advancing pointer. It checks if the
string ends or is split by comma.
@ayufan ayufan force-pushed the parse-control-arrays branch from 5ebc86f to a231d4d Compare June 8, 2025 17:43
@ayufan
Copy link
Owner Author

ayufan commented Jun 8, 2025

@arekm
Copy link
Contributor

arekm commented Jun 8, 2025

Looks like we need to assume 'not array' before isArray() was implemented:
raspberrypi/libcamera@ab67fdd
so for libcamera < 0.4.0

@ayufan
Copy link
Owner Author

ayufan commented Jun 8, 2025

@arekm Would you mind picking this PR into your changes and finishing them? :) Thank you!

@ayufan
Copy link
Owner Author

ayufan commented Jun 8, 2025

@arekm I pushed another commit to this PR.

To make it easier to test different variants (on amd64 or arm64) you can use:

  • .github/ci/build-env raspi bookworm arm64/v8 to get a docker shell in which you can compile

@arekm
Copy link
Contributor

arekm commented Jun 8, 2025

Maybe

0001-Don-t-use-isArray-on-older-libcamera-where-isArray-w.patch

docker doesn't work for me (sorry, rarely using docker)

arekm@voron24:~/test/1/camera-streamer$ .github/ci/build-env raspi bookworm arm64/v8
+ DOCKER_BUILDKIT=1
+ docker build -t camera_streamer_build_env_bookworm_arm64/v8 --build-arg DOCKER_ARCH=arm64/v8 --build-arg DEBIAN_VERSION=bookworm --build-arg BUILD_TYPE=raspi --target build_env -
[+] Building 1.2s (8/8) FINISHED                                                                                                                                                                                                        docker:default
 => [internal] load build definition from Dockerfile                                                                                                                                                                                              0.0s
 => => transferring dockerfile: 1.52kB                                                                                                                                                                                                            0.0s
 => WARN: FromAsCasing: 'as' and 'FROM' keywords' casing do not match (line 4)                                                                                                                                                                    0.0s
 => WARN: FromAsCasing: 'as' and 'FROM' keywords' casing do not match (line 24)                                                                                                                                                                   0.0s
 => WARN: FromAsCasing: 'as' and 'FROM' keywords' casing do not match (line 31)                                                                                                                                                                   0.0s
 => WARN: InvalidDefaultArgInFrom: Default value for ARG ${DOCKER_REPO}debian:${DEBIAN_VERSION} results in empty or invalid base image name (line 4)                                                                                              0.0s
 => [internal] load metadata for docker.io/library/debian:bookworm                                                                                                                                                                                1.0s
 => [internal] load .dockerignore                                                                                                                                                                                                                 0.0s
 => => transferring context: 2B                                                                                                                                                                                                                   0.0s
 => [build_env 1/4] FROM docker.io/library/debian:bookworm@sha256:bd73076dc2cd9c88f48b5b358328f24f2a4289811bd73787c031e20db9f97123                                                                                                                0.0s
 => CACHED [build_env 2/4] RUN apt-get -y update && apt-get -y install gnupg2                                                                                                                                                                     0.0s
 => CACHED [build_env 3/4] RUN [ "raspi" != "raspi" ] ||   (     ( [ "$(dpkg --print-architecture)" != "armhf" ] || echo "deb http://raspbian.raspberrypi.org/raspbian/ bookworm main contrib non-free rpi" > /etc/apt/sources.list ) &&     ech  0.0s
 => CACHED [build_env 4/4] RUN apt-get -y install build-essential xxd cmake ccache git-core pkg-config   libavformat-dev libavutil-dev libavcodec-dev libssl-dev v4l-utils debhelper                                                              0.0s
 => exporting to image                                                                                                                                                                                                                            0.0s
 => => exporting layers                                                                                                                                                                                                                           0.0s
 => => writing image sha256:003f798d4b16e10e80522fec3a5c9dbde1d8f945eaf9cdbe30d4e855bdf90f93                                                                                                                                                      0.0s
 => => naming to docker.io/camera_streamer_build_env_bookworm_arm64/v8                                                                                                                                                                            0.0s

 4 warnings found (use docker --debug to expand):
 - FromAsCasing: 'as' and 'FROM' keywords' casing do not match (line 4)
 - FromAsCasing: 'as' and 'FROM' keywords' casing do not match (line 24)
 - FromAsCasing: 'as' and 'FROM' keywords' casing do not match (line 31)
 - InvalidDefaultArgInFrom: Default value for ARG ${DOCKER_REPO}debian:${DEBIAN_VERSION} results in empty or invalid base image name (line 4)
+ exec docker run --rm -it -u 1000 -v /home/arekm/test/1/camera-streamer:/home/arekm/test/1/camera-streamer -w /home/arekm/test/1/camera-streamer camera_streamer_build_env_bookworm_arm64/v8
I have no name!@da4887274267:/home/arekm/test/1/camera-streamer$ make -j10
printf "#define GIT_VERSION \"v0.2.8-18-gcaf4206\"\n#define GIT_REVISION \"caf4206\"\n" > version.h.tmp
if ccache g++ -Werror -Wall -g -I/home/arekm/test/1/camera-streamer -D_GNU_SOURCE -Wno-error=deprecated-declarations -DUSE_HW_H264 -DUSE_FFMPEG -DUSE_LIBCAMERA -I/usr/include/libcamera  -DUSE_RTSP -I/usr/include/liveMedia -I/usr/include/groupsock -I/usr/include/BasicUsageEnvironment -I/usr/include/UsageEnvironment  -DUSE_LIBDATACHANNEL -Ithird_party/libdatachannel/include -Ithird_party/libdatachannel/deps/json/include -o tests/libcamera/orientation.o -c tests/libcamera/orientation.cc 2>/dev/null; then \
	printf "#define LIBCAMERA_USES_ORIENTATION\n" >> version.h.tmp; \
else \
	printf "#define LIBCAMERA_USES_TRANSFORM\n" >> version.h.tmp; \
fi
diff -u version.h version.h.tmp || mv version.h.tmp version.h
--- version.h	2025-06-08 20:30:34.672684005 +0000
+++ version.h.tmp	2025-06-08 20:39:23.239903717 +0000
@@ -1,3 +1,3 @@
-#define GIT_VERSION "v0.2.8-17-gbe2d4d7"
-#define GIT_REVISION "be2d4d7"
-#define LIBCAMERA_USES_ORIENTATION
+#define GIT_VERSION "v0.2.8-18-gcaf4206"
+#define GIT_REVISION "caf4206"
+#define LIBCAMERA_USES_TRANSFORM
rm -f version.h.tmp
make camera-streamer
make[1]: Entering directory '/home/arekm/test/1/camera-streamer'
ccache cc -std=gnu17 -MMD -Werror -Wall -g -I/home/arekm/test/1/camera-streamer -D_GNU_SOURCE -Wno-error=deprecated-declarations -DUSE_HW_H264 -DUSE_FFMPEG -DUSE_LIBCAMERA -I/usr/include/libcamera  -DUSE_RTSP -I/usr/include/liveMedia -I/usr/include/groupsock -I/usr/include/BasicUsageEnvironment -I/usr/include/UsageEnvironment  -DUSE_LIBDATACHANNEL -Ithird_party/libdatachannel/include -Ithird_party/libdatachannel/deps/json/include -c -o util/opts/opts.o util/opts/opts.c
ccache g++ -std=c++17 -MMD -Werror -Wall -g -I/home/arekm/test/1/camera-streamer -D_GNU_SOURCE -Wno-error=deprecated-declarations -DUSE_HW_H264 -DUSE_FFMPEG -DUSE_LIBCAMERA -I/usr/include/libcamera  -DUSE_RTSP -I/usr/include/liveMedia -I/usr/include/groupsock -I/usr/include/BasicUsageEnvironment -I/usr/include/UsageEnvironment  -DUSE_LIBDATACHANNEL -Ithird_party/libdatachannel/include -Ithird_party/libdatachannel/deps/json/include -c -o device/libcamera/buffer.o device/libcamera/buffer.cc
ccache: error: Failed to create directory //.cache/ccache/tmp: Permission denied
ccache g++ -std=c++17 -MMD -Werror -Wall -g -I/home/arekm/test/1/camera-streamer -D_GNU_SOURCE -Wno-error=deprecated-declarations -DUSE_HW_H264 -DUSE_FFMPEG -DUSE_LIBCAMERA -I/usr/include/libcamera  -DUSE_RTSP -I/usr/include/liveMedia -I/usr/include/groupsock -I/usr/include/BasicUsageEnvironment -I/usr/include/UsageEnvironment  -DUSE_LIBDATACHANNEL -Ithird_party/libdatachannel/include -Ithird_party/libdatachannel/deps/json/include -c -o device/libcamera/buffer_list.o device/libcamera/buffer_list.cc
make[1]: *** [Makefile:103: util/opts/opts.o] Error 1
make[1]: *** Waiting for unfinished jobs....
ccache: error: Failed to create directory //.cache/ccache/tmp: Permission denied
make[1]: *** [Makefile:106: device/libcamera/buffer.o] Error 1
ccache: error: Failed to create directory //.cache/ccache/tmp: Permission denied
make[1]: *** [Makefile:106: device/libcamera/buffer_list.o] Error 1
make[1]: Leaving directory '/home/arekm/test/1/camera-streamer'
make: *** [Makefile:67: all] Error 2
I have no name!@da4887274267:/home/arekm/test/1/camera-streamer$

@ayufan
Copy link
Owner Author

ayufan commented Jun 8, 2025

@arekm Pull latest commit from main, it fixes this problem.

@arekm arekm mentioned this pull request Jun 9, 2025
@arekm
Copy link
Contributor

arekm commented Jun 9, 2025

#176 should do the job (fixes bullseye and small bug in parsing rework)

@ayufan ayufan closed this Jul 2, 2025
@ayufan ayufan deleted the parse-control-arrays branch July 2, 2025 19:07
ayufan added a commit that referenced this pull request Jul 2, 2025
This does that by trying to parse value,
and then advancing pointer. It checks if the
string ends or is split by comma.

With collaboration from @arekm. Take a look at:

- #170
- #172
- #176
ayufan added a commit that referenced this pull request Jul 2, 2025
This does that by trying to parse value,
and then advancing pointer. It checks if the
string ends or is split by comma.

With collaboration from @arekm. Take a look at:

- #170
- #172
- #176
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants