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 735404 - Feature Submission: Added XSync support to xvimagesink
Feature Submission: Added XSync support to xvimagesink
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
git master
Other Linux
: Normal enhancement
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-08-25 19:08 UTC by Stirling Westrup
Modified: 2018-11-03 11:31 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch to implement xsync support in xvimagesink (20.31 KB, patch)
2014-08-25 19:08 UTC, Stirling Westrup
none Details | Review

Description Stirling Westrup 2014-08-25 19:08:58 UTC
Created attachment 284445 [details] [review]
Patch to implement xsync support in xvimagesink

There is an X Server extension called XSync which allows for synchronizing X operations against an external clock. Under Linux the default 'SERVERTIME' clock is a monotonic clock shared by all servers on a linux box, allowing for synchronization between independent X Servers running on a single machine.

To make use of this feature, I've added 'xsync' and 'xsync-clock' properties to xvimagesink. If xsync is true, then whenever xvimagesink would normally synchronize frames, it will attempt to do so using the XSync clock named in 'xsync-clock'

I've added this features in order to help support videowall software that needs multiple X Servers to show frames at the same moment.

This is my first attempt at modifying the internals of a complex sink like xvimagesink, and I may have made some mistakes, but the code currently appears to operate as expected.
Comment 1 Sebastian Dröge (slomo) 2014-08-28 07:28:47 UTC
It would probably be cleaner to implement a GstClock around the XSync X extension and set such a clock on the pipeline to do the synchronization.
Comment 2 Stirling Westrup 2014-08-28 14:43:32 UTC
I had considered that, but the XSync clock has only millisecond resolution, while GStreamer clocks generally have nanosecond resolution. I wasn't sure that wouldn't be an issue.

Besides, every time I tried setting a clock on the pipeline, it was ignored, so I went this route.
Comment 3 Sebastian Dröge (slomo) 2014-08-28 14:44:33 UTC
milliseconds are ok, not great but acceptable :)

You have to use gst_pipeline_use_clock() not gst_element_set_clock(), in case that was the mistake.
Comment 4 Stirling Westrup 2014-08-28 14:57:03 UTC
Here's how I was attempting to set the clock in one of my experiments:
Despite this, an audio clock was chosen as the clock.

static GstElement * vaal_pipeline_new()
  { GstElement     * pipeline = gst_element_factory_create
      (pipefactory,"pipeline");

    gst_pipeline_use_clock(GST_PIPELINE(pipeline), gst_system_clock_obtain());

    return pipeline;
  }
Comment 5 Stirling Westrup 2014-08-28 14:58:53 UTC
So, if I went back and created a new XSync clock, would folks prefer it be a patch on the current gstclock file, or a new file, and if new, where should it be in the code tree?
Comment 6 Sebastian Dröge (slomo) 2014-08-29 08:32:02 UTC
It should be in a separate file, just not sure where it should be located as it needs to link to libX11. A separate library seems overkill but I don't see another solution right now
Comment 7 Tim-Philipp Müller 2014-08-29 09:53:01 UTC
Make it a property in xvimagesink/ximagesink to use that clock? Then it can be got from the pipeline/element?
Comment 8 Tim-Philipp Müller 2014-08-29 09:53:45 UTC
Not use, propose I suppose. Or we add a clock plugin feature subclass ;)
Comment 9 Jan Schmidt 2014-08-29 10:34:21 UTC
I've always wondered about a mode where we take rate from the audio clock, but take phase from the video clock into a synthesised master clock. I think that's like Xine's metronome.
Comment 10 GStreamer system administrator 2018-11-03 11:31:05 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/issues/130.