Skip to content

Commit

Permalink
Macro fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
disa6302 committed Jul 31, 2023
1 parent 35dbe0e commit 26a5b80
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/include/com/amazonaws/kinesis/video/webrtcclient/Include.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,28 +28,28 @@ extern "C" {
/* TODO: Potentially move these call to PIC instead. Moving to PIC in the future would not cause any backward compatibility issues */
#define PROFILE_CALL(f, msg) \
do { \
UINT64 startTime = GETTIME(); \
UINT64 startTimeInMacro = GETTIME(); \
f; \
DLOGP("[%s] Time taken: %" PRIu64 " ms", msg, (GETTIME() - startTime) / HUNDREDS_OF_NANOS_IN_A_MILLISECOND); \
DLOGP("[%s] Time taken: %" PRIu64 " ms", (msg), (GETTIME() - startTimeInMacro) / HUNDREDS_OF_NANOS_IN_A_MILLISECOND); \
} while (FALSE)

#define PROFILE_CALL_WITH_T_OBJ(f, t, msg) \
do { \
UINT64 startTime = GETTIME(); \
UINT64 startTimeInMacro = GETTIME(); \
f; \
t = (GETTIME() - startTime) / HUNDREDS_OF_NANOS_IN_A_MILLISECOND; \
DLOGP("[%s] Time taken: %" PRIu64 " ms", msg, t); \
t = (GETTIME() - startTimeInMacro) / HUNDREDS_OF_NANOS_IN_A_MILLISECOND; \
DLOGP("[%s] Time taken: %" PRIu64 " ms", (msg), (t)); \
} while (FALSE)

#define PROFILE_WITH_START_TIME(t, msg) \
do { \
DLOGP("[%s] Time taken: %" PRIu64 " ms", msg, (GETTIME() - t) / HUNDREDS_OF_NANOS_IN_A_MILLISECOND); \
DLOGP("[%s] Time taken: %" PRIu64 " ms", msg, (GETTIME() - (t)) / HUNDREDS_OF_NANOS_IN_A_MILLISECOND); \
} while (FALSE)

#define PROFILE_WITH_START_TIME_OBJ(t1, t2, msg) \
do { \
t2 = (GETTIME() - t1) / HUNDREDS_OF_NANOS_IN_A_MILLISECOND; \
DLOGP("[%s] Time taken: %" PRIu64 " ms", msg, t2); \
t2 = (GETTIME() - (t1)) / HUNDREDS_OF_NANOS_IN_A_MILLISECOND; \
DLOGP("[%s] Time taken: %" PRIu64 " ms", (msg), t2); \
} while (FALSE)

/*! \addtogroup StatusCodes
Expand Down
4 changes: 4 additions & 0 deletions src/source/Ice/IceAgent.c
Original file line number Diff line number Diff line change
Expand Up @@ -2528,6 +2528,8 @@ STATUS handleStunPacket(PIceAgent pIceAgent, PBYTE pBuffer, UINT32 bufferLen, PS
pIceCandidatePair->roundTripTime = GETTIME() - requestSentTime;
pIceCandidatePair->rtcIceCandidatePairDiagnostics.currentRoundTripTime =
(DOUBLE) (pIceCandidatePair->roundTripTime) / HUNDREDS_OF_NANOS_IN_A_SECOND;
} else {
DLOGW("Unable to fetch request Timestamp from the hash table. No update to RTT for the pair (error code: 0x%08x)", retStatus);
}
CHK_WARN(transactionIdStoreHasId(pIceCandidatePair->pTransactionIdStore, pBuffer + STUN_PACKET_TRANSACTION_ID_OFFSET), retStatus,
"Dropping response packet because transaction id does not match");
Expand Down Expand Up @@ -2574,6 +2576,8 @@ STATUS handleStunPacket(PIceAgent pIceAgent, PBYTE pBuffer, UINT32 bufferLen, PS
(DOUBLE) (pIceCandidatePair->roundTripTime) / HUNDREDS_OF_NANOS_IN_A_SECOND;

CHK_STATUS(hashTableRemove(pIceCandidatePair->requestSentTime, checkSum));
} else {
DLOGW("Unable to fetch request Timestamp from the hash table. No update to RTT for the pair (error code: 0x%08x)", retStatus);
}
}

Expand Down

0 comments on commit 26a5b80

Please sign in to comment.