gstvaapiutils_h265: Add H265 Tier specific utility functions

-- New API: gst_vaapi_utils_h265_get_tier_from_string()
-- New API: gst_vaapi_utils_h265_get_tier_string()

https://bugzilla.gnome.org/show_bug.cgi?id=748874

Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
This commit is contained in:
Sreerenj Balachandran 2015-05-25 10:58:52 +03:00
parent 40e836e5eb
commit e069ddf2b1
2 changed files with 50 additions and 0 deletions

View file

@ -40,6 +40,15 @@ static const struct map gst_vaapi_h265_profile_map[] = {
/* *INDENT-ON* */ /* *INDENT-ON* */
}; };
/* Tier string map */
static const struct map gst_vaapi_h265_tier_map[] = {
/* *INDENT-OFF* */
{ GST_VAAPI_TIER_H265_MAIN, "main" },
{ GST_VAAPI_TIER_H265_HIGH, "high"},
{ GST_VAAPI_TIER_H265_UNKNOWN, "unknown"}
/* *INDENT-ON* */
};
/* Level string map */ /* Level string map */
static const struct map gst_vaapi_h265_level_map[] = { static const struct map gst_vaapi_h265_level_map[] = {
/* *INDENT-OFF* */ /* *INDENT-OFF* */
@ -323,3 +332,22 @@ gst_vaapi_utils_h265_get_chroma_format_idc (GstVaapiChromaType chroma_type)
} }
return chroma_format_idc; return chroma_format_idc;
} }
/** Returns GstVaapiTierH265 from a string representation */
GstVaapiTierH265
gst_vaapi_utils_h265_get_tier_from_string (const gchar * str)
{
const struct map *const m = map_lookup_name (gst_vaapi_h265_tier_map, str);
return m ? (GstVaapiTierH265) m->value : GST_VAAPI_TIER_H265_UNKNOWN;
}
/** Returns a string representation for the supplied H.265 tier */
const gchar *
gst_vaapi_utils_h265_get_tier_string (GstVaapiTierH265 tier)
{
const struct map *const m =
map_lookup_value (gst_vaapi_h265_tier_map, tier);
return m ? m->name : NULL;
}

View file

@ -63,6 +63,20 @@ typedef enum {
GST_VAAPI_LEVEL_H265_L6_2, GST_VAAPI_LEVEL_H265_L6_2,
} GstVaapiLevelH265; } GstVaapiLevelH265;
/**
* GstVaapiTierH265:
* GST_VAAPI_TIER_H265_MAIN: H265 Tier 0
* GST_VAAPI_TIER_H265_HIGH: H265 Tier 1
* GST_VAAPI_TIER_H265_UNKNOWN: Unknown Tier
*
* The set of all Tier for #GstVaapiTierH265.
*/
typedef enum {
GST_VAAPI_TIER_H265_MAIN,
GST_VAAPI_TIER_H265_HIGH,
GST_VAAPI_TIER_H265_UNKNOWN = -1
} GstVaapiTierH265;
/* Returns a relative score for the supplied GstVaapiProfile */ /* Returns a relative score for the supplied GstVaapiProfile */
guint guint
gst_vaapi_utils_h265_get_profile_score (GstVaapiProfile profile); gst_vaapi_utils_h265_get_profile_score (GstVaapiProfile profile);
@ -83,6 +97,14 @@ gst_vaapi_utils_h265_get_level_from_string (const gchar * str);
const gchar * const gchar *
gst_vaapi_utils_h265_get_level_string (GstVaapiLevelH265 level); gst_vaapi_utils_h265_get_level_string (GstVaapiLevelH265 level);
/* Returns GstVaapiTierH265 from a string representation */
GstVaapiTierH265
gst_vaapi_utils_h265_get_tier_from_string (const gchar * str);
/* Returns a string representation for the supplied H.265 Tier */
const gchar *
gst_vaapi_utils_h265_get_tier_string (GstVaapiTierH265 tier);
G_END_DECLS G_END_DECLS
#endif /* GST_VAAPI_UTILS_H265_H */ #endif /* GST_VAAPI_UTILS_H265_H */