running GStreamer as a background process/daemon

Sergei Vorobyov sergei.vorobyov at facilitylabs.com
Tue Jun 24 15:45:05 PDT 2014


> So you are saying that the explicit
> gst_video_overlay_set_window_handle() always works? And what exactly
> does not always work then? Letting the video sink create the window
i> tself? And what is the error message you get on the bus when it fails?

without export DISPLAY=:0.0

the window instantaneously appears and disappears, for a fraction of a
second, and gst_element_set_state (pipeline, GST_STATE_PLAYING)
 returns GST_STATE_CHANGE_FAILURE

I will try to catch all errors I can (my code already checks all return
codes and compiles with all warnings). However it sometimes freezes to the
point my Ubuntu Linux 14.04 system breaks (although I run my GStreamer MP
only in the user mode).

By the way, I am using the stock Ubuntu apt-get install gstreamer1*. Maybe
it's better to use the latest stable or development version from a
repository?

Thanks!




On Wed, Jun 25, 2014 at 12:31 AM, Sergei Vorobyov <
sergei.vorobyov at facilitylabs.com> wrote:

> I resolved the problem by simply adding the explicit export DISPLAY=:0.0
> to the script:
>
> #!/bin/bash
>
> case $1 in
>      start)
> echo $$ > /var/run-usr/mp.pid;
>  export DISPLAY=:0.0
>       exec 2>&1 /path/to/my/mp 1>/dev/null ;;
>
> although the apparently equivalent (to export DISPLAY=:0.0)
>
> Display *display = XOpenDisplay (":0");
>
> nor
>
> Display *display = XOpenDisplay (":0.0");
>
> in the mp code don't help. This was the problem!
>
>
>
> On Tue, Jun 24, 2014 at 3:41 PM, Sergei Vorobyov <
> sergei.vorobyov at facilitylabs.com> wrote:
>
>> To make my GStreamer app unsinkable (sad to say the GStreamer sometimes
>> freezes after a few days of intensive repetitive usage with dynamic pipes,
>> caps, etc) I decided to start, monitor, and relaunch when needed my media
>> player as a background process. Trouble is:
>>
>> the background process fails in the very beginning at
>>
>> if (gst_element_set_state (pipeline, GST_STATE_PLAYING) ==
>>                                          GST_STATE_CHANGE_FAILURE) {
>>             LOG_ERROR("failed to set pipeline to PLAYING");
>>             EXIT(-1);
>> }
>>
>> whereas it always works OK in the foreground mode.
>>
>> Note that my
>>
>> Display *display = XOpenDisplay (":0");
>>
>> Window window = XCreateWindow(display, ...
>>
>> gst_video_overlay_set_window_handle(GST_VIDEO_OVERLAY(sink), window);
>>
>> (where sink is ximagesink; I am trying to overlay my ximagesink over an
>> X-window)
>>
>> all work OK in the fore- and background modes.
>>
>> Of course, I cannot test the void result
>> of gst_video_overlay_set_window_handle.
>>
>> Any ideas? Thanks!
>>
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20140625/39eba10c/attachment.html>


More information about the gstreamer-devel mailing list