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 637927 - oggdemux: set headers on caps
oggdemux: set headers on caps
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
unspecified
Other All
: Normal normal
: 0.10.32
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2010-12-24 10:33 UTC by Vincent Penquerc'h
Modified: 2010-12-25 15:55 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
oggdemux: set headers on caps (3.06 KB, patch)
2010-12-24 10:34 UTC, Vincent Penquerc'h
needs-work Details | Review
oggdemux: set headers on caps (2.84 KB, patch)
2010-12-24 13:31 UTC, Vincent Penquerc'h
committed Details | Review

Description Vincent Penquerc'h 2010-12-24 10:33:58 UTC
This will allow a decoder to initialize itself 'on the fly' in the middle of
a stream, without having to be sent headers.
This can happen when switching subtitle tracks in Totem, for instance.
Comment 1 Vincent Penquerc'h 2010-12-24 10:34:01 UTC
Created attachment 176995 [details] [review]
oggdemux: set headers on caps

This will allow switching from one stream to another without having to send
the headers for the new stream again.
Comment 2 Sebastian Dröge (slomo) 2010-12-24 13:10:02 UTC
Review of attachment 176995 [details] [review]:

Good patch, just two really minor things :)

::: ext/ogg/gstoggdemux.c
@@ +1741,3 @@
+    GST_BUFFER_FLAG_SET (buffer, GST_BUFFER_FLAG_IN_CAPS);
+    g_value_init (&value, GST_TYPE_BUFFER);
+    gst_value_set_buffer (&value, buffer);

You could use gst_value_take_buffer() here to prevent copying the data twice

@@ +1842,3 @@
 
+    /* Set headers on caps */
+    caps = gst_caps_copy (pad->map.caps);

Just use gst_caps_make_writable() here and change the mapper caps inplace
Comment 3 Sebastian Dröge (slomo) 2010-12-24 13:12:16 UTC
(In reply to comment #2)

> ::: ext/ogg/gstoggdemux.c
> @@ +1741,3 @@
> +    GST_BUFFER_FLAG_SET (buffer, GST_BUFFER_FLAG_IN_CAPS);
> +    g_value_init (&value, GST_TYPE_BUFFER);
> +    gst_value_set_buffer (&value, buffer);
> 
> You could use gst_value_take_buffer() here to prevent copying the data twice

Of course this is wrong (the copying) and really doesn't matter here
Comment 4 Vincent Penquerc'h 2010-12-24 13:31:28 UTC
Created attachment 177015 [details] [review]
oggdemux: set headers on caps

This will allow switching from one stream to another without having to send
the headers for the new stream again.
Comment 5 Sebastian Dröge (slomo) 2010-12-25 15:55:39 UTC
commit dd135119d929ce60c2a2594b51cd3db0e47a6b73
Author: Vincent Penquerc'h <vincent.penquerch@collabora.co.uk>
Date:   Thu Dec 23 17:18:17 2010 +0000

    oggdemux: set headers on caps
    
    This will allow switching from one stream to another without having to send
    the headers for the new stream again.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=637927