Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test and accommodate Producer C CMake improvements #1154

Open
wants to merge 17 commits into
base: develop-pre-3.4.1
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -322,11 +322,11 @@ jobs:
- name: Install dependencies
run: |
choco install nasm strawberryperl
choco install gstreamer --version=1.16.2
choco install gstreamer-devel --version=1.16.2
choco install gstreamer --version=1.22.8
choco install gstreamer-devel --version=1.22.8
- name: Build repository
run: |
$env:Path += ";C:\Strawberry\perl\site\bin;C:\Strawberry\perl\bin;C:\Strawberry\c\bin;C:\Program Files\NASM;C:\amazon-kinesis-video-streams-producer-sdk-cpp\open-source\local\lib;C:\amazon-kinesis-video-streams-producer-sdk-cpp\open-source\local\bin"
$env:Path += ";C:\Strawberry\perl\site\bin;C:\Strawberry\perl\bin;C:\Strawberry\c\bin;C:\Program Files\NASM;C:\amazon-kinesis-video-streams-producer-sdk-cpp\open-source\lib;C:\amazon-kinesis-video-streams-producer-sdk-cpp\open-source\bin"
cd C:\amazon-kinesis-video-streams-producer-sdk-cpp
.github\build_windows.bat
- name: Configure AWS Credentials
Expand All @@ -338,7 +338,7 @@ jobs:
role-duration-seconds: 10800
- name: Run tests
run: |
$env:Path += ';C:\Strawberry\perl\site\bin;C:\Strawberry\perl\bin;C:\Strawberry\c\bin;C:\Program Files\NASM;C:\amazon-kinesis-video-streams-producer-sdk-cpp\open-source\local\lib;C:\amazon-kinesis-video-streams-producer-sdk-cpp\open-source\local\bin'
$env:Path += ';C:\Strawberry\perl\site\bin;C:\Strawberry\perl\bin;C:\Strawberry\c\bin;C:\Program Files\NASM;C:\amazon-kinesis-video-streams-producer-sdk-cpp\open-source\lib;C:\amazon-kinesis-video-streams-producer-sdk-cpp\open-source\bin'
& "C:\amazon-kinesis-video-streams-producer-sdk-cpp\build\tst\producerTest.exe"

arm64-cross-compilation:
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ cmake-build-debug/
cmake-build-release/
doc/
open-source/
outputs
tags
dependency

Expand Down
2 changes: 1 addition & 1 deletion CMake/Dependencies/libkvscproducer-CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ include(ExternalProject)
# clone repo only
ExternalProject_Add(libkvscproducer-download
GIT_REPOSITORY https://github.com/awslabs/amazon-kinesis-video-streams-producer-c.git
GIT_TAG develop
GIT_TAG cmake-cleanup
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remember to change this back to /develop branch once Producer C PR is merged

SOURCE_DIR "${CMAKE_CURRENT_BINARY_DIR}/kvscproducer-src"
BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/kvscproducer-build"
CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
Expand Down
26 changes: 11 additions & 15 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,11 @@ endif()

if(BUILD_DEPENDENCIES)
if(NOT EXISTS ${KINESIS_VIDEO_OPEN_SOURCE_SRC})
file(MAKE_DIRECTORY ${KINESIS_VIDEO_OPEN_SOURCE_SRC}/local)
file(MAKE_DIRECTORY ${KINESIS_VIDEO_OPEN_SOURCE_SRC})
endif()

if (NOT OPEN_SRC_INSTALL_PREFIX)
set(OPEN_SRC_INSTALL_PREFIX ${KINESIS_VIDEO_OPEN_SOURCE_SRC}/local)
set(OPEN_SRC_INSTALL_PREFIX ${KINESIS_VIDEO_OPEN_SOURCE_SRC})
set(ENV{PKG_CONFIG_PATH}
"$ENV{PKG_CONFIG_PATH}:${OPEN_SRC_INSTALL_PREFIX}/lib/pkgconfig")
set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} ${OPEN_SRC_INSTALL_PREFIX})
Expand All @@ -97,11 +97,11 @@ endif()
find_package(Threads)
find_package(PkgConfig REQUIRED)

