Skip to content

Commit

Permalink
add prudynt package + thingino live 555
Browse files Browse the repository at this point in the history
  • Loading branch information
gtxaspec committed Mar 3, 2024
1 parent dd4f35f commit a7fdf7e
Show file tree
Hide file tree
Showing 9 changed files with 286 additions and 0 deletions.
2 changes: 2 additions & 0 deletions package/Config.in
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,5 @@ source "$BR2_EXTERNAL_THINGINO_PATH/package/vtund-openipc/Config.in"
source "$BR2_EXTERNAL_THINGINO_PATH/package/webui/Config.in"
source "$BR2_EXTERNAL_THINGINO_PATH/package/yaml-cli/Config.in"
source "$BR2_EXTERNAL_THINGINO_PATH/package/zerotier-one/Config.in"
source "$BR2_EXTERNAL_THINGINO_PATH/package/prudynt_v3/Config.in"
source "$BR2_EXTERNAL_THINGINO_PATH/package/thingino-live555/Config.in"
10 changes: 10 additions & 0 deletions package/ingenic-osdrv-t31/ingenic-osdrv-t31.mk
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ INGENIC_OSDRV_T31_SITE =
INGENIC_OSDRV_T31_LICENSE = MIT
INGENIC_OSDRV_T31_LICENSE_FILES = LICENSE

define INGENIC_OSDRV_T31_INSTALL_STAGING_CMDS
$(info Copying files to staging...)
$(INSTALL) -m 755 -d $(STAGING_DIR)/usr/lib
$(INSTALL) -m 644 $(@D)/files/lib/*.so $(STAGING_DIR)/usr/lib/
endef

define INGENIC_OSDRV_T31_INSTALL_TARGET_CMDS
$(INSTALL) -m 755 -d $(TARGET_DIR)/etc/sensor
$(INSTALL) -m 644 -t $(TARGET_DIR)/etc/sensor $(INGENIC_OSDRV_T31_PKGDIR)/files/sensor/$(SENSOR_MODEL).yaml
Expand All @@ -22,4 +28,8 @@ define INGENIC_OSDRV_T31_INSTALL_TARGET_CMDS
$(INSTALL) -m 644 -t $(TARGET_DIR)/usr/lib/ $(INGENIC_OSDRV_T31_PKGDIR)/files/lib/*.so
endef

define INGENIC_OSDRV_T31_POST_BUILD_HOOK
$(call INGENIC_OSDRV_T31_INSTALL_STAGING_CMDS)
endef

$(eval $(generic-package))
5 changes: 5 additions & 0 deletions package/prudynt_v3/Config.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
config BR2_PACKAGE_PRUDYNT_V3
bool "prudynt for t31"
default n
help
Experimental port
20 changes: 20 additions & 0 deletions package/prudynt_v3/prudynt_v3.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
PRUDYNT_V3_SITE_METHOD = git
PRUDYNT_V3_SITE = https://github.com/gtxaspec/prudynt-v3
PRUDYNT_V3_VERSION = $(shell git ls-remote $(PRUDYNT_V3_SITE) HEAD | head -1 | cut -f1)
PRUDYNT_V3_DEPENDENCIES = libconfig thingino-live555 ingenic-osdrv-t31 freetype

define PRUDYNT_V3_BUILD_CMDS
$(MAKE) ARCH=$(TARGET_ARCH) CROSS_COMPILE=$(TARGET_CROSS) \
CFLAGS="$(TARGET_CFLAGS) -DNO_OPENSSL=1 \
-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/usr/include/freetype2 \
-I$(STAGING_DIR)/usr/include/liveMedia -I$(STAGING_DIR)/usr/include/groupsock \
-I$(STAGING_DIR)/usr/include/UsageEnvironment -I$(STAGING_DIR)/usr/include/BasicUsageEnvironment" \
LDFLAGS="$(TARGET_LDFLAGS) -L$(STAGING_DIR)/usr/lib \
-L$(TARGET_DIR)/usr/lib" -C $(@D) all
endef

define PRUDYNT_V3_INSTALL_TARGET_CMDS
$(INSTALL) -m 0755 -D $(@D)/bin/prudynt $(TARGET_DIR)/usr/bin/prudynt
endef

$(eval $(generic-package))
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
From: Benjamin Drung <[email protected]>
Date: Sat, 16 Sep 2017 11:22:03 +0200
Subject: Add a pkg-config file for the shared libraries

This patch was downloaded from Debian
https://sources.debian.org/src/liblivemedia/2018.08.05-1/debian/patches/0002-Add-a-pkg-config-file-for-the-shared-libraries.patch/

The local/ part of PREXIX and LIBDIR was removed to fit into buildroot.

A similar version of this patch is part of the vlc source repo:
http://git.videolan.org/?p=vlc.git;a=blob;f=contrib/src/live555/add-pkgconfig-file.patch;hb=HEAD

Upstream status: Rejected
http://lists.live555.com/pipermail/live-devel/2013-January/016374.html
http://lists.live555.com/pipermail/live-devel/2013-January/016375.html

Signed-off-by: Bernd Kuhls <[email protected]>
---
Makefile.head | 3 +++
Makefile.tail | 7 ++++++-
live555.pc.in | 9 +++++++++
3 files changed, 18 insertions(+), 1 deletion(-)
create mode 100644 live555.pc.in

diff --git a/Makefile.head b/Makefile.head
index 458c54c..1571037 100644
--- a/Makefile.head
+++ b/Makefile.head
@@ -1 +1,4 @@
+PREFIX = /usr
+LIBDIR = /usr/lib
+VERSION = $(shell grep LIVEMEDIA_LIBRARY_VERSION_STRING liveMedia/include/liveMedia_version.hh | sed 's/.*"\([^"]*\)".*/\1/')
##### Change the following for your environment:
diff --git a/Makefile.tail b/Makefile.tail
index fc594ea..a20a527 100644
--- a/Makefile.tail
+++ b/Makefile.tail
@@ -22,7 +22,12 @@ all:
@echo
@echo "For more information about this source code (including your obligations under the LGPL), please see our FAQ at http://live555.com/liveMedia/faq.html"

