*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
*/
#ifndef __GST_BIT_READER_H__
#define __GST_BIT_READER_H__
#include <gst/gst.h>
+#include <gst/base/base-prelude.h>
/* FIXME: inline functions */
/**
* GstBitReader:
- * @data: Data from which the bit reader will read
+ * @data: (array length=size): Data from which the bit reader will
+ * read
* @size: Size of @data in bytes
* @byte: Current byte position
* @bit: Bit position in the current byte
gpointer _gst_reserved[GST_PADDING];
} GstBitReader;
+GST_BASE_API
GstBitReader * gst_bit_reader_new (const guint8 *data, guint size) G_GNUC_MALLOC;
+
+GST_BASE_API
void gst_bit_reader_free (GstBitReader *reader);
+GST_BASE_API
void gst_bit_reader_init (GstBitReader *reader, const guint8 *data, guint size);
+GST_BASE_API
gboolean gst_bit_reader_set_pos (GstBitReader *reader, guint pos);
+
+GST_BASE_API
guint gst_bit_reader_get_pos (const GstBitReader *reader);
+GST_BASE_API
guint gst_bit_reader_get_remaining (const GstBitReader *reader);
+GST_BASE_API
guint gst_bit_reader_get_size (const GstBitReader *reader);
+GST_BASE_API
gboolean gst_bit_reader_skip (GstBitReader *reader, guint nbits);
+
+GST_BASE_API
gboolean gst_bit_reader_skip_to_byte (GstBitReader *reader);
+GST_BASE_API
gboolean gst_bit_reader_get_bits_uint8 (GstBitReader *reader, guint8 *val, guint nbits);
+
+GST_BASE_API
gboolean gst_bit_reader_get_bits_uint16 (GstBitReader *reader, guint16 *val, guint nbits);
+
+GST_BASE_API
gboolean gst_bit_reader_get_bits_uint32 (GstBitReader *reader, guint32 *val, guint nbits);
+
+GST_BASE_API
gboolean gst_bit_reader_get_bits_uint64 (GstBitReader *reader, guint64 *val, guint nbits);
+GST_BASE_API
gboolean gst_bit_reader_peek_bits_uint8 (const GstBitReader *reader, guint8 *val, guint nbits);
+
+GST_BASE_API
gboolean gst_bit_reader_peek_bits_uint16 (const GstBitReader *reader, guint16 *val, guint nbits);
+
+GST_BASE_API
gboolean gst_bit_reader_peek_bits_uint32 (const GstBitReader *reader, guint32 *val, guint nbits);
+
+GST_BASE_API
gboolean gst_bit_reader_peek_bits_uint64 (const GstBitReader *reader, guint64 *val, guint nbits);
/**
* used. This macro can used be to initialize a variable, but it cannot
* be assigned to a variable. In that case you have to use
* gst_bit_reader_init().
- *
- * Since: 0.10.22
*/
#define GST_BIT_READER_INIT(data, size) {data, size, 0, 0}