[packages/ustreamer] up to 5.48

atler atler at pld-linux.org
Wed Jan 17 14:34:01 CET 2024


commit 9f34520b009d4d3437ada48b1c6e4fe039a6d3a4
Author: Jan Palus <atler at pld-linux.org>
Date:   Wed Jan 17 13:44:46 2024 +0100

    up to 5.48

 libgpiod2.patch     | 155 ----------------------------------------------------
 ustreamer.spec      |  10 +---
 verbose_build.patch | 111 -------------------------------------
 3 files changed, 3 insertions(+), 273 deletions(-)
---
diff --git a/ustreamer.spec b/ustreamer.spec
index d174761..d213a2f 100644
--- a/ustreamer.spec
+++ b/ustreamer.spec
@@ -5,15 +5,13 @@
 Summary:	Lightweight and fast MJPEG-HTTP streamer
 Summary(pl.UTF-8):	Lekki i szybki program do emisji strumieni MJPEG-HTTP
 Name:		ustreamer
-Version:	5.46
-Release:	2
+Version:	5.48
+Release:	1
 License:	GPL v3
 Group:		Applications/Multimedia
 #Source0Download: https://github.com/pikvm/ustreamer/tags
 Source0:	https://github.com/pikvm/ustreamer/archive/v%{version}/%{name}-%{version}.tar.gz
-# Source0-md5:	069c99f597d1b0dc72740b668baaaff6
-Patch0:		verbose_build.patch
-Patch1:		libgpiod2.patch
+# Source0-md5:	417816c8e6142c7860a2feccc50126e6
 URL:		https://github.com/pikvm/ustreamer
 BuildRequires:	libbsd-devel
 BuildRequires:	libevent-devel
@@ -36,8 +34,6 @@ dowolnego urządzenia V4L2 do sieci.
 
 %prep
 %setup -q
-%patch0 -p1
-%patch1 -p1
 
 %build
 %{__make} \
