From 977af86e8b413f953e24c830f1346b741c627e95 Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Tue, 27 Feb 2018 11:30:15 +0100 Subject: [PATCH] h265parser: parse extra profile fields Those fields have been introduced in version 2 and later to define new profiles like the format range extensions profiles (A.3.5). NOTE: This patch breaks the parser ABI, rebuild needed. https://bugzilla.gnome.org/show_bug.cgi?id=793876 --- gst-libs/gst/codecparsers/gsth265parser.c | 13 ++++++++++++- gst-libs/gst/codecparsers/gsth265parser.h | 22 ++++++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/gst-libs/gst/codecparsers/gsth265parser.c b/gst-libs/gst/codecparsers/gsth265parser.c index 0b2d68c887..01f9d587a6 100644 --- a/gst-libs/gst/codecparsers/gsth265parser.c +++ b/gst-libs/gst/codecparsers/gsth265parser.c @@ -264,8 +264,19 @@ gst_h265_parse_profile_tier_level (GstH265ProfileTierLevel * ptl, READ_UINT8 (nr, ptl->non_packed_constraint_flag, 1); READ_UINT8 (nr, ptl->frame_only_constraint_flag, 1); + READ_UINT8 (nr, ptl->max_12bit_constraint_flag, 1); + READ_UINT8 (nr, ptl->max_10bit_constraint_flag, 1); + READ_UINT8 (nr, ptl->max_8bit_constraint_flag, 1); + READ_UINT8 (nr, ptl->max_422chroma_constraint_flag, 1); + READ_UINT8 (nr, ptl->max_420chroma_constraint_flag, 1); + READ_UINT8 (nr, ptl->max_monochrome_constraint_flag, 1); + READ_UINT8 (nr, ptl->intra_constraint_flag, 1); + READ_UINT8 (nr, ptl->one_picture_only_constraint_flag, 1); + READ_UINT8 (nr, ptl->lower_bit_rate_constraint_flag, 1); + READ_UINT8 (nr, ptl->max_14bit_constraint_flag, 1); + /* skip the reserved zero bits */ - if (!nal_reader_skip (nr, 44)) + if (!nal_reader_skip (nr, 34)) goto error; READ_UINT8 (nr, ptl->level_idc, 8); diff --git a/gst-libs/gst/codecparsers/gsth265parser.h b/gst-libs/gst/codecparsers/gsth265parser.h index 8fa807a1ed..45c5e54846 100644 --- a/gst-libs/gst/codecparsers/gsth265parser.h +++ b/gst-libs/gst/codecparsers/gsth265parser.h @@ -316,6 +316,16 @@ struct _GstH265NalUnit * @non_packed_constraint_flag: indicate the presence of frame packing * arragement sei message * @frame_only_constraint_flag: recognize the field_seq_flag + * @max_12bit_constraint_flag: used to define profile extensions, see Annex A + * @max_10bit_constraint_flag: used to define profile extensions, see Annex A + * @max_8bit_constraint_flag: used to define profile extensions, see Annex A + * @max_422chroma_constraint_flag: used to define profile extensions, see Annex A + * @max_420chroma_constraint_flag: used to define profile extensions, see Annex A + * @max_monochrome_constraint_flag: used to define profile extensions, see Annex A + * @intra_constraint_flag: used to define profile extensions, see Annex A + * @one_picture_only_constraint_flag: used to define profile extensions, see Annex A + * @lower_bit_rate_constraint_flag: used to define profile extensions, see Annex A + * @max_14bit_constraint_flag: used to define profile extensions, see Annex A * @level idc: indicate the level which the CVS confirms * @sub_layer_profile_present_flag: sublayer profile presence ind * @sub_layer_level_present_flag:sublayer level presence indicator. @@ -344,6 +354,18 @@ struct _GstH265ProfileTierLevel { guint8 interlaced_source_flag; guint8 non_packed_constraint_flag; guint8 frame_only_constraint_flag; + + guint8 max_12bit_constraint_flag; + guint8 max_10bit_constraint_flag; + guint8 max_8bit_constraint_flag; + guint8 max_422chroma_constraint_flag; + guint8 max_420chroma_constraint_flag; + guint8 max_monochrome_constraint_flag; + guint8 intra_constraint_flag; + guint8 one_picture_only_constraint_flag; + guint8 lower_bit_rate_constraint_flag; + guint8 max_14bit_constraint_flag; + guint8 level_idc; guint8 sub_layer_profile_present_flag[6];