GNOME Bugzilla – Bug 350296
[udpsrc] add property to remove extra headers from buffers
Last modified: 2007-03-02 12:56:28 UTC
This patch gives the possibility to remove the extra header from the UDP packet. Why? Because some encoders add extra headers that contains no neccesary data to decode the media. If you don't use the property nothing happens. This feat. request is simmilar to following bug for RTP. http://bugzilla.gnome.org/show_bug.cgi?id=350278
Created attachment 70398 [details] [review] Udp skip header patch This patch makes it possible to skip a header.
Thanks for the patch! Some comments: (Note: I don't know much about how things are supposed to work on the RTP side of things in GStreamer, I'm just commenting on the code) - "skip-header" sounds a bit generic, and it would be good IMHO if it was possible to know from the property name and the property description what this property actually does, without reading the code. I don't think that's quite the case yet ("skip a header, 0 = default" - so there isn't even an indication that this is in bytes or a size or length or anything). - please don't use temp->size directly, use GST_BUFFER_SIZE (temp) - you should check for udpsrc->skip_header >= buffer_size before trying to make a subbuffer (not really sure what to do in that case though, maybe just drop the buffer with a GST_WARNING or so?) - you should special-case the normal case of udpsrc->skip_header == 0 where creating a sub buffer can be avoided altogether Someone else will need to comment on whether this is useful to have in the first place though.
Created attachment 70467 [details] [review] a better patch to this problem Thanks, to look at it. In this patch I fixed all you suggested. Now the property is called skip-first-bytes. This makes it more clear to users what it does. The need for this patch? Many profesional (MPEG2/4) encoders uses this extra headers. (Mavix, Pelconet,...)
Patch by: Thijs Vermeir <thijsvermeir at gmail dot com> * gst/udp/gstudpsrc.c: (gst_udpsrc_class_init), (gst_udpsrc_init), (gst_udpsrc_create), (gst_udpsrc_set_property), (gst_udpsrc_get_property): * gst/udp/gstudpsrc.h: Add support to strip proprietary headers. Fixes #350296.