Add LiRequestIdrFrame() API for requesting an IDR frame on demand

This commit is contained in:
Cameron Gutman
2022-10-05 00:46:56 -05:00
parent 502f799a73
commit 9240090983
4 changed files with 15 additions and 9 deletions
+4 -4
View File
@@ -312,20 +312,20 @@ void queueFrameInvalidationTuple(int startFrame, int endFrame) {
// Too many invalidation tuples, so we need an IDR frame now // Too many invalidation tuples, so we need an IDR frame now
Limelog("RFI range list reached maximum size limit\n"); Limelog("RFI range list reached maximum size limit\n");
free(qfit); free(qfit);
requestIdrOnDemand(); LiRequestIdrFrame();
} }
} }
else { else {
requestIdrOnDemand(); LiRequestIdrFrame();
} }
} }
else { else {
requestIdrOnDemand(); LiRequestIdrFrame();
} }
} }
// Request an IDR frame on demand by the decoder // Request an IDR frame on demand by the decoder
void requestIdrOnDemand(void) { void LiRequestIdrFrame(void) {
// Any reference frame invalidation requests should be dropped now. // Any reference frame invalidation requests should be dropped now.
// We require a full IDR frame to recover. // We require a full IDR frame to recover.
freeFrameInvalidationList(LbqFlushQueueItems(&invalidReferenceFrameTuples)); freeFrameInvalidationList(LbqFlushQueueItems(&invalidReferenceFrameTuples));
-1
View File
@@ -83,7 +83,6 @@ int initializeControlStream(void);
int startControlStream(void); int startControlStream(void);
int stopControlStream(void); int stopControlStream(void);
void destroyControlStream(void); void destroyControlStream(void);
void requestIdrOnDemand(void);
void connectionDetectedFrameLoss(int startFrame, int endFrame); void connectionDetectedFrameLoss(int startFrame, int endFrame);
void connectionReceivedCompleteFrame(int frameIndex); void connectionReceivedCompleteFrame(int frameIndex);
void connectionSawFrame(int frameIndex); void connectionSawFrame(int frameIndex);
+7
View File
@@ -693,6 +693,13 @@ void LiCompleteVideoFrame(VIDEO_FRAME_HANDLE handle, int drStatus);
// See ConnListenerSetHdrMode() for more details. // See ConnListenerSetHdrMode() for more details.
bool LiGetCurrentHostDisplayHdrMode(void); bool LiGetCurrentHostDisplayHdrMode(void);
// This function requests an IDR frame from the host. Typically this is done using DR_NEED_IDR, but clients
// processing frames asynchronously may need to reset their decoder state even after returning DR_OK for
// the prior frame. Rather than wait for a new frame and return DR_NEED_IDR for that one, they can just
// call this API instead. Note that this function does not guarantee that the *next* frame will be an IDR
// frame, just that an IDR frame will arrive soon.
void LiRequestIdrFrame(void);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
+4 -4
View File
@@ -113,7 +113,7 @@ static void dropFrameState(void) {
// Request an IDR frame // Request an IDR frame
waitingForIdrFrame = true; waitingForIdrFrame = true;
requestIdrOnDemand(); LiRequestIdrFrame();
} }
cleanupFrameState(); cleanupFrameState();
@@ -415,7 +415,7 @@ static void reassembleFrame(int frameNumber) {
// Request an IDR frame to recover (RFI recovery is not supported here) // Request an IDR frame to recover (RFI recovery is not supported here)
waitingForIdrFrame = true; waitingForIdrFrame = true;
requestIdrOnDemand(); LiRequestIdrFrame();
return; return;
} }
} }
@@ -608,7 +608,7 @@ void requestDecoderRefresh(void) {
dropStatePending = true; dropStatePending = true;
// Request the IDR frame // Request the IDR frame
requestIdrOnDemand(); LiRequestIdrFrame();
} }
// Return 1 if packet is the first one in the frame // Return 1 if packet is the first one in the frame
@@ -843,7 +843,7 @@ static void processRtpPayload(PNV_VIDEO_PACKET videoPacket, int length,
// detection of the recovery of the network. Requesting an IDR frame while // detection of the recovery of the network. Requesting an IDR frame while
// the network is unstable will just contribute to congestion collapse. // the network is unstable will just contribute to congestion collapse.
if (waitingForNextSuccessfulFrame) { if (waitingForNextSuccessfulFrame) {
requestIdrOnDemand(); LiRequestIdrFrame();
} }
} }
else { else {