Provide seperate platform option to enable VDPAU

This commit is contained in:
Iwan Timmer
2017-06-10 15:42:53 +02:00
parent 819503dd4d
commit c1b06dca75
9 changed files with 34 additions and 28 deletions

View File

@@ -20,10 +20,13 @@
#include <Limelight.h>
#define DISPLAY_FULLSCREEN 1
#define FORCE_HARDWARE_ACCELERATION 2
#define ENABLE_HARDWARE_ACCELERATION 2
#ifdef HAVE_X11
extern DECODER_RENDERER_CALLBACKS decoder_callbacks_x11;
#ifdef HAVE_VDPAU
extern DECODER_RENDERER_CALLBACKS decoder_callbacks_x11_vdpau;
#endif
#endif
#ifdef HAVE_SDL
extern DECODER_RENDERER_CALLBACKS decoder_callbacks_sdl;

View File

@@ -52,7 +52,7 @@ static int frame_handle(int pipefd) {
int x11_setup(int videoFormat, int width, int height, int redrawRate, void* context, int drFlags) {
int avc_flags = SLICE_THREADING;
if (drFlags & FORCE_HARDWARE_ACCELERATION)
if (drFlags & ENABLE_HARDWARE_ACCELERATION)
avc_flags |= HARDWARE_ACCELERATION;
ffmpeg_buffer = malloc(DECODER_BUFFER_SIZE + FF_INPUT_BUFFER_PADDING_SIZE);
@@ -113,6 +113,10 @@ int x11_setup(int videoFormat, int width, int height, int redrawRate, void* cont
return 0;
}
int x11_setup_vdpau(int videoFormat, int width, int height, int redrawRate, void* context, int drFlags) {
x11_setup(videoFormat, width, height, redrawRate, context, drFlags | ENABLE_HARDWARE_ACCELERATION);
}
void x11_cleanup() {
ffmpeg_destroy();
egl_destroy();
@@ -147,3 +151,10 @@ DECODER_RENDERER_CALLBACKS decoder_callbacks_x11 = {
.submitDecodeUnit = x11_submit_decode_unit,
.capabilities = CAPABILITY_SLICES_PER_FRAME(4) | CAPABILITY_REFERENCE_FRAME_INVALIDATION_AVC | CAPABILITY_REFERENCE_FRAME_INVALIDATION_HEVC | CAPABILITY_DIRECT_SUBMIT,
};
DECODER_RENDERER_CALLBACKS decoder_callbacks_x11_vdpau = {
.setup = x11_setup_vdpau,
.cleanup = x11_cleanup,
.submitDecodeUnit = x11_submit_decode_unit,
.capabilities = CAPABILITY_DIRECT_SUBMIT,
};