-install:
+install_shared_libraries:
+ install -d $(DESTDIR)$(LIBDIR)/pkgconfig
+ sed "s#@PREFIX@#$(PREFIX)#;s#@LIBDIR@#$(LIBDIR)#;s#@VERSION@#$(VERSION)#" live555.pc.in > $(DESTDIR)$(LIBDIR)/pkgconfig/live555.pc
+ chmod 644 $(DESTDIR)$(LIBDIR)/pkgconfig/live555.pc
+
+install: $(INSTALL2)
cd $(LIVEMEDIA_DIR) ; $(MAKE) install
cd $(GROUPSOCK_DIR) ; $(MAKE) install
cd $(USAGE_ENVIRONMENT_DIR) ; $(MAKE) install
diff --git a/live555.pc.in b/live555.pc.in
new file mode 100644
index 0000000..3736944
--- /dev/null
+++ b/live555.pc.in
@@ -0,0 +1,9 @@
+prefix=@PREFIX@
+libdir=@LIBDIR@
+includedir=${prefix}/include
+
+Name: live555
+Description: multimedia RTSP streaming library
+Version: @VERSION@
+Cflags: -I${includedir}/liveMedia -I${includedir}/groupsock -I${includedir}/BasicUsageEnvironment -I${includedir}/UsageEnvironment
+Libs: -L${libdir} -lliveMedia -lgroupsock -lBasicUsageEnvironment -lUsageEnvironment
10 changes: 10 additions & 0 deletions package/thingino-live555/10_remove_test_programs.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
--- a/Makefile.tail 2016-01-29 02:39:11.000000000 +0000
+++ b/Makefile.tail 2020-09-08 01:18:10.714666044 +0000
@@ -25,7 +25,6 @@
cd $(GROUPSOCK_DIR) ; $(MAKE) install
cd $(USAGE_ENVIRONMENT_DIR) ; $(MAKE) install
cd $(BASIC_USAGE_ENVIRONMENT_DIR) ; $(MAKE) install
- cd $(TESTPROGS_DIR) ; $(MAKE) install
cd $(MEDIA_SERVER_DIR) ; $(MAKE) install
cd $(PROXY_SERVER_DIR) ; $(MAKE) install

87 changes: 87 additions & 0 deletions package/thingino-live555/20-sdp-snprintf-fix.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
--- a/liveMedia/ServerMediaSession.cpp 2021-05-03 08:42:11.000000000 -0500
+++ b/liveMedia/ServerMediaSession.cpp 2023-01-18 20:44:55.477817187 -0600
@@ -270,40 +270,46 @@
}

