summaryrefslogtreecommitdiff
path: root/gst-libs
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2018-03-01 11:08:44 +0100
committerNicolas Dufresne <nicolas.dufresne@collabora.com>2018-03-05 13:19:42 -0500
commitd252f503fc2cd9e373e1467cdf3f0de34345359a (patch)
treeb630930b211f7ecb737e2bca3c70f913bd03a8b0 /gst-libs
parent076809ebd582638c8198276325ede5b59eb9b102 (diff)
h265parser: decouple GstH265Profile and GstH265ProfileIDC
We used to have the same enum to represent H265 profiles and idc values. Those are no longer the same with extension profiles defined from version 2 of the spec. Split those enums so the semantic of each is clearer and we'll be able to add extension profiles to GstH265Profile. Also add gst_h265_profile_tier_level_get_profile() to retrieve the GstH265Profile from the GstH265ProfileTierLevel. It will be used to implement the detection of extension profiles. https://bugzilla.gnome.org/show_bug.cgi?id=793876
Diffstat (limited to 'gst-libs')
-rw-r--r--gst-libs/gst/codecparsers/gsth265parser.c24
-rw-r--r--gst-libs/gst/codecparsers/gsth265parser.h27
2 files changed, 51 insertions, 0 deletions
diff --git a/gst-libs/gst/codecparsers/gsth265parser.c b/gst-libs/gst/codecparsers/gsth265parser.c
index e7d56be9c..0b2d68c88 100644
--- a/gst-libs/gst/codecparsers/gsth265parser.c
+++ b/gst-libs/gst/codecparsers/gsth265parser.c
@@ -2630,3 +2630,27 @@ gst_h265_quant_matrix_8x8_get_raster_from_uprightdiagonal (guint8 out_quant[64],
for (i = 0; i < 64; i++)
out_quant[uprightdiagonal_8x8[i]] = quant[i];
}
+
+GstH265Profile
+gst_h265_profile_tier_level_get_profile (GstH265ProfileTierLevel * ptl)
+{
+ if (ptl->profile_idc == GST_H265_PROFILE_IDC_MAIN
+ || ptl->profile_compatibility_flag[1])
+ return GST_H265_PROFILE_MAIN;
+
+ if (ptl->profile_idc == GST_H265_PROFILE_IDC_MAIN_10
+ || ptl->profile_compatibility_flag[2])
+ return GST_H265_PROFILE_MAIN_10;
+
+ if (ptl->profile_idc == GST_H265_PROFILE_IDC_MAIN_STILL_PICTURE
+ || ptl->profile_compatibility_flag[3])
+ return GST_H265_PROFILE_MAIN_STILL_PICTURE;
+
+ /* TODO:
+ * - GST_H265_PROFILE_IDC_FORMAT_RANGE_EXTENSION
+ * - GST_H265_PROFILE_IDC_HIGH_THROUGHPUT
+ * - GST_H265_PROFILE_IDC_SCREEN_CONTENT_CODING
+ */
+
+ return GST_H265_PROFILE_INVALID;
+}
diff --git a/gst-libs/gst/codecparsers/gsth265parser.h b/gst-libs/gst/codecparsers/gsth265parser.h
index 21d655114..8fa807a1e 100644
--- a/gst-libs/gst/codecparsers/gsth265parser.h
+++ b/gst-libs/gst/codecparsers/gsth265parser.h
@@ -51,12 +51,36 @@ G_BEGIN_DECLS
*
*/
typedef enum {
+ GST_H265_PROFILE_INVALID = -1,
GST_H265_PROFILE_MAIN = 1,
GST_H265_PROFILE_MAIN_10 = 2,
GST_H265_PROFILE_MAIN_STILL_PICTURE = 3
} GstH265Profile;
/**
+ * GstH265ProfileIDC:
+ * @GST_H265_PROFILE_IDC_MAIN: Main profile (A.3.2)
+ * @GST_H265_PROFILE_IDC_MAIN_10: Main 10 profile (A.3.3)
+ * @GST_H265_PROFILE_IDC_MAIN_STILL_PICTURE: Main Still Picture profile (A.3.4)
+ * @GST_H265_PROFILE_IDC_FORMAT_RANGE_EXTENSION: Format range extensions profile (A.3.5)
+ * @GST_H265_PROFILE_IDC_HIGH_THROUGHPUT: High throughput profiles (A.3.6)
+ * @GST_H265_PROFILE_IDC_SCREEN_CONTENT_CODING: Screen content coding extensions profiles (A.3.7)
+ *
+ * Valid values for the profile_idc field. This is different from
+ * #GstH265Profile as an extension idc can be used to encode a whole variety of
+ * profiles.
+ *
+ */
+typedef enum {
+ GST_H265_PROFILE_IDC_MAIN = 1,
+ GST_H265_PROFILE_IDC_MAIN_10 = 2,
+ GST_H265_PROFILE_IDC_MAIN_STILL_PICTURE = 3,
+ GST_H265_PROFILE_IDC_FORMAT_RANGE_EXTENSION = 4,
+ GST_H265_PROFILE_IDC_HIGH_THROUGHPUT = 5,
+ GST_H265_PROFILE_IDC_SCREEN_CONTENT_CODING = 9,
+} GstH265ProfileIDC;
+
+/**
* GstH265NalUnitType:
* @GST_H265_NAL_SLICE_TRAIL_N: Slice nal of a non-TSA, non-STSA trailing picture
* @GST_H265_NAL_SLICE_TRAIL_R: Slice nal of a non-TSA, non-STSA trailing picture
@@ -1134,5 +1158,8 @@ void gst_h265_quant_matrix_8x8_get_raster_from_uprightdiagonal (guint8 out_qu
#define gst_h265_quant_matrix_32x32_get_raster_from_uprightdiagonal\
gst_h265_quant_matrix_8x8_get_raster_from_uprightdiagonal
+GST_EXPORT
+GstH265Profile gst_h265_profile_tier_level_get_profile (GstH265ProfileTierLevel * ptl);
+
G_END_DECLS
#endif