mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-17 03:35:21 +00:00
libs: profile: add gst_vaapi_profile_get_va_name()
gst_vaapi_profile_get_name() returns a proper name for GstCaps. Nonetheless, there are many profiles which don't have a name representation for that realm. gst_vaapi_profile_get_va_name() returns the name of the profile according to its VAProfile name. This new funtion is used in the encoder error message.
This commit is contained in:
parent
f7c1ac036d
commit
1c73dc969c
9 changed files with 29 additions and 8 deletions
|
@ -1145,7 +1145,7 @@ ensure_hw_profile (GstVaapiEncoderH264 * encoder)
|
|||
error_unsupported_profile:
|
||||
{
|
||||
GST_ERROR ("unsupported HW profile %s",
|
||||
gst_vaapi_profile_get_name (encoder->profile));
|
||||
gst_vaapi_profile_get_va_name (encoder->profile));
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -954,7 +954,7 @@ ensure_hw_profile (GstVaapiEncoderH265 * encoder)
|
|||
error_unsupported_profile:
|
||||
{
|
||||
GST_ERROR ("unsupported HW profile %s",
|
||||
gst_vaapi_profile_get_name (encoder->profile));
|
||||
gst_vaapi_profile_get_va_name (encoder->profile));
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -164,7 +164,7 @@ ensure_hw_profile (GstVaapiEncoderJpeg * encoder)
|
|||
error_unsupported_profile:
|
||||
{
|
||||
GST_ERROR ("unsupported HW profile %s",
|
||||
gst_vaapi_profile_get_name (encoder->profile));
|
||||
gst_vaapi_profile_get_va_name (encoder->profile));
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -101,7 +101,7 @@ ensure_hw_profile (GstVaapiEncoderMpeg2 * encoder)
|
|||
error_unsupported_profile:
|
||||
{
|
||||
GST_ERROR ("unsupported HW profile %s",
|
||||
gst_vaapi_profile_get_name (encoder->profile));
|
||||
gst_vaapi_profile_get_va_name (encoder->profile));
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -109,7 +109,7 @@ ensure_hw_profile (GstVaapiEncoderVP8 * encoder)
|
|||
error_unsupported_profile:
|
||||
{
|
||||
GST_ERROR ("unsupported HW profile %s",
|
||||
gst_vaapi_profile_get_name (encoder->profile));
|
||||
gst_vaapi_profile_get_va_name (encoder->profile));
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -196,7 +196,7 @@ ensure_hw_profile (GstVaapiEncoderVP9 * encoder)
|
|||
error_unsupported_profile:
|
||||
{
|
||||
GST_ERROR ("unsupported HW profile %s",
|
||||
gst_vaapi_profile_get_name (encoder->profile));
|
||||
gst_vaapi_profile_get_va_name (encoder->profile));
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
#include <gst/gstbuffer.h>
|
||||
#include "gstvaapicompat.h"
|
||||
#include "gstvaapiprofile.h"
|
||||
#include "gstvaapiutils.h"
|
||||
#include "gstvaapiworkarounds.h"
|
||||
|
||||
typedef struct _GstVaapiCodecMap GstVaapiCodecMap;
|
||||
|
@ -242,9 +243,26 @@ gst_vaapi_profile_get_name (GstVaapiProfile profile)
|
|||
}
|
||||
|
||||
/**
|
||||
* gst_vaapi_profile_get_media_type_name:
|
||||
* gst_vaapi_profile_get_va_name:
|
||||
* @profile: a #GstVaapiProfile
|
||||
*
|
||||
* Returns a string representation for the supplied @profile as VAProfile.
|
||||
*
|
||||
* Return value: the statically allocated string representation of
|
||||
* @profile as VAProfile
|
||||
*/
|
||||
const gchar *
|
||||
gst_vaapi_profile_get_va_name (GstVaapiProfile profile)
|
||||
{
|
||||
const GstVaapiProfileMap *const m = get_profiles_map (profile);
|
||||
|
||||
return m ? string_of_VAProfile (m->va_profile) : NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_vaapi_profile_get_media_type_name:
|
||||
* @profile: a #GstVaapiProfileo
|
||||
*
|
||||
* Returns a string representation for the media type of the supplied
|
||||
* @profile.
|
||||
*
|
||||
|
|
|
@ -221,6 +221,9 @@ gst_vaapi_profile_from_caps(const GstCaps *caps);
|
|||
const gchar *
|
||||
gst_vaapi_profile_get_name(GstVaapiProfile profile);
|
||||
|
||||
const gchar *
|
||||
gst_vaapi_profile_get_va_name(GstVaapiProfile profile);
|
||||
|
||||
const gchar *
|
||||
gst_vaapi_profile_get_media_type_name(GstVaapiProfile profile);
|
||||
|
||||
|
|
|
@ -84,7 +84,7 @@ print_profiles (GArray * profiles, const gchar * name)
|
|||
if (!codec_name)
|
||||
continue;
|
||||
|
||||
profile_name = gst_vaapi_profile_get_name (profile);
|
||||
profile_name = gst_vaapi_profile_get_va_name (profile);
|
||||
if (!profile_name)
|
||||
continue;
|
||||
|
||||
|
|
Loading…
Reference in a new issue