Debugging/Logging

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Debugging/Logging

Zmad
Hi,

I have an element (bin) that has defined its own GstDebugCategory. What I did was to break out some of the element-functions to another utility-file. This was done to facilitate stubbing when running check-tests.

A drawback of this is that Gstreamer logging functions e.g. GST_DEBUG (), GST_INFO (), GST_ELEMENT_ERROR(),... does not seem to work in the utility-file.

Is there a way around this, so that the utility-file can use the debug category of the element?

--
Regards

/Mats

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Debugging/Logging

Jan Alexander Steffens
On Mon, Jun 26, 2017 at 8:59 AM Mats Lindestam <[hidden email]> wrote:
I have an element (bin) that has defined its own GstDebugCategory. What I did was to break out some of the element-functions to another utility-file. This was done to facilitate stubbing when running check-tests.

A drawback of this is that Gstreamer logging functions e.g. GST_DEBUG (), GST_INFO (), GST_ELEMENT_ERROR(),... does not seem to work in the utility-file.

Is there a way around this, so that the utility-file can use the debug category of the element?

If you want to share a debug category across more than one compilation unit, instead of using GST_DEBUG_CATEGORY_STATIC, define the category using GST_DEBUG_CATEGORY in one compilation unit and reference it using GST_DEBUG_CATEGORY_EXTERN in the other units (e.g. via the element's header file).

You still need to define GST_CAT_DEFAULT in all compilation units.

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Debugging/Logging

Zmad
Ok, I see.
Thank you for your answer.

/Mats



2017-06-26 9:08 GMT+02:00 Jan Alexander Steffens <[hidden email]>:
On Mon, Jun 26, 2017 at 8:59 AM Mats Lindestam <[hidden email]> wrote:
I have an element (bin) that has defined its own GstDebugCategory. What I did was to break out some of the element-functions to another utility-file. This was done to facilitate stubbing when running check-tests.

A drawback of this is that Gstreamer logging functions e.g. GST_DEBUG (), GST_INFO (), GST_ELEMENT_ERROR(),... does not seem to work in the utility-file.

Is there a way around this, so that the utility-file can use the debug category of the element?

If you want to share a debug category across more than one compilation unit, instead of using GST_DEBUG_CATEGORY_STATIC, define the category using GST_DEBUG_CATEGORY in one compilation unit and reference it using GST_DEBUG_CATEGORY_EXTERN in the other units (e.g. via the element's header file).

You still need to define GST_CAT_DEFAULT in all compilation units.

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel




--
Mvh

/Mats

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel