summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSreerenj Balachandran <sreerenj.balachandran@intel.com>2015-05-25 10:58:52 +0300
committerSreerenj Balachandran <sreerenj.balachandran@intel.com>2015-05-25 11:23:16 +0300
commite069ddf2b135c4c422a959a6c59e78d15a5e091a (patch)
tree357267951162b5c58a752884cf694b047f83da46
parent40e836e5eb925cd757cb97de6d8f20b7abc8b56b (diff)
downloadgst-vaapi-e069ddf2b135c4c422a959a6c59e78d15a5e091a.tar.gz
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>
-rw-r--r--gst-libs/gst/vaapi/gstvaapiutils_h265.c28
-rw-r--r--gst-libs/gst/vaapi/gstvaapiutils_h265.h22
2 files changed, 50 insertions, 0 deletions
diff --git a/gst-libs/gst/vaapi/gstvaapiutils_h265.c b/gst-libs/gst/vaapi/gstvaapiutils_h265.c
index 279400e0..0a80d3db 100644
--- a/gst-libs/gst/vaapi/gstvaapiutils_h265.c
+++ b/gst-libs/gst/vaapi/gstvaapiutils_h265.c
@@ -40,6 +40,15 @@ static const struct map gst_vaapi_h265_profile_map[] = {
/* *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 */
static const struct map gst_vaapi_h265_level_map[] = {
/* *INDENT-OFF* */
@@ -323,3 +332,22 @@ gst_vaapi_utils_h265_get_chroma_format_idc (GstVaapiChromaType chroma_type)
}
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;
+}
diff --git a/gst-libs/gst/vaapi/gstvaapiutils_h265.h b/gst-libs/gst/vaapi/gstvaapiutils_h265.h
index fff6e641..71011b99 100644
--- a/gst-libs/gst/vaapi/gstvaapiutils_h265.h
+++ b/gst-libs/gst/vaapi/gstvaapiutils_h265.h
@@ -63,6 +63,20 @@ typedef enum {
GST_VAAPI_LEVEL_H265_L6_2,
} 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 */
guint
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 *
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
#endif /* GST_VAAPI_UTILS_H265_H */