[Bug 683842] New: Fix race condition in videomixer2 on 0.10

GStreamer (bugzilla.gnome.org) bugzilla at gnome.org
Tue Sep 11 18:14:16 PDT 2012


https://bugzilla.gnome.org/show_bug.cgi?id=683842
  GStreamer | gst-plugins-good | 0.10.x

           Summary: Fix race condition in videomixer2 on 0.10
    Classification: Platform
           Product: GStreamer
           Version: 0.10.x
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: Normal
         Component: gst-plugins-good
        AssignedTo: gstreamer-bugs at lists.freedesktop.org
        ReportedBy: youness.alaoui at collabora.co.uk
         QAContact: gstreamer-bugs at lists.freedesktop.org
     GNOME version: ---


While doing some tests, I noticed that videomixer2 would sometimes give a wrong
window size. In my use case I had two windows of 100x100, and I would use
videomixer2 to mix them into a 200x100 image (by setting the xpos to 100 on one
of videomixer's pads).

When streaming starts, gst_videomixer2_pad_sink_setcaps gets called for each of
the pads, and gst_videomixer2_update_src_caps gets called that finds/defines
the best output resolution. The first time, it will decide on 100x100 (the
resolution of the first video), then it will get called again for the second
pad and decide on 200x100 (the resolution of the second video + its xpos). In
both cases it calls gst_pad_set_caps, and a race condition could cause the
second set_caps to be called while the first set_caps is in progress, and
gst_pad_set_caps will simply output a "pad was dispatching" debug message but
will not call the setcaps function, which is the one storing the width/height
to the private struct. In the end, the 200x100 resolution might never be seen
by the setcaps function and we end up with a 100x100 image and the second data
source not being mixed.

I have not found a good way to fix this race condition, but I've made a patch
that at least works around the problem... :

http://cgit.collabora.com/git/user/kakaroto/gst-plugins-good.git/commit/?h=videomixer&id=1a5a48888509ae0c4a11db4d65d85e411ed92a3a
If anyone knows of a better fix for this issue, let me know, otherwise please
review/merge my patch.

Thanks.

-- 
Configure bugmail: https://bugzilla.gnome.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list