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 607771 - [API] Add gst_byte_writer_fill
[API] Add gst_byte_writer_fill
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other All
: Normal enhancement
: 0.10.27
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2010-01-22 14:47 UTC by Thiago Sousa Santos
Modified: 2010-02-12 20:32 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
adds the function and docs (3.02 KB, patch)
2010-01-22 14:49 UTC, Thiago Sousa Santos
none Details | Review
adds test (1.37 KB, patch)
2010-01-22 14:50 UTC, Thiago Sousa Santos
none Details | Review
updates .refs (773 bytes, patch)
2010-01-22 14:50 UTC, Thiago Sousa Santos
none Details | Review

Description Thiago Sousa Santos 2010-01-22 14:47:50 UTC
Adds a function to be able to do memsets in GstByteWriter.

"gst_byte_writer_put_padding (GstByteWriter, guint8 value, guint size)" writes @size bytes with @value.

Useful (as the name already says) for adding padding to buffers.

Patches following.
Comment 1 Thiago Sousa Santos 2010-01-22 14:49:45 UTC
Created attachment 152012 [details] [review]
adds the function and docs
Comment 2 Thiago Sousa Santos 2010-01-22 14:50:07 UTC
Created attachment 152013 [details] [review]
adds test
Comment 3 Thiago Sousa Santos 2010-01-22 14:50:24 UTC
Created attachment 152014 [details] [review]
updates .refs
Comment 4 Sebastian Dröge (slomo) 2010-01-22 14:54:52 UTC
Looks good to me but maybe the function's name could be changed because it's not exactly padding what this function does but writing n-times a specific byte... liboil for example calls this oil_splat_u8_ns().
Comment 5 Thiago Sousa Santos 2010-01-22 14:57:57 UTC
I agree that the name is mostly one of the use cases that it might contemplate.

But I couldn't find a better one.
Comment 6 Tim-Philipp Müller 2010-01-22 15:05:22 UTC
Thoughts and minor nitpicks:

 - the 'update .defs' commit should be merged with
   the initial commit that adds the API IMHO

 - commit message: the 'API' marker should be in the
   message body not the first line (that's how we mostly
   do it, with one or two exceptions), e.g.:

      bytewriter: add _put_padding function

      Adds a new function to GstByteWriter....

      API: gst_byte_writer_put_padding()

 - I think it should either be called _put_padding() with
   the value argument removed (does anyone ever want
   to add non-0 padding bytes?), or one should rename
   it to something else (don't ask me what though,
   something with 'fill' maybe or 'memset' or 'set'?)
Comment 7 Thiago Sousa Santos 2010-01-22 15:22:55 UTC
gst_byte_writer_fill looks good to me :)
Comment 8 Tim-Philipp Müller 2010-01-25 13:35:47 UTC
> gst_byte_writer_fill looks good to me :)

Worksforme
Comment 9 Thiago Sousa Santos 2010-02-12 20:32:01 UTC
Forgot to add the bug number, but here they are.

Module: gstreamer
Branch: master
Commit: bfff7a1b4ece0c0b5ca30dd93392707fc097f7a9
URL:    http://cgit.freedesktop.org/gstreamer/gstreamer/commit/?id=bfff7a1b4ece0c0b5ca30dd93392707fc097f7a9

Author: Thiago Santos <thiago.sousa.santos@collabora.co.uk>
Date:   Fri Jan 22 09:19:31 2010 -0300

bytewriter: add _fill function

Adds a new function to GstByteWriter that writes
a constant value to a memory area (aka memset).
Useful for adding padding to buffers.

Also updates .def file and docs.

API: gst_byte_writer_fill()


Module: gstreamer
Branch: master
Commit: aad80a10530fdd0ee8a943c1ea34bbf821db5bb5
URL:    http://cgit.freedesktop.org/gstreamer/gstreamer/commit/?id=aad80a10530fdd0ee8a943c1ea34bbf821db5bb5

Author: Thiago Santos <thiago.sousa.santos@collabora.co.uk>
Date:   Fri Jan 22 11:38:59 2010 -0300

bytewriter: Adds a test for _fill