Skip to content

Commit

Permalink
Use uint64_t for DECODE_UNIT presentationTimeMs
Browse files Browse the repository at this point in the history
This still holds a millisecond value sourced from RTP timestamp, but since we're changing the API anyway, now is a good time to future-proof this field.
  • Loading branch information
andygrundman committed Oct 20, 2024
1 parent b7f2814 commit c1a2873
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/Limelight.h
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ typedef struct _DECODE_UNIT {
// Presentation time in milliseconds with the epoch at the first captured frame.
// This can be used to aid frame pacing or to drop old frames that were queued too
// long prior to display.
unsigned int presentationTimeMs;
uint64_t presentationTimeMs;

// Length of the entire buffer chain in bytes
int fullLength;
Expand Down
4 changes: 2 additions & 2 deletions src/RtpVideoQueue.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ typedef struct _RTPV_QUEUE_ENTRY {
struct _RTPV_QUEUE_ENTRY* prev;
PRTP_PACKET packet;
uint64_t receiveTimeUs;
uint32_t presentationTimeMs;
uint64_t presentationTimeMs;
int length;
bool isParity;
} RTPV_QUEUE_ENTRY, *PRTPV_QUEUE_ENTRY;
Expand Down Expand Up @@ -43,7 +43,7 @@ typedef struct _RTP_VIDEO_QUEUE {
uint8_t multiFecCurrentBlockNumber;
uint8_t multiFecLastBlockNumber;

uint32_t lastOosFramePresentationTimestamp;
uint64_t lastOosFramePresentationTimestamp;
bool receivedOosData;

RTP_VIDEO_STATS stats; // the above values are short-lived, this tracks stats for the life of the queue
Expand Down
6 changes: 3 additions & 3 deletions src/VideoDepacketizer.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ static bool strictIdrFrameWait;
static uint64_t syntheticPtsBaseUs;
static uint16_t frameHostProcessingLatency;
static uint64_t firstPacketReceiveTimeUs;
static unsigned int firstPacketPresentationTime;
static uint64_t firstPacketPresentationTime;
static bool dropStatePending;
static bool idrFrameProcessed;

Expand Down Expand Up @@ -828,10 +828,10 @@ static void processRtpPayload(PNV_VIDEO_PACKET videoPacket, int length,
}

if (!presentationTimeMs && frameIndex > 0) {
firstPacketPresentationTime = (unsigned int)((receiveTimeUs - syntheticPtsBaseUs) / 1000);
firstPacketPresentationTime = (receiveTimeUs - syntheticPtsBaseUs) / 1000;
}
else {
firstPacketPresentationTime = (unsigned int)presentationTimeMs;
firstPacketPresentationTime = presentationTimeMs;
}
}

Expand Down

0 comments on commit c1a2873

Please sign in to comment.