mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
codecparsers: ensure the debug category is properly initialized
The user of the library might not need to create a NalParser, so the debug category needs to be initialized from other functions as well if required.
This commit is contained in:
parent
3f15c9b05a
commit
529b248a89
1 changed files with 11 additions and 2 deletions
|
@ -93,6 +93,14 @@
|
||||||
GST_DEBUG_CATEGORY (h264_parser_debug);
|
GST_DEBUG_CATEGORY (h264_parser_debug);
|
||||||
#define GST_CAT_DEFAULT h264_parser_debug
|
#define GST_CAT_DEFAULT h264_parser_debug
|
||||||
|
|
||||||
|
static gboolean initialized = FALSE;
|
||||||
|
#define INITIALIZE_DEBUG_CATEGORY \
|
||||||
|
if (!initialized) { \
|
||||||
|
GST_DEBUG_CATEGORY_INIT (h264_parser_debug, "codecparsers_h264", 0, \
|
||||||
|
"h264 parser library"); \
|
||||||
|
initialized = TRUE; \
|
||||||
|
}
|
||||||
|
|
||||||
/**** Default scaling_lists according to Table 7-2 *****/
|
/**** Default scaling_lists according to Table 7-2 *****/
|
||||||
static const guint8 default_4x4_intra[16] = {
|
static const guint8 default_4x4_intra[16] = {
|
||||||
6, 13, 13, 20, 20, 20, 28, 28, 28, 28, 32, 32,
|
6, 13, 13, 20, 20, 20, 28, 28, 28, 28, 32, 32,
|
||||||
|
@ -1171,8 +1179,7 @@ gst_h264_nal_parser_new (void)
|
||||||
GstH264NalParser *nalparser;
|
GstH264NalParser *nalparser;
|
||||||
|
|
||||||
nalparser = g_slice_new0 (GstH264NalParser);
|
nalparser = g_slice_new0 (GstH264NalParser);
|
||||||
GST_DEBUG_CATEGORY_INIT (h264_parser_debug, "codecparsers_h264", 0,
|
INITIALIZE_DEBUG_CATEGORY;
|
||||||
"h264 parser library");
|
|
||||||
|
|
||||||
return nalparser;
|
return nalparser;
|
||||||
}
|
}
|
||||||
|
@ -1435,6 +1442,7 @@ gst_h264_parse_sps (GstH264NalUnit * nalu, GstH264SPS * sps,
|
||||||
guint subhc[] = { 1, 2, 1, 1 };
|
guint subhc[] = { 1, 2, 1, 1 };
|
||||||
GstH264VUIParams *vui = NULL;
|
GstH264VUIParams *vui = NULL;
|
||||||
|
|
||||||
|
INITIALIZE_DEBUG_CATEGORY;
|
||||||
GST_DEBUG ("parsing SPS");
|
GST_DEBUG ("parsing SPS");
|
||||||
nal_reader_init (&nr, nalu->data + nalu->offset + 1, nalu->size - 1);
|
nal_reader_init (&nr, nalu->data + nalu->offset + 1, nalu->size - 1);
|
||||||
|
|
||||||
|
@ -1614,6 +1622,7 @@ gst_h264_parse_pps (GstH264NalParser * nalparser, GstH264NalUnit * nalu,
|
||||||
guint8 pic_scaling_matrix_present_flag;
|
guint8 pic_scaling_matrix_present_flag;
|
||||||
gint qp_bd_offset;
|
gint qp_bd_offset;
|
||||||
|
|
||||||
|
INITIALIZE_DEBUG_CATEGORY;
|
||||||
GST_DEBUG ("parsing PPS");
|
GST_DEBUG ("parsing PPS");
|
||||||
|
|
||||||
nal_reader_init (&nr, nalu->data + nalu->offset + 1, nalu->size - 1);
|
nal_reader_init (&nr, nalu->data + nalu->offset + 1, nalu->size - 1);
|
||||||
|
|
Loading…
Reference in a new issue