mirror of
https://github.com/moonlight-stream/moonlight-common-c.git
synced 2025-08-18 09:25:49 +00:00
Add capability for the video decoder to request an IDR frame
This commit is contained in:
parent
cf957025e6
commit
ee3369ff9b
@ -56,6 +56,12 @@ void destroyControlStream(void) {
|
|||||||
PltCloseEvent(&resyncEvent);
|
PltCloseEvent(&resyncEvent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Resync on demand by the decoder */
|
||||||
|
void resyncOnDemand(void) {
|
||||||
|
// FIXME: Send ranges
|
||||||
|
PltSetEvent(&resyncEvent);
|
||||||
|
}
|
||||||
|
|
||||||
/* Resync if the connection is too slow */
|
/* Resync if the connection is too slow */
|
||||||
void connectionSinkTooSlow(int startFrame, int endFrame) {
|
void connectionSinkTooSlow(int startFrame, int endFrame) {
|
||||||
// FIXME: Send ranges
|
// FIXME: Send ranges
|
||||||
|
@ -12,6 +12,7 @@ int initializeControlStream(IP_ADDRESS host, PSTREAM_CONFIGURATION streamConfig,
|
|||||||
int startControlStream(void);
|
int startControlStream(void);
|
||||||
int stopControlStream(void);
|
int stopControlStream(void);
|
||||||
void destroyControlStream(void);
|
void destroyControlStream(void);
|
||||||
|
void resyncOnDemand(void);
|
||||||
void connectionSinkTooSlow(int startFrame, int endFrame);
|
void connectionSinkTooSlow(int startFrame, int endFrame);
|
||||||
void connectionDetectedFrameLoss(int startFrame, int endFrame);
|
void connectionDetectedFrameLoss(int startFrame, int endFrame);
|
||||||
void connectionReceivedFrame(int frameIndex);
|
void connectionReceivedFrame(int frameIndex);
|
||||||
|
@ -31,7 +31,10 @@ typedef void(*DecoderRendererSetup)(int width, int height, int redrawRate, void*
|
|||||||
typedef void(*DecoderRendererStart)(void);
|
typedef void(*DecoderRendererStart)(void);
|
||||||
typedef void(*DecoderRendererStop)(void);
|
typedef void(*DecoderRendererStop)(void);
|
||||||
typedef void(*DecoderRendererRelease)(void);
|
typedef void(*DecoderRendererRelease)(void);
|
||||||
typedef void(*DecoderRendererSubmitDecodeUnit)(PDECODE_UNIT decodeUnit);
|
|
||||||
|
#define DR_OK 0
|
||||||
|
#define DR_NEED_IDR -1
|
||||||
|
typedef int(*DecoderRendererSubmitDecodeUnit)(PDECODE_UNIT decodeUnit);
|
||||||
|
|
||||||
typedef struct _DECODER_RENDERER_CALLBACKS {
|
typedef struct _DECODER_RENDERER_CALLBACKS {
|
||||||
DecoderRendererSetup setup;
|
DecoderRendererSetup setup;
|
||||||
|
@ -99,9 +99,14 @@ static void DecoderThreadProc(void* context) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
callbacks.submitDecodeUnit(du);
|
int ret = callbacks.submitDecodeUnit(du);
|
||||||
|
|
||||||
freeDecodeUnit(du);
|
freeDecodeUnit(du);
|
||||||
|
|
||||||
|
if (ret == DR_NEED_IDR) {
|
||||||
|
Limelog("Request IDR frame on behalf of DR\n");
|
||||||
|
resyncOnDemand();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user