Skip to content

Commit 1ffc834

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 53f2b15 commit 1ffc834

File tree

8 files changed

+60
-31
lines changed

8 files changed

+60
-31
lines changed

samples/Common.c

+22
Original file line numberDiff line numberDiff line change
@@ -1127,6 +1127,28 @@ STATUS freeSampleConfiguration(PSampleConfiguration* ppSampleConfiguration)
11271127
timerQueueFree(&pSampleConfiguration->timerQueueHandle);
11281128
}
11291129

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

samples/kvsWebRTCClientMaster.c

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

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

192-
return (PVOID) (ULONG_PTR) retStatus;
206+
return (PVOID)(ULONG_PTR) retStatus;
193207
}
194208

195209
PVOID sendAudioPackets(PVOID args)
@@ -259,5 +273,5 @@ PVOID sampleReceiveAudioVideoFrame(PVOID args)
259273

260274
CleanUp:
261275

262-
return (PVOID) (ULONG_PTR) retStatus;
276+
return (PVOID)(ULONG_PTR) retStatus;
263277
}

samples/kvsWebRTCClientViewer.c

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

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

src/source/Ice/IceAgent.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -2748,8 +2748,8 @@ VOID iceAgentLogNewCandidate(PIceCandidate pIceCandidate)
27482748
break;
27492749
}
27502750
DLOGD("New %s ice candidate discovered. Id: %s. Ip: %s:%u. Type: %s. Protocol: %s.", pIceCandidate->isRemote ? "remote" : "local",
2751-
pIceCandidate->id, ipAddr, (UINT16) getInt16(pIceCandidate->ipAddress.port),
2752-
iceAgentGetCandidateTypeStr(pIceCandidate->iceCandidateType), protocol);
2751+
pIceCandidate->id, ipAddr, (UINT16) getInt16(pIceCandidate->ipAddress.port), iceAgentGetCandidateTypeStr(pIceCandidate->iceCandidateType),
2752+
protocol);
27532753
}
27542754
}
27552755

src/source/PeerConnection/PeerConnection.c

+9
Original file line numberDiff line numberDiff line change
@@ -1449,6 +1449,15 @@ STATUS addTransceiver(PRtcPeerConnection pPeerConnection, PRtcMediaStreamTrack p
14491449
}
14501450

14511451
CHK(pKvsPeerConnection != NULL, STATUS_NULL_ARG);
1452+
1453+
if (direction == RTC_RTP_TRANSCEIVER_DIRECTION_RECVONLY && pRtcMediaStreamTrack == NULL) {
1454+
MEMSET(&videoTrack, 0x00, SIZEOF(RtcMediaStreamTrack));
1455+
videoTrack.kind = MEDIA_STREAM_TRACK_KIND_VIDEO;
1456+
videoTrack.codec = RTC_CODEC_H264_PROFILE_42E01F_LEVEL_ASYMMETRY_ALLOWED_PACKETIZATION_MODE;
1457+
STRCPY(videoTrack.streamId, "myKvsVideoStream");
1458+
STRCPY(videoTrack.trackId, "myVideoTrack");
1459+
pRtcMediaStreamTrack = &videoTrack;
1460+
}
14521461

14531462
if (direction == RTC_RTP_TRANSCEIVER_DIRECTION_RECVONLY && pRtcMediaStreamTrack == NULL) {
14541463
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/Signaling.c

+6
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,12 @@ STATUS createSignalingSync(PSignalingClientInfoInternal pClientInfo, PChannelInf
3939
CHK_STATUS(validateSignalingClientInfo(pSignalingClient, pClientInfo));
4040

4141
pSignalingClient->version = SIGNALING_CLIENT_CURRENT_VERSION;
42+
<<<<<<< HEAD
43+
=======
44+
45+
pSignalingClient->version = SIGNALING_CLIENT_CURRENT_VERSION;
46+
47+
>>>>>>> 4c2647012 (Release 1 7 0 (#1354))
4248
// Set invalid call times
4349
pSignalingClient->describeTime = INVALID_TIMESTAMP_VALUE;
4450
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)
@@ -342,8 +342,8 @@ typedef struct {
342342
} SignalingClient, *PSignalingClient;
343343

344344
// Public handle to and from object converters
345-
#define TO_SIGNALING_CLIENT_HANDLE(p) ((SIGNALING_CLIENT_HANDLE) (p))
346-
#define FROM_SIGNALING_CLIENT_HANDLE(h) (IS_VALID_SIGNALING_CLIENT_HANDLE(h) ? (PSignalingClient) (h) : NULL)
345+
#define TO_SIGNALING_CLIENT_HANDLE(p) ((SIGNALING_CLIENT_HANDLE)(p))
346+
#define FROM_SIGNALING_CLIENT_HANDLE(h) (IS_VALID_SIGNALING_CLIENT_HANDLE(h) ? (PSignalingClient)(h) : NULL)
347347

348348
STATUS createSignalingSync(PSignalingClientInfoInternal, PChannelInfo, PSignalingClientCallbacks, PAwsCredentialProvider, PSignalingClient*);
349349
STATUS freeSignaling(PSignalingClient*);

0 commit comments

Comments
 (0)