File tree Expand file tree Collapse file tree 3 files changed +253
-12
lines changed
include/com/amazonaws/kinesis/video/webrtcclient Expand file tree Collapse file tree 3 files changed +253
-12
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ option(INSTRUMENTED_ALLOCATORS "Enable memory instrumentation" OFF)
2323option (ENABLE_AWS_SDK_IN_TESTS "Enable support for compiling AWS SDKs for tests" ON )
2424option (ENABLE_STATS_CALCULATION_CONTROL "Enable support for runtime control of ice agent stat calculations." OFF )
2525option (BUILD_OLD_MBEDTLS_VERSION "Use MbedTLS version 2.28.8." OFF )
26+ option (PREFER_DYNAMIC_ALLOCS "Prefer dynamic allocations for payloads and URLs" OFF )
2627
2728# Developer Flags
2829option (BUILD_TEST "Build the testing tree." OFF )
@@ -133,6 +134,10 @@ if (ENABLE_STATS_CALCULATION_CONTROL)
133134 add_definitions (-DENABLE_STATS_CALCULATION_CONTROL)
134135endif ()
135136
137+ if (PREFER_DYNAMIC_ALLOCS)
138+ add_definitions (-DPREFER_DYNAMIC_ALLOCS=1)
139+ endif ()
140+
136141if (USE_OPENSSL)
137142 add_definitions (-DKVS_USE_OPENSSL)
138143elseif (USE_MBEDTLS)
Original file line number Diff line number Diff line change @@ -1279,6 +1279,21 @@ typedef struct {
12791279 //!<
12801280} RtcIceCandidateInit , * PRtcIceCandidateInit ;
12811281
1282+ /**
1283+ * @brief Define this macro to use dynamically allocated payload in SignalingMessage
1284+ * This can be useful for platforms with limited memory as it avoids allocating
1285+ * MAX_SIGNALING_MESSAGE_LEN for each message when only a small payload is needed
1286+ */
1287+
1288+ /**
1289+ * @brief If PREFER_DYNAMIC_ALLOCS is set to 1, use dynamic allocation for signaling payload
1290+ * Otherwise, use the existing DYNAMIC_SIGNALING_PAYLOAD setting
1291+ */
1292+ #if PREFER_DYNAMIC_ALLOCS
1293+ #define DYNAMIC_SIGNALING_PAYLOAD 1
1294+ #define USE_DYNAMIC_URL 1
1295+ #endif
1296+
12821297/**
12831298 * @brief Structure defining the basic signaling message
12841299 */
@@ -1293,7 +1308,11 @@ typedef struct {
12931308
12941309 UINT32 payloadLen ; //!< Optional payload length. If 0, the length will be calculated
12951310
1311+ #ifdef DYNAMIC_SIGNALING_PAYLOAD
1312+ PCHAR payload ; //!< Actual signaling message payload - dynamically allocated
1313+ #else
12961314 CHAR payload [MAX_SIGNALING_MESSAGE_LEN + 1 ]; //!< Actual signaling message payload
1315+ #endif
12971316} SignalingMessage , * PSignalingMessage ;
12981317
12991318/**
You can’t perform that action at this time.
0 commit comments