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 727945 - funnel: element doesn't forward eos stream
funnel: element doesn't forward eos stream
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
1.2.4
Other Linux
: Normal normal
: 1.3.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-04-10 09:04 UTC by Srimanta Panda (trollkarlen)
Modified: 2014-04-28 06:08 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Handles eos event on sink pad (4.30 KB, patch)
2014-04-11 18:19 UTC, Srimanta Panda (trollkarlen)
needs-work Details | Review
After review comment (4.31 KB, patch)
2014-04-14 07:59 UTC, Srimanta Panda (trollkarlen)
none Details | Review
After review comment fix (4.27 KB, patch)
2014-04-14 09:35 UTC, Srimanta Panda (trollkarlen)
committed Details | Review
Revert the third comment (568 bytes, patch)
2014-04-25 07:38 UTC, Srimanta Panda (trollkarlen)
committed Details | Review

Description Srimanta Panda (trollkarlen) 2014-04-10 09:04:49 UTC
GstFunnel element doesn't forward EOS to downstream, if no data is received before sending eos from multiple source element attached to the funnel.


Reproduce with:

gst-launch-1.0 -v -e fakesrc num-buffers=0 ! funnel name=f ! fakesink fakesrc num-buffers=0 ! f.
Comment 1 Srimanta Panda (trollkarlen) 2014-04-10 12:31:27 UTC
Currently I am working on it.
Comment 2 Srimanta Panda (trollkarlen) 2014-04-11 18:19:19 UTC
Created attachment 274125 [details] [review]
Handles eos event on sink pad

Now it checks if all the sink pad has got eos events then it forwards it to downstream.
Comment 3 Olivier Crête 2014-04-11 18:37:35 UTC
Review of attachment 274125 [details] [review]:

::: plugins/elements/gstfunnel.c
@@ +159,3 @@
+
+  if (element->numsinkpads == 0) {
+    GST_OBJECT_UNLOCK (funnel);

Probably makes sense to put all of the unlocks in one place with a goto.

@@ +168,3 @@
 
+    /* eos event has not enrolled for current pad, we don't check for current pad */
+    if ((pad != NULL) && (pad == sinkpad))

No need to check if the pas is NULL, if it's NULL, pad won't be equal to sinkpad.

@@ +265,2 @@
       forward = FALSE;
+    } else if (funnel->last_sinkpad && (pad != funnel->last_sinkpad)) {

Same thing here, pad will never be NULL, so no need to check that last_sinkpad is not NULL.
Comment 4 Srimanta Panda (trollkarlen) 2014-04-14 07:59:38 UTC
Created attachment 274234 [details] [review]
After review comment

Fixed all the review comments
Comment 5 Srimanta Panda (trollkarlen) 2014-04-14 09:35:10 UTC
Created attachment 274246 [details] [review]
After review comment fix

Fixed all review comment
Comment 6 Olivier Crête 2014-04-17 23:56:40 UTC
Committed a slightly modified version:

commit 094fdfee7ec31019a54beb347457435cf9f62a0c
Author: Srimanta Panda <srimanta@axis.com>
Date:   Fri Apr 11 19:52:02 2014 +0200

    funnel: Handle end of stream event on sink pad
    
    Handle end of stream events on sink pad. Check all the sink pad
    has received eos before forwarding to source pad.
    
    Fixes : https://bugzilla.gnome.org/show_bug.cgi?id=727945
Comment 7 Srimanta Panda 2014-04-23 14:26:52 UTC
In the 3rd comment Oliver mentioned not to check for NULL. But we need to check for NULL as if both the source pads are sending only EOS without data it will not forward the EOS down stream because the the else if will be executed and funnel->last_sink pad is NULL and forward will FALSE.

Please revert the 3rd comments and push it.
Comment 8 Srimanta Panda (trollkarlen) 2014-04-25 07:38:36 UTC
Created attachment 275109 [details] [review]
Revert the third comment

If no data is coming but only EOS is sent from all of the sinkpad, it is not forwarding the EOS. That's why I need to revert the third comment given by Oliver. This secures forwarding the EOS although no dat has received from any of the sink pads.
Comment 9 Olivier Crête 2014-04-28 06:08:30 UTC
commit e3e1b0eac769a4d70a705147dcebc8e941af1460
Author: Srimanta Panda <panda_srimanta@yahoo.co.in>
Date:   Fri Apr 25 07:38:00 2014 +0000

    funnel: Check if the last pad was set
    
    If no data is coming but only EOS is sent from all of the sinkpad, it is not
    forwarding the EOS.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=727945