mirror of
https://github.com/moonlight-stream/moonlight-common-c.git
synced 2026-11-30 09:44:28 +00:00
Add LiGetPendingVideoFrames() and LiGetPendingAudioFrames()
This commit is contained in:
1 parent
59481c085a
commit
dffe51e885
5 files changed
+28
-20
No files matched your search
+8
-13
@@ -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);
|
||||
}
|
||||
Reference in new issue
Block a user