X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=libs%2Fgst%2Fbase%2Fgstbitreader.h;h=380edd3fe68a25f749adeb49f3ed9edce4fe3cfd;hb=5bf13cdd5314bc3c6c81bd620e712acdcab14eb2;hp=52336129067636edc3f9b36d8ee0487df21eec96;hpb=fb8fbdaeb35269f7095ac5f00d7ec3c10de4e35d;p=platform%2Fupstream%2Fgstreamer.git diff --git a/libs/gst/base/gstbitreader.h b/libs/gst/base/gstbitreader.h index 5233612..380edd3 100644 --- a/libs/gst/base/gstbitreader.h +++ b/libs/gst/base/gstbitreader.h @@ -14,14 +14,15 @@ * * 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 +#include /* FIXME: inline functions */ @@ -31,7 +32,8 @@ G_BEGIN_DECLS /** * 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 @@ -49,29 +51,55 @@ typedef struct { 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); /** @@ -83,8 +111,6 @@ gboolean gst_bit_reader_peek_bits_uint64 (const GstBitReader *reader, gui * 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}