From f0dfd51e3f6ceca1b6440e9f40e039bc9630a4b8 Mon Sep 17 00:00:00 2001 From: Michel Promonet Date: Sat, 9 Dec 2017 16:56:00 +0100 Subject: [PATCH 01/10] upgrade v4l2wrapper --- v4l2wrapper | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/v4l2wrapper b/v4l2wrapper index 5889f87..6c8e99c 160000 --- a/v4l2wrapper +++ b/v4l2wrapper @@ -1 +1 @@ -Subproject commit 5889f878eb4a38e722a600aed6bd9d7a8ce9e1cd +Subproject commit 6c8e99c6025e18ad388d7e8030a7f80d844f4a15 From 188867881ee0400a840035d79e94f7656f17497e Mon Sep 17 00:00:00 2001 From: Michel Promonet Date: Sat, 9 Dec 2017 17:11:40 +0100 Subject: [PATCH 02/10] upgrade v4l2wrapper --- v4l2wrapper | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/v4l2wrapper b/v4l2wrapper index 6c8e99c..6af3509 160000 --- a/v4l2wrapper +++ b/v4l2wrapper @@ -1 +1 @@ -Subproject commit 6c8e99c6025e18ad388d7e8030a7f80d844f4a15 +Subproject commit 6af3509aea22b4869180da7cb5de46a66788f826 From 2b2de16e09a11e725789a7a2669a69703d5f0062 Mon Sep 17 00:00:00 2001 From: Michel Promonet Date: Sat, 9 Dec 2017 17:15:14 +0100 Subject: [PATCH 03/10] upgrade v4l2wrapper --- v4l2wrapper | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/v4l2wrapper b/v4l2wrapper index 6af3509..503aa82 160000 --- a/v4l2wrapper +++ b/v4l2wrapper @@ -1 +1 @@ -Subproject commit 6af3509aea22b4869180da7cb5de46a66788f826 +Subproject commit 503aa82bac044f659a08a6c028e15cea8dd57213 From e7c5de04077852f41eff589cb52d423534236533 Mon Sep 17 00:00:00 2001 From: Michel Promonet Date: Sat, 9 Dec 2017 17:18:36 +0100 Subject: [PATCH 04/10] allow to build without log4cpp --- CMakeLists.txt | 14 ++++++-------- inc/SegmentServerMediaSubsession.h | 1 + 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 401f0f5..fb69b5e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -54,16 +54,14 @@ endif (ALSA_LIBRARY) # LOG4CPP find_path(LOG4CPP_INCLUDE_DIR log4cpp/Category.hh) -if (NOT LOG4CPP_INCLUDE_DIR) - message(STATUS "Installing liblog4cpp5-dev.") - EXEC_PROGRAM("sudo apt-get install -y liblog4cpp5-dev") -endif (NOT LOG4CPP_INCLUDE_DIR) +if (LOG4CPP_INCLUDE_DIR) + message(STATUS "Log4Cpp available") + include_directories(${LOG4CPP_INCLUDE_DIR}) -find_path(V4L2_INCLUDE_DIR log4cpp/Category.hh) -include_directories(${LOG4CPP_INCLUDE_DIR}) + find_library(LOG4CPP_LIBRARY log4cpp) + target_link_libraries(${PROJECT_NAME} "${LOG4CPP_LIBRARY}") +endif (LOG4CPP_INCLUDE_DIR) -find_library(LOG4CPP_LIBRARY log4cpp) -target_link_libraries(${PROJECT_NAME} "${LOG4CPP_LIBRARY}") # live555 find_path(LIBLIVE555_INCLUDE_DIR liveMedia/liveMedia.hh) diff --git a/inc/SegmentServerMediaSubsession.h b/inc/SegmentServerMediaSubsession.h index cafdcad..2622ca5 100644 --- a/inc/SegmentServerMediaSubsession.h +++ b/inc/SegmentServerMediaSubsession.h @@ -9,6 +9,7 @@ #pragma once +#include #include "UnicastServerMediaSubsession.h" // ----------------------------------------- From 16f8164e0c228480f147188df7fc16844a1003b3 Mon Sep 17 00:00:00 2001 From: Michel Promonet Date: Sun, 10 Dec 2017 00:34:59 +0100 Subject: [PATCH 05/10] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index efdf223..9d36213 100644 --- a/README.md +++ b/README.md @@ -31,8 +31,8 @@ Domain public Dependencies ------------ - liblivemedia-dev [License LGPL](http://www.live555.com/liveMedia/) > live.2012.01.07 (need StreamReplicator) - - liblog4cpp5-dev [License LGPL](http://log4cpp.sourceforge.net/#license) - libv4l2cpp [Unlicense](https://github.com/mpromonet/libv4l2cpp/blob/master/LICENSE) + - liblog4cpp5-dev [License LGPL](http://log4cpp.sourceforge.net/#license) (optional) Usage ----- From a9e33f504c98b45c3554a73a6b1c15d26a8cd24f Mon Sep 17 00:00:00 2001 From: Michel Promonet Date: Sun, 10 Dec 2017 12:31:20 +0100 Subject: [PATCH 06/10] fix build with log4cpp --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index fb69b5e..e93da57 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -56,6 +56,7 @@ endif (ALSA_LIBRARY) find_path(LOG4CPP_INCLUDE_DIR log4cpp/Category.hh) if (LOG4CPP_INCLUDE_DIR) message(STATUS "Log4Cpp available") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DHAVE_LOG4CPP") include_directories(${LOG4CPP_INCLUDE_DIR}) find_library(LOG4CPP_LIBRARY log4cpp) From c41050be5a7662eb6e317d1b5cf81870b27ed35d Mon Sep 17 00:00:00 2001 From: Michel Promonet Date: Sun, 10 Dec 2017 12:31:41 +0100 Subject: [PATCH 07/10] set default port with PORT variable --- src/main.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main.cpp b/src/main.cpp index b5572cb..61238d7 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -388,6 +388,10 @@ int main(int argc, char** argv) #ifdef HAVE_ALSA snd_pcm_format_t audioFmt = SND_PCM_FORMAT_S16_BE; #endif + const char* defaultPort = getenv("PORT"); + if (defaultPort != NULL) { + rtspPort = atoi(defaultPort); + } // decode parameters int c = 0; From 6524852e9985397ebec231b04c2b44c011e9e5cd Mon Sep 17 00:00:00 2001 From: Michel Promonet Date: Sat, 16 Dec 2017 00:27:13 +0100 Subject: [PATCH 08/10] remove basename --- src/main.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 61238d7..52e1593 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -263,6 +263,17 @@ void decodeDevice(const std::string & device, std::string & videoDev, std::strin getline(is, audioDev); } +std::string getDeviceName(const std::string & devicePath) +{ + std::string deviceName(devicePath); + size_t pos = deviceName.find_last_of('/'); + if (pos != std::string::npos) { + deviceName.erase(0,pos+1); + } + return deviceName; +} + + /* --------------------------------------------------------------------------- ** get a "deviceid" from uevent sys file ** -------------------------------------------------------------------------*/ @@ -338,7 +349,7 @@ std::string getV4l2Alsa(const std::string& v4l2device) { } } - auto deviceId = videodevices.find(basename(v4l2device.c_str())); + auto deviceId = videodevices.find(getDeviceName(v4l2device)); if (deviceId != videodevices.end()) { auto audioDeviceIt = audiodevices.find(deviceId->second); @@ -536,7 +547,7 @@ int main(int argc, char** argv) std::string baseUrl; if (devList.size() > 1) { - baseUrl = basename(videoDev.c_str()); + baseUrl = getDeviceName(videoDev); baseUrl.append("/"); } MPEG2TransportStreamFromESSource* muxer = NULL; From 9dd20de21f309f9f735d0c3ff04e4dc87175471a Mon Sep 17 00:00:00 2001 From: Michel Promonet Date: Sat, 16 Dec 2017 17:30:42 +0100 Subject: [PATCH 09/10] Update README.md --- README.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/README.md b/README.md index 9d36213..c56c241 100644 --- a/README.md +++ b/README.md @@ -24,10 +24,6 @@ The HTTP server support : - HLS - MPEG-DASH -License ------------- -Domain public - Dependencies ------------ - liblivemedia-dev [License LGPL](http://www.live555.com/liveMedia/) > live.2012.01.07 (need StreamReplicator) From d61e9cbb5db20ce9b349a8418a1ae8550643699c Mon Sep 17 00:00:00 2001 From: Michel Promonet Date: Sat, 16 Dec 2017 18:12:44 +0100 Subject: [PATCH 10/10] quote ${VERSION} in CMakefile --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e93da57..841bc40 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,7 +13,7 @@ set(CMAKE_CXX_FLAGS "-std=c++11 -Wall") find_package(Git) if(GIT_FOUND) EXECUTE_PROCESS(COMMAND ${GIT_EXECUTABLE} describe --tags --always --dirty OUTPUT_VARIABLE VERSION OUTPUT_STRIP_TRAILING_WHITESPACE) - STRING(REGEX REPLACE "^v(.*)" "\\1" VERSION ${VERSION}) + STRING(REGEX REPLACE "^v(.*)" "\\1" VERSION "${VERSION}") add_definitions("-DVERSION=\"${VERSION}\"") endif()