Skip to content

Commit

Permalink
Removing gstreamer dependency from aprapipes (#253)
Browse files Browse the repository at this point in the history
* initial commit

* builder files changed to remove gstreamer

* Removing gst based modules, other gstreamer files

* small yml file fix

---------

Co-authored-by: Vinayak Bhustali <vinayakb@apra.in>
  • Loading branch information
Vinayak-YB and Vinayak Bhustali authored Jul 4, 2023
1 parent c36edb8 commit bd172e5
Show file tree
Hide file tree
Showing 25 changed files with 0 additions and 2,885 deletions.
1 change: 0 additions & 1 deletion .github/workflows/CI-Linux-ARM64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ jobs:
is-selfhosted: true
cuda: 'ON'
prep-cmd: 'echo skipping builder prep as I can not sudo'
is-build-gst: false
cache-path: './none'
cmake-conf-cmd: 'export VCPKG_FORCE_SYSTEM_BINARIES=1 && cmake -B . -DENABLE_ARM64=ON ../base'
nProc: 6
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/CI-Win-CUDA.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ jobs:
flav: 'Windows-cuda'
cuda: 'ON'
is-selfhosted: true
is-build-gst: false # part of vcpkg on windows
nProc: 8
nTestTimeoutMins: 20
win-cuda-publish:
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/CI-Win-NoCUDA.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ jobs:
flav: 'Win-nocuda'
cuda: 'OFF'
is-selfhosted: false
is-build-gst: false # part of vcpkg on windows
is-prep-phase: true
nProc: 3
win-nocuda-build-test:
Expand All @@ -28,7 +27,6 @@ jobs:
flav: 'Win-nocuda'
is-selfhosted: false
cuda: 'OFF'
is-build-gst: false # part of vcpkg on windows
is-prep-phase: false
nProc: 3
win-nocuda-publish:
Expand Down
12 changes: 0 additions & 12 deletions .github/workflows/build-test-lin-container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,6 @@ on:
description: 'this workflow is called for a prep phase: it will split vcpkg install into 2 portions to cache and save'
default: false
required: false
is-build-gst:
type: boolean
description: 'should we build GStreamer? we dont build on windows and ARM_Linux.'
default: true
required: false
cache-path:
type: string
description: 'the folder which needs to be cached e.g. .cache/vcpkg'
Expand All @@ -77,7 +72,6 @@ jobs:
build:
env:
TEST_EXE: build/aprapipesut
LD_LIB_PATH: '${{github.workspace}}/thirdparty/gst-build/gst-build-1.16/outInstall/lib/x86_64-linux-gnu:${{github.workspace}}/thirdparty/Video_Codec_SDK_10.0.26/Lib/linux/stubs/x86_64:/usr/local/cuda-10.2/compat/:/usr/local/cuda/lib64:${LD_LIBRARY_PATH-}'
CMAKE_TC_FILE: '../vcpkg/scripts/buildsystems/vcpkg.cmake' # Note: naming this variable as CMAKE_TOOLCHAIN_FILE can cause havoc!!!
container: ghcr.io/kumaakh/aprapipes-build-x86-ubutu18.04-cuda:latest
defaults:
Expand Down Expand Up @@ -136,7 +130,6 @@ jobs:
run: |
cp -R /root/.cache /github/home/ || true
ls ${{ inputs.cache-path }} || true
ls thirdparty/gst-build/gst-build-1.16/outInstall || true
continue-on-error: true

- name: Cache dependencies for fast cloud build
Expand All @@ -145,15 +138,10 @@ jobs:
with:
path: |
${{ inputs.cache-path }}
./thirdparty/gst-build/gst-build-1.16/outInstall/
./thirdparty/libmp4/build
key: ${{ inputs.flav }}-4-${{ hashFiles( 'base/vcpkg.json', 'vcpkg/baseline.json', 'submodule_ver.txt') }}
restore-keys: ${{ inputs.flav }}-

- name: Build Gstreamer On Linux_x64 when it is not cached
if: ${{ inputs.is-build-gst && steps.cache-all.outputs.cache-hit != 'true'}}
working-directory: ${{github.workspace}}/thirdparty
run: sh ./build_gstreamer.sh

- name: Build libmp4 when it is not cached
if: ${{ steps.cache-all.outputs.cache-hit != 'true' }}
Expand Down
16 changes: 0 additions & 16 deletions .github/workflows/build-test-lin-wsl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,6 @@ on:
description: 'this workflow is called for a prep phase: it will split vcpkg install into 2 portions to cache and save'
default: false
required: false
is-build-gst:
type: boolean
description: 'should we build GStreamer? we dont build on windows and ARM_Linux.'
default: true
required: false
cache-path:
type: string
description: 'the folder which needs to be cached e.g. .cache/vcpkg'
Expand All @@ -77,7 +72,6 @@ jobs:
build:
env:
TEST_EXE: build/aprapipesut
LD_LIB_PATH: './thirdparty/gst-build/gst-build-1.16/outInstall/lib/x86_64-linux-gnu:./thirdparty/Video_Codec_SDK_10.0.26/Lib/linux/stubs/x86_64:/usr/local/cuda-10.2/compat/:/usr/local/cuda/lib64:${LD_LIBRARY_PATH-}'
CMAKE_TC_FILE: '../vcpkg/scripts/buildsystems/vcpkg.cmake' # Note: naming this variable as CMAKE_TOOLCHAIN_FILE can cause havoc!!!
runs-on: ${{ inputs.runner }}
steps:
Expand Down Expand Up @@ -139,7 +133,6 @@ jobs:
run: |
cp -R /root/.cache /github/home/ || true
ls ${{ inputs.cache-path }} || true
ls thirdparty/gst-build/gst-build-1.16/outInstall || true
continue-on-error: true

- name: Cache dependencies for fast cloud build
Expand All @@ -148,25 +141,16 @@ jobs:
with:
path: |
${{ inputs.cache-path }}
./thirdparty/gst-build/gst-build-1.16/outInstall/
./thirdparty/libmp4/build
key: ${{ inputs.flav }}-4-${{ hashFiles( 'base/vcpkg.json', 'vcpkg/baseline.json', 'submodule_ver.txt') }}
restore-keys: ${{ inputs.flav }}-

- name: On WSL prep the thirdparty build scripts
working-directory: ${{github.workspace}}/thirdparty
run: |
(dos2unix ./build_gstreamer.sh) || true
chmod a+x ./build_gstreamer.sh
(dos2unix libmp4/build.cmd) || true
chmod a+x libmp4/build.cmd
shell: wsl-bash {0}

- name: Build Gstreamer On Linux_x64 when it is not cached
if: ${{ inputs.is-build-gst && steps.cache-all.outputs.cache-hit != 'true'}}
working-directory: ${{github.workspace}}/thirdparty
run: sh ./build_gstreamer.sh
shell: wsl-bash {0}

- name: Build libmp4 when it is not cached
if: ${{ steps.cache-all.outputs.cache-hit != 'true' }}
Expand Down
13 changes: 0 additions & 13 deletions .github/workflows/build-test-lin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,6 @@ on:
description: 'this workflow is called for a prep phase: it will split vcpkg install into 2 portions to cache and save'
default: false
required: false
is-build-gst:
type: boolean
description: 'should we build GStreamer? we dont build on windows and ARM_Linux.'
default: true
required: false
cache-path:
type: string
description: 'the folder which needs to be cached e.g. .cache/vcpkg'
Expand All @@ -77,7 +72,6 @@ jobs:
build:
env:
TEST_EXE: build/aprapipesut
LD_LIB_PATH: '${{github.workspace}}/thirdparty/gst-build/gst-build-1.16/outInstall/lib/x86_64-linux-gnu:${{github.workspace}}/thirdparty/Video_Codec_SDK_10.0.26/Lib/linux/stubs/x86_64:/usr/local/cuda-10.2/compat/:/usr/local/cuda/lib64:${LD_LIBRARY_PATH-}'
CMAKE_TC_FILE: '../vcpkg/scripts/buildsystems/vcpkg.cmake' # Note: naming this variable as CMAKE_TOOLCHAIN_FILE can cause havoc!!!
runs-on: ${{ inputs.runner }}
steps:
Expand Down Expand Up @@ -132,7 +126,6 @@ jobs:
run: |
cp -R /root/.cache /github/home/ || true
ls ${{ inputs.cache-path }} || true
ls thirdparty/gst-build/gst-build-1.16/outInstall || true
continue-on-error: true

- name: Cache dependencies for fast cloud build
Expand All @@ -141,15 +134,9 @@ jobs:
with:
path: |
${{ inputs.cache-path }}
./thirdparty/gst-build/gst-build-1.16/outInstall/
./thirdparty/libmp4/build
key: ${{ inputs.flav }}-4-${{ hashFiles( 'base/vcpkg.json', 'vcpkg/baseline.json', 'submodule_ver.txt') }}
restore-keys: ${{ inputs.flav }}-

- name: Build Gstreamer On Linux_x64 when it is not cached
if: ${{ inputs.is-build-gst && steps.cache-all.outputs.cache-hit != 'true'}}
working-directory: ${{github.workspace}}/thirdparty
run: sh ./build_gstreamer.sh

- name: Build libmp4 when it is not cached
if: ${{ steps.cache-all.outputs.cache-hit != 'true' }}
Expand Down
12 changes: 0 additions & 12 deletions .github/workflows/build-test-win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,6 @@ on:
description: 'this workflow is called for a prep phase: it will split vcpkg install into 2 portions to cache and save'
default: false
required: false
is-build-gst:
type: boolean
description: 'should we build GStreamer? we dont build on windows and ARM_Linux.'
default: true
required: false
cache-path:
type: string
description: 'the folder which needs to be cached e.g. .cache/vcpkg'
Expand Down Expand Up @@ -134,7 +129,6 @@ jobs:
run: |
cp -R /root/.cache /github/home/ || true
ls ${{ inputs.cache-path }} || true
ls thirdparty/gst-build/gst-build-1.16/outInstall || true
continue-on-error: true

- name: Cache dependencies for fast cloud build
Expand All @@ -143,15 +137,9 @@ jobs:
with:
path: |
${{ inputs.cache-path }}
${{ github.workspace }}/thirdparty/gst-build/gst-build-1.16/outInstall/
${{ github.workspace }}/thirdparty/libmp4/build/Release/mp4lib.lib
key: ${{ inputs.flav }}-3-${{ hashFiles( 'base/vcpkg.json', 'vcpkg/baseline.json', 'submodule_ver.txt') }}
restore-keys: ${{ inputs.flav }}-

- name: Build Gstreamer On Linux_x64 when it is not cached
if: ${{ inputs.is-build-gst && steps.cache-all.outputs.cache-hit != 'true'}}
working-directory: ${{github.workspace}}/thirdparty
run: sh ./build_gstreamer.sh

- name: Build libmp4 when it is not cached
if: ${{ steps.cache-all.outputs.cache-hit != 'true' }}
Expand Down
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
[submodule "vcpkg"]
path = vcpkg
url = https://github.com/Apra-Labs/vcpkg
[submodule "thirdparty/gst-build"]
path = thirdparty/gst-build
url = https://gitlab.freedesktop.org/gstreamer/gst-build.git
[submodule "thirdparty/libmp4"]
path = thirdparty/libmp4
url = https://github.com/Apra-Labs/libmp4.git
Expand Down
108 changes: 0 additions & 108 deletions base/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@ OPTION(ENABLE_LINUX "Use this switch to enable LINUX" ON)
OPTION(ENABLE_CUDA "Use this switch to enable CUDA" ON)
OPTION(ENABLE_ARM64 "Use this switch to enable ARM64" OFF)
OPTION(ENABLE_WINDOWS "Use this switch to enable WINDOWS" OFF)
OPTION(ENABLE_GST "Use this switch to integrate Gstreamer" ON)

IF(ENABLE_ARM64) #no GST build for ARM64 yet
set(ENABLE_GST OFF)
ENDIF(ENABLE_ARM64)

set(VCPKG_INSTALL_OPTIONS "--clean-after-build")
IF(ENABLE_CUDA)
Expand Down Expand Up @@ -41,10 +36,6 @@ project(APRAPIPES)

set ( LIBMP4_LIB_DIR "../thirdparty/libmp4/build/")
set ( LIBMP4_INC_DIR "../thirdparty/libmp4/include/")
IF(ENABLE_LINUX AND ENABLE_GST)
# no gst on arm64 yet, linux:x64 uses a non-vcpk build of gst
set(ENV{PKG_CONFIG_PATH} "${CMAKE_SOURCE_DIR}/../thirdparty/gst-build/gst-build-1.16/outInstall/lib/x86_64-linux-gnu/pkgconfig/")
ENDIF(ENABLE_LINUX AND ENABLE_GST)

IF(ENABLE_WINDOWS)
set (LIBMP4_LIB_DIR "${CMAKE_SOURCE_DIR}/../thirdparty/libmp4/build/${CMAKE_BUILD_TYPE}")
Expand All @@ -57,28 +48,6 @@ message(STATUS ${LIBMP4_INC_DIR} ">>>>>> LIBMP4_INC_DIR")
list(APPEND CMAKE_PREFIX_PATH ${LIBMP4_LIB_DIR})
find_library(LIBMP4_LIB NAMES mp4lib.lib libmp4lib.a REQUIRED)
find_package(PkgConfig REQUIRED)

IF(ENABLE_GST)
pkg_check_modules(gstreamer-1.0 REQUIRED IMPORTED_TARGET GLOBAL gstreamer-1.0)
pkg_check_modules(gobject-2.0 REQUIRED IMPORTED_TARGET GLOBAL gobject-2.0)
pkg_check_modules(glib-2.0 REQUIRED IMPORTED_TARGET GLOBAL glib-2.0)
pkg_check_modules(gio-2.0 REQUIRED IMPORTED_TARGET GLOBAL gio-2.0)
pkg_check_modules(gstreamer-rtp-1.0 REQUIRED IMPORTED_TARGET GLOBAL gstreamer-rtp-1.0)
pkg_check_modules(gstreamer-rtsp-1.0 REQUIRED IMPORTED_TARGET GLOBAL gstreamer-rtsp-1.0)
pkg_check_modules(gstreamer-rtsp-server-1.0 REQUIRED IMPORTED_TARGET GLOBAL gstreamer-rtsp-server-1.0)
pkg_check_modules(gstreamer-app-1.0 REQUIRED IMPORTED_TARGET GLOBAL gstreamer-app-1.0)
pkg_check_modules(gstreamer-net-1.0 REQUIRED IMPORTED_TARGET GLOBAL gstreamer-net-1.0)
pkg_check_modules(gstreamer-webrtc-1.0 REQUIRED IMPORTED_TARGET GLOBAL gstreamer-webrtc-1.0)
pkg_check_modules(libpcre REQUIRED IMPORTED_TARGET GLOBAL libpcre)
pkg_check_modules(gthread-2.0 REQUIRED IMPORTED_TARGET GLOBAL gthread-2.0)
pkg_check_modules(gmodule-2.0 REQUIRED IMPORTED_TARGET GLOBAL gmodule-2.0)
pkg_check_modules(gstreamer-base-1.0 REQUIRED IMPORTED_TARGET GLOBAL gstreamer-base-1.0)
IF(NOT ENABLE_WINDOWS)
pkg_check_modules(json-glib-1.0 REQUIRED IMPORTED_TARGET GLOBAL json-glib-1.0)
pkg_check_modules(libsoup-2.4 REQUIRED IMPORTED_TARGET GLOBAL libsoup-2.4)
ENDIF(NOT ENABLE_WINDOWS)

ENDIF(ENABLE_GST)


find_package(Boost COMPONENTS system thread filesystem serialization log chrono unit_test_framework REQUIRED)
Expand Down Expand Up @@ -315,16 +284,6 @@ SET(IP_FILES
)


IF(ENABLE_GST)
IF(NOT ENABLE_WINDOWS)
list(APPEND IP_FILES
src/GstWebRTCSink.cpp
)
ENDIF(NOT ENABLE_WINDOWS)
list(APPEND IP_FILES
src/GstOnvifRtspSink.cpp
)
ENDIF(ENABLE_GST)

SET(IP_FILES_H
include/HistogramOverlay.h
Expand All @@ -349,16 +308,6 @@ SET(IP_FILES_H
)


IF(ENABLE_GST)
IF(NOT ENABLE_WINDOWS)
list(APPEND IP_FILES
include/GstWebRTCSink.h
)
ENDIF(NOT ENABLE_WINDOWS)
list(APPEND IP_FILES
include/GstOnvifRtspSink.h
)
ENDIF(ENABLE_GST)

SET(CUDA_CORE_FILES
src/apra_cudamalloc_allocator.cu
Expand Down Expand Up @@ -495,7 +444,6 @@ ENDIF(ENABLE_CUDA)
message(STATUS "-------------Printing Soure file list-----------------${SOURCE}")
add_library(aprapipes STATIC ${SOURCE})

message(STATUS "-------------Printing Include folder-----------------${gstreamer-1.0_INCLUDE_DIRS}")
target_include_directories ( aprapipes PRIVATE
${JETSON_MULTIMEDIA_LIB_INCLUDE}
${FFMPEG_INCLUDE_DIRS}
Expand All @@ -505,32 +453,6 @@ ${LIBMP4_INC_DIR}
${NVCODEC_INCLUDE_DIR}
)

IF(ENABLE_GST)
target_include_directories ( aprapipes PRIVATE
${gstreamer-app-1.0_INCLUDE_DIRS}
${gstreamer-base-1.0_INCLUDE_DIRS}
${gstreamer-1.0_INCLUDE_DIRS}
${gstreamer-rtsp-server-1.0_INCLUDE_DIRS}
${gstreamer-webrtc-1.0_INCLUDE_DIRS}
${libpcre_INCLUDE_DIRS}
${glib-2.0_INCLUDE_DIRS}
${gstreamer-rtsp-1.0_INCLUDE_DIRS}
${gstreamer-rtp-1.0_INCLUDE_DIRS}
${gstreamer-net-1.0_INCLUDE_DIRS}
${gio-2.0_INCLUDE_DIRS}
${gmodule-2.0_INCLUDE_DIRS}
${gthread-2.0_INCLUDE_DIRS}
${gobject-2.0_INCLUDE_DIRS}
)
IF(NOT ENABLE_WINDOWS)
target_include_directories( aprapipes PRIVATE
${gstreamer-webrtc-1.0_INCLUDE_DIRS}
${json-glib-1.0_INCLUDE_DIRS}
${libsoup-2.4_INCLUDE_DIRS}
)
ENDIF(NOT ENABLE_WINDOWS)
ENDIF(ENABLE_GST)


# aprapipes Unit Tests

Expand Down Expand Up @@ -635,34 +557,6 @@ IF(ENABLE_LINUX)
)
ENDIF(ENABLE_LINUX)

IF(ENABLE_GST)
SET(GST_LIBS
PkgConfig::gstreamer-app-1.0
PkgConfig::gstreamer-base-1.0
PkgConfig::gstreamer-1.0
PkgConfig::gstreamer-rtsp-server-1.0
PkgConfig::libpcre
PkgConfig::glib-2.0
PkgConfig::gstreamer-rtsp-1.0
PkgConfig::gstreamer-rtp-1.0
PkgConfig::gstreamer-net-1.0
)
list(APPEND UT_FILES
test/gstrtsponvifsink_tests.cpp
)

IF(NOT ENABLE_WINDOWS)
list(APPEND GST_LIBS
PkgConfig::gstreamer-webrtc-1.0
PkgConfig::json-glib-1.0
PkgConfig::libsoup-2.4
)
list(APPEND UT_FILES
test/gstwebrtcsink_tests.cpp
)
ENDIF(NOT ENABLE_WINDOWS)
ENDIF(ENABLE_GST)


add_executable(aprapipesut ${UT_FILES})

Expand Down Expand Up @@ -690,7 +584,6 @@ target_link_libraries(aprapipesut
${NVCODEC_LIB}
${NVJPEGLIB_L4T}
${CURSES_LIBRARIES}
${GST_LIBS}
ZXing::Core
ZXing::ZXing
BZip2::BZip2
Expand All @@ -701,7 +594,6 @@ target_link_libraries(aprapipesut
)

IF(ENABLE_WINDOWS)
#file(GLOB RUNTIME_DLLS ../thirdparty/gst-build/gst-build-1.16/outInstall/bin/*.dll)
file(COPY ${RUNTIME_DLLS} DESTINATION Debug/)
file(COPY ${RUNTIME_DLLS} DESTINATION Release/)
IF(GHA)
Expand Down
Loading

0 comments on commit bd172e5

Please sign in to comment.