Skip to content

Commit 4c26470

Browse files
jdelapladisa6302niyatim23ela34northteam
committed
Release 1 7 0 (#1354)
* Log ice candidate protocol appropriately (#1230) * Log ice candidate protocol appropriately * Add develop to travis CI * Address comments * Realign branches during transition (#1257) * create data channel sample (#1203) * create data channel sample * moved variables to Samples.h, encapsulated with ENABLE_DATA_CHANNEL directive * removed unused variables, moved variable declarations to the top of a block * create data channel sample * moved variables to Samples.h, encapsulated with ENABLE_DATA_CHANNEL directive * Cancel the thread once mediaThreadStarted flag is set to false (#1227) * Initial stale PR template (#1226) * Update stale issue template * Testing every minute * Fix stale issue PR template (#1234) No code changed. Just a template change. So merging * Add bug and question label * Switch stale PR action to daily cadence * [FIX] When protocol in DCEP header of data channel open command is not empty, there is a check preventing the data channel to be opened. Now protocol length is correctly handled to avoid check failing. (#1228) Co-authored-by: Niyati Maheshwari <niyatim23@gmail.com> Co-authored-by: Divya Sampath Kumar <disa6302@colorado.edu> Co-authored-by: ela34 <8700736+ela34@users.noreply.github.com> * set protocol value following the spec (#1259) Co-authored-by: liyufang <liyufang@xiaomi.com> * filter out invalid candidate in sdp (#1260) Co-authored-by: liyufang <liyufang@xiaomi.com> * Added targets for cmake clean (#1253) * added targets for cmake clean * added new line, updated readme * added missing new line * updated readme to include folder details * updated readme to include folder details * viewer sample: wrap datachannel callback with `ENABLE_DATA_CHANNEL` (#1261) * create data channel sample (#1203) * create data channel sample * moved variables to Samples.h, encapsulated with ENABLE_DATA_CHANNEL directive * removed unused variables, moved variable declarations to the top of a block * create data channel sample * moved variables to Samples.h, encapsulated with ENABLE_DATA_CHANNEL directive * Cancel the thread once mediaThreadStarted flag is set to false (#1227) * Initial stale PR template (#1226) * Update stale issue template * Testing every minute * Fix stale issue PR template (#1234) No code changed. Just a template change. So merging * Add bug and question label * Switch stale PR action to daily cadence * [FIX] When protocol in DCEP header of data channel open command is not empty, there is a check preventing the data channel to be opened. Now protocol length is correctly handled to avoid check failing. (#1228) * viewer sample: wrap datachannel callback with `ENABLE_DATA_CHANNEL` Signed-off-by: zhiqinli@amazon.com <zhiqinli@amazon.com> Co-authored-by: Niyati Maheshwari <niyatim23@gmail.com> Co-authored-by: Divya Sampath Kumar <disa6302@colorado.edu> Co-authored-by: ela34 <8700736+ela34@users.noreply.github.com> * libwebsockets: add patch to fix pipe fd leak issue (#1264) Signed-off-by: Alex.Li <zhiqinli@amazon.com> * Fix scripts/pare_status.py for non-status #defines (#1268) (#1274) Co-authored-by: Kevin Allen <kallen@aurora.tech> * fix a few bugs * Revert "fix a few bugs" This reverts commit 0939024. * fix some bugs (#1277) * Fix bugs (#1279) * fix edge case try to unlock a mutex which is not locked in teh acse the sample config was NULL (#1286) * cmake: allow user to specify OPEN_SRC_INSTALL_PREFIX (#1293) Signed-off-by: Alex.Li <zhiqinli@amazon.com> * Fix inconsistent log priority (#1309) Patch reduces priority of a few info level log messages to verbose level to be consistent with other functions in file and rest of code base. * Modify protocol loggin design in develop (#1311) * typo: typo fix (#1317) Signed-off-by: Alex.Li <zhiqinli@amazon.com> * Signaling state machine rework (#1323) * replaced recursive calls to stepSignalingStateMachine with loops * removed recursive calls to stepSignalingStateMachine * replaced stepSignalingstatemachine with signalingStateMachineIterator * removed stepUntil, continueOnReady; removed status from iterator signature; set signalingclient version; added a lock in refreshIceConfiguration * changed the declaration for i from int to UINT32 * added signaling version; removed unnecessary comment * removed redeclaration; changed value in an existing macro * Fix issue with API call failures being treated as success (#1328) * return proper error, do not reset call result value * for non retriable failures, set the terminal exit status for state in… (#1320) * for non retriable failures, set the terminal exit status for state in state machine * address comments * adjust tests set retry max to 1 * Update LwsApiCalls.c trigger travis ci * Incorporating PIC state machine level retry changes into webrtc signaling state machine (#1326) * Incorporating PIC state machine level retry changes into webrtc signaling state machine * Signaling state machine rework (#1323) * replaced recursive calls to stepSignalingStateMachine with loops * removed recursive calls to stepSignalingStateMachine * replaced stepSignalingstatemachine with signalingStateMachineIterator * removed stepUntil, continueOnReady; removed status from iterator signature; set signalingclient version; added a lock in refreshIceConfiguration * changed the declaration for i from int to UINT32 * added signaling version; removed unnecessary comment * removed redeclaration; changed value in an existing macro * Fix issue with API call failures being treated as success (#1328) * return proper error, do not reset call result value * for non retriable failures, set the terminal exit status for state in… (#1320) * for non retriable failures, set the terminal exit status for state in state machine * address comments * adjust tests set retry max to 1 * Update LwsApiCalls.c trigger travis ci * Add retry strategy to client info to avoiud changing create signaling channel API signature * Incorporating PIC state machine level retry changes into webrtc signaling state machine * Add retry strategy to client info to avoiud changing create signaling channel API signature * Adding more debug logs in the code * fix merge conflicts * PR feedback Co-authored-by: Niyati Maheshwari <niyatim23@gmail.com> Co-authored-by: Hassan Sahibzada <hsahibza@amazon.com> * Revert " Incorporating PIC state machine level retry changes into webrtc signaling state machine (#1326)" (#1339) This reverts commit 06bffce. * Incorporating PIC state machine level retry changes into webrtc signaling state machine (#1341) * Incorporating PIC state machine level retry changes into webrtc signaling state machine * Add a n optional check for free retry strategy * Remove unused goto label * add missing sleep in get token state machine execute API * update log line * Update Producer hash * Adding a high level retry strategy while creating signaling client * Add Retry count retrieval in hook (#1335) * Add Retry count retrieval in hook * Fix compile issue on travis * Pull in latest changes in retry structures * Rebasing off develop with successful travis run for retry * Log git hash (#1345) * Log git hash * Update CMakeLists.txt white space change to trigger travis Co-authored-by: Hassan Sahibzada <hsahibza@amazon.com> * Fix retry count to indicate count only after a retry has occured (#1348) Fix retry count to indicate count only after a retry has occurred * add support for automatic clock skew detection and correction (#1344) * add support for automatic clock skew detection and correction * auto fix clock skew and add tests * enable test to check clock recovery * remove stuff left over from debugging, reset logging default to WARN * remove unused variable * get rid of verbose logging in unit tests causes static build to fail due to excessive log output * simplify code get rid of extra call to length because the lws_hdr_copy returns the same value * handle null stream track in case of recvonly (#1346) * handle null stream track in case of recvonly * a test with null stream track for revconly * Fix a comment * whitespace change * State machine preparation is decoupled from the constructor (#1343) * Merge master into develop (#1352) * Missing the public API switch in the other samples (#1356) * Fix Fetch error retry cases (#1359) * Fix Fetch error retry cases * update comment Co-authored-by: Divya Sampath Kumar <disa6302@colorado.edu> Co-authored-by: Niyati Maheshwari <niyatim23@gmail.com> Co-authored-by: ela34 <8700736+ela34@users.noreply.github.com> Co-authored-by: northteam <northteam@users.noreply.github.com> Co-authored-by: liyufang <liyufang@xiaomi.com> Co-authored-by: Alex.D.Scofield <zhiqinli@amazon.com> Co-authored-by: Kevin Allen <kallen@aurora.tech> Co-authored-by: Hassan Sahibzada <hsahibza@amazon.com> Co-authored-by: Chris Hiszpanski <chris@hiszpanski.name> Co-authored-by: Anurag Katey <kateyanurag@users.noreply.github.com>
1 parent a02c2f9 commit 4c26470

File tree

10 files changed

+60
-32
lines changed

10 files changed

+60
-32
lines changed

CMake/Dependencies/libkvsCommonLws-CMakeLists.txt

+4
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@ include(ExternalProject)
66

77
ExternalProject_Add(libkvsCommonLws-download
88
GIT_REPOSITORY https://github.com/awslabs/amazon-kinesis-video-streams-producer-c.git
9+
<<<<<<< HEAD
910
GIT_TAG 7d1b76f53680c1e23afb6f35f0cca97ccdb35e3f
11+
=======
12+
GIT_TAG c7fce9e06021452ff3c42dc70c8360606b22ad53
13+
>>>>>>> 22c9e3d79 (Release 1 7 0 (#1354))
1014
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/build
1115
CMAKE_ARGS
1216
-DCMAKE_INSTALL_PREFIX=${OPEN_SRC_INSTALL_PREFIX}

samples/Common.c

+22
Original file line numberDiff line numberDiff line change
@@ -1124,6 +1124,28 @@ STATUS freeSampleConfiguration(PSampleConfiguration* ppSampleConfiguration)
11241124
timerQueueFree(&pSampleConfiguration->timerQueueHandle);
11251125
}
11261126

1127+
if (IS_VALID_TIMER_QUEUE_HANDLE(pSampleConfiguration->timerQueueHandle)) {
1128+
if (pSampleConfiguration->iceCandidatePairStatsTimerId != MAX_UINT32) {
1129+
retStatus = timerQueueCancelTimer(pSampleConfiguration->timerQueueHandle, pSampleConfiguration->iceCandidatePairStatsTimerId,
1130+
(UINT64) pSampleConfiguration);
1131+
if (STATUS_FAILED(retStatus)) {
1132+
DLOGE("Failed to cancel stats timer with: 0x%08x", retStatus);
1133+
}
1134+
pSampleConfiguration->iceCandidatePairStatsTimerId = MAX_UINT32;
1135+
}
1136+
1137+
if (pSampleConfiguration->pregenerateCertTimerId != MAX_UINT32) {
1138+
retStatus = timerQueueCancelTimer(pSampleConfiguration->timerQueueHandle, pSampleConfiguration->pregenerateCertTimerId,
1139+
(UINT64) pSampleConfiguration);
1140+
if (STATUS_FAILED(retStatus)) {
1141+
DLOGE("Failed to cancel certificate pre-generation timer with: 0x%08x", retStatus);
1142+
}
1143+
pSampleConfiguration->pregenerateCertTimerId = MAX_UINT32;
1144+
}
1145+
1146+
timerQueueFree(&pSampleConfiguration->timerQueueHandle);
1147+
}
1148+
11271149
if (pSampleConfiguration->pPendingSignalingMessageForRemoteClient != NULL) {
11281150
// Iterate and free all the pending queues
11291151
stackQueueGetIterator(pSampleConfiguration->pPendingSignalingMessageForRemoteClient, &iterator);

samples/kvsWebRTCClientMaster.c

+16-2
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,20 @@ INT32 main(INT32 argc, CHAR* argv[])
6464
// Kick of the termination sequence
6565
ATOMIC_STORE_BOOL(&pSampleConfiguration->appTerminateFlag, TRUE);
6666

67+
if (IS_VALID_MUTEX_VALUE(pSampleConfiguration->sampleConfigurationObjLock)) {
68+
MUTEX_LOCK(pSampleConfiguration->sampleConfigurationObjLock);
69+
}
70+
71+
// Cancel the media thread
72+
if (pSampleConfiguration->mediaThreadStarted) {
73+
DLOGD("Canceling media thread");
74+
THREAD_CANCEL(pSampleConfiguration->mediaSenderTid);
75+
}
76+
77+
if (IS_VALID_MUTEX_VALUE(pSampleConfiguration->sampleConfigurationObjLock)) {
78+
MUTEX_UNLOCK(pSampleConfiguration->sampleConfigurationObjLock);
79+
}
80+
6781
if (pSampleConfiguration->mediaSenderTid != INVALID_TID_VALUE) {
6882
THREAD_JOIN(pSampleConfiguration->mediaSenderTid, NULL);
6983
}
@@ -185,7 +199,7 @@ PVOID sendVideoPackets(PVOID args)
185199
DLOGI("[KVS Master] Closing video thread");
186200
CHK_LOG_ERR(retStatus);
187201

188-
return (PVOID) (ULONG_PTR) retStatus;
202+
return (PVOID)(ULONG_PTR) retStatus;
189203
}
190204

191205
PVOID sendAudioPackets(PVOID args)
@@ -252,5 +266,5 @@ PVOID sampleReceiveAudioVideoFrame(PVOID args)
252266

253267
CleanUp:
254268

255-
return (PVOID) (ULONG_PTR) retStatus;
269+
return (PVOID)(ULONG_PTR) retStatus;
256270
}

samples/kvsWebRTCClientViewer.c

-22
Original file line numberDiff line numberDiff line change
@@ -135,28 +135,6 @@ INT32 main(INT32 argc, CHAR* argv[])
135135
DLOGI("[KVS Viewer] Data Channel open now...");
136136
#endif
137137

138-
#ifdef ENABLE_DATA_CHANNEL
139-
PRtcDataChannel pDataChannel = NULL;
140-
PRtcPeerConnection pPeerConnection = pSampleStreamingSession->pPeerConnection;
141-
SIZE_T datachannelLocalOpenCount = 0;
142-
143-
// Creating a new datachannel on the peer connection of the existing sample streaming session
144-
retStatus = createDataChannel(pPeerConnection, pChannelName, NULL, &pDataChannel);
145-
if(retStatus != STATUS_SUCCESS) {
146-
printf("[KVS Viewer] createDataChannel(): operation returned status code: 0x%08x \n", retStatus);
147-
goto CleanUp;
148-
}
149-
printf("[KVS Viewer] Creating data channel...completed\n");
150-
151-
// Setting a callback for when the data channel is open
152-
retStatus = dataChannelOnOpen(pDataChannel, (UINT64) &datachannelLocalOpenCount, dataChannelOnOpenCallback);
153-
if(retStatus != STATUS_SUCCESS) {
154-
printf("[KVS Viewer] dataChannelOnOpen(): operation returned status code: 0x%08x \n", retStatus);
155-
goto CleanUp;
156-
}
157-
printf("[KVS Viewer] Data Channel open now...\n");
158-
#endif
159-
160138
// Block until interrupted
161139
while (!ATOMIC_LOAD_BOOL(&pSampleConfiguration->interrupted) && !ATOMIC_LOAD_BOOL(&pSampleStreamingSession->terminateFlag)) {
162140
THREAD_SLEEP(HUNDREDS_OF_NANOS_IN_A_SECOND);

src/source/Ice/IceAgent.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -2731,8 +2731,8 @@ VOID iceAgentLogNewCandidate(PIceCandidate pIceCandidate)
27312731
break;
27322732
}
27332733
DLOGD("New %s ice candidate discovered. Id: %s. Ip: %s:%u. Type: %s. Protocol: %s.", pIceCandidate->isRemote ? "remote" : "local",
2734-
pIceCandidate->id, ipAddr, (UINT16) getInt16(pIceCandidate->ipAddress.port),
2735-
iceAgentGetCandidateTypeStr(pIceCandidate->iceCandidateType), protocol);
2734+
pIceCandidate->id, ipAddr, (UINT16) getInt16(pIceCandidate->ipAddress.port), iceAgentGetCandidateTypeStr(pIceCandidate->iceCandidateType),
2735+
protocol);
27362736
}
27372737
}
27382738

