Skip to content

Commit

Permalink
Release 1 7 0 (#1354)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
Co-authored-by: Divya Sampath Kumar <[email protected]>
Co-authored-by: ela34 <[email protected]>

* set protocol value following the spec (#1259)

Co-authored-by: liyufang <[email protected]>

* filter out invalid candidate in sdp (#1260)

Co-authored-by: liyufang <[email protected]>

* 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: [email protected] <[email protected]>

Co-authored-by: Niyati Maheshwari <[email protected]>
Co-authored-by: Divya Sampath Kumar <[email protected]>
Co-authored-by: ela34 <[email protected]>

* libwebsockets: add patch to fix pipe fd leak issue (#1264)

Signed-off-by: Alex.Li <[email protected]>

* Fix scripts/pare_status.py for non-status #defines (#1268) (#1274)

Co-authored-by: Kevin Allen <[email protected]>

* 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 <[email protected]>

* 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 <[email protected]>

* 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 <[email protected]>
Co-authored-by: Hassan Sahibzada <[email protected]>

* 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 <[email protected]>

* 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 <[email protected]>
Co-authored-by: Niyati Maheshwari <[email protected]>
Co-authored-by: ela34 <[email protected]>
Co-authored-by: northteam <[email protected]>
Co-authored-by: liyufang <[email protected]>
Co-authored-by: Alex.D.Scofield <[email protected]>
Co-authored-by: Kevin Allen <[email protected]>
Co-authored-by: Hassan Sahibzada <[email protected]>
Co-authored-by: Chris Hiszpanski <[email protected]>
Co-authored-by: Anurag Katey <[email protected]>
  • Loading branch information
11 people committed Dec 5, 2023
1 parent 53f2b15 commit 1ffc834
Show file tree
Hide file tree
Showing 8 changed files with 60 additions and 31 deletions.
22 changes: 22 additions & 0 deletions samples/Common.c
Original file line number Diff line number Diff line change
Expand Up @@ -1127,6 +1127,28 @@ STATUS freeSampleConfiguration(PSampleConfiguration* ppSampleConfiguration)
timerQueueFree(&pSampleConfiguration->timerQueueHandle);
}

if (IS_VALID_TIMER_QUEUE_HANDLE(pSampleConfiguration->timerQueueHandle)) {
if (pSampleConfiguration->iceCandidatePairStatsTimerId != MAX_UINT32) {
retStatus = timerQueueCancelTimer(pSampleConfiguration->timerQueueHandle, pSampleConfiguration->iceCandidatePairStatsTimerId,
(UINT64) pSampleConfiguration);
if (STATUS_FAILED(retStatus)) {
DLOGE("Failed to cancel stats timer with: 0x%08x", retStatus);
}
pSampleConfiguration->iceCandidatePairStatsTimerId = MAX_UINT32;
}

if (pSampleConfiguration->pregenerateCertTimerId != MAX_UINT32) {
retStatus = timerQueueCancelTimer(pSampleConfiguration->timerQueueHandle, pSampleConfiguration->pregenerateCertTimerId,
(UINT64) pSampleConfiguration);
if (STATUS_FAILED(retStatus)) {
DLOGE("Failed to cancel certificate pre-generation timer with: 0x%08x", retStatus);
}
pSampleConfiguration->pregenerateCertTimerId = MAX_UINT32;
}

timerQueueFree(&pSampleConfiguration->timerQueueHandle);
}

if (pSampleConfiguration->pPendingSignalingMessageForRemoteClient != NULL) {
// Iterate and free all the pending queues
stackQueueGetIterator(pSampleConfiguration->pPendingSignalingMessageForRemoteClient, &iterator);
Expand Down
18 changes: 16 additions & 2 deletions samples/kvsWebRTCClientMaster.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,20 @@ INT32 main(INT32 argc, CHAR* argv[])
// Kick of the termination sequence
ATOMIC_STORE_BOOL(&pSampleConfiguration->appTerminateFlag, TRUE);

if (IS_VALID_MUTEX_VALUE(pSampleConfiguration->sampleConfigurationObjLock)) {
MUTEX_LOCK(pSampleConfiguration->sampleConfigurationObjLock);
}

// Cancel the media thread
if (pSampleConfiguration->mediaThreadStarted) {
DLOGD("Canceling media thread");
THREAD_CANCEL(pSampleConfiguration->mediaSenderTid);
}

if (IS_VALID_MUTEX_VALUE(pSampleConfiguration->sampleConfigurationObjLock)) {
MUTEX_UNLOCK(pSampleConfiguration->sampleConfigurationObjLock);
}

if (pSampleConfiguration->mediaSenderTid != INVALID_TID_VALUE) {
THREAD_JOIN(pSampleConfiguration->mediaSenderTid, NULL);
}
Expand Down Expand Up @@ -189,7 +203,7 @@ PVOID sendVideoPackets(PVOID args)
DLOGI("[KVS Master] Closing video thread");
CHK_LOG_ERR(retStatus);

return (PVOID) (ULONG_PTR) retStatus;
return (PVOID)(ULONG_PTR) retStatus;
}

PVOID sendAudioPackets(PVOID args)
Expand Down Expand Up @@ -259,5 +273,5 @@ PVOID sampleReceiveAudioVideoFrame(PVOID args)

CleanUp:

return (PVOID) (ULONG_PTR) retStatus;
return (PVOID)(ULONG_PTR) retStatus;
}
22 changes: 0 additions & 22 deletions samples/kvsWebRTCClientViewer.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,28 +137,6 @@ INT32 main(INT32 argc, CHAR* argv[])
DLOGI("[KVS Viewer] Data Channel open now...");
#endif

#ifdef ENABLE_DATA_CHANNEL
PRtcDataChannel pDataChannel = NULL;
PRtcPeerConnection pPeerConnection = pSampleStreamingSession->pPeerConnection;
SIZE_T datachannelLocalOpenCount = 0;

// Creating a new datachannel on the peer connection of the existing sample streaming session
retStatus = createDataChannel(pPeerConnection, pChannelName, NULL, &pDataChannel);
if(retStatus != STATUS_SUCCESS) {
printf("[KVS Viewer] createDataChannel(): operation returned status code: 0x%08x \n", retStatus);
goto CleanUp;
}
printf("[KVS Viewer] Creating data channel...completed\n");

// Setting a callback for when the data channel is open
retStatus = dataChannelOnOpen(pDataChannel, (UINT64) &datachannelLocalOpenCount, dataChannelOnOpenCallback);
if(retStatus != STATUS_SUCCESS) {
printf("[KVS Viewer] dataChannelOnOpen(): operation returned status code: 0x%08x \n", retStatus);
goto CleanUp;
}
printf("[KVS Viewer] Data Channel open now...\n");
#endif

// Block until interrupted
while (!ATOMIC_LOAD_BOOL(&pSampleConfiguration->interrupted) && !ATOMIC_LOAD_BOOL(&pSampleStreamingSession->terminateFlag)) {
THREAD_SLEEP(HUNDREDS_OF_NANOS_IN_A_SECOND);
Expand Down
4 changes: 2 additions & 2 deletions src/source/Ice/IceAgent.c
Original file line number Diff line number Diff line change
Expand Up @@ -2748,8 +2748,8 @@ VOID iceAgentLogNewCandidate(PIceCandidate pIceCandidate)
break;
}
DLOGD("New %s ice candidate discovered. Id: %s. Ip: %s:%u. Type: %s. Protocol: %s.", pIceCandidate->isRemote ? "remote" : "local",
pIceCandidate->id, ipAddr, (UINT16) getInt16(pIceCandidate->ipAddress.port),
iceAgentGetCandidateTypeStr(pIceCandidate->iceCandidateType), protocol);
pIceCandidate->id, ipAddr, (UINT16) getInt16(pIceCandidate->ipAddress.port), iceAgentGetCandidateTypeStr(pIceCandidate->iceCandidateType),
protocol);
}
}

