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 721350 - baseparse: push pending events before GAP
baseparse: push pending events before GAP
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
unspecified
Other All
: Normal normal
: 1.2.3
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-01-02 17:12 UTC by Thiago Sousa Santos
Modified: 2014-01-08 17:18 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
baseparse: refactor pending events pushing (3.82 KB, patch)
2014-01-02 17:12 UTC, Thiago Sousa Santos
committed Details | Review
baseparse: push pending events before GAP event (1.15 KB, patch)
2014-01-02 17:13 UTC, Thiago Sousa Santos
committed Details | Review
baseparse: remove pending_segment as it was being misused (4.68 KB, patch)
2014-01-02 19:51 UTC, Thiago Sousa Santos
committed Details | Review

Description Thiago Sousa Santos 2014-01-02 17:12:56 UTC
Make sure the segment event is pushed before pushing the GAP
as it is needed to do timestamp to running time operations on sinks
Comment 1 Thiago Sousa Santos 2014-01-02 17:12:58 UTC
Created attachment 265164 [details] [review]
baseparse: refactor pending events pushing

Refactor code repeated 3 times to a common function
Comment 2 Thiago Sousa Santos 2014-01-02 17:13:02 UTC
Created attachment 265165 [details] [review]
baseparse: push pending events before GAP event

A GAP event is handled as an empty buffer by sinks and they expect
to receive start up events before GAP events (like a segment).

This is important specially if there is a GAP at the beginning of
a stream (before any buffers) so that the segment event can be
pushed downstream before the GAP
Comment 3 Sebastian Dröge (slomo) 2014-01-02 17:14:57 UTC
Review of attachment 265164 [details] [review]:

::: libs/gst/base/gstbaseparse.c
@@ +2017,3 @@
+    parse->priv->pending_events = NULL;
+    for (l = r; l != NULL; l = l->next) {
+      gst_pad_push_event (parse->srcpad, GST_EVENT (l->data));

Make this GST_EVENT_CAST() :)

@@ +2020,3 @@
+    }
+    g_list_free (r);
+    parse->priv->pending_segment = FALSE;

What is it good for? This variable seems useless or not properly used? :)
Comment 4 Sebastian Dröge (slomo) 2014-01-02 17:15:51 UTC
Review of attachment 265165 [details] [review]:

.
Comment 5 Thiago Sousa Santos 2014-01-02 19:51:08 UTC
Created attachment 265187 [details] [review]
baseparse: remove pending_segment as it was being misused

It wasn't required, instead baseparse was using it to check the media
caps to identify if it was handling audio or video.

The pending_segment was removed and a checked_media boolean
replaced it for a more accurate naming.
Comment 6 Thiago Sousa Santos 2014-01-02 19:57:07 UTC
Did the requested changes and pushed.

commit e02c00a58a7f1577c8dab92d6823a1408d5b5f0a
Author: Thiago Santos <ts.santos@sisa.samsung.com>
Date:   Thu Jan 2 16:22:37 2014 -0300

    baseparse: remove pending_segment as it was being misused
    
    It wasn't required, instead baseparse was using it to check the media
    caps to identify if it was handling audio or video.
    
    The pending_segment was removed and a checked_media boolean
    replaced it for a more accurate naming.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=721350

commit accaadf52ac7cdb9c30383d70a9418bc258fd35d
Author: Thiago Santos <ts.santos@sisa.samsung.com>
Date:   Thu Jan 2 13:43:54 2014 -0300

    baseparse: push pending events before GAP event
    
    A GAP event is handled as an empty buffer by sinks and they expect
    to receive start up events before GAP events (like a segment).
    
    This is important specially if there is a GAP at the beginning of
    a stream (before any buffers) so that the segment event can be
    pushed downstream before the GAP
    
    https://bugzilla.gnome.org/show_bug.cgi?id=721350

commit d917eb7160d0043db970d4d599a32020c69ae63c
Author: Thiago Santos <ts.santos@sisa.samsung.com>
Date:   Thu Jan 2 13:41:25 2014 -0300

    baseparse: refactor pending events pushing

    Refactor code repeated 3 times to a common function
    
    https://bugzilla.gnome.org/show_bug.cgi?id=721350
Comment 7 Sebastian Dröge (slomo) 2014-01-06 10:00:42 UTC
Thiago, should this go into 1.2? Does it happen in practice?
Comment 8 Thiago Sousa Santos 2014-01-06 13:13:03 UTC
(In reply to comment #7)
> Thiago, should this go into 1.2? Does it happen in practice?

It can happen with playbin when the file has a delayed start for some stream, like qtdemux handling edit lists. I guess it should go into 1.2.
Comment 9 Thiago Sousa Santos 2014-01-08 17:18:45 UTC
commit c8196719e7b0cc8dedc67b9e8cb604c14c91c5a3
Author: Thiago Santos <ts.santos@sisa.samsung.com>
Date:   Thu Jan 2 16:22:37 2014 -0300

    baseparse: remove pending_segment as it was being misused
    
    It wasn't required, instead baseparse was using it to check the media
    caps to identify if it was handling audio or video.
    
    The pending_segment was removed and a checked_media boolean
    replaced it for a more accurate naming.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=721350
Pushed to 1.2 branch


commit 5705e1ec33f753a3b748b8c7e88db05552ee0595
Author: Thiago Santos <ts.santos@sisa.samsung.com>
Date:   Thu Jan 2 13:43:54 2014 -0300

    baseparse: push pending events before GAP event
    
    A GAP event is handled as an empty buffer by sinks and they expect
    to receive start up events before GAP events (like a segment).
    
    This is important specially if there is a GAP at the beginning of
    a stream (before any buffers) so that the segment event can be
    pushed downstream before the GAP
    
    https://bugzilla.gnome.org/show_bug.cgi?id=721350

commit 7513fab9e608d76c0bcb9783da9f86ca8dc14c9a
Author: Thiago Santos <ts.santos@sisa.samsung.com>
Date:   Thu Jan 2 13:41:25 2014 -0300

    baseparse: refactor pending events pushing
    
    Refactor code repeated 3 times to a common function
    
    https://bugzilla.gnome.org/show_bug.cgi?id=721350