h264parser: Define level enum values

... and stop duplicating it

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4595>
This commit is contained in:
Seungha Yang 2023-05-11 04:53:24 +09:00 committed by GStreamer Marge Bot
parent 783ebbeecb
commit e9d8bf7532
4 changed files with 37 additions and 78 deletions

View file

@ -352,6 +352,37 @@ typedef enum
GST_H264_CT_TYPE_UNKNOWN = 2,
} GstCtType;
/**
* GstH264Level:
*
* H.264 level
*
* Since: 1.24
*/
typedef enum
{
GST_H264_LEVEL_L1 = 10,
GST_H264_LEVEL_L1B = 9,
GST_H264_LEVEL_L1_1 = 11,
GST_H264_LEVEL_L1_2 = 12,
GST_H264_LEVEL_L1_3 = 13,
GST_H264_LEVEL_L2_0 = 20,
GST_H264_LEVEL_L2_1 = 21,
GST_H264_LEVEL_L2_2 = 22,
GST_H264_LEVEL_L3 = 30,
GST_H264_LEVEL_L3_1 = 31,
GST_H264_LEVEL_L3_2 = 32,
GST_H264_LEVEL_L4 = 40,
GST_H264_LEVEL_L4_1 = 41,
GST_H264_LEVEL_L4_2 = 42,
GST_H264_LEVEL_L5 = 50,
GST_H264_LEVEL_L5_1 = 51,
GST_H264_LEVEL_L5_2 = 52,
GST_H264_LEVEL_L6 = 60,
GST_H264_LEVEL_L6_1 = 61,
GST_H264_LEVEL_L6_2 = 62,
} GstH264Level;
typedef struct _GstH264NalParser GstH264NalParser;
typedef struct _GstH264NalUnit GstH264NalUnit;

View file

@ -2218,33 +2218,9 @@ gst_h264_decoder_get_max_num_reorder_frames (GstH264Decoder * self,
return max_dpb_size;
}
typedef enum
{
GST_H264_LEVEL_L1 = 10,
GST_H264_LEVEL_L1B = 9,
GST_H264_LEVEL_L1_1 = 11,
GST_H264_LEVEL_L1_2 = 12,
GST_H264_LEVEL_L1_3 = 13,
GST_H264_LEVEL_L2_0 = 20,
GST_H264_LEVEL_L2_1 = 21,
GST_H264_LEVEL_L2_2 = 22,
GST_H264_LEVEL_L3 = 30,
GST_H264_LEVEL_L3_1 = 31,
GST_H264_LEVEL_L3_2 = 32,
GST_H264_LEVEL_L4 = 40,
GST_H264_LEVEL_L4_1 = 41,
GST_H264_LEVEL_L4_2 = 42,
GST_H264_LEVEL_L5 = 50,
GST_H264_LEVEL_L5_1 = 51,
GST_H264_LEVEL_L5_2 = 52,
GST_H264_LEVEL_L6 = 60,
GST_H264_LEVEL_L6_1 = 61,
GST_H264_LEVEL_L6_2 = 62,
} GstH264DecoderLevel;
typedef struct
{
GstH264DecoderLevel level;
GstH264Level level;
guint32 max_mbps;
guint32 max_fs;
@ -2276,7 +2252,7 @@ static const LevelLimits level_limits_map[] = {
};
static gint
h264_level_to_max_dpb_mbs (GstH264DecoderLevel level)
h264_level_to_max_dpb_mbs (GstH264Level level)
{
gint i;
for (i = 0; i < G_N_ELEMENTS (level_limits_map); i++) {
@ -2395,7 +2371,7 @@ gst_h264_decoder_process_sps (GstH264Decoder * self, GstH264SPS * sps)
level = 9;
}
max_dpb_mbs = h264_level_to_max_dpb_mbs ((GstH264DecoderLevel) level);
max_dpb_mbs = h264_level_to_max_dpb_mbs ((GstH264Level) level);
if (!max_dpb_mbs)
return GST_FLOW_ERROR;

View file

@ -194,33 +194,9 @@ gst_h264_timestamper_set_caps (GstCodecTimestamper * timestamper,
return TRUE;
}
typedef enum
{
GST_H264_LEVEL_L1 = 10,
GST_H264_LEVEL_L1B = 9,
GST_H264_LEVEL_L1_1 = 11,
GST_H264_LEVEL_L1_2 = 12,
GST_H264_LEVEL_L1_3 = 13,
GST_H264_LEVEL_L2_0 = 20,
GST_H264_LEVEL_L2_1 = 21,
GST_H264_LEVEL_L2_2 = 22,
GST_H264_LEVEL_L3 = 30,
GST_H264_LEVEL_L3_1 = 31,
GST_H264_LEVEL_L3_2 = 32,
GST_H264_LEVEL_L4 = 40,
GST_H264_LEVEL_L4_1 = 41,
GST_H264_LEVEL_L4_2 = 42,
GST_H264_LEVEL_L5 = 50,
GST_H264_LEVEL_L5_1 = 51,
GST_H264_LEVEL_L5_2 = 52,
GST_H264_LEVEL_L6 = 60,
GST_H264_LEVEL_L6_1 = 61,
GST_H264_LEVEL_L6_2 = 62,
} GstH264DecoderLevel;
typedef struct
{
GstH264DecoderLevel level;
GstH264Level level;
guint32 max_mbps;
guint32 max_fs;
@ -252,7 +228,7 @@ static const LevelLimits level_limits_map[] = {
};
static guint
h264_level_to_max_dpb_mbs (GstH264DecoderLevel level)
h264_level_to_max_dpb_mbs (GstH264Level level)
{
gint i;
for (i = 0; i < G_N_ELEMENTS (level_limits_map); i++) {
@ -283,7 +259,7 @@ gst_h264_timestamper_process_sps (GstH264Timestamper * self, GstH264SPS * sps)
level = 9;
}
max_dpb_mbs = h264_level_to_max_dpb_mbs ((GstH264DecoderLevel) level);
max_dpb_mbs = h264_level_to_max_dpb_mbs ((GstH264Level) level);
if (sps->vui_parameters_present_flag
&& sps->vui_parameters.bitstream_restriction_flag) {
max_dpb_frames = MAX (1, sps->vui_parameters.max_dec_frame_buffering);

View file

@ -2042,30 +2042,6 @@ get_level_string (GstH264SPS * sps)
}
}
typedef enum
{
GST_H264_LEVEL_L1 = 10,
GST_H264_LEVEL_L1B = 9,
GST_H264_LEVEL_L1_1 = 11,
GST_H264_LEVEL_L1_2 = 12,
GST_H264_LEVEL_L1_3 = 13,
GST_H264_LEVEL_L2_0 = 20,
GST_H264_LEVEL_L2_1 = 21,
GST_H264_LEVEL_L2_2 = 22,
GST_H264_LEVEL_L3 = 30,
GST_H264_LEVEL_L3_1 = 31,
GST_H264_LEVEL_L3_2 = 32,
GST_H264_LEVEL_L4 = 40,
GST_H264_LEVEL_L4_1 = 41,
GST_H264_LEVEL_L4_2 = 42,
GST_H264_LEVEL_L5 = 50,
GST_H264_LEVEL_L5_1 = 51,
GST_H264_LEVEL_L5_2 = 52,
GST_H264_LEVEL_L6 = 60,
GST_H264_LEVEL_L6_1 = 61,
GST_H264_LEVEL_L6_2 = 62,
} GstH264Level;
typedef struct
{
GstH264Level level;