GNOME Bugzilla – Bug 734360
[API] bytereader: add _get_sub_reader() and _peek_sub_reader()
Last modified: 2014-08-15 09:06:32 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.
Maybe it should be _peek_sub_reader() + _get_sub_reader() for consistency?
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()