diff --git a/libgpiod2.patch b/libgpiod2.patch
deleted file mode 100644
index 3aafb5c..0000000
--- a/libgpiod2.patch
+++ /dev/null
@@ -1,155 +0,0 @@
-From 605ece2ecad42e81008219a12cf2dd50bd35f3e0 Mon Sep 17 00:00:00 2001
-From: Jan Palus <jpalus at fastmail.com>
-Date: Mon, 1 Jan 2024 18:20:37 +0100
-Subject: [PATCH] gpio: add support for libgpiod 2.x
-
----
- src/Makefile              |   2 +-
- src/ustreamer/gpio/gpio.c | 100 ++++++++++++++++++++++++++++++++++++++
- src/ustreamer/gpio/gpio.h |   4 ++
- 3 files changed, 105 insertions(+), 1 deletion(-)
-
-diff --git a/src/Makefile b/src/Makefile
-index ac5897a7..76e8fa73 100644
---- a/src/Makefile
-+++ b/src/Makefile
-@@ -42,7 +42,7 @@ endef
- 
- ifneq ($(call optbool,$(WITH_GPIO)),)
- _USTR_LIBS += -lgpiod
--override _CFLAGS += -DWITH_GPIO
-+override _CFLAGS += -DWITH_GPIO $(shell pkg-config --atleast-version=2 libgpiod 2> /dev/null && echo -DHAVE_GPIOD2)
- _USTR_SRCS += $(shell ls ustreamer/gpio/*.c)
- endif
- 
-diff --git a/src/ustreamer/gpio/gpio.c b/src/ustreamer/gpio/gpio.c
-index cea40dc4..7c608517 100644
---- a/src/ustreamer/gpio/gpio.c
-+++ b/src/ustreamer/gpio/gpio.c
-@@ -80,6 +80,105 @@ void us_gpio_destroy(void) {
- 	}
- }
- 
-+#ifdef HAVE_GPIOD2
-+int us_gpio_inner_set(us_gpio_output_s *output, bool state) {
-+	int retval = 0;
-+
-+	assert(us_g_gpio.chip != NULL);
-+	assert(output->line != NULL);
-+	assert(output->state != state); // Must be checked in macro for the performance
-+	US_MUTEX_LOCK(us_g_gpio.mutex);
-+
-+	if (gpiod_line_request_set_value(output->line, output->pin, state ? GPIOD_LINE_VALUE_ACTIVE : GPIOD_LINE_VALUE_INACTIVE) < 0) {
-+		US_LOG_PERROR("GPIO: Can't write value %d to line %s (will be disabled)", state ? GPIOD_LINE_VALUE_ACTIVE : GPIOD_LINE_VALUE_INACTIVE, output->consumer);
-+		_gpio_output_destroy(output);
-+		retval = -1;
-+	}
-+
-+	US_MUTEX_UNLOCK(us_g_gpio.mutex);
-+	return retval;
-+}
-+
-+static void _gpio_output_init(us_gpio_output_s *output) {
-+	struct gpiod_line_settings *line_settings = NULL;
-+	struct gpiod_line_config *line_config = NULL;
-+	struct gpiod_request_config *request_config = NULL;
-+
-+	assert(us_g_gpio.chip != NULL);
-+	assert(output->line == NULL);
-+
-+	US_ASPRINTF(output->consumer, "%s::%s", us_g_gpio.consumer_prefix, output->role);
-+
-+	if (output->pin >= 0) {
-+		line_settings = gpiod_line_settings_new();
-+		if (line_settings == NULL) {
-+			US_LOG_PERROR("GPIO: Can't allocate line settings for pin=%d", output->pin);
-+			goto output_destroy;
-+		}
-+
-+		if (gpiod_line_settings_set_direction(line_settings, GPIOD_LINE_DIRECTION_OUTPUT) < 0) {
-+			US_LOG_PERROR("GPIO: Can't set direction for pin=%d", output->pin);
-+			goto free_settings;
-+
-+		}
-+
-+		if (gpiod_line_settings_set_output_value(line_settings, GPIOD_LINE_VALUE_INACTIVE) < 0) {
-+			US_LOG_PERROR("GPIO: Can't set initial line value for pin=%d", output->pin);
-+			goto free_settings;
-+		}
-+
-+		line_config = gpiod_line_config_new();
-+		if (line_config == NULL) {
-+			US_LOG_PERROR("GPIO: Can't allocate line config for pin=%d", output->pin);
-+			goto free_settings;
-+		}
-+
-+		if (gpiod_line_config_add_line_settings(line_config, (const unsigned int *) &output->pin, 1, line_settings) < 0) {
-+			US_LOG_PERROR("GPIO: Can't set initial line value for pin=%d", output->pin);
-+			goto free_settings;
-+		}
-+
-+		if (output->consumer != NULL) {
-+			request_config = gpiod_request_config_new();
-+			if (request_config == NULL) {
-+				US_LOG_PERROR("GPIO: Can't allocate request config for pin=%d", output->pin);
-+				goto free_settings;
-+			}
-+
-+			gpiod_request_config_set_consumer(request_config, output->consumer);
-+		}
-+
-+		if ((output->line = gpiod_chip_request_lines(us_g_gpio.chip, request_config, line_config)) == NULL) {
-+			US_LOG_PERROR("GPIO: Can't request pin=%d as %s", output->pin, output->consumer);
-+			goto free_config;
-+		}
-+	}
-+
-+free_config:
-+	if (request_config != NULL) {
-+		gpiod_request_config_free(request_config);
-+	}
-+	gpiod_line_config_free(line_config);
-+free_settings:
-+	gpiod_line_settings_free(line_settings);
-+output_destroy:
-+	if (output->line == NULL) {
-+		_gpio_output_destroy(output);
-+	}
-+}
-+
-+static void _gpio_output_destroy(us_gpio_output_s *output) {
-+	if (output->line != NULL) {
-+		gpiod_line_request_release(output->line);
-+		output->line = NULL;
-+	}
-+	if (output->consumer != NULL) {
-+		free(output->consumer);
-+		output->consumer = NULL;
-+	}
-+	output->state = false;
-+}
-+#else
- int us_gpio_inner_set(us_gpio_output_s *output, bool state) {
- 	int retval = 0;
- 
-@@ -127,3 +226,4 @@ static void _gpio_output_destroy(us_gpio_output_s *output) {
- 	}
- 	output->state = false;
- }
-+#endif
-diff --git a/src/ustreamer/gpio/gpio.h b/src/ustreamer/gpio/gpio.h
-index 8bb86488..17a7e8f0 100644
---- a/src/ustreamer/gpio/gpio.h
-+++ b/src/ustreamer/gpio/gpio.h
-@@ -39,7 +39,11 @@ typedef struct {
- 	int					pin;
- 	const char			*role;
- 	char 				*consumer;
-+#ifdef HAVE_GPIOD2
-+	struct gpiod_line_request	*line;
-+#else
- 	struct gpiod_line	*line;
-+#endif
- 	bool				state;
- } us_gpio_output_s;
- 
diff --git a/verbose_build.patch b/verbose_build.patch
deleted file mode 100644
index 2191fe4..0000000
--- a/verbose_build.patch
+++ /dev/null
@@ -1,111 +0,0 @@
-From 6672cd87bfc51aa301da72a6303d9023fe75a566 Mon Sep 17 00:00:00 2001
-From: Jan Palus <jpalus at fastmail.com>
-Date: Mon, 1 Jan 2024 19:14:09 +0100
-Subject: [PATCH] add option to make verbose builds
-
-if V=1 is passed to make echo invoked command verbosely
----
- Makefile        | 11 +++++++----
- janus/Makefile  |  6 +++---
- python/Makefile |  2 +-
- src/Makefile    |  8 ++++----
- 4 files changed, 15 insertions(+), 12 deletions(-)
-
-diff --git a/Makefile b/Makefile
-index 9f3ea84c..8dab4c77 100644
---- a/Makefile
-+++ b/Makefile
-@@ -22,6 +22,9 @@ define optbool
- $(filter $(shell echo $(1) | tr A-Z a-z), yes on 1)
- endef
- 
-+ifeq ($(V),)
-+	ECHO = @
-+endif
- 
- # =====
- all:
-@@ -36,18 +39,18 @@ endif
- 
- apps:
- 	$(MAKE) -C src
--	@ ln -sf src/ustreamer.bin ustreamer
--	@ ln -sf src/ustreamer-dump.bin ustreamer-dump
-+	$(ECHO) ln -sf src/ustreamer.bin ustreamer
-+	$(ECHO) ln -sf src/ustreamer-dump.bin ustreamer-dump
- 
- 
- python:
- 	$(MAKE) -C python
--	@ ln -sf python/build/lib.*/*.so .
-+	$(ECHO) ln -sf python/build/lib.*/*.so .
- 
- 
- janus:
- 	$(MAKE) -C janus
--	@ ln -sf janus/*.so .
-+	$(ECHO) ln -sf janus/*.so .
- 
- 
- install: all
-diff --git a/janus/Makefile b/janus/Makefile
-index afbad3ee..90111830 100644
---- a/janus/Makefile
-+++ b/janus/Makefile
-@@ -31,13 +31,13 @@ endif
- # =====
- $(_PLUGIN): $(_SRCS:%.c=$(_BUILD)/%.o)
- 	$(info == SO $@)
--	@ $(CC) $^ -o $@ $(_LDFLAGS)
-+	$(ECHO) $(CC) $^ -o $@ $(_LDFLAGS)
- 
- 
- $(_BUILD)/%.o: %.c
- 	$(info -- CC $<)
--	@ mkdir -p $(dir $@) || true
--	@ $(CC) $< -o $@ $(_CFLAGS)
-+	$(ECHO) mkdir -p $(dir $@) || true
-+	$(ECHO) $(CC) $< -o $@ $(_CFLAGS)
- 
- 
- 
-diff --git a/python/Makefile b/python/Makefile
-index b9e723c0..a8b60d54 100644
---- a/python/Makefile
-+++ b/python/Makefile
-@@ -9,7 +9,7 @@ PY ?= python3
- # =====
- all:
- 	$(info == PY_BUILD ustreamer-*.so)
--	@ $(PY) setup.py build
-+	$(ECHO) $(PY) setup.py build
- 
- 
- install:
-diff --git a/src/Makefile b/src/Makefile
-index ac5897a7..a56ae9d4 100644
---- a/src/Makefile
-+++ b/src/Makefile
-@@ -86,18 +86,18 @@ install-strip: install
- 
- $(_USTR): $(_USTR_SRCS:%.c=$(_BUILD)/%.o)
- 	$(info == LD $@)
--	@ $(CC) $^ -o $@ $(_LDFLAGS) $(_USTR_LIBS)
-+	$(ECHO) $(CC) $^ -o $@ $(_LDFLAGS) $(_USTR_LIBS)
- 
- 
- $(_DUMP): $(_DUMP_SRCS:%.c=$(_BUILD)/%.o)
- 	$(info == LD $@)
--	@ $(CC) $^ -o $@ $(_LDFLAGS) $(_DUMP_LIBS)
-+	$(ECHO) $(CC) $^ -o $@ $(_LDFLAGS) $(_DUMP_LIBS)
- 
- 
- $(_BUILD)/%.o: %.c
- 	$(info -- CC $<)
--	@ mkdir -p $(dir $@) || true
--	@ $(CC) $< -o $@ $(_CFLAGS)
-+	$(ECHO) mkdir -p $(dir $@) || true
-+	$(ECHO) $(CC) $< -o $@ $(_CFLAGS)
- 
- 
- clean:
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/ustreamer.git/commitdiff/9f34520b009d4d3437ada48b1c6e4fe039a6d3a4



More information about the pld-cvs-commit mailing list