mirror of
https://github.com/moonlight-stream/moonlight-common-c.git
synced 2026-11-28 16:54:32 +00:00
Introduce optional pull-based API for video data
This commit is contained in:
1 parent
b2d4b2c61f
commit
68c784445c
6 files changed
+81
-19
No files matched your search
+6
-8
@@ -154,24 +154,22 @@ static void ReceiveThreadProc(void* context) {
|
||||
}
|
||||
}
|
||||
|
||||
void submitFrame(PQUEUED_DECODE_UNIT qdu) {
|
||||
// Pass the frame to the decoder
|
||||
int ret = VideoCallbacks.submitDecodeUnit(&qdu->decodeUnit);
|
||||
completeQueuedDecodeUnit(qdu, ret);
|
||||
|
||||
void notifyKeyFrameReceived(void) {
|
||||
// Remember that we got a full frame successfully
|
||||
receivedFullFrame = true;
|
||||
}
|
||||
|
||||
// Decoder thread proc
|
||||
static void DecoderThreadProc(void* context) {
|
||||
PQUEUED_DECODE_UNIT qdu;
|
||||
while (!PltIsThreadInterrupted(&decoderThread)) {
|
||||
if (!getNextQueuedDecodeUnit(&qdu)) {
|
||||
VIDEO_FRAME_HANDLE frameHandle;
|
||||
PDECODE_UNIT decodeUnit;
|
||||
|
||||
if (!LiWaitForNextVideoFrame(&frameHandle, &decodeUnit)) {
|
||||
return;
|
||||
}
|
||||
|
||||
submitFrame(qdu);
|
||||
LiCompleteVideoFrame(frameHandle, VideoCallbacks.submitDecodeUnit(decodeUnit));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user