char const* const sdpPrefixFmt =
- "v=0\r\n"
- "o=- %ld%06ld %d IN %s %s\r\n"
- "s=%s\r\n"
- "i=%s\r\n"
- "t=0 0\r\n"
- "a=tool:%s%s\r\n"
- "a=type:broadcast\r\n"
- "a=control:*\r\n"
- "%s"
- "%s"
- "a=x-qt-text-nam:%s\r\n"
- "a=x-qt-text-inf:%s\r\n"
- "%s";
- sdpLength += strlen(sdpPrefixFmt)
- + 20 + 6 + 20 + 3/*IP4 or IP6*/ + ipAddressStrSize
- + strlen(fDescriptionSDPString)
- + strlen(fInfoSDPString)
- + strlen(libNameStr) + strlen(libVersionStr)
- + strlen(sourceFilterLine)
- + strlen(rangeLine)
- + strlen(fDescriptionSDPString)
- + strlen(fInfoSDPString)
- + strlen(fMiscSDPLines);
+ "v=0\r\n";
+// "o=- %d%d %d IN %s";// %s\r\n";
+// "s=%s\r\n"
+// "i=%s\r\n"
+// "t=0 0\r\n"
+// "a=tool:%s%s\r\n"
+// "a=type:broadcast\r\n"
+// "a=control:*\r\n" //<-- To here is still sent
+// "%s" // source filter line
+// "%s" // range line
+// "a=x-qt-text-nam:%s\r\n"
+// "a=x-qt-text-inf:%s\r\n"
+// "%s";
+// sdpLength += strlen(sdpPrefixFmt)
+// + 20 + 6 + 20 + 3/*IP4 or IP6*/ + ipAddressStrSize
+// + strlen(fDescriptionSDPString)
+// + strlen(fInfoSDPString)
+// + strlen(libNameStr) + strlen(libVersionStr)
+// + strlen(sourceFilterLine)
+// + strlen(rangeLine)
+// + strlen(fDescriptionSDPString)
+// + strlen(fInfoSDPString)
+// + strlen(fMiscSDPLines);
+sdpLength=10000;
sdpLength += 1000; // in case the length of the "subsession->sdpLines()" calls below change
sdp = new char[sdpLength];
if (sdp == NULL) break;

