<div dir="ltr">Hi Bernhard,<div>Currently i am using the filesrc element. It reads the buffers it self. Doing some more debugging shows that the filesrc element is in PAUSE state when the fifo is empty. Instead of going for EOS , filesrc element waits. i believe this is the reason filesrc not changing to READY or NULL state. I will check your solution with appsrc element , which i will read from the fio and push to the appsrc element.</div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Mar 6, 2018 at 6:57 PM, Bernhard Graaf <span dir="ltr"><<a href="mailto:bernhard.graaf@gmx.de" target="_blank">bernhard.graaf@gmx.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<u></u>
<div lang="DE" link="blue" vlink="blue">
<div class="m_-6238810299267647367Section1">
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span lang="EN-US" style="font-size:10.0pt;font-family:Arial;color:navy">Quit simple:<u></u><u></u></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span lang="EN-US" style="font-size:10.0pt;font-family:Arial;color:navy"><u></u> <u></u></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span lang="EN-US" style="font-size:10.0pt;font-family:Arial;color:navy">Generate named pipe.<u></u><u></u></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span lang="EN-US" style="font-size:10.0pt;font-family:Arial;color:navy">Example Code from my
program:<u></u><u></u></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span lang="EN-US" style="font-size:10.0pt;font-family:Arial;color:navy">--------------<u></u><u></u></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span lang="EN-US" style="font-size:10.0pt;font-family:Arial;color:navy">umask(0);<u></u><u></u></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span lang="EN-US" style="font-size:10.0pt;font-family:Arial;color:navy">
sprintf(np_name,"/home/bgraaf/<wbr>wrk/bgl/bgl_np.%i", pid);<u></u><u></u></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span lang="EN-US" style="font-size:10.0pt;font-family:Arial;color:navy"> if (mkfifo (np_name,
O_RDWR | 0666) < 0)<u></u><u></u></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span lang="EN-US" style="font-size:10.0pt;font-family:Arial;color:navy"> </span></font><font size="2" color="navy" face="Arial"><span style="font-size:10.0pt;font-family:Arial;color:navy">{<u></u><u></u></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:10.0pt;font-family:Arial;color:navy"> if ( errno == EEXIST)
printf("Versuche vorhandene Named Pipe '%s' zu verwenden\n",
np_name);<u></u><u></u></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:10.0pt;font-family:Arial;color:navy"> else <u></u><u></u></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:10.0pt;font-family:Arial;color:navy"> {<u></u><u></u></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:10.0pt;font-family:Arial;color:navy"> perror("mkfifo()");<u></u><u></u></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:10.0pt;font-family:Arial;color:navy"> syslog(LOG_ERR, "Eigene Named
Pipe nicht erstellt --> Progammabbruch\n");<u></u><u></u></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:10.0pt;font-family:Arial;color:navy"> </span></font><font size="2" color="navy" face="Arial"><span lang="EN-US" style="font-size:10.0pt;font-family:Arial;color:navy">exit(EXIT_FAILURE);<u></u><u></u></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span lang="EN-US" style="font-size:10.0pt;font-family:Arial;color:navy"> }<u></u><u></u></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span lang="EN-US" style="font-size:10.0pt;font-family:Arial;color:navy"> }<u></u><u></u></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span lang="EN-US" style="font-size:10.0pt;font-family:Arial;color:navy"><u></u> <u></u></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span lang="EN-US" style="font-size:10.0pt;font-family:Arial;color:navy"><u></u> <u></u></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span lang="EN-US" style="font-size:10.0pt;font-family:Arial;color:navy"> fd1 = open ( np_name,
O_RDONLY | O_NONBLOCK);<u></u><u></u></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span lang="EN-US" style="font-size:10.0pt;font-family:Arial;color:navy"> if ( fd1 == -1)<u></u><u></u></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span lang="EN-US" style="font-size:10.0pt;font-family:Arial;color:navy"> {<u></u><u></u></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span lang="EN-US" style="font-size:10.0pt;font-family:Arial;color:navy"> sprintf(tmp_str,
"Konnte Named Pipe '%s' nicht öffnen\n", np_name);<u></u><u></u></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span lang="EN-US" style="font-size:10.0pt;font-family:Arial;color:navy"> </span></font><font size="2" color="navy" face="Arial"><span lang="NL" style="font-size:10.0pt;font-family:Arial;color:navy">syslog(LOG_ERR, "%s\n",tmp_str);<u></u><u></u></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span lang="NL" style="font-size:10.0pt;font-family:Arial;color:navy"> </span></font><font size="2" color="navy" face="Arial"><span lang="EN-US" style="font-size:10.0pt;font-family:Arial;color:navy">perror(tmp_str);<u></u><u></u></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span lang="EN-US" style="font-size:10.0pt;font-family:Arial;color:navy"> exit(EXIT_FAILURE);<u></u><u></u></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span lang="EN-US" style="font-size:10.0pt;font-family:Arial;color:navy"> }<u></u><u></u></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span lang="EN-US" style="font-size:10.0pt;font-family:Arial;color:navy"><u></u> <u></u></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span lang="EN-US" style="font-size:10.0pt;font-family:Arial;color:navy">----------------------</span></font><font size="2" color="navy" face="Arial"><span style="font-size:10.0pt;font-family:Arial;color:navy"><u></u><u></u></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span lang="EN-US" style="font-size:10.0pt;font-family:Arial;color:navy"><u></u> <u></u></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span lang="EN-US" style="font-size:10.0pt;font-family:Arial;color:navy">Include a timer f.e.: g_timeout_add
(500, (GSourceFunc)np, NULL);<u></u><u></u></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span lang="EN-US" style="font-size:10.0pt;font-family:Arial;color:navy"><u></u> <u></u></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span lang="EN-US" style="font-size:10.0pt;font-family:Arial;color:navy">And add a function<u></u><u></u></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span lang="EN-US" style="font-size:10.0pt;font-family:Arial;color:navy">Example:<u></u><u></u></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span lang="EN-US" style="font-size:10.0pt;font-family:Arial;color:navy">int np(gpointer data) <u></u><u></u></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span lang="EN-US" style="font-size:10.0pt;font-family:Arial;color:navy">{<u></u><u></u></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span lang="EN-US" style="font-size:10.0pt;font-family:Arial;color:navy"> char tmp_str[25];<u></u><u></u></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span lang="EN-US" style="font-size:10.0pt;font-family:Arial;color:navy"><u></u> <u></u></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span lang="EN-US" style="font-size:10.0pt;font-family:Arial;color:navy"><u></u> <u></u></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span lang="EN-US" style="font-size:10.0pt;font-family:Arial;color:navy"> if (read ( fd1,
tmp_str, 20) != 0)<u></u><u></u></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span lang="EN-US" style="font-size:10.0pt;font-family:Arial;color:navy"> {<u></u><u></u></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span lang="EN-US" style="font-size:10.0pt;font-family:Arial;color:navy"> printf("Stoppe
mp (got '%s')\n",tmp_str);<u></u><u></u></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span lang="EN-US" style="font-size:10.0pt;font-family:Arial;color:navy">
gst_element_send_event (dvb_pipe, gst_event_new_eos()); <u></u><u></u></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span lang="EN-US" style="font-size:10.0pt;font-family:Arial;color:navy"> }<u></u><u></u></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span lang="EN-US" style="font-size:10.0pt;font-family:Arial;color:navy"><u></u> <u></u></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span lang="EN-US" style="font-size:10.0pt;font-family:Arial;color:navy"> return 1;<u></u><u></u></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span lang="EN-US" style="font-size:10.0pt;font-family:Arial;color:navy">}<u></u><u></u></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span lang="EN-US" style="font-size:10.0pt;font-family:Arial;color:navy"><u></u> <u></u></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span lang="EN-US" style="font-size:10.0pt;font-family:Arial;color:navy">From another program you
can write what ever into the named pipe and the pipeline will close.<u></u><u></u></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span lang="EN-US" style="font-size:10.0pt;font-family:Arial;color:navy">Works fine in my app.<u></u><u></u></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span lang="EN-US" style="font-size:10.0pt;font-family:Arial;color:navy"><u></u> <u></u></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span lang="EN-US" style="font-size:10.0pt;font-family:Arial;color:navy">Regards<u></u><u></u></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span lang="EN-US" style="font-size:10.0pt;font-family:Arial;color:navy">Bernhard<u></u><u></u></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span lang="EN-GB" style="font-size:10.0pt;font-family:Arial;color:navy"><u></u> <u></u></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span lang="EN-GB" style="font-size:10.0pt;font-family:Arial;color:navy"><u></u> <u></u></span></font></p>
<div>
<div class="MsoNormal" align="center" style="text-align:center"><font size="3" face="Times New Roman"><span style="font-size:12.0pt">
<hr size="2" width="100%" align="center">
</span></font></div>
<p class="MsoNormal"><b><font size="2" face="Tahoma"><span lang="EN-US" style="font-size:10.0pt;font-family:Tahoma;font-weight:bold">Von:</span></font></b><font size="2" face="Tahoma"><span lang="EN-US" style="font-size:10.0pt;font-family:Tahoma">
gstreamer-devel [mailto:<a href="mailto:gstreamer-devel-bounces@lists.freedesktop.org" target="_blank">gstreamer-devel-<wbr>bounces@lists.freedesktop.org</a>] <b><span style="font-weight:bold">Im Auftrag von </span></b>Anjo John<br>
<b><span style="font-weight:bold">Gesende</span></b></span></font><b><font size="2" face="Tahoma"><span style="font-size:10.0pt;font-family:Tahoma;font-weight:bold">t:</span></font></b><font size="2" face="Tahoma"><span style="font-size:10.0pt;font-family:Tahoma"> Dienstag, 6. März 2018 12:34<span class=""><br>
<b><span style="font-weight:bold">An:</span></b> <u></u>Discussion
of the development of and with GStreamer<u></u><br>
</span><b><span style="font-weight:bold">Betreff:</span></b> Re: element send EOS
event not returning</span></font><u></u><u></u></p>
</div><div><div class="h5">
<p class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size:12.0pt"><u></u> <u></u></span></font></p>
<div>
<p class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size:12.0pt">Hi Bernhard,<u></u><u></u></span></font></p>
<div>
<p class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size:12.0pt">Would you please explain "</span></font><font size="2" color="#222222" face="Arial"><span style="font-size:9.5pt;font-family:Arial;color:#222222;background:white"><span style="font-variant-ligatures:normal;font-variant-caps:normal;text-align:start;text-decoration-style:initial;text-decoration-color:initial;float:none;word-spacing:0px">I handle this with a
named pipe</span></span></font>". 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.<u></u><u></u></p>
</div>
</div>
<div>
<p class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size:12.0pt"><u></u> <u></u></span></font></p>
<div>
<p class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size:12.0pt">On Tue, Mar 6, 2018 at 4:51 PM, bernhard.graaf <<a href="mailto:bernhard.graaf@gmx.de" target="_blank">bernhard.graaf@gmx.de</a>>
wrote:<u></u><u></u></span></font></p>
<div>
<div>
<p class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size:12.0pt">I handle this with a named pipe<u></u><u></u></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size:12.0pt"><u></u> <u></u></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size:12.0pt"><u></u> <u></u></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size:12.0pt"><u></u> <u></u></span></font></p>
</div>
<div id="m_-6238810299267647367m_-5738193980912035446composer_signature">
<div>
<p class="MsoNormal"><font size="2" color="#575757" face="Times New Roman"><span style="font-size:10.0pt;color:#575757">Von meinem Samsung Galaxy Smartphone
gesendet.<u></u><u></u></span></font></p>
</div>
</div>
<div>
<p class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size:12.0pt"><u></u> <u></u></span></font></p>
</div>
<div>
<div>
<p class="MsoNormal"><font size="3" color="black" face="Times New Roman"><span style="font-size:12.0pt;color:black">-------- Ursprüngliche Nachricht --------<u></u><u></u></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="3" color="black" face="Times New Roman"><span style="font-size:12.0pt;color:black">Von: Anjo John <<a href="mailto:anjo.john@vvdntech.in" target="_blank">anjo.john@vvdntech.in</a>>
<u></u><u></u></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="3" color="black" face="Times New Roman"><span style="font-size:12.0pt;color:black">Datum: 06.03.18 08:13 (GMT+01:00) <u></u><u></u></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="3" color="black" face="Times New Roman"><span style="font-size:12.0pt;color:black">An: <u></u>Discussion
of the development of and with GStreamer<u></u> <<a href="mailto:gstreamer-devel@lists.freedesktop.org" target="_blank">gstreamer-devel@lists.freedes<wbr>ktop.org</a>>
<u></u><u></u></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="3" color="black" face="Times New Roman"><span style="font-size:12.0pt;color:black">Betreff: element send EOS event not
returning <u></u><u></u></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="3" color="black" face="Times New Roman"><span style="font-size:12.0pt;color:black"><u></u> <u></u></span></font></p>
</div>
</div>
<div>
<div>
<div>
<p class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size:12.0pt">Hi All,<u></u><u></u></span></font></p>
<div>
<p class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size:12.0pt">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. <u></u><u></u></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size:12.0pt">this is my pipeline<u></u><u></u></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size:12.0pt">gst-launch-1.0 -e filesrc location=/tmp/test ! h264parse ! imxvpudec !
imxg2dvideosink framebuffer=/dev/fb1 <br clear="all">
<u></u><u></u></span></font></p>
<div>
<p class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size:12.0pt"><u></u> <u></u></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size:12.0pt">i have converted this to c application and added a signal handler for
SIGINT. in signal handler i sent the event <u></u><u></u></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size:12.0pt"> gst_element_send_event(pipeli<wbr>ne, gst_event_new_eos());<u></u><u></u></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size:12.0pt">but the call never returns. Also tried to sent the event to filesrc
element. It is also hanging. <u></u><u></u></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size:12.0pt">is there any way to stop the pipeline gracefully, any help is
appreciated<u></u><u></u></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size:12.0pt"><u></u> <u></u></span></font></p>
</div>
<p class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size:12.0pt">-- <u></u><u></u></span></font></p>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><font size="3" face="Times New Roman"><span style="font-size:12.0pt"><br>
*With Best Regards*<br>
<br>
<br>
*Anjo John*<br>
<br>
VVDN Technologies Pvt Ltd<br>
<br>
*Cell : *+91 9539931442 | Skype :anjojohn051<br>
<u></u><u></u></span></font></p>
</div>
</div>
</div>
</div>
</div>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><font size="3" face="Times New Roman"><span style="font-size:12.0pt"><br>
______________________________<wbr>_________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.freedesktop.org" target="_blank">gstreamer-devel@lists.freedesk<wbr>top.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/gstreamer-dev<wbr>el</a><u></u><u></u></span></font></p>
</div>
<p class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size:12.0pt"><br>
<br clear="all">
<u></u><u></u></span></font></p>
<div>
<p class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size:12.0pt"><u></u> <u></u></span></font></p>
</div>
<p class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size:12.0pt">-- <u></u><u></u></span></font></p>
<div data-smartmail="gmail_signature">
<p class="MsoNormal" style="margin-bottom:12.0pt"><font size="3" face="Times New Roman"><span style="font-size:12.0pt"><br>
*With Best Regards*<br>
<br>
<br>
*Anjo John*<br>
<br>
VVDN Technologies Pvt Ltd<br>
<br>
*Cell : *+91 9539931442 | Skype :anjojohn051<br>
<u></u><u></u></span></font></p>
</div>
</div>
</div></div></div>
</div>
<br>______________________________<wbr>_________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.<wbr>freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/gstreamer-<wbr>devel</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><br>*With Best Regards*<br><br><br>*Anjo John*<br><br>VVDN Technologies Pvt Ltd<br><br>*Cell : *+91 9539931442 | Skype :anjojohn051<br> <br><br></div>
</div></div>