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

Apply signaling component #1950

Closed
wants to merge 26 commits into from
Closed
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
a4507f5
Apply signaling component
ActoryOu Mar 8, 2024
43eb203
align cmake commands for sdp and signaling
ActoryOu Mar 11, 2024
4297549
apply signaling API&structure change
ActoryOu Mar 12, 2024
aab28f9
clang formatting
ActoryOu Mar 13, 2024
7e13449
Remove unused variables, fix webrtc_client_test build
ActoryOu Mar 13, 2024
4bc41c5
Add -fPIC for coreJSON if compiler is GNU or Clang
ActoryOu Mar 13, 2024
8611f19
Fix coreJSON cmake args.
ActoryOu Mar 13, 2024
298eaaf
Remove more unused variables and add debug log in sample-check.sh
ActoryOu Mar 14, 2024
7cb4e5b
Remove redundant spaces in cmake files.
ActoryOu Mar 14, 2024
813c8e7
Remove unused variables.
ActoryOu Mar 14, 2024
99e8e4e
Fix static compilation
ActoryOu Mar 15, 2024
0c09c9e
cast from SIZE_T to size_t for signaling APIs
ActoryOu Mar 18, 2024
5c9c1bc
Merge branch 'develop' into ApplySignalingComponent
ActoryOu May 15, 2024
ea246be
Remove signaling APIunit test cases those are moved into Signaling co…
ActoryOu May 16, 2024
56fa0f6
Remove context in Signaling APIs.
ActoryOu Jun 4, 2024
48daae4
Fix formatting
ActoryOu Jun 4, 2024
fa63887
Fix mac compilation
ActoryOu Jun 4, 2024
7e5631a
Fix MAC clang compilation
ActoryOu Jun 4, 2024
63494fe
Remove ICE server list in both send/recv websocket messages.
ActoryOu Jun 21, 2024
efdf809
Merge branch 'develop' into ApplySignalingComponent
ActoryOu Jun 21, 2024
dc01a7a
Fix compilation and fix comments.
ActoryOu Jun 21, 2024
40a1e66
Remove unnecessary includes/definitions.
ActoryOu Jun 21, 2024
9509ccd
Removing Ice server lists in SDP_OFFER or SDP_ANSWER in unit tests.
ActoryOu Jun 21, 2024
c116583
Empty commit to trigger CI.
ActoryOu Jun 21, 2024
0379d0c
Remove unused variables.
ActoryOu Jun 26, 2024
280e1f0
Fix CI - unused vars (#2017)
disa6302 Jun 25, 2024
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
24 changes: 24 additions & 0 deletions CMake/Dependencies/libcorejson-CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
cmake_minimum_required(VERSION 3.6.3)

project(libcorejson NONE)

if (BUILD_STATIC_LIBS OR WIN32)
set(LIBCOREJSON_SHARED_LIBS OFF)
else()
set(LIBCOREJSON_SHARED_LIBS ON)
endif()

include(ExternalProject)
ExternalProject_Add(libcorejson
GIT_REPOSITORY https://github.com/FreeRTOS/coreJSON.git
GIT_TAG dc1ab9130a1fb99b801a2a1fa8e9f42239f752be
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/build
PATCH_COMMAND git apply --ignore-whitespace ${CMAKE_CURRENT_LIST_DIR}/libcorejson-add-cmakelists.patch
CMAKE_ARGS
-DCMAKE_INSTALL_PREFIX=${OPEN_SRC_INSTALL_PREFIX}
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-DBUILD_SHARED_LIBS=${LIBCOREJSON_SHARED_LIBS}
"-DCMAKE_C_FLAGS=${CMAKE_C_FLAGS} -fPIC"
BUILD_ALWAYS TRUE
TEST_COMMAND ""
)
31 changes: 31 additions & 0 deletions CMake/Dependencies/libcorejson-add-cmakelists.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 0000000..9a5f850
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,25 @@
+cmake_minimum_required(VERSION 3.6.3)
+project(corejson C)
+
+include(jsonFilePaths.cmake)
+
+if(BUILD_SHARED_LIBS)
+ add_library(corejson SHARED ${JSON_SOURCES})
+else()
+ add_library(corejson STATIC ${JSON_SOURCES})
+endif()
+
+target_include_directories(corejson PUBLIC
+ ${JSON_INCLUDE_PUBLIC_DIRS})
+
+# install header files
+install(
+ FILES ${JSON_INCLUDE_PUBLIC_DIRS}/core_json.h
+ DESTINATION include/corejson)
+
+install(
+ TARGETS corejson
+ ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
+ LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
+ RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
+
23 changes: 23 additions & 0 deletions CMake/Dependencies/libkvssignaling-CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
cmake_minimum_required(VERSION 3.6.3)

project(libkvssignaling NONE)

include(ExternalProject)
if (BUILD_STATIC_LIBS OR WIN32)
set(LIBKVSSIGNALING_SHARED_LIBS OFF)
else()
set(LIBKVSSIGNALING_SHARED_LIBS ON)
endif()

ExternalProject_Add(libkvssignaling
GIT_REPOSITORY https://github.com/ActoryOu/amazon-kinesis-video-streams-signaling-public.git
GIT_TAG aggarg_suggestions
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/build
CMAKE_ARGS
-DCMAKE_INSTALL_PREFIX=${OPEN_SRC_INSTALL_PREFIX}
-DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
-DBUILD_SHARED_LIBS=${LIBKVSSIGNALING_SHARED_LIBS}
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
BUILD_ALWAYS TRUE
TEST_COMMAND ""
)
4 changes: 3 additions & 1 deletion CMake/Utilities.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ function(build_dependency lib_name)
kvsCommonLws
kvssdp
kvsstun
kvsrtp)
kvsrtp
corejson
kvssignaling)
list(FIND supported_libs ${lib_name} index)
if(${index} EQUAL -1)
message(WARNING "${lib_name} is not supported to build from source")
Expand Down
19 changes: 18 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -225,11 +225,24 @@ if(BUILD_DEPENDENCIES)
build_dependency(kvsrtp ${BUILD_ARGS})