// Generate the SDP prefix (session-level lines):
- snprintf(sdp, sdpLength, sdpPrefixFmt,
- fCreationTime.tv_sec, fCreationTime.tv_usec, // o= <session id>
- 1, // o= <version> // (needs to change if params are modified)
- addressFamily == AF_INET ? "IP4" : "IP6", // o= <address family>
- ipAddressStr.val(), // o= <address>
- fDescriptionSDPString, // s= <description>
+ snprintf(sdp, sdpLength, sdpPrefixFmt);//,
+
+
+// COMMENTING THIS STUFF OUT BECAUSE SNPRINTF IS CRASHING ON MUSL/MIPS
+// seems to stream and work anyway
+//
+// fCreationTime.tv_sec, fCreationTime.tv_usec, // o= <session id>
+// 1, // o= <version> // (needs to change if params are modified)
+// addressFamily == AF_INET ? "IP4" : "IP6");//, // o= <address family>
+// ipAddressStr.val(), // o= <address>
+/* fDescriptionSDPString, // s= <description>
fInfoSDPString, // i= <info>
libNameStr, libVersionStr, // a=tool:
sourceFilterLine, // a=source-filter: incl (if a SSM session)
@@ -311,7 +317,7 @@
fDescriptionSDPString, // a=x-qt-text-nam: line
fInfoSDPString, // a=x-qt-text-inf: line
fMiscSDPLines); // miscellaneous session SDP lines (if any)
-
+*/
// Then, add the (media-level) lines for each subsession:
char* mediaSDP = sdp;
for (subsession = fSubsessionsHead; subsession != NULL;
12 changes: 12 additions & 0 deletions package/thingino-live555/Config.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
config BR2_PACKAGE_THINGINO_LIVE555
bool "live555"
depends on BR2_INSTALL_LIBSTDCPP
help
LIVE555 Streaming Media forms a set of C++ libraries for
multimedia streaming, using open standard protocols
(RTP/RTCP, RTSP, SIP).

http://www.live555.com/liveMedia/

comment "live555 needs a toolchain w/ C++"
depends on !BR2_INSTALL_LIBSTDCPP
74 changes: 74 additions & 0 deletions package/thingino-live555/thingino-live555.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
################################################################################
#
# live555
#
################################################################################

THINGINO_LIVE555_VERSION = 2024.02.28
THINGINO_LIVE555_SOURCE = live.$(THINGINO_LIVE555_VERSION).tar.gz
THINGINO_LIVE555_SITE = http://www.live555.com/liveMedia/public
# There is a COPYING file with the GPL-3.0 license text, but none of
# the source files appear to be released under GPL-3.0, and the
# project web site says it's licensed under the LGPL:
# http://live555.com/liveMedia/faq.html#copyright-and-license
THINGINO_LIVE555_LICENSE = LGPL-3.0+
THINGINO_LIVE555_LICENSE_FILES = COPYING.LESSER
THINGINO_LIVE555_CPE_ID_VENDOR = live555
THINGINO_LIVE555_CPE_ID_PRODUCT = streaming_media
THINGINO_LIVE555_INSTALL_STAGING = YES

THINGINO_LIVE555_CFLAGS = $(TARGET_CFLAGS)

ifeq ($(BR2_STATIC_LIBS),y)
THINGINO_LIVE555_CONFIG_TARGET = linux
THINGINO_LIVE555_LIBRARY_LINK = $(TARGET_AR) cr
else
THINGINO_LIVE555_CONFIG_TARGET = linux-with-shared-libraries
THINGINO_LIVE555_LIBRARY_LINK = $(TARGET_CC) -o
THINGINO_LIVE555_CFLAGS += -fPIC
endif

ifeq ($(BR2_PACKAGE_OPENSSL),y)
THINGINO_LIVE555_DEPENDENCIES += host-pkgconf openssl
THINGINO_LIVE555_CONSOLE_LIBS = `$(PKG_CONFIG_HOST_BINARY) --libs openssl`
# passed to ar for static linking, which gets confused by -L<dir>
ifneq ($(BR2_STATIC_LIBS),y)
THINGINO_LIVE555_LIVEMEDIA_LIBS = $(THINGINO_LIVE555_CONSOLE_LIBS)
endif
else
THINGINO_LIVE555_CFLAGS += -DNO_OPENSSL
endif

ifneq ($(BR2_ENABLE_LOCALE),y)
THINGINO_LIVE555_CFLAGS += -DLOCALE_NOT_USED
endif

define THINGINO_LIVE555_CONFIGURE_CMDS
echo 'COMPILE_OPTS = $$(INCLUDES) -I. -DSOCKLEN_T=socklen_t -DNO_STD_LIB $(THINGINO_LIVE555_CFLAGS)' >> $(@D)/config.$(THINGINO_LIVE555_CONFIG_TARGET)
echo 'C_COMPILER = $(TARGET_CC)' >> $(@D)/config.$(THINGINO_LIVE555_CONFIG_TARGET)
echo 'CPLUSPLUS_COMPILER = $(TARGET_CXX)' >> $(@D)/config.$(THINGINO_LIVE555_CONFIG_TARGET)

echo 'LINK = $(TARGET_CXX) -o' >> $(@D)/config.$(THINGINO_LIVE555_CONFIG_TARGET)
echo 'LINK_OPTS = -L. $(TARGET_LDFLAGS)' >> $(@D)/config.$(THINGINO_LIVE555_CONFIG_TARGET)
echo 'PREFIX = /usr' >> $(@D)/config.$(THINGINO_LIVE555_CONFIG_TARGET)
# Must have a whitespace at the end of LIBRARY_LINK, otherwise static link
# fails
echo 'LIBRARY_LINK = $(THINGINO_LIVE555_LIBRARY_LINK) ' >> $(@D)/config.$(THINGINO_LIVE555_CONFIG_TARGET)
echo 'LIBS_FOR_CONSOLE_APPLICATION = $(THINGINO_LIVE555_CONSOLE_LIBS)' >> $(@D)/config.$(THINGINO_LIVE555_CONFIG_TARGET)
echo 'LIBS_FOR_LIVEMEDIA_LIB = $(THINGINO_LIVE555_LIVEMEDIA_LIBS)' >> $(@D)/config.$(THINGINO_LIVE555_CONFIG_TARGET)
(cd $(@D); ./genMakefiles $(THINGINO_LIVE555_CONFIG_TARGET))
endef

define THINGINO_LIVE555_BUILD_CMDS
$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) all
endef

define THINGINO_LIVE555_INSTALL_STAGING_CMDS
$(TARGET_MAKE_ENV) $(MAKE) DESTDIR=$(STAGING_DIR) -C $(@D) install
endef

define THINGINO_LIVE555_INSTALL_TARGET_CMDS
$(TARGET_MAKE_ENV) $(MAKE) DESTDIR=$(TARGET_DIR) PREFIX=/usr -C $(@D) install
endef

$(eval $(generic-package))

0 comments on commit a7fdf7e

Please sign in to comment.