GNOME Bugzilla – Bug 766510
videosink: test_video_center_rect raise a warning when turning on debug
Last modified: 2016-05-20 06:09:37 UTC
GST_DEBUG=5 G_DEBUG=fatal-warnings make check TESTS=libs/video 0:00:00.023606512 27778 0x16d1600 DEBUG check libs/video.c:2416:test_video_center_rect: test start (lt-video:27778): GStreamer-CRITICAL **: gst_debug_log_valist: assertion 'category != NULL' failed That's because the the unit test calls gst_video_sink_center_rect() without instantiating a GstVideoSink first so the debug category has not been init. Strictly speaking this is correct I think so the debug category should be initialized if needed when this function is called.
Created attachment 327966 [details] [review] videosink: init the debug cat in gst_video_sink_center_rect() Fix a warning when running: GST_DEBUG=5 G_DEBUG=fatal-warnings make check TESTS=libs/video
Comment on attachment 327966 [details] [review] videosink: init the debug cat in gst_video_sink_center_rect() Thanks for the patch. I think this might not be thread-safe, so I wonder if we should just call the _get_type() function and do a class_ref() instead, or something like in gst-libs/gst/tag/tags.c (gst_tag_ensure_debug_category) with GOnce.
Created attachment 327967 [details] [review] videosink: ensure the debug cat is initialized Fix a warning when running: GST_DEBUG=5 G_DEBUG=fatal-warnings make check TESTS=libs/video
Review of attachment 327967 [details] [review]: Looks good, but: ::: gst-libs/gst/video/gstvideosink.c @@ +283,3 @@ static const GTypeInfo videosink_info = { sizeof (GstVideoSinkClass), + NULL, You can use G_DEFINE_TYPE() now :)
Created attachment 328052 [details] [review] videosink: ensure the debug cat is initialized Fix a warning when running: GST_DEBUG=5 G_DEBUG=fatal-warnings make check TESTS=libs/video
Thanks, merged: commit 8fc42f12f04f8c487eda91adb87e04f200774d86 Author: Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> Date: Mon May 16 12:52:50 2016 +0200 videosink: ensure the debug category is always initialized gst_video_sink_center_rect() can be called without a GstVideoSink having been instantiated so we can't relly on the video sink class_init function to init the category. Fix a warning when running: GST_CHECKS=test_video_center_rect GST_DEBUG=6 G_DEBUG=fatal_warnings make libs/video.check-norepeat https://bugzilla.gnome.org/show_bug.cgi?id=766510