Add capability for the video decoder to request an IDR frame

This commit is contained in:
Cameron Gutman 2015-01-09 17:34:26 -05:00
parent cf957025e6
commit ee3369ff9b
4 changed files with 17 additions and 2 deletions

View File

@ -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

View File

@ -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);

View File

@ -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;

View File

@ -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();
}
} }
} }