pkg_check_modules(KVSCPRODUCER libcproducer)
if(KVSCPRODUCER_FOUND)
set(OPEN_SRC_INCLUDE_DIRS ${OPEN_SRC_INCLUDE_DIRS} ${KVSCPRODUCER_INCLUDE_DIRS})
link_directories(${KVSCPRODUCER_LIBRARY_DIRS})
else()
pkg_check_modules(KVSCPRODUCER libcproducer)
if(KVSCPRODUCER_FOUND)
set(OPEN_SRC_INCLUDE_DIRS ${OPEN_SRC_INCLUDE_DIRS} ${KVSCPRODUCER_INCLUDE_DIRS})
link_directories(${KVSCPRODUCER_LIBRARY_DIRS})
else()
set(DEPENDENCY_DOWNLOAD_PATH ${CMAKE_CURRENT_SOURCE_DIR}/dependency)
if(NOT EXISTS ${DEPENDENCY_DOWNLOAD_PATH})
file(MAKE_DIRECTORY ${DEPENDENCY_DOWNLOAD_PATH})
Expand All @@ -123,10 +123,10 @@ message("LOG4CPLUS_INCLUDE_DIR is ${LOG4CPLUS_INCLUDE_DIR}")
message("LOG4CPLUS_LIBRARIES is ${LOG4CPLUS_LIBRARIES}")

if (WIN32)
if(EXISTS "C:\\gstreamer\\1.0\\x86_64\\bin\\pkg-config.exe")
set(PKG_CONFIG_EXECUTABLE "C:\\gstreamer\\1.0\\x86_64\\bin\\pkg-config.exe")
if(EXISTS "C:\\gstreamer\\1.0\\msvc_x86_64\\bin\\pkg-config.exe")
set(PKG_CONFIG_EXECUTABLE "C:\\gstreamer\\1.0\\msvc_x86_64\\bin\\pkg-config.exe")
else()
set(PKG_CONFIG_EXECUTABLE "D:\\gstreamer\\1.0\\x86_64\\bin\\pkg-config.exe")
set(PKG_CONFIG_EXECUTABLE "D:\\gstreamer\\1.0\\msvc_x86_64\\bin\\pkg-config.exe")
endif()
endif()

Expand Down Expand Up @@ -178,9 +178,6 @@ include_directories(${KINESIS_VIDEO_PRODUCER_CPP_SRC}/src/credential-providers)
include_directories(${KINESIS_VIDEO_PRODUCER_CPP_SRC}/src/common)
include_directories(${KINESIS_VIDEO_PRODUCER_CPP_SRC}/src/JNI/include)

include_directories(${LOG4CPLUS_INCLUDE_DIR})


install(
DIRECTORY ${KINESIS_VIDEO_PRODUCER_CPP_SRC}/src
DESTINATION .)
Expand All @@ -194,7 +191,7 @@ endif()
target_link_libraries(
KinesisVideoProducer
PUBLIC cproducer
${LOG4CPLUS_LIBRARIES})
${LOG4CPLUS_LIBRARIES})

install(
TARGETS KinesisVideoProducer
Expand Down Expand Up @@ -228,7 +225,6 @@ if(BUILD_JNI)
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
endif()


if(BUILD_GSTREAMER_PLUGIN)
pkg_check_modules(GST_APP REQUIRED gstreamer-app-1.0)
include_directories(${GST_APP_INCLUDE_DIRS})
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ The equivalent for Windows is

```bat
set GST_PLUGIN_PATH=%CD%\build
set PATH=%PATH%;%CD%\open-source\local\bin;%CD%\open-source\local\lib
set PATH=%PATH%;%CD%\open-source\bin;%CD%\open-source\lib
```

Now if you execute `gst-inspect-1.0 kvssink` you should get information on the plugin like
Expand Down
Loading