AW: element send EOS event not returning

Bernhard Graaf bernhard.graaf at gmx.de
Tue Mar 6 13:27:28 UTC 2018


Quit simple:

 

Generate named pipe.

Example Code from my program:

--------------

umask(0);

  sprintf(np_name,"/home/bgraaf/wrk/bgl/bgl_np.%i", pid);

  if (mkfifo (np_name, O_RDWR | 0666) < 0)

  {

    if ( errno == EEXIST) printf("Versuche vorhandene Named Pipe '%s' zu
verwenden\n", np_name);

    else 

    {

      perror("mkfifo()");

      syslog(LOG_ERR, "Eigene Named Pipe nicht erstellt -->
Progammabbruch\n");

      exit(EXIT_FAILURE);

    }

  }

 

 

  fd1 = open ( np_name, O_RDONLY | O_NONBLOCK);

  if ( fd1 == -1)

  {

    sprintf(tmp_str, "Konnte Named Pipe '%s' nicht öffnen\n", np_name);

    syslog(LOG_ERR, "%s\n",tmp_str);

    perror(tmp_str);

    exit(EXIT_FAILURE);

  }

 

----------------------

 

Include a timer f.e.: g_timeout_add (500, (GSourceFunc)np, NULL);

 

And add a function

Example:

int np(gpointer data) 

{

  char tmp_str[25];

 

 

  if (read ( fd1, tmp_str, 20) != 0)

  {

    printf("Stoppe mp (got '%s')\n",tmp_str);

    gst_element_send_event (dvb_pipe, gst_event_new_eos()); 

  }

 

  return 1;

}

 

>From another program you can write what ever into the named pipe and the
pipeline will close.

Works fine in my app.

 

Regards

Bernhard

 

 

  _____  

Von: gstreamer-devel [mailto:gstreamer-devel-bounces at lists.freedesktop.org]
Im Auftrag von Anjo John
Gesendet: Dienstag, 6. März 2018 12:34
An: Discussion of the development of and with GStreamer
Betreff: Re: element send EOS event not returning

 

Hi Bernhard,

Would you please explain "I handle this with a named pipe". In my
implementation , the /tmp/test is also a fifo. the filesrc element read from
this fifo. But i am not able to send EOS even to pipeline or the filesrc
element (call isn't returned ). I have tried ulinking and deleting this
fifo, also tried with fdsrc instead of filesrc. All result in same
behaviour. Would you tell me if i am doing anything wrong? the pipeline is
stopping correctly when running in foreground. Only cause issues when run
from other programs using system() command or making this as an application.

 

On Tue, Mar 6, 2018 at 4:51 PM, bernhard.graaf <bernhard.graaf at gmx.de>
wrote:

I handle this with a named pipe

 

 

 

Von meinem Samsung Galaxy Smartphone gesendet.

 

-------- Ursprüngliche Nachricht --------

Von: Anjo John <anjo.john at vvdntech.in> 

Datum: 06.03.18 08:13 (GMT+01:00) 

An: Discussion of the development of and with GStreamer
<gstreamer-devel at lists. <mailto:gstreamer-devel at lists.freedesktop.org>
freedesktop.org> 

Betreff: element send EOS event not returning 

 

Hi All,

i have a Gstreamer application to read H264 data from a fifo and
decode+display. Problem i am facing is whenever i run the pipeline using
gst-launch i am able to stop the pipeline with ctrl+c interrupt. But if i
run the same pipeline using system () command from other application and
sending kill -2 to gst-launch , pipeline is not stopping. 

this is my pipeline

gst-launch-1.0 -e filesrc location=/tmp/test ! h264parse ! imxvpudec !
imxg2dvideosink framebuffer=/dev/fb1 


 

i have converted this to c application and added a signal handler for
SIGINT. in signal handler i sent the event 

 gst_element_send_event(pipeline, gst_event_new_eos());

but the call never returns. Also tried to sent the event to filesrc element.
It is also hanging. 

is there any way to stop the pipeline gracefully, any help is appreciated

 

-- 


*With Best Regards*


*Anjo John*

VVDN Technologies Pvt Ltd

*Cell : *+91 9539931442 | Skype :anjojohn051
 


_______________________________________________
gstreamer-devel mailing list
gstreamer-devel at lists. <mailto:gstreamer-devel at lists.freedesktop.org>
freedesktop.org
https://lists.freedesktop.org/
<https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel>
mailman/listinfo/gstreamer-devel





 

-- 


*With Best Regards*


*Anjo John*

VVDN Technologies Pvt Ltd

*Cell : *+91 9539931442 | Skype :anjojohn051
 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20180306/bc874b60/attachment-0001.html>


More information about the gstreamer-devel mailing list