New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add VAAPI options and pass them to ffmpeg #6667
Conversation
Can one of the admins verify this patch? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for this addition, but a few changes will be required so we can merge it.
@@ -2371,6 +2371,16 @@ int freerdp_client_settings_parse_command_line_arguments(rdpSettings* settings, | |||
return rc; | |||
} | |||
} | |||
CommandLineSwitchCase(arg, "vaapi-connection-type") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, this will get messy.
Please unify all options into a single one with parameters, e.g. /vaapi:type:foo,device:bar
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe even better, add parameters to /gdi:hw
as that already switches between different backend implementations
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, but wouldn't this belong to the /gfx switch, which affects h264 decoding?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no, as /video
channel also utilizes the backend.
@@ -78,6 +78,8 @@ struct _H264_CONTEXT | |||
|
|||
void* lumaData; | |||
wLog* log; | |||
|
|||
const rdpSettings* settings; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really required, is it? Just passing the arguments to Init
should be sufficient.
@@ -108,6 +110,8 @@ extern "C" | |||
FREERDP_API BOOL h264_context_reset(H264_CONTEXT* h264, UINT32 width, UINT32 height); | |||
|
|||
FREERDP_API H264_CONTEXT* h264_context_new(BOOL Compressor); | |||
FREERDP_API H264_CONTEXT* h264_context_new_settings(BOOL Compressor, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better change to FREERDP_API H264_CONTEXT* h264_context_new(BOOL Compressor, ...);
and let the backend interpret the arguments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also remove h264_context_new_settings
there must only be one way to initialize the context, otherwise you´ll end up with different decoding settings.
@@ -1562,6 +1562,9 @@ struct rdp_settings | |||
ALIGN64 char* ActionScript; | |||
ALIGN64 DWORD Floatbar; | |||
ALIGN64 char* XSelectionAtom; | |||
|
|||
ALIGN64 char* VAAPIConnectionType; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unify to a single string, let the backend interpret it.
Also add it to public API
@@ -973,6 +973,12 @@ static BOOL freerdp_settings_int_buffer_copy(rdpSettings* _settings, const rdpSe | |||
_settings->ActionScript = _strdup(settings->ActionScript); | |||
if (settings->XSelectionAtom) | |||
_settings->XSelectionAtom = _strdup(settings->XSelectionAtom); | |||
|
|||
if (settings->VAAPIConnectionType) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not required if part of public API
@vredez There's a new VA-API driver module backed by NVDEC now: https://github.com/elFarto/nvidia-vaapi-driver |
Let's close this PR |
TLDR: Simple way of getting hardware acceleration working (again) with NVIDIA graphics cards.
FreeRDP uses FFmpeg for VAAPI hardware acceleration. If not specified, the FFmpeg API internally prefers the DRM connection type over the X11 one. Unfortunately, the VAAPI driver for NVIDIA users (libva-vdpau-driver), which seems to be unmaintained since 2012, only supports the X11 connection type.
Two new options are added:
/vaapi-connection-type
/vaapi-device
both of which are passed to ffmpeg, where parameter validation is handled