After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 766510 - videosink: test_video_center_rect raise a warning when turning on debug
videosink: test_video_center_rect raise a warning when turning on debug
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
git master
Other Linux
: Normal minor
: 1.8.2
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-05-16 10:52 UTC by Guillaume Desmottes
Modified: 2016-05-20 06:09 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
videosink: init the debug cat in gst_video_sink_center_rect() (1.15 KB, patch)
2016-05-16 10:53 UTC, Guillaume Desmottes
reviewed Details | Review
videosink: ensure the debug cat is initialized (2.23 KB, patch)
2016-05-16 11:23 UTC, Guillaume Desmottes
none Details | Review
videosink: ensure the debug cat is initialized (2.79 KB, patch)
2016-05-17 09:50 UTC, Guillaume Desmottes
committed Details | Review

Description Guillaume Desmottes 2016-05-16 10:52:38 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.
Comment 1 Guillaume Desmottes 2016-05-16 10:53:43 UTC
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 2 Tim-Philipp Müller 2016-05-16 11:04:41 UTC
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.
Comment 3 Guillaume Desmottes 2016-05-16 11:23:21 UTC
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
Comment 4 Sebastian Dröge (slomo) 2016-05-17 06:54:28 UTC
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 :)
Comment 5 Guillaume Desmottes 2016-05-17 09:50:45 UTC
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
Comment 6 Tim-Philipp Müller 2016-05-18 18:46:54 UTC
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