Expand Down
9 changes: 9 additions & 0 deletions src/source/PeerConnection/PeerConnection.c
Original file line number Diff line number Diff line change
Expand Up @@ -1449,6 +1449,15 @@ STATUS addTransceiver(PRtcPeerConnection pPeerConnection, PRtcMediaStreamTrack p
}

CHK(pKvsPeerConnection != NULL, STATUS_NULL_ARG);

if (direction == RTC_RTP_TRANSCEIVER_DIRECTION_RECVONLY && pRtcMediaStreamTrack == NULL) {
MEMSET(&videoTrack, 0x00, SIZEOF(RtcMediaStreamTrack));
videoTrack.kind = MEDIA_STREAM_TRACK_KIND_VIDEO;
videoTrack.codec = RTC_CODEC_H264_PROFILE_42E01F_LEVEL_ASYMMETRY_ALLOWED_PACKETIZATION_MODE;
STRCPY(videoTrack.streamId, "myKvsVideoStream");
STRCPY(videoTrack.trackId, "myVideoTrack");
pRtcMediaStreamTrack = &videoTrack;
}

if (direction == RTC_RTP_TRANSCEIVER_DIRECTION_RECVONLY && pRtcMediaStreamTrack == NULL) {
MEMSET(&videoTrack, 0x00, SIZEOF(RtcMediaStreamTrack));
Expand Down
2 changes: 1 addition & 1 deletion src/source/Signaling/Client.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ STATUS createSignalingClientSync(PSignalingClientInfo pClientInfo, PChannelInfo
UINT64 signalingClientCreationWaitTime;
UINT64 startTime = 0;

DLOGI("Creating Signaling Client Sync");
DLOGV("Creating Signaling Client Sync");
CHK(pSignalingHandle != NULL && pClientInfo != NULL, STATUS_NULL_ARG);

// Convert the client info to the internal structure with empty values
Expand Down
6 changes: 6 additions & 0 deletions src/source/Signaling/Signaling.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ STATUS createSignalingSync(PSignalingClientInfoInternal pClientInfo, PChannelInf
CHK_STATUS(validateSignalingClientInfo(pSignalingClient, pClientInfo));

pSignalingClient->version = SIGNALING_CLIENT_CURRENT_VERSION;
<<<<<<< HEAD
=======

pSignalingClient->version = SIGNALING_CLIENT_CURRENT_VERSION;

>>>>>>> 4c2647012 (Release 1 7 0 (#1354))
// Set invalid call times
pSignalingClient->describeTime = INVALID_TIMESTAMP_VALUE;
pSignalingClient->createTime = INVALID_TIMESTAMP_VALUE;
Expand Down
8 changes: 4 additions & 4 deletions src/source/Signaling/Signaling.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ extern "C" {
#define SIGNALING_REQUEST_ID_HEADER_NAME KVS_REQUEST_ID_HEADER_NAME ":"

// Signaling client from custom data conversion
#define SIGNALING_CLIENT_FROM_CUSTOM_DATA(h) ((PSignalingClient) (h))
#define CUSTOM_DATA_FROM_SIGNALING_CLIENT(p) ((UINT64) (p))
#define SIGNALING_CLIENT_FROM_CUSTOM_DATA(h) ((PSignalingClient)(h))
#define CUSTOM_DATA_FROM_SIGNALING_CLIENT(p) ((UINT64)(p))

// Grace period for refreshing the ICE configuration
#define ICE_CONFIGURATION_REFRESH_GRACE_PERIOD (30 * HUNDREDS_OF_NANOS_IN_A_SECOND)
Expand Down Expand Up @@ -342,8 +342,8 @@ typedef struct {
} SignalingClient, *PSignalingClient;

// Public handle to and from object converters
#define TO_SIGNALING_CLIENT_HANDLE(p) ((SIGNALING_CLIENT_HANDLE) (p))
#define FROM_SIGNALING_CLIENT_HANDLE(h) (IS_VALID_SIGNALING_CLIENT_HANDLE(h) ? (PSignalingClient) (h) : NULL)
#define TO_SIGNALING_CLIENT_HANDLE(p) ((SIGNALING_CLIENT_HANDLE)(p))
#define FROM_SIGNALING_CLIENT_HANDLE(h) (IS_VALID_SIGNALING_CLIENT_HANDLE(h) ? (PSignalingClient)(h) : NULL)

STATUS createSignalingSync(PSignalingClientInfoInternal, PChannelInfo, PSignalingClientCallbacks, PAwsCredentialProvider, PSignalingClient*);
STATUS freeSignaling(PSignalingClient*);
Expand Down

0 comments on commit 1ffc834

Please sign in to comment.