src/source/PeerConnection/PeerConnection.c

+9
Original file line numberDiff line numberDiff line change
@@ -1253,6 +1253,15 @@ STATUS addTransceiver(PRtcPeerConnection pPeerConnection, PRtcMediaStreamTrack p
12531253
}
12541254

12551255
CHK(pKvsPeerConnection != NULL, STATUS_NULL_ARG);
1256+
1257+
if (direction == RTC_RTP_TRANSCEIVER_DIRECTION_RECVONLY && pRtcMediaStreamTrack == NULL) {
1258+
MEMSET(&videoTrack, 0x00, SIZEOF(RtcMediaStreamTrack));
1259+
videoTrack.kind = MEDIA_STREAM_TRACK_KIND_VIDEO;
1260+
videoTrack.codec = RTC_CODEC_H264_PROFILE_42E01F_LEVEL_ASYMMETRY_ALLOWED_PACKETIZATION_MODE;
1261+
STRCPY(videoTrack.streamId, "myKvsVideoStream");
1262+
STRCPY(videoTrack.trackId, "myVideoTrack");
1263+
pRtcMediaStreamTrack = &videoTrack;
1264+
}
12561265

12571266
if (direction == RTC_RTP_TRANSCEIVER_DIRECTION_RECVONLY && pRtcMediaStreamTrack == NULL) {
12581267
MEMSET(&videoTrack, 0x00, SIZEOF(RtcMediaStreamTrack));

src/source/Signaling/Client.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ STATUS createSignalingClientSync(PSignalingClientInfo pClientInfo, PChannelInfo
6464
UINT64 signalingClientCreationWaitTime;
6565
UINT64 startTime = 0;
6666

67-
DLOGI("Creating Signaling Client Sync");
67+
DLOGV("Creating Signaling Client Sync");
6868
CHK(pSignalingHandle != NULL && pClientInfo != NULL, STATUS_NULL_ARG);
6969

7070
// Convert the client info to the internal structure with empty values

src/source/Signaling/LwsApiCalls.c

-1
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,6 @@ INT32 lwsHttpCallbackRoutine(struct lws* wsi, enum lws_callback_reasons reason,
173173
pLwsCallInfo->callInfo.callResult = SERVICE_CALL_SIGNATURE_NOT_YET_CURRENT;
174174
}
175175
}
176-
177176
} else {
178177
DLOGV("Received client http read response: %s", pLwsCallInfo->callInfo.responseData);
179178
}

