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 734360 - [API] bytereader: add _get_sub_reader() and _peek_sub_reader()
[API] bytereader: add _get_sub_reader() and _peek_sub_reader()
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other Linux
: Normal enhancement
: 1.5.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-08-06 13:28 UTC by Tim-Philipp Müller
Modified: 2014-08-15 09:06 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
bytereader: add gst_byte_reader_init_sub_reader() and _get_sub_reader() (10.95 KB, patch)
2014-08-06 13:28 UTC, Tim-Philipp Müller
committed Details | Review

Description Tim-Philipp Müller 2014-08-06 13:28:02 UTC
Created attachment 282699 [details] [review]
bytereader: add gst_byte_reader_init_sub_reader() and _get_sub_reader()

It would be nice to have API to init a sub-reader of a certain size from a given byte reader. This is useful when reading chunked formats, one can easily get a byte reader for a sub-chunk and make sure one never reads beyond the sub-chunk boundary.
Comment 1 Tim-Philipp Müller 2014-08-06 13:40:00 UTC
Maybe it should be _peek_sub_reader() + _get_sub_reader() for consistency?
Comment 2 Tim-Philipp Müller 2014-08-15 09:06:21 UTC
Went for peek + get instead:

commit 86d7a597f00b7e1a6619cf566bfb27adb7f3f8c2
Author: Tim-Philipp Müller <tim@centricular.com>
Date:   Wed Aug 6 14:01:09 2014 +0100

    bytereader: add gst_byte_reader_peek_sub_reader() and _get_sub_reader()
    
    Adds API to get or peek a sub-reader of a certain size from
    a given byte reader. This is useful when parsing nested chunks,
    one can easily get a byte reader for a sub-chunk and make
    sure one never reads beyond the sub-chunk boundary.
    
    API: gst_byte_reader_peek_sub_reader()
    API: gst_byte_reader_get_sub_reader()