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 731716 - funnel: fix eos handling and unit test case
funnel: fix eos handling and unit test case
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
1.2.4
Other Linux
: Normal normal
: 1.3.3
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-06-16 11:42 UTC by Srimanta Panda (trollkarlen)
Modified: 2014-06-19 14:48 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix for funnel unittestcase (2.52 KB, patch)
2014-06-16 13:07 UTC, Srimanta Panda (trollkarlen)
none Details | Review
Patch for fix funnel EOS handling and wrong unittest (2.48 KB, patch)
2014-06-19 13:25 UTC, Srimanta Panda (trollkarlen)
committed Details | Review

Description Srimanta Panda (trollkarlen) 2014-06-16 11:42:03 UTC
Refine eos handling in funnel. Also funnel unit test cases are incorrect related to EOS handling.
Comment 1 Srimanta Panda (trollkarlen) 2014-06-16 11:43:09 UTC
I am working on it and soon provide a patch related to it.
Comment 2 Srimanta Panda (trollkarlen) 2014-06-16 13:07:00 UTC
Created attachment 278537 [details] [review]
Fix for funnel unittestcase
Comment 3 Tim-Philipp Müller 2014-06-18 23:05:53 UTC
It would be nice if your commit message actually explained what you fixed/what changed, or how the current behaviour wasn't right (easier for reviewers to match that to what the patch does). It seems to me one might want different modes for funnel: one where it forwards the first EOS, and one where it only forwards EOS once it's see EOS on all input pads. Either seems equally plausible IMHO, unless you envision the element is only used on once specific use case.
Comment 4 Srimanta Panda (trollkarlen) 2014-06-19 07:59:57 UTC
The funnel implementation as such was implemented to forward EOS when all the sinkpad receives EOS on all input pad. 
And also in the unit test if you see the comment, it was clearly mentioned it should fail (but the condition check was done not to fail).

The related issue I worked on was https://bugzilla.gnome.org/show_bug.cgi?id=727945

After that I found the testcase is wrong and modified it.
Also change in funnel code is related to eos. Suppose one of the funnel is forwarding eos and no data has come to either of the sink pad, then also it was forwarding the EOS.
because the previous code was like

    if ((GST_EVENT_TYPE (event) == GST_EVENT_EOS) &&
        (!gst_funnel_all_sinkpads_eos_unlocked (funnel, pad))) {
      forward = FALSE;
    } else if (funnel->last_sinkpad && (pad != funnel->last_sinkpad)) {
    
      ....
    }
    
So it was faling first condition and also second because (funnel->last_sinkpad == NULL). And it was forwarding the EOS.

Please let me know if you need any further clarification on it.


(In reply to comment #3)
> It would be nice if your commit message actually explained what you fixed/what
> changed, or how the current behaviour wasn't right (easier for reviewers to
> match that to what the patch does). It seems to me one might want different
> modes for funnel: one where it forwards the first EOS, and one where it only
> forwards EOS once it's see EOS on all input pads. Either seems equally
> plausible IMHO, unless you envision the element is only used on once specific
> use case.
Comment 5 Srimanta Panda (trollkarlen) 2014-06-19 13:23:48 UTC
Comment on attachment 278537 [details] [review]
Fix for funnel unittestcase

Need to refine the git comment.
Comment 6 Srimanta Panda (trollkarlen) 2014-06-19 13:25:07 UTC
Created attachment 278766 [details] [review]
Patch for fix funnel EOS handling and wrong unittest

When no data is coming from sinkpads and eos events
arrived at one of the sinkpad, funnel forwards the EOS
event to downstream. It forwards the EOS because lastsink pad
is NULL. Also the unit testcase of the funnel is not checking
the correct behavior as it should. The unit test case should
fail if one of the sink pad has already EOS present on it and
we are trying to push one more EOS.
Comment 7 Olivier Crête 2014-06-19 14:48:48 UTC
Pushed

commit 5b3ee70ea953227439820a38f2fc87842c3a5025
Author: Srimanta Panda <srimanta.panda@axis.com>
Date:   Mon Jun 16 13:47:55 2014 +0200

    Fix funnel EOS handling and wrong unittest
    
    When no data is coming from sinkpads and eos events
    arrived at one of the sinkpad, funnel forwards the EOS
    event to downstream. It forwards the EOS because lastsink pad
    is NULL. Also the unit testcase of the funnel is not checking
    the correct behavior as it should. The unit test case should
    fail if one of the sink pad has already EOS present on it and
    we are trying to push one more EOS.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=731716