Merge pull request #8348 from mpromonet/master
v4l2rtspserver: simplify build using release 0.1.6
This commit is contained in:
commit
1fb2a16a24
4 changed files with 18 additions and 110 deletions
|
@ -7,23 +7,23 @@
|
||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=v4l2rtspserver
|
PKG_NAME:=v4l2rtspserver
|
||||||
PKG_VERSION:=0.1.3
|
PKG_VERSION:=0.1.6
|
||||||
PKG_RELEASE:=1
|
PKG_RELEASE:=1
|
||||||
|
|
||||||
#cannot use codeload as this uses submodules
|
#cannot use codeload as this uses submodules
|
||||||
PKG_SOURCE_PROTO:=git
|
PKG_SOURCE_PROTO:=git
|
||||||
PKG_SOURCE_URL:=https://github.com/mpromonet/v4l2rtspserver
|
PKG_SOURCE_URL:=https://github.com/mpromonet/v4l2rtspserver
|
||||||
PKG_SOURCE_VERSION:=v$(PKG_VERSION)
|
PKG_SOURCE_VERSION:=v$(PKG_VERSION)
|
||||||
PKG_MIRROR_HASH:=73499d0db515ae0d66c6d2a73c9c474ca35007aaf17451da01e793d972eab35a
|
PKG_MIRROR_HASH:=9e076d2ecac08d5cbd0af7cfaa355e077e03fe35be73259ae7f520e2ef4243f8
|
||||||
|
|
||||||
PKG_MAINTAINER:=Roger Dammit <rogerdammit@gmail.com>
|
|
||||||
PKG_LICENSE:=Unlicense
|
|
||||||
PKG_LICENSE_FILES:=LICENSE
|
|
||||||
|
|
||||||
LIVE555_VERSION:=2019.02.03
|
LIVE555_VERSION:=2019.02.03
|
||||||
LIVE555_HASH:=1c938d91553eff224c7a860f8f38b3256028704b474a3fc6bcf2eddc42268710
|
LIVE555_HASH:=1c938d91553eff224c7a860f8f38b3256028704b474a3fc6bcf2eddc42268710
|
||||||
LIVE555_FILE:=live.$(LIVE555_VERSION).tar.gz
|
LIVE555_FILE:=live.$(LIVE555_VERSION).tar.gz
|
||||||
|
|
||||||
|
PKG_MAINTAINER:=Roger Dammit <rogerdammit@gmail.com>
|
||||||
|
PKG_LICENSE:=Unlicense
|
||||||
|
PKG_LICENSE_FILES:=LICENSE
|
||||||
|
|
||||||
PKG_BUILD_PARALLEL:=1
|
PKG_BUILD_PARALLEL:=1
|
||||||
CMAKE_INSTALL:=1
|
CMAKE_INSTALL:=1
|
||||||
|
|
||||||
|
@ -57,38 +57,19 @@ TARGET_CFLAGS += -flto
|
||||||
TARGET_CXXFLAGS += -fno-rtti
|
TARGET_CXXFLAGS += -fno-rtti
|
||||||
TARGET_LDFLAGS += -Wl,--gc-sections
|
TARGET_LDFLAGS += -Wl,--gc-sections
|
||||||
|
|
||||||
|
CMAKE_OPTIONS += -DALSA=OFF -DLIVE555CFLAGS="-DSOCKLEN_T=socklen_t -D_LARGEFILE_SOURCE=1 -D_FILE_OFFSET_BITS=64 -DLOCALE_NOT_USED -DNO_SSTREAM=1 -DALLOW_RTSP_SERVER_PORT_REUSE=1"
|
||||||
|
|
||||||
|
|
||||||
define Build/Prepare
|
define Build/Prepare
|
||||||
$(Build/Prepare/Default)
|
$(Build/Prepare/Default)
|
||||||
|
|
||||||
## need to compile some dependencies so that cmake will find them
|
# download live555
|
||||||
|
|
||||||
# build live555
|
|
||||||
$(eval $(call Download,live555))
|
$(eval $(call Download,live555))
|
||||||
|
mkdir -p $(PKG_BUILD_DIR)/live
|
||||||
mkdir -p $(PKG_BUILD_DIR)/live555
|
$(TAR) -xf $(DL_DIR)/$(LIVE555_FILE) --strip=1 -C $(PKG_BUILD_DIR)/live
|
||||||
$(TAR) -xf $(DL_DIR)/$(LIVE555_FILE) --strip=1 -C $(PKG_BUILD_DIR)/live555
|
|
||||||
$(CP) files/config.openwrt $(PKG_BUILD_DIR)/live555
|
|
||||||
( cd $(PKG_BUILD_DIR)/live555; ./genMakefiles openwrt )
|
|
||||||
|
|
||||||
+$(MAKE_VARS) $(MAKE) $(MAKE_FLAGS) -C $(PKG_BUILD_DIR)/live555
|
|
||||||
$(MAKE_VARS) $(MAKE) $(MAKE_FLAGS) -C $(PKG_BUILD_DIR)/live555 PREFIX="$(STAGING_DIR)/usr/" install
|
|
||||||
|
|
||||||
# build v4l2wrapper
|
|
||||||
+$(MAKE_VARS) $(MAKE) $(MAKE_FLAGS) -C $(PKG_BUILD_DIR)/v4l2wrapper
|
|
||||||
$(CP) $(PKG_BUILD_DIR)/v4l2wrapper/libv4l2wrapper.a $(PKG_BUILD_DIR)
|
|
||||||
|
|
||||||
# cmake patches (these are very hacky and should be a lot cleaner)
|
|
||||||
|
|
||||||
# prevent root path override
|
|
||||||
$(SED) 's/SET(CMAKE_FIND_ROOT_PATH/#SET(CMAKE_FIND_ROOT_PATH/' $(PKG_BUILD_DIR)/CMakeLists.txt
|
|
||||||
|
|
||||||
# set search path for v4l2wrapper to current build dir
|
|
||||||
$(SED) 's/V4L2WRAPPER_LIBRARY libv4l2wrapper.a/V4L2WRAPPER_LIBRARY libv4l2wrapper.a PATHS "." NO_CMAKE_FIND_ROOT_PATH/' $(PKG_BUILD_DIR)/CMakeLists.txt
|
|
||||||
|
|
||||||
# disable ALSA
|
|
||||||
$(SED) 's/find_package(ALSA QUIET)//' $(PKG_BUILD_DIR)/CMakeLists.txt
|
|
||||||
endef
|
endef
|
||||||
|
|
||||||
|
|
||||||
define Package/v4l2rtspserver/install
|
define Package/v4l2rtspserver/install
|
||||||
$(INSTALL_DIR) $(1)/usr/bin
|
$(INSTALL_DIR) $(1)/usr/bin
|
||||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/v4l2rtspserver-$(PKG_VERSION) $(1)/usr/bin/
|
$(INSTALL_BIN) $(PKG_BUILD_DIR)/v4l2rtspserver-$(PKG_VERSION) $(1)/usr/bin/
|
||||||
|
|
|
@ -1,19 +0,0 @@
|
||||||
COMPILE_OPTS = $(INCLUDES) -DSOCKLEN_T=socklen_t -D_LARGEFILE_SOURCE=1 -D_FILE_OFFSET_BITS=64 -DLOCALE_NOT_USED -DNO_SSTREAM=1 -DALLOW_RTSP_SERVER_PORT_REUSE=1
|
|
||||||
C = c
|
|
||||||
C_COMPILER = $(GCC)
|
|
||||||
CFLAGS += $(COMPILE_OPTS)
|
|
||||||
C_FLAGS = $(CFLAGS)
|
|
||||||
CPP = cpp
|
|
||||||
CPLUSPLUS_COMPILER = $(AS) # optimizations are only in AR apparently, so use instead of CXX
|
|
||||||
CPLUSPLUS_FLAGS = $(COMPILE_OPTS) -Wall -DBSD=1
|
|
||||||
CPLUSPLUS_FLAGS += $(CPPFLAGS) -fexceptions
|
|
||||||
OBJ = o
|
|
||||||
LINK = $(CXX) -o
|
|
||||||
LINK_OPTS = -L. $(LDFLAGS)
|
|
||||||
CONSOLE_LINK_OPTS = $(LINK_OPTS)
|
|
||||||
LIBRARY_LINK = $(AR) cr
|
|
||||||
LIBRARY_LINK_OPTS =
|
|
||||||
LIB_SUFFIX = a
|
|
||||||
LIBS_FOR_CONSOLE_APPLICATION = $(CXXLIBS)
|
|
||||||
LIBS_FOR_GUI_APPLICATION = $(LIBS_FOR_CONSOLE_APPLICATION)
|
|
||||||
EXE =
|
|
|
@ -40,10 +40,6 @@ start_instance() {
|
||||||
config_get path "$s" 'path'
|
config_get path "$s" 'path'
|
||||||
config_get format "$s" 'format'
|
config_get format "$s" 'format'
|
||||||
|
|
||||||
# pull out resolution width and height from string
|
|
||||||
local w="$(echo $resolution | cut -d'x' -f1)"
|
|
||||||
local h="$(echo $resolution | cut -d'x' -f2)"
|
|
||||||
|
|
||||||
# make sure format is uppercase
|
# make sure format is uppercase
|
||||||
format="$(echo $format | tr a-z A-Z)"
|
format="$(echo $format | tr a-z A-Z)"
|
||||||
|
|
||||||
|
@ -52,9 +48,10 @@ start_instance() {
|
||||||
args="$args -P $port"
|
args="$args -P $port"
|
||||||
args="$args -u ${path}"
|
args="$args -u ${path}"
|
||||||
args="$args -F $fps"
|
args="$args -F $fps"
|
||||||
args="$args -W $w"
|
args="$args -G ${resolution}"
|
||||||
args="$args -H $h"
|
if [ ! -z "$format" ]; then
|
||||||
args="$args -f$format"
|
args="$args -f$format"
|
||||||
|
fi
|
||||||
args="$args -c" # fixes issue with corrupt frames with H264
|
args="$args -c" # fixes issue with corrupt frames with H264
|
||||||
|
|
||||||
if [ -n "$username" ]; then
|
if [ -n "$username" ]; then
|
||||||
|
|
|
@ -1,51 +0,0 @@
|
||||||
From f732d44c2bc47e6eccf65e5eb3160734f11e5d3e Mon Sep 17 00:00:00 2001
|
|
||||||
From: Rosen Penev <rosenp@gmail.com>
|
|
||||||
Date: Thu, 27 Dec 2018 20:16:59 -0800
|
|
||||||
Subject: [PATCH] Switch Makefile to compile with g++
|
|
||||||
|
|
||||||
With this change I managed to get OpenWrt to compile with uclibcxx
|
|
||||||
instead of libstdcpp.
|
|
||||||
|
|
||||||
Made CXX adjustable by the shell as OpenWrt needs to override this.
|
|
||||||
It also has its own ar.
|
|
||||||
|
|
||||||
EXTRA_CXXFLAGS seems to be the proper variable based on usage in the
|
|
||||||
OpenWrt tree.
|
|
||||||
---
|
|
||||||
Makefile | 12 ++++++------
|
|
||||||
1 file changed, 6 insertions(+), 6 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/Makefile b/Makefile
|
|
||||||
index 51aaa37..f05bf0d 100644
|
|
||||||
--- a/v4l2wrapper/Makefile
|
|
||||||
+++ b/v4l2wrapper/Makefile
|
|
||||||
@@ -1,12 +1,12 @@
|
|
||||||
-CFLAGS = -W -Wall -pthread -g -pipe $(CFLAGS_EXTRA)
|
|
||||||
-CFLAGS += -I inc
|
|
||||||
+CXXFLAGS ?= -W -Wall -pthread -g -pipe $(EXTRA_CXXFLAGS)
|
|
||||||
+CXXFLAGS += -I inc
|
|
||||||
RM = rm -rf
|
|
||||||
-CC = $(CROSS)gcc
|
|
||||||
-AR = $(CROSS)ar
|
|
||||||
+CXX ?= $(CROSS)g++
|
|
||||||
+AR ?= $(CROSS)ar
|
|
||||||
PREFIX?=/usr
|
|
||||||
|
|
||||||
ifneq ($(wildcard $(SYSROOT)$(PREFIX)/include/log4cpp/Category.hh),)
|
|
||||||
-CFLAGS += -DHAVE_LOG4CPP -I $(SYSROOT)$(PREFIX)/include
|
|
||||||
+CXXFLAGS += -DHAVE_LOG4CPP -I $(SYSROOT)$(PREFIX)/include
|
|
||||||
endif
|
|
||||||
|
|
||||||
V4L2WRAPPER_CPP:=$(wildcard src/*.cpp)
|
|
||||||
@@ -17,7 +17,7 @@ V4L2WRAPPER_OBJ:=$(V4L2WRAPPER_CPP:%.cpp=%.o)
|
|
||||||
all: libv4l2wrapper.a
|
|
||||||
|
|
||||||
%.o: %.cpp
|
|
||||||
- $(CC) -c -o $@ $< $(CFLAGS)
|
|
||||||
+ $(CXX) -c -o $@ $< $(CXXFLAGS)
|
|
||||||
|
|
||||||
libv4l2wrapper.a: $(V4L2WRAPPER_OBJ)
|
|
||||||
$(AR) rcs $@ $^
|
|
||||||
--
|
|
||||||
2.20.1
|
|
||||||
|
|
Loading…
Reference in a new issue