element send EOS event not returning

Anjo John anjo.john at vvdntech.in
Wed Mar 7 12:41:18 UTC 2018


Hi Bernhard,
Issue got fixed. i used fdsrc instead of filesrc. the fd pointer for fdsrc
was opened in NON-BLOCKING mode.
    mkfifo("/tmp/test", 0666);
    fp = open("/tmp/test", O_RDONLY | O_NONBLOCK);
    if (fp == NULL) {
        fprintf(stderr, "/tmp/test fifo create error\n");
    }
    g_object_set(Data.source, "fd", fp, NULL);
Thank you for the suggestion.

On Wed, Mar 7, 2018 at 8:49 AM, Anjo John <anjo.john at vvdntech.in> wrote:

> Hi Bernhard,
> 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.
>
> On Tue, Mar 6, 2018 at 6:57 PM, Bernhard Graaf <bernhard.graaf at gmx.de>
> wrote:
>
>> 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-bounce
>> s at lists.freedesktop.org] *Im Auftrag von *Anjo John
>> *Gesende**t:* 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.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.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>>
>>
>>
>>
>>
>> --
>>
>>
>> *With Best Regards*
>>
>>
>> *Anjo John*
>>
>> VVDN Technologies Pvt Ltd
>>
>> *Cell : *+91 9539931442 | Skype :anjojohn051
>>
>>
>> _______________________________________________
>> gstreamer-devel mailing list
>> gstreamer-devel at lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>>
>>
>
>
> --
>
> *With Best Regards*
>
>
> *Anjo John*
>
> VVDN Technologies Pvt Ltd
>
> *Cell : *+91 9539931442 | Skype :anjojohn051
>
>
>


-- 

*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/20180307/bddc639a/attachment-0001.html>


More information about the gstreamer-devel mailing list