gstreamer-encoder: Also check for lpenc for va plugin

This commit is contained in:
Michael Scherle 2025-05-14 16:48:17 +02:00
parent 04de0657cf
commit d561f81855

View File

@ -976,24 +976,28 @@ static gchar *find_best_hw_plugin(const gchar *codec_name)
{
char plugins[][20] = {"msdk", "va", "vaapi"};
gchar *feature_name;
int i;
const gchar *encode_gpu = get_encode_gpu();
if (encode_gpu) {
g_strlcat(plugins[1], encode_gpu, sizeof(plugins[1]));
}
int i;
for (i = 0; i < G_N_ELEMENTS(plugins); i++) {
feature_name = !codec_name ? g_strconcat(plugins[i], "postproc", NULL) :
g_strconcat(plugins[i], codec_name, "enc", NULL);
if (!gst_features_lookup(feature_name)) {
g_free(feature_name);
feature_name = NULL;
continue;
if (gst_features_lookup(feature_name)) {
return feature_name;
}
g_free(feature_name);
if(i == 1 && codec_name){
feature_name = g_strconcat(plugins[i], "lpenc", NULL);
if (gst_features_lookup(feature_name)) {
return feature_name;
}
g_free(feature_name);
}
break;
}
return feature_name;
return NULL;
}
static gchar *get_hw_gstenc_opts(const gchar *encoder, const gchar *codec_name)