set(BUILD_ARGS
-DBUILD_STATIC_LIBS=${BUILD_STATIC_LIBS}
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-DCMAKE_C_FLAGS=${CMAKE_C_FLAGS})

build_dependency(usrsctp ${BUILD_ARGS})
build_dependency(corejson ${BUILD_ARGS})

set(BUILD_ARGS
-DBUILD_STATIC_LIBS=${BUILD_STATIC_LIBS}
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
"-DCMAKE_C_FLAGS=${CMAKE_C_FLAGS} -I${OPEN_SRC_INSTALL_PREFIX}/include/corejson")

build_dependency(kvssignaling ${BUILD_ARGS})

set(BUILD_ARGS
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-DCMAKE_C_FLAGS=${CMAKE_C_FLAGS})

build_dependency(usrsctp ${BUILD_ARGS})

if(BUILD_TEST)
build_dependency(gtest)
Expand Down Expand Up @@ -412,6 +425,8 @@ target_link_libraries(
kvssdp
kvsstun
kvsrtp
corejson
kvssignaling
${CMAKE_THREAD_LIBS_INIT}
${OPENSSL_SSL_LIBRARY}
${OPENSSL_CRYPTO_LIBRARY}
Expand All @@ -436,6 +451,8 @@ target_link_libraries(
kvssdp
kvsstun
kvsrtp
corejson
kvssignaling
PRIVATE kvspicUtils
kvspicState
${CMAKE_THREAD_LIBS_INIT}
Expand Down
6 changes: 3 additions & 3 deletions samples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,13 @@ add_executable(
kvsWebrtcClientMaster
Common.c
kvsWebRTCClientMaster.c)
target_link_libraries(kvsWebrtcClientMaster kvsWebrtcClient kvsWebrtcSignalingClient ${EXTRA_DEPS} kvsCommonLws kvspicUtils websockets kvssdp kvsstun kvsrtp)
target_link_libraries(kvsWebrtcClientMaster kvsWebrtcClient kvsWebrtcSignalingClient ${EXTRA_DEPS} kvsCommonLws kvspicUtils websockets kvssdp kvsstun kvsrtp kvssignaling corejson)

add_executable(
kvsWebrtcClientViewer
Common.c
kvsWebRTCClientViewer.c)
target_link_libraries(kvsWebrtcClientViewer kvsWebrtcClient kvsWebrtcSignalingClient ${EXTRA_DEPS} kvsCommonLws kvspicUtils websockets kvssdp kvsstun kvsrtp)
target_link_libraries(kvsWebrtcClientViewer kvsWebrtcClient kvsWebrtcSignalingClient ${EXTRA_DEPS} kvsCommonLws kvspicUtils websockets kvssdp kvsstun kvsrtp kvssignaling corejson)

add_executable(
discoverNatBehavior
Expand All @@ -81,7 +81,7 @@ if(GST_FOUND)
GstAudioVideoReceiver.c
kvsWebRTCClientMasterGstSample.c
)
target_link_libraries(kvsWebrtcClientMasterGstSample kvsWebrtcClient kvsWebrtcSignalingClient ${EXTRA_DEPS} ${GST_SAMPLE_LIBRARIES} kvsCommonLws kvspicUtils websockets kvssdp kvsstun kvsrtp)
target_link_libraries(kvsWebrtcClientMasterGstSample kvsWebrtcClient kvsWebrtcSignalingClient ${EXTRA_DEPS} ${GST_SAMPLE_LIBRARIES} kvsCommonLws kvspicUtils websockets kvssdp kvsstun kvsrtp kvssignaling corejson)

install(TARGETS kvsWebrtcClientMasterGstSample
RUNTIME DESTINATION bin
Expand Down
1 change: 1 addition & 0 deletions scripts/check-sample.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ set -xv

pwd
ls -l
ls -l open-source/lib

pids=""
cd build/samples
Expand Down
33 changes: 0 additions & 33 deletions src/source/Signaling/ChannelInfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -317,39 +317,6 @@ PCHAR getStringFromChannelType(SIGNALING_CHANNEL_TYPE type)
return typeStr;
}

SIGNALING_CHANNEL_ROLE_TYPE getChannelRoleTypeFromString(PCHAR type, UINT32 length)
{
// Assume the channel Deleting status first
SIGNALING_CHANNEL_ROLE_TYPE channelRoleType = SIGNALING_CHANNEL_ROLE_TYPE_UNKNOWN;

if (0 == STRNCMP(SIGNALING_CHANNEL_ROLE_TYPE_MASTER_STR, type, length)) {
channelRoleType = SIGNALING_CHANNEL_ROLE_TYPE_MASTER;
} else if (0 == STRNCMP(SIGNALING_CHANNEL_ROLE_TYPE_VIEWER_STR, type, length)) {
channelRoleType = SIGNALING_CHANNEL_ROLE_TYPE_VIEWER;
}

return channelRoleType;
}

PCHAR getStringFromChannelRoleType(SIGNALING_CHANNEL_ROLE_TYPE type)
{
PCHAR typeStr;

switch (type) {
case SIGNALING_CHANNEL_ROLE_TYPE_MASTER:
typeStr = SIGNALING_CHANNEL_ROLE_TYPE_MASTER_STR;
break;
case SIGNALING_CHANNEL_ROLE_TYPE_VIEWER:
typeStr = SIGNALING_CHANNEL_ROLE_TYPE_VIEWER_STR;
break;
default:
typeStr = SIGNALING_CHANNEL_ROLE_TYPE_UNKNOWN_STR;
break;
}

return typeStr;
}

// https://docs.aws.amazon.com/kinesisvideostreams-webrtc-dg/latest/devguide/kvswebrtc-how-iam.html#kinesis-using-iam-arn-format
// Example: arn:aws:kinesisvideo:region:account-id:channel/channel-name/code
STATUS validateKvsSignalingChannelArnAndExtractChannelName(PChannelInfo pChannelInfo, PUINT16 pStart, PUINT16 pNumChars)
Expand Down
24 changes: 0 additions & 24 deletions src/source/Signaling/ChannelInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,6 @@ extern "C" {
#define SIGNALING_CHANNEL_TYPE_UNKNOWN_STR (PCHAR) "UNKOWN"
#define SIGNALING_CHANNEL_TYPE_SINGLE_MASTER_STR (PCHAR) "SINGLE_MASTER"

// Signaling channel role type string
#define SIGNALING_CHANNEL_ROLE_TYPE_UNKNOWN_STR (PCHAR) "UNKOWN"
#define SIGNALING_CHANNEL_ROLE_TYPE_MASTER_STR (PCHAR) "MASTER"
#define SIGNALING_CHANNEL_ROLE_TYPE_VIEWER_STR (PCHAR) "VIEWER"

// Min and max for the message TTL value
#define MIN_SIGNALING_MESSAGE_TTL_VALUE (5 * HUNDREDS_OF_NANOS_IN_A_SECOND)
#define MAX_SIGNALING_MESSAGE_TTL_VALUE (120 * HUNDREDS_OF_NANOS_IN_A_SECOND)
Expand Down Expand Up @@ -86,25 +81,6 @@ SIGNALING_CHANNEL_TYPE getChannelTypeFromString(PCHAR, UINT32);
*/
PCHAR getStringFromChannelType(SIGNALING_CHANNEL_TYPE);

/**
* Returns the signaling channel Role from a string
*
* @param - PCHAR - IN - String representation of the channel role
* @param - UINT32 - IN - String length
*
* @return - Signaling channel type
*/
SIGNALING_CHANNEL_ROLE_TYPE getChannelRoleTypeFromString(PCHAR, UINT32);

/**
* Returns the signaling channel role type string
*
* @param - SIGNALING_CHANNEL_TYPE - IN - Signaling channel type
*
* @return - Signaling channel type string
*/
PCHAR getStringFromChannelRoleType(SIGNALING_CHANNEL_ROLE_TYPE);

/**
* Determines whether or not the channel arn is valid
* If VALID it extracts the channel name
Expand Down
Loading
Loading