src/source/Signaling/Signaling.c

+2
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ STATUS createSignalingSync(PSignalingClientInfoInternal pClientInfo, PChannelInf
4444

4545
pSignalingClient->version = SIGNALING_CLIENT_CURRENT_VERSION;
4646

47+
pSignalingClient->version = SIGNALING_CLIENT_CURRENT_VERSION;
48+
4749
// Set invalid call times
4850
pSignalingClient->describeTime = INVALID_TIMESTAMP_VALUE;
4951
pSignalingClient->createTime = INVALID_TIMESTAMP_VALUE;

src/source/Signaling/Signaling.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ extern "C" {
1414
#define SIGNALING_REQUEST_ID_HEADER_NAME KVS_REQUEST_ID_HEADER_NAME ":"
1515

1616
// Signaling client from custom data conversion
17-
#define SIGNALING_CLIENT_FROM_CUSTOM_DATA(h) ((PSignalingClient) (h))
18-
#define CUSTOM_DATA_FROM_SIGNALING_CLIENT(p) ((UINT64) (p))
17+
#define SIGNALING_CLIENT_FROM_CUSTOM_DATA(h) ((PSignalingClient)(h))
18+
#define CUSTOM_DATA_FROM_SIGNALING_CLIENT(p) ((UINT64)(p))
1919

2020
// Grace period for refreshing the ICE configuration
2121
#define ICE_CONFIGURATION_REFRESH_GRACE_PERIOD (30 * HUNDREDS_OF_NANOS_IN_A_SECOND)
@@ -346,8 +346,8 @@ typedef struct {
346346
} SignalingClient, *PSignalingClient;
347347

348348
// Public handle to and from object converters
349-
#define TO_SIGNALING_CLIENT_HANDLE(p) ((SIGNALING_CLIENT_HANDLE) (p))
350-
#define FROM_SIGNALING_CLIENT_HANDLE(h) (IS_VALID_SIGNALING_CLIENT_HANDLE(h) ? (PSignalingClient) (h) : NULL)
349+
#define TO_SIGNALING_CLIENT_HANDLE(p) ((SIGNALING_CLIENT_HANDLE)(p))
350+
#define FROM_SIGNALING_CLIENT_HANDLE(h) (IS_VALID_SIGNALING_CLIENT_HANDLE(h) ? (PSignalingClient)(h) : NULL)
351351

352352
STATUS createSignalingSync(PSignalingClientInfoInternal, PChannelInfo, PSignalingClientCallbacks, PAwsCredentialProvider, PSignalingClient*);
353353
STATUS freeSignaling(PSignalingClient*);

0 commit comments

Comments
 (0)