2018-07-18 03:00:16 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <Limelight.h>
|
|
|
|
#include <SDL.h>
|
|
|
|
#include "settings/streamingpreferences.h"
|
|
|
|
|
|
|
|
#define SDL_CODE_FRAME_READY 0
|
|
|
|
|
|
|
|
#define MAX_SLICES 4
|
|
|
|
|
2018-09-25 07:47:59 +00:00
|
|
|
typedef struct _VIDEO_STATS {
|
|
|
|
uint32_t receivedFrames;
|
|
|
|
uint32_t decodedFrames;
|
|
|
|
uint32_t renderedFrames;
|
2019-01-22 01:43:15 +00:00
|
|
|
uint32_t totalFrames;
|
2018-09-25 07:47:59 +00:00
|
|
|
uint32_t networkDroppedFrames;
|
|
|
|
uint32_t pacerDroppedFrames;
|
|
|
|
uint32_t totalReassemblyTime;
|
|
|
|
uint32_t totalDecodeTime;
|
2018-12-25 20:09:45 +00:00
|
|
|
uint32_t totalPacerTime;
|
2018-09-25 07:47:59 +00:00
|
|
|
uint32_t totalRenderTime;
|
2019-01-22 01:43:15 +00:00
|
|
|
float totalFps;
|
2018-09-25 07:47:59 +00:00
|
|
|
float receivedFps;
|
|
|
|
float decodedFps;
|
|
|
|
float renderedFps;
|
|
|
|
uint32_t measurementStartTimestamp;
|
|
|
|
} VIDEO_STATS, *PVIDEO_STATS;
|
|
|
|
|
2019-04-12 05:27:20 +00:00
|
|
|
typedef struct _DECODER_PARAMETERS {
|
|
|
|
SDL_Window* window;
|
|
|
|
StreamingPreferences::VideoDecoderSelection vds;
|
|
|
|
|
|
|
|
int videoFormat;
|
|
|
|
int width;
|
|
|
|
int height;
|
|
|
|
int frameRate;
|
|
|
|
bool enableVsync;
|
|
|
|
bool enableFramePacing;
|
|
|
|
} DECODER_PARAMETERS, *PDECODER_PARAMETERS;
|
|
|
|
|
2018-07-18 03:00:16 +00:00
|
|
|
class IVideoDecoder {
|
|
|
|
public:
|
|
|
|
virtual ~IVideoDecoder() {}
|
2019-04-12 05:27:20 +00:00
|
|
|
virtual bool initialize(PDECODER_PARAMETERS params) = 0;
|
2018-07-18 03:00:16 +00:00
|
|
|
virtual bool isHardwareAccelerated() = 0;
|
2018-08-25 19:38:04 +00:00
|
|
|
virtual int getDecoderCapabilities() = 0;
|
2018-07-18 03:00:16 +00:00
|
|
|
virtual int submitDecodeUnit(PDECODE_UNIT du) = 0;
|
2019-04-10 04:46:14 +00:00
|
|
|
virtual void renderFrameOnMainThread() = 0;
|
2018-07-18 03:00:16 +00:00
|
|
|
};
|