mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-11 09:55:36 +00:00
bytereader: const-ify byte reader argument in peek/scan API
Because we can.
This commit is contained in:
parent
726e4479b7
commit
07755fd5ee
2 changed files with 39 additions and 38 deletions
|
@ -707,7 +707,7 @@ gst_byte_reader_get_##name (GstByteReader * reader, type * val) \
|
|||
} \
|
||||
\
|
||||
gboolean \
|
||||
gst_byte_reader_peek_##name (GstByteReader * reader, type * val) \
|
||||
gst_byte_reader_peek_##name (const GstByteReader * reader, type * val) \
|
||||
{ \
|
||||
return _gst_byte_reader_peek_##name##_inline (reader, val); \
|
||||
}
|
||||
|
@ -886,7 +886,7 @@ gst_byte_reader_get_data (GstByteReader * reader, guint size,
|
|||
* Since: 0.10.22
|
||||
*/
|
||||
gboolean
|
||||
gst_byte_reader_peek_data (GstByteReader * reader, guint size,
|
||||
gst_byte_reader_peek_data (const GstByteReader * reader, guint size,
|
||||
const guint8 ** val)
|
||||
{
|
||||
return _gst_byte_reader_peek_data_inline (reader, size, val);
|
||||
|
@ -957,7 +957,7 @@ gst_byte_reader_dup_data (GstByteReader * reader, guint size, guint8 ** val)
|
|||
* Since: 0.10.24
|
||||
*/
|
||||
guint
|
||||
gst_byte_reader_masked_scan_uint32 (GstByteReader * reader, guint32 mask,
|
||||
gst_byte_reader_masked_scan_uint32 (const GstByteReader * reader, guint32 mask,
|
||||
guint32 pattern, guint offset, guint size)
|
||||
{
|
||||
const guint8 *data;
|
||||
|
@ -995,7 +995,7 @@ gst_byte_reader_masked_scan_uint32 (GstByteReader * reader, guint32 mask,
|
|||
|
||||
#define GST_BYTE_READER_SCAN_STRING(bits) \
|
||||
static guint \
|
||||
gst_byte_reader_scan_string_utf##bits (GstByteReader * reader) \
|
||||
gst_byte_reader_scan_string_utf##bits (const GstByteReader * reader) \
|
||||
{ \
|
||||
guint len, off, max_len; \
|
||||
\
|
||||
|
@ -1141,7 +1141,8 @@ GST_BYTE_READER_SKIP_STRING (32);
|
|||
* Since: 0.10.24
|
||||
*/
|
||||
gboolean
|
||||
gst_byte_reader_peek_string_utf8 (GstByteReader * reader, const gchar ** str)
|
||||
gst_byte_reader_peek_string_utf8 (const GstByteReader * reader,
|
||||
const gchar ** str)
|
||||
{
|
||||
g_return_val_if_fail (reader != NULL, FALSE);
|
||||
g_return_val_if_fail (str != NULL, FALSE);
|
||||
|
|
|
@ -78,38 +78,38 @@ gboolean gst_byte_reader_get_int64_le (GstByteReader *reader, gint64 *val);
|
|||
gboolean gst_byte_reader_get_uint64_be (GstByteReader *reader, guint64 *val);
|
||||
gboolean gst_byte_reader_get_int64_be (GstByteReader *reader, gint64 *val);
|
||||
|
||||
gboolean gst_byte_reader_peek_uint8 (GstByteReader *reader, guint8 *val);
|
||||
gboolean gst_byte_reader_peek_int8 (GstByteReader *reader, gint8 *val);
|
||||
gboolean gst_byte_reader_peek_uint16_le (GstByteReader *reader, guint16 *val);
|
||||
gboolean gst_byte_reader_peek_int16_le (GstByteReader *reader, gint16 *val);
|
||||
gboolean gst_byte_reader_peek_uint16_be (GstByteReader *reader, guint16 *val);
|
||||
gboolean gst_byte_reader_peek_int16_be (GstByteReader *reader, gint16 *val);
|
||||
gboolean gst_byte_reader_peek_uint24_le (GstByteReader *reader, guint32 *val);
|
||||
gboolean gst_byte_reader_peek_int24_le (GstByteReader *reader, gint32 *val);
|
||||
gboolean gst_byte_reader_peek_uint24_be (GstByteReader *reader, guint32 *val);
|
||||
gboolean gst_byte_reader_peek_int24_be (GstByteReader *reader, gint32 *val);
|
||||
gboolean gst_byte_reader_peek_uint32_le (GstByteReader *reader, guint32 *val);
|
||||
gboolean gst_byte_reader_peek_int32_le (GstByteReader *reader, gint32 *val);
|
||||
gboolean gst_byte_reader_peek_uint32_be (GstByteReader *reader, guint32 *val);
|
||||
gboolean gst_byte_reader_peek_int32_be (GstByteReader *reader, gint32 *val);
|
||||
gboolean gst_byte_reader_peek_uint64_le (GstByteReader *reader, guint64 *val);
|
||||
gboolean gst_byte_reader_peek_int64_le (GstByteReader *reader, gint64 *val);
|
||||
gboolean gst_byte_reader_peek_uint64_be (GstByteReader *reader, guint64 *val);
|
||||
gboolean gst_byte_reader_peek_int64_be (GstByteReader *reader, gint64 *val);
|
||||
gboolean gst_byte_reader_peek_uint8 (const GstByteReader *reader, guint8 *val);
|
||||
gboolean gst_byte_reader_peek_int8 (const GstByteReader *reader, gint8 *val);
|
||||
gboolean gst_byte_reader_peek_uint16_le (const GstByteReader *reader, guint16 *val);
|
||||
gboolean gst_byte_reader_peek_int16_le (const GstByteReader *reader, gint16 *val);
|
||||
gboolean gst_byte_reader_peek_uint16_be (const GstByteReader *reader, guint16 *val);
|
||||
gboolean gst_byte_reader_peek_int16_be (const GstByteReader *reader, gint16 *val);
|
||||
gboolean gst_byte_reader_peek_uint24_le (const GstByteReader *reader, guint32 *val);
|
||||
gboolean gst_byte_reader_peek_int24_le (const GstByteReader *reader, gint32 *val);
|
||||
gboolean gst_byte_reader_peek_uint24_be (const GstByteReader *reader, guint32 *val);
|
||||
gboolean gst_byte_reader_peek_int24_be (const GstByteReader *reader, gint32 *val);
|
||||
gboolean gst_byte_reader_peek_uint32_le (const GstByteReader *reader, guint32 *val);
|
||||
gboolean gst_byte_reader_peek_int32_le (const GstByteReader *reader, gint32 *val);
|
||||
gboolean gst_byte_reader_peek_uint32_be (const GstByteReader *reader, guint32 *val);
|
||||
gboolean gst_byte_reader_peek_int32_be (const GstByteReader *reader, gint32 *val);
|
||||
gboolean gst_byte_reader_peek_uint64_le (const GstByteReader *reader, guint64 *val);
|
||||
gboolean gst_byte_reader_peek_int64_le (const GstByteReader *reader, gint64 *val);
|
||||
gboolean gst_byte_reader_peek_uint64_be (const GstByteReader *reader, guint64 *val);
|
||||
gboolean gst_byte_reader_peek_int64_be (const GstByteReader *reader, gint64 *val);
|
||||
|
||||
gboolean gst_byte_reader_get_float32_le (GstByteReader *reader, gfloat *val);
|
||||
gboolean gst_byte_reader_get_float32_be (GstByteReader *reader, gfloat *val);
|
||||
gboolean gst_byte_reader_get_float64_le (GstByteReader *reader, gdouble *val);
|
||||
gboolean gst_byte_reader_get_float64_be (GstByteReader *reader, gdouble *val);
|
||||
|
||||
gboolean gst_byte_reader_peek_float32_le (GstByteReader *reader, gfloat *val);
|
||||
gboolean gst_byte_reader_peek_float32_be (GstByteReader *reader, gfloat *val);
|
||||
gboolean gst_byte_reader_peek_float64_le (GstByteReader *reader, gdouble *val);
|
||||
gboolean gst_byte_reader_peek_float64_be (GstByteReader *reader, gdouble *val);
|
||||
gboolean gst_byte_reader_peek_float32_le (const GstByteReader *reader, gfloat *val);
|
||||
gboolean gst_byte_reader_peek_float32_be (const GstByteReader *reader, gfloat *val);
|
||||
gboolean gst_byte_reader_peek_float64_le (const GstByteReader *reader, gdouble *val);
|
||||
gboolean gst_byte_reader_peek_float64_be (const GstByteReader *reader, gdouble *val);
|
||||
|
||||
gboolean gst_byte_reader_dup_data (GstByteReader * reader, guint size, guint8 ** val);
|
||||
gboolean gst_byte_reader_get_data (GstByteReader * reader, guint size, const guint8 ** val);
|
||||
gboolean gst_byte_reader_peek_data (GstByteReader * reader, guint size, const guint8 ** val);
|
||||
gboolean gst_byte_reader_peek_data (const GstByteReader * reader, guint size, const guint8 ** val);
|
||||
|
||||
#define gst_byte_reader_dup_string(reader,str) \
|
||||
gst_byte_reader_dup_string_utf8(reader,str)
|
||||
|
@ -132,9 +132,9 @@ gboolean gst_byte_reader_skip_string_utf32 (GstByteReader * reader);
|
|||
gst_byte_reader_peek_string_utf8(reader,str)
|
||||
|
||||
gboolean gst_byte_reader_get_string_utf8 (GstByteReader * reader, const gchar ** str);
|
||||
gboolean gst_byte_reader_peek_string_utf8 (GstByteReader * reader, const gchar ** str);
|
||||
gboolean gst_byte_reader_peek_string_utf8 (const GstByteReader * reader, const gchar ** str);
|
||||
|
||||
guint gst_byte_reader_masked_scan_uint32 (GstByteReader * reader,
|
||||
guint gst_byte_reader_masked_scan_uint32 (const GstByteReader * reader,
|
||||
guint32 mask,
|
||||
guint32 pattern,
|
||||
guint offset,
|
||||
|
@ -178,7 +178,7 @@ gst_byte_reader_skip_unchecked (GstByteReader * reader, guint nbytes)
|
|||
#define __GST_BYTE_READER_GET_PEEK_BITS_UNCHECKED(bits,type,lower,upper,adj) \
|
||||
\
|
||||
static inline type \
|
||||
gst_byte_reader_peek_##lower##_unchecked (GstByteReader * reader) \
|
||||
gst_byte_reader_peek_##lower##_unchecked (const GstByteReader * reader) \
|
||||
{ \
|
||||
type val = (type) GST_READ_##upper (reader->data + reader->byte); \
|
||||
adj \
|
||||
|
@ -228,7 +228,7 @@ __GST_BYTE_READER_GET_PEEK_BITS_UNCHECKED(64,gdouble,float64_be,DOUBLE_BE,/* */)
|
|||
#undef __GET_PEEK_BITS_UNCHECKED
|
||||
|
||||
static inline const guint8 *
|
||||
gst_byte_reader_peek_data_unchecked (GstByteReader * reader)
|
||||
gst_byte_reader_peek_data_unchecked (const GstByteReader * reader)
|
||||
{
|
||||
return (const guint8 *) (reader->data + reader->byte);
|
||||
}
|
||||
|
@ -289,7 +289,7 @@ _gst_byte_reader_get_size_inline (const GstByteReader * reader)
|
|||
#define __GST_BYTE_READER_GET_PEEK_BITS_INLINE(bits,type,name) \
|
||||
\
|
||||
static inline gboolean \
|
||||
_gst_byte_reader_peek_##name##_inline (GstByteReader * reader, type * val) \
|
||||
_gst_byte_reader_peek_##name##_inline (const GstByteReader * reader, type * val) \
|
||||
{ \
|
||||
g_return_val_if_fail (reader != NULL, FALSE); \
|
||||
g_return_val_if_fail (val != NULL, FALSE); \
|
||||
|
@ -476,7 +476,7 @@ _gst_byte_reader_get_data_inline (GstByteReader * reader, guint size, const guin
|
|||
}
|
||||
|
||||
static inline gboolean
|
||||
_gst_byte_reader_peek_data_inline (GstByteReader * reader, guint size, const guint8 ** val)
|
||||
_gst_byte_reader_peek_data_inline (const GstByteReader * reader, guint size, const guint8 ** val)
|
||||
{
|
||||
g_return_val_if_fail (reader != NULL, FALSE);
|
||||
g_return_val_if_fail (val != NULL, FALSE);
|
||||
|
|
Loading…
Reference in a new issue