Add LiGetPendingVideoFrames() and LiGetPendingAudioFrames()

This commit is contained in:
Cameron Gutman 2019-05-07 20:25:26 -07:00
commit dffe51e885
5 changed files with 28 additions and 20 deletions

View file

@ -38,9 +38,7 @@ typedef struct _LENTRY_INTERNAL {
// Init
void initializeVideoDepacketizer(int pktSize) {
if ((VideoCallbacks.capabilities & CAPABILITY_DIRECT_SUBMIT) == 0) {
LbqInitializeLinkedBlockingQueue(&decodeUnitQueue, 15);
}
LbqInitializeLinkedBlockingQueue(&decodeUnitQueue, 15);
nextFrameNumber = 1;
startFrameNumber = 0;
@ -116,17 +114,12 @@ static void freeDecodeUnitList(PLINKED_BLOCKING_QUEUE_ENTRY entry) {
}
void stopVideoDepacketizer(void) {
if ((VideoCallbacks.capabilities & CAPABILITY_DIRECT_SUBMIT) == 0) {
LbqSignalQueueShutdown(&decodeUnitQueue);
}
LbqSignalQueueShutdown(&decodeUnitQueue);
}
// Cleanup video depacketizer and free malloced memory
void destroyVideoDepacketizer(void) {
if ((VideoCallbacks.capabilities & CAPABILITY_DIRECT_SUBMIT) == 0) {
freeDecodeUnitList(LbqDestroyLinkedBlockingQueue(&decodeUnitQueue));
}
freeDecodeUnitList(LbqDestroyLinkedBlockingQueue(&decodeUnitQueue));
cleanupFrameState();
}
@ -486,9 +479,7 @@ void requestDecoderRefresh(void) {
waitingForIdrFrame = 1;
// Flush the decode unit queue
if ((VideoCallbacks.capabilities & CAPABILITY_DIRECT_SUBMIT) == 0) {
freeDecodeUnitList(LbqFlushQueueItems(&decodeUnitQueue));
}
freeDecodeUnitList(LbqFlushQueueItems(&decodeUnitQueue));
// Request the receive thread drop its state
// on the next call. We can't do it here because
@ -695,3 +686,7 @@ void queueRtpPacket(PRTPFEC_QUEUE_ENTRY queueEntryPtr) {
free(existingEntry->allocPtr);
}
}
int LiGetPendingVideoFrames(void) {
return LbqGetItemCount(&decodeUnitQueue);
}