From 3c3274a8daffbe61cd1ef2b7a9b680b03f676608 Mon Sep 17 00:00:00 2001 From: Seungha Yang Date: Sun, 17 Apr 2022 00:00:55 +0900 Subject: [PATCH] qsv: Move debug init into each source file Part-of: --- .../gst-plugins-bad/sys/qsv/gstqsvdecoder.cpp | 8 +++--- .../gst-plugins-bad/sys/qsv/gstqsvencoder.cpp | 8 +++--- .../gst-plugins-bad/sys/qsv/gstqsvh264dec.cpp | 5 +++- .../gst-plugins-bad/sys/qsv/gstqsvh264enc.cpp | 5 +++- .../gst-plugins-bad/sys/qsv/gstqsvh265enc.cpp | 5 +++- .../gst-plugins-bad/sys/qsv/gstqsvjpegenc.cpp | 5 +++- .../gst-plugins-bad/sys/qsv/gstqsvvp9enc.cpp | 4 ++- .../gst-plugins-bad/sys/qsv/plugin.cpp | 25 ++----------------- 8 files changed, 31 insertions(+), 34 deletions(-) diff --git a/subprojects/gst-plugins-bad/sys/qsv/gstqsvdecoder.cpp b/subprojects/gst-plugins-bad/sys/qsv/gstqsvdecoder.cpp index 73377144c6..ad0b4372de 100644 --- a/subprojects/gst-plugins-bad/sys/qsv/gstqsvdecoder.cpp +++ b/subprojects/gst-plugins-bad/sys/qsv/gstqsvdecoder.cpp @@ -37,7 +37,7 @@ using namespace Microsoft::WRL; #include "gstqsvallocator_va.h" #endif /* G_OS_WIN32 */ -GST_DEBUG_CATEGORY_EXTERN (gst_qsv_decoder_debug); +GST_DEBUG_CATEGORY_STATIC (gst_qsv_decoder_debug); #define GST_CAT_DEFAULT gst_qsv_decoder_debug #define GST_QSV_DECODER_FLOW_NEW_SEQUENCE GST_FLOW_CUSTOM_SUCCESS_1 @@ -101,8 +101,10 @@ struct _GstQsvDecoderPrivate }; #define gst_qsv_decoder_parent_class parent_class -G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (GstQsvDecoder, gst_qsv_decoder, - GST_TYPE_VIDEO_DECODER); +G_DEFINE_ABSTRACT_TYPE_WITH_CODE (GstQsvDecoder, gst_qsv_decoder, + GST_TYPE_VIDEO_DECODER, G_ADD_PRIVATE (GstQsvDecoder); + GST_DEBUG_CATEGORY_INIT (gst_qsv_decoder_debug, + "qsvdecoder", 0, "qsvdecoder")); static void gst_qsv_decoder_get_property (GObject * object, guint prop_id, GValue * value, GParamSpec * pspec); diff --git a/subprojects/gst-plugins-bad/sys/qsv/gstqsvencoder.cpp b/subprojects/gst-plugins-bad/sys/qsv/gstqsvencoder.cpp index b06940745f..e16a13a30b 100644 --- a/subprojects/gst-plugins-bad/sys/qsv/gstqsvencoder.cpp +++ b/subprojects/gst-plugins-bad/sys/qsv/gstqsvencoder.cpp @@ -38,7 +38,7 @@ using namespace Microsoft::WRL; #include "gstqsvallocator_va.h" #endif /* G_OS_WIN32 */ -GST_DEBUG_CATEGORY_EXTERN (gst_qsv_encoder_debug); +GST_DEBUG_CATEGORY_STATIC (gst_qsv_encoder_debug); #define GST_CAT_DEFAULT gst_qsv_encoder_debug GType @@ -129,8 +129,10 @@ struct _GstQsvEncoderPrivate }; #define gst_qsv_encoder_parent_class parent_class -G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (GstQsvEncoder, gst_qsv_encoder, - GST_TYPE_VIDEO_ENCODER); +G_DEFINE_ABSTRACT_TYPE_WITH_CODE (GstQsvEncoder, gst_qsv_encoder, + GST_TYPE_VIDEO_ENCODER, G_ADD_PRIVATE (GstQsvEncoder); + GST_DEBUG_CATEGORY_INIT (gst_qsv_encoder_debug, + "qsvencoder", 0, "qsvencoder")); static void gst_qsv_encoder_dispose (GObject * object); static void gst_qsv_encoder_finalize (GObject * object); diff --git a/subprojects/gst-plugins-bad/sys/qsv/gstqsvh264dec.cpp b/subprojects/gst-plugins-bad/sys/qsv/gstqsvh264dec.cpp index d17f0b0289..4ddf383d4b 100644 --- a/subprojects/gst-plugins-bad/sys/qsv/gstqsvh264dec.cpp +++ b/subprojects/gst-plugins-bad/sys/qsv/gstqsvh264dec.cpp @@ -31,7 +31,7 @@ #include #endif -GST_DEBUG_CATEGORY_EXTERN (gst_qsv_h264_dec_debug); +GST_DEBUG_CATEGORY_STATIC (gst_qsv_h264_dec_debug); #define GST_CAT_DEFAULT gst_qsv_h264_dec_debug typedef struct _GstQsvH264Dec @@ -97,6 +97,9 @@ gst_qsv_h264_dec_register (GstPlugin * plugin, guint rank, guint impl_index, }; Resolution max_resolution; + GST_DEBUG_CATEGORY_INIT (gst_qsv_h264_dec_debug, + "qsvh264dec", 0, "qsvh264dec"); + memset (¶m, 0, sizeof (mfxVideoParam)); memset (&max_resolution, 0, sizeof (Resolution)); diff --git a/subprojects/gst-plugins-bad/sys/qsv/gstqsvh264enc.cpp b/subprojects/gst-plugins-bad/sys/qsv/gstqsvh264enc.cpp index b5aa1f628b..cb8433d88d 100644 --- a/subprojects/gst-plugins-bad/sys/qsv/gstqsvh264enc.cpp +++ b/subprojects/gst-plugins-bad/sys/qsv/gstqsvh264enc.cpp @@ -35,7 +35,7 @@ #include #endif -GST_DEBUG_CATEGORY_EXTERN (gst_qsv_h264_enc_debug); +GST_DEBUG_CATEGORY_STATIC (gst_qsv_h264_enc_debug); #define GST_CAT_DEFAULT gst_qsv_h264_enc_debug typedef enum @@ -1715,6 +1715,9 @@ gst_qsv_h264_enc_register (GstPlugin * plugin, guint rank, guint impl_index, Resolution max_resolution; bool supports_interlaced = false; + GST_DEBUG_CATEGORY_INIT (gst_qsv_h264_enc_debug, + "qsvh264enc", 0, "qsvh264enc"); + memset (¶m, 0, sizeof (mfxVideoParam)); memset (&max_resolution, 0, sizeof (Resolution)); diff --git a/subprojects/gst-plugins-bad/sys/qsv/gstqsvh265enc.cpp b/subprojects/gst-plugins-bad/sys/qsv/gstqsvh265enc.cpp index fa1b810eef..2bbe801e24 100644 --- a/subprojects/gst-plugins-bad/sys/qsv/gstqsvh265enc.cpp +++ b/subprojects/gst-plugins-bad/sys/qsv/gstqsvh265enc.cpp @@ -34,7 +34,7 @@ #include #endif -GST_DEBUG_CATEGORY_EXTERN (gst_qsv_h265_enc_debug); +GST_DEBUG_CATEGORY_STATIC (gst_qsv_h265_enc_debug); #define GST_CAT_DEFAULT gst_qsv_h265_enc_debug typedef enum @@ -1355,6 +1355,9 @@ gst_qsv_h265_enc_register (GstPlugin * plugin, guint rank, guint impl_index, mfxExtBuffer *ext_buffers[2]; gboolean hdr10_aware = FALSE; + GST_DEBUG_CATEGORY_INIT (gst_qsv_h265_enc_debug, + "qsvh265enc", 0, "qsvh265enc"); + memset (¶m, 0, sizeof (mfxVideoParam)); memset (&max_resolution, 0, sizeof (Resolution)); memset (&cll, 0, sizeof (mfxExtContentLightLevelInfo)); diff --git a/subprojects/gst-plugins-bad/sys/qsv/gstqsvjpegenc.cpp b/subprojects/gst-plugins-bad/sys/qsv/gstqsvjpegenc.cpp index 0a07df1463..fe74e7f96c 100644 --- a/subprojects/gst-plugins-bad/sys/qsv/gstqsvjpegenc.cpp +++ b/subprojects/gst-plugins-bad/sys/qsv/gstqsvjpegenc.cpp @@ -33,7 +33,7 @@ #include #endif -GST_DEBUG_CATEGORY_EXTERN (gst_qsv_jpeg_enc_debug); +GST_DEBUG_CATEGORY_STATIC (gst_qsv_jpeg_enc_debug); #define GST_CAT_DEFAULT gst_qsv_jpeg_enc_debug enum @@ -356,6 +356,9 @@ gst_qsv_jpeg_enc_register (GstPlugin * plugin, guint rank, guint impl_index, mfxStatus status; gboolean interlaved = TRUE; + GST_DEBUG_CATEGORY_INIT (gst_qsv_jpeg_enc_debug, + "qsvjpegenc", 0, "qsvjpegenc"); + memset (¶m, 0, sizeof (mfxVideoParam)); memset (&max_resolution, 0, sizeof (Resolution)); diff --git a/subprojects/gst-plugins-bad/sys/qsv/gstqsvvp9enc.cpp b/subprojects/gst-plugins-bad/sys/qsv/gstqsvvp9enc.cpp index a8a96cc72b..511143f07c 100644 --- a/subprojects/gst-plugins-bad/sys/qsv/gstqsvvp9enc.cpp +++ b/subprojects/gst-plugins-bad/sys/qsv/gstqsvvp9enc.cpp @@ -33,7 +33,7 @@ #include #endif -GST_DEBUG_CATEGORY_EXTERN (gst_qsv_vp9_enc_debug); +GST_DEBUG_CATEGORY_STATIC (gst_qsv_vp9_enc_debug); #define GST_CAT_DEFAULT gst_qsv_vp9_enc_debug #define GST_TYPE_QSV_VP9_ENC_RATE_CONTROL (gst_qsv_vp9_enc_rate_control_get_type ()) @@ -800,6 +800,8 @@ gst_qsv_vp9_enc_register (GstPlugin * plugin, guint rank, guint impl_index, mfxExtVP9Param vp9_param; mfxExtBuffer *ext_bufs[1]; + GST_DEBUG_CATEGORY_INIT (gst_qsv_vp9_enc_debug, "qsvvp9enc", 0, "qsvvp9enc"); + memset (¶m, 0, sizeof (mfxVideoParam)); memset (&max_resolution, 0, sizeof (Resolution)); diff --git a/subprojects/gst-plugins-bad/sys/qsv/plugin.cpp b/subprojects/gst-plugins-bad/sys/qsv/plugin.cpp index 4f4ab7e629..068626f8d8 100644 --- a/subprojects/gst-plugins-bad/sys/qsv/plugin.cpp +++ b/subprojects/gst-plugins-bad/sys/qsv/plugin.cpp @@ -43,13 +43,6 @@ GST_DEBUG_CATEGORY (gst_qsv_debug); GST_DEBUG_CATEGORY (gst_qsv_allocator_debug); -GST_DEBUG_CATEGORY (gst_qsv_decoder_debug); -GST_DEBUG_CATEGORY (gst_qsv_encoder_debug); -GST_DEBUG_CATEGORY (gst_qsv_h264_dec_debug); -GST_DEBUG_CATEGORY (gst_qsv_h264_enc_debug); -GST_DEBUG_CATEGORY (gst_qsv_h265_enc_debug); -GST_DEBUG_CATEGORY (gst_qsv_jpeg_enc_debug); -GST_DEBUG_CATEGORY (gst_qsv_vp9_enc_debug); #define GST_CAT_DEFAULT gst_qsv_debug @@ -205,6 +198,8 @@ plugin_init (GstPlugin * plugin) #endif GST_DEBUG_CATEGORY_INIT (gst_qsv_debug, "qsv", 0, "Intel Quick Sync Video"); + GST_DEBUG_CATEGORY_INIT (gst_qsv_allocator_debug, + "qsvallocator", 0, "qsvallocator"); loader = gst_qsv_get_loader (); if (!loader) @@ -218,22 +213,6 @@ plugin_init (GstPlugin * plugin) GST_INFO ("Found %d platform devices", g_list_length (platform_devices)); - GST_DEBUG_CATEGORY_INIT (gst_qsv_allocator_debug, - "qsvallocator", 0, "qsvallocator"); - GST_DEBUG_CATEGORY_INIT (gst_qsv_decoder_debug, - "qsvdecoder", 0, "qsvdecoder"); - GST_DEBUG_CATEGORY_INIT (gst_qsv_encoder_debug, - "qsvencoder", 0, "qsvencoder"); - GST_DEBUG_CATEGORY_INIT (gst_qsv_h264_dec_debug, - "qsvh264dec", 0, "qsvh264dec"); - GST_DEBUG_CATEGORY_INIT (gst_qsv_h264_enc_debug, - "qsvh264enc", 0, "qsvh264enc"); - GST_DEBUG_CATEGORY_INIT (gst_qsv_h265_enc_debug, - "qsvh265enc", 0, "qsvh265enc"); - GST_DEBUG_CATEGORY_INIT (gst_qsv_jpeg_enc_debug, - "qsvjpegenc", 0, "qsvjpegenc"); - GST_DEBUG_CATEGORY_INIT (gst_qsv_vp9_enc_debug, "qsvvp9enc", 0, "qsvvp9enc"); - do { mfxStatus status = MFX_ERR_NONE; mfxSession session = nullptr;