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)
23
23
option (ENABLE_AWS_SDK_IN_TESTS "Enable support for compiling AWS SDKs for tests" ON )
24
24
option (ENABLE_STATS_CALCULATION_CONTROL "Enable support for runtime control of ice agent stat calculations." OFF )
25
25
option (BUILD_OLD_MBEDTLS_VERSION "Use MbedTLS version 2.28.8." OFF )
26
+ option (PREFER_DYNAMIC_ALLOCS "Prefer dynamic allocations for signalingpayloads and URLs" OFF )
26
27
27
28
# Developer Flags
28
29
option (BUILD_TEST "Build the testing tree." OFF )
@@ -147,6 +148,10 @@ if (ENABLE_STATS_CALCULATION_CONTROL)
147
148
add_definitions (-DENABLE_STATS_CALCULATION_CONTROL )
148
149
endif ()
149
150
151
+ if (PREFER_DYNAMIC_ALLOCS )
152
+ add_definitions (-DPREFER_DYNAMIC_ALLOCS=1 )
153
+ endif ()
154
+
150
155
if (USE_OPENSSL )
151
156
add_definitions (-DKVS_USE_OPENSSL )
152
157
elseif (USE_MBEDTLS )
Original file line number Diff line number Diff line change @@ -1279,6 +1279,21 @@ typedef struct {
1279
1279
//!<
1280
1280
} RtcIceCandidateInit , * PRtcIceCandidateInit ;
1281
1281
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
+
1282
1297
/**
1283
1298
* @brief Structure defining the basic signaling message
1284
1299
*/
@@ -1293,7 +1308,11 @@ typedef struct {
1293
1308
1294
1309
UINT32 payloadLen ; //!< Optional payload length. If 0, the length will be calculated
1295
1310
1311
+ #ifdef DYNAMIC_SIGNALING_PAYLOAD
1312
+ PCHAR payload ; //!< Actual signaling message payload - dynamically allocated
1313
+ #else
1296
1314
CHAR payload [MAX_SIGNALING_MESSAGE_LEN + 1 ]; //!< Actual signaling message payload
1315
+ #endif
1297
1316
} SignalingMessage , * PSignalingMessage ;
1298
1317
1299
1318
/**
You can’t perform that action at this time.
0 commit comments