Port gtk-doc comments to their equivalent markdown syntax
[platform/upstream/gstreamer.git] / libs / gst / base / gstbytereader.c
index c1875e6..baa152f 100644 (file)
@@ -1,7 +1,7 @@
 /* GStreamer byte reader
  *
  * Copyright (C) 2008 Sebastian Dröge <sebastian.droege@collabora.co.uk>.
- * Copyright (C) 2009 Tim-Philipp Müller <tim centricular net>
+ * Copyright (C) 2009,2014 Tim-Philipp Müller <tim centricular net>
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
@@ -15,8 +15,8 @@
  *
  * 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.
  */
 
 #ifdef HAVE_CONFIG_H
@@ -30,6 +30,7 @@
 
 /**
  * SECTION:gstbytereader
+ * @title: GstByteReader
  * @short_description: Reads different integer, string and floating point
  *     types from a memory buffer
  *
@@ -42,7 +43,7 @@
  */
 
 /**
- * gst_byte_reader_new:
+ * gst_byte_reader_new: (skip)
  * @data: (in) (transfer none) (array length=size): data from which the
  *     #GstByteReader should read
  * @size: Size of @data in bytes
@@ -52,8 +53,6 @@
  * Free-function: gst_byte_reader_free
  *
  * Returns: (transfer full): a new #GstByteReader instance
- *
- * Since: 0.10.22
  */
 GstByteReader *
 gst_byte_reader_new (const guint8 * data, guint size)
@@ -72,8 +71,6 @@ gst_byte_reader_new (const guint8 * data, guint size)
  *
  * Frees a #GstByteReader instance, which was previously allocated by
  * gst_byte_reader_new().
- * 
- * Since: 0.10.22
  */
 void
 gst_byte_reader_free (GstByteReader * reader)
@@ -92,8 +89,6 @@ gst_byte_reader_free (GstByteReader * reader)
  *
  * Initializes a #GstByteReader instance to read from @data. This function
  * can be called on already initialized instances.
- * 
- * Since: 0.10.22
  */
 void
 gst_byte_reader_init (GstByteReader * reader, const guint8 * data, guint size)
@@ -106,6 +101,56 @@ gst_byte_reader_init (GstByteReader * reader, const guint8 * data, guint size)
 }
 
 /**
+ * gst_byte_reader_peek_sub_reader: (skip)
+ * @reader: an existing and initialized #GstByteReader instance
+ * @sub_reader: a #GstByteReader instance to initialize as sub-reader
+ * @size: size of @sub_reader in bytes
+ *
+ * Initializes a #GstByteReader sub-reader instance to contain @size bytes of
+ * data from the current position of @reader. This is useful to read chunked
+ * formats and make sure that one doesn't read beyond the size of the sub-chunk.
+ *
+ * Unlike gst_byte_reader_get_sub_reader(), this function does not modify the
+ * current position of @reader.
+ *
+ * Returns: FALSE on error or if @reader does not contain @size more bytes from
+ *     the current position, and otherwise TRUE
+ *
+ * Since: 1.6
+ */
+gboolean
+gst_byte_reader_peek_sub_reader (GstByteReader * reader,
+    GstByteReader * sub_reader, guint size)
+{
+  return _gst_byte_reader_peek_sub_reader_inline (reader, sub_reader, size);
+}
+
+/**
+ * gst_byte_reader_get_sub_reader: (skip)
+ * @reader: an existing and initialized #GstByteReader instance
+ * @sub_reader: a #GstByteReader instance to initialize as sub-reader
+ * @size: size of @sub_reader in bytes
+ *
+ * Initializes a #GstByteReader sub-reader instance to contain @size bytes of
+ * data from the current position of @reader. This is useful to read chunked
+ * formats and make sure that one doesn't read beyond the size of the sub-chunk.
+ *
+ * Unlike gst_byte_reader_peek_sub_reader(), this function also modifies the
+ * position of @reader and moves it forward by @size bytes.
+ *
+ * Returns: FALSE on error or if @reader does not contain @size more bytes from
+ *     the current position, and otherwise TRUE
+ *
+ * Since: 1.6
+ */
+gboolean
+gst_byte_reader_get_sub_reader (GstByteReader * reader,
+    GstByteReader * sub_reader, guint size)
+{
+  return _gst_byte_reader_get_sub_reader_inline (reader, sub_reader, size);
+}
+
+/**
  * gst_byte_reader_set_pos:
  * @reader: a #GstByteReader instance
  * @pos: The new position in bytes
@@ -114,8 +159,6 @@ gst_byte_reader_init (GstByteReader * reader, const guint8 * data, guint size)
  *
  * Returns: %TRUE if the position could be set successfully, %FALSE
  * otherwise.
- * 
- * Since: 0.10.22
  */
 gboolean
 gst_byte_reader_set_pos (GstByteReader * reader, guint pos)
@@ -137,8 +180,6 @@ gst_byte_reader_set_pos (GstByteReader * reader, guint pos)
  * Returns the current position of a #GstByteReader instance in bytes.
  *
  * Returns: The current position of @reader in bytes.
- * 
- * Since: 0.10.22
  */
 guint
 gst_byte_reader_get_pos (const GstByteReader * reader)
@@ -153,8 +194,6 @@ gst_byte_reader_get_pos (const GstByteReader * reader)
  * Returns the remaining number of bytes of a #GstByteReader instance.
  *
  * Returns: The remaining number of bytes of @reader instance.
- * 
- * Since: 0.10.22
  */
 guint
 gst_byte_reader_get_remaining (const GstByteReader * reader)
@@ -169,8 +208,6 @@ gst_byte_reader_get_remaining (const GstByteReader * reader)
  * Returns the total number of bytes of a #GstByteReader instance.
  *
  * Returns: The total number of bytes of @reader instance.
- * 
- * Since: 0.10.26
  */
 guint
 gst_byte_reader_get_size (const GstByteReader * reader)
@@ -189,8 +226,6 @@ gst_byte_reader_get_size (const GstByteReader * reader)
  * Skips @nbytes bytes of the #GstByteReader instance.
  *
  * Returns: %TRUE if @nbytes bytes could be skipped, %FALSE otherwise.
- * 
- * Since: 0.10.22
  */
 gboolean
 gst_byte_reader_skip (GstByteReader * reader, guint nbytes)
@@ -206,8 +241,6 @@ gst_byte_reader_skip (GstByteReader * reader, guint nbytes)
  * Read an unsigned 8 bit integer into @val and update the current position.
  *
  * Returns: %TRUE if successful, %FALSE otherwise.
- * 
- * Since: 0.10.22
  */
 
 /**
@@ -218,8 +251,6 @@ gst_byte_reader_skip (GstByteReader * reader, guint nbytes)
  * Read a signed 8 bit integer into @val and update the current position.
  *
  * Returns: %TRUE if successful, %FALSE otherwise.
- * 
- * Since: 0.10.22
  */
 
 /**
@@ -230,8 +261,6 @@ gst_byte_reader_skip (GstByteReader * reader, guint nbytes)
  * Read an unsigned 8 bit integer into @val but keep the current position.
  *
  * Returns: %TRUE if successful, %FALSE otherwise.
- * 
- * Since: 0.10.22
  */
 
 /**
@@ -242,8 +271,6 @@ gst_byte_reader_skip (GstByteReader * reader, guint nbytes)
  * Read a signed 8 bit integer into @val but keep the current position.
  *
  * Returns: %TRUE if successful, %FALSE otherwise.
- * 
- * Since: 0.10.22
  */
 
 /**
@@ -255,8 +282,6 @@ gst_byte_reader_skip (GstByteReader * reader, guint nbytes)
  * and update the current position.
  *
  * Returns: %TRUE if successful, %FALSE otherwise.
- * 
- * Since: 0.10.22
  */
 
 /**
@@ -268,8 +293,6 @@ gst_byte_reader_skip (GstByteReader * reader, guint nbytes)
  * and update the current position.
  *
  * Returns: %TRUE if successful, %FALSE otherwise.
- * 
- * Since: 0.10.22
  */
 
 /**
@@ -281,8 +304,6 @@ gst_byte_reader_skip (GstByteReader * reader, guint nbytes)
  * but keep the current position.
  *
  * Returns: %TRUE if successful, %FALSE otherwise.
- * 
- * Since: 0.10.22
  */
 
 /**
@@ -294,8 +315,6 @@ gst_byte_reader_skip (GstByteReader * reader, guint nbytes)
  * but keep the current position.
  *
  * Returns: %TRUE if successful, %FALSE otherwise.
- * 
- * Since: 0.10.22
  */
 
 /**
@@ -307,8 +326,6 @@ gst_byte_reader_skip (GstByteReader * reader, guint nbytes)
  * and update the current position.
  *
  * Returns: %TRUE if successful, %FALSE otherwise.
- * 
- * Since: 0.10.22
  */
 
 /**
@@ -320,8 +337,6 @@ gst_byte_reader_skip (GstByteReader * reader, guint nbytes)
  * and update the current position.
  *
  * Returns: %TRUE if successful, %FALSE otherwise.
- * 
- * Since: 0.10.22
  */
 
 /**
@@ -333,8 +348,6 @@ gst_byte_reader_skip (GstByteReader * reader, guint nbytes)
  * but keep the current position.
  *
  * Returns: %TRUE if successful, %FALSE otherwise.
- * 
- * Since: 0.10.22
  */
 
 /**
@@ -346,8 +359,6 @@ gst_byte_reader_skip (GstByteReader * reader, guint nbytes)
  * but keep the current position.
  *
  * Returns: %TRUE if successful, %FALSE otherwise.
- * 
- * Since: 0.10.22
  */
 
 /**
@@ -359,8 +370,6 @@ gst_byte_reader_skip (GstByteReader * reader, guint nbytes)
  * and update the current position.
  *
  * Returns: %TRUE if successful, %FALSE otherwise.
- * 
- * Since: 0.10.22
  */
 
 /**
@@ -372,8 +381,6 @@ gst_byte_reader_skip (GstByteReader * reader, guint nbytes)
  * and update the current position.
  *
  * Returns: %TRUE if successful, %FALSE otherwise.
- * 
- * Since: 0.10.22
  */
 
 /**
@@ -385,8 +392,6 @@ gst_byte_reader_skip (GstByteReader * reader, guint nbytes)
  * but keep the current position.
  *
  * Returns: %TRUE if successful, %FALSE otherwise.
- * 
- * Since: 0.10.22
  */
 
 /**
@@ -398,8 +403,6 @@ gst_byte_reader_skip (GstByteReader * reader, guint nbytes)
  * but keep the current position.
  *
  * Returns: %TRUE if successful, %FALSE otherwise.
- * 
- * Since: 0.10.22
  */
 
 /**
@@ -411,8 +414,6 @@ gst_byte_reader_skip (GstByteReader * reader, guint nbytes)
  * and update the current position.
  *
  * Returns: %TRUE if successful, %FALSE otherwise.
- * 
- * Since: 0.10.22
  */
 
 /**
@@ -424,8 +425,6 @@ gst_byte_reader_skip (GstByteReader * reader, guint nbytes)
  * and update the current position.
  *
  * Returns: %TRUE if successful, %FALSE otherwise.
- * 
- * Since: 0.10.22
  */
 
 /**
@@ -437,8 +436,6 @@ gst_byte_reader_skip (GstByteReader * reader, guint nbytes)
  * but keep the current position.
  *
  * Returns: %TRUE if successful, %FALSE otherwise.
- * 
- * Since: 0.10.22
  */
 
 /**
@@ -450,8 +447,6 @@ gst_byte_reader_skip (GstByteReader * reader, guint nbytes)
  * but keep the current position.
  *
  * Returns: %TRUE if successful, %FALSE otherwise.
- * 
- * Since: 0.10.22
  */
 
 
@@ -464,8 +459,6 @@ gst_byte_reader_skip (GstByteReader * reader, guint nbytes)
  * and update the current position.
  *
  * Returns: %TRUE if successful, %FALSE otherwise.
- * 
- * Since: 0.10.22
  */
 
 /**
@@ -477,8 +470,6 @@ gst_byte_reader_skip (GstByteReader * reader, guint nbytes)
  * and update the current position.
  *
  * Returns: %TRUE if successful, %FALSE otherwise.
- * 
- * Since: 0.10.22
  */
 
 /**
@@ -490,8 +481,6 @@ gst_byte_reader_skip (GstByteReader * reader, guint nbytes)
  * but keep the current position.
  *
  * Returns: %TRUE if successful, %FALSE otherwise.
- * 
- * Since: 0.10.22
  */
 
 /**
@@ -503,8 +492,6 @@ gst_byte_reader_skip (GstByteReader * reader, guint nbytes)
  * but keep the current position.
  *
  * Returns: %TRUE if successful, %FALSE otherwise.
- * 
- * Since: 0.10.22
  */
 
 /**
@@ -516,8 +503,6 @@ gst_byte_reader_skip (GstByteReader * reader, guint nbytes)
  * and update the current position.
  *
  * Returns: %TRUE if successful, %FALSE otherwise.
- * 
- * Since: 0.10.22
  */
 
 /**
@@ -529,8 +514,6 @@ gst_byte_reader_skip (GstByteReader * reader, guint nbytes)
  * and update the current position.
  *
  * Returns: %TRUE if successful, %FALSE otherwise.
- * 
- * Since: 0.10.22
  */
 
 /**
@@ -542,8 +525,6 @@ gst_byte_reader_skip (GstByteReader * reader, guint nbytes)
  * but keep the current position.
  *
  * Returns: %TRUE if successful, %FALSE otherwise.
- * 
- * Since: 0.10.22
  */
 
 /**
@@ -555,8 +536,6 @@ gst_byte_reader_skip (GstByteReader * reader, guint nbytes)
  * but keep the current position.
  *
  * Returns: %TRUE if successful, %FALSE otherwise.
- * 
- * Since: 0.10.22
  */
 
 /**
@@ -568,8 +547,6 @@ gst_byte_reader_skip (GstByteReader * reader, guint nbytes)
  * and update the current position.
  *
  * Returns: %TRUE if successful, %FALSE otherwise.
- * 
- * Since: 0.10.22
  */
 
 /**
@@ -581,8 +558,6 @@ gst_byte_reader_skip (GstByteReader * reader, guint nbytes)
  * and update the current position.
  *
  * Returns: %TRUE if successful, %FALSE otherwise.
- * 
- * Since: 0.10.22
  */
 
 /**
@@ -594,8 +569,6 @@ gst_byte_reader_skip (GstByteReader * reader, guint nbytes)
  * but keep the current position.
  *
  * Returns: %TRUE if successful, %FALSE otherwise.
- * 
- * Since: 0.10.22
  */
 
 /**
@@ -607,8 +580,6 @@ gst_byte_reader_skip (GstByteReader * reader, guint nbytes)
  * but keep the current position.
  *
  * Returns: %TRUE if successful, %FALSE otherwise.
- * 
- * Since: 0.10.22
  */
 
 /**
@@ -620,8 +591,6 @@ gst_byte_reader_skip (GstByteReader * reader, guint nbytes)
  * and update the current position.
  *
  * Returns: %TRUE if successful, %FALSE otherwise.
- * 
- * Since: 0.10.22
  */
 
 /**
@@ -633,8 +602,6 @@ gst_byte_reader_skip (GstByteReader * reader, guint nbytes)
  * and update the current position.
  *
  * Returns: %TRUE if successful, %FALSE otherwise.
- * 
- * Since: 0.10.22
  */
 
 /**
@@ -646,8 +613,6 @@ gst_byte_reader_skip (GstByteReader * reader, guint nbytes)
  * but keep the current position.
  *
  * Returns: %TRUE if successful, %FALSE otherwise.
- * 
- * Since: 0.10.22
  */
 
 /**
@@ -659,8 +624,6 @@ gst_byte_reader_skip (GstByteReader * reader, guint nbytes)
  * but keep the current position.
  *
  * Returns: %TRUE if successful, %FALSE otherwise.
- * 
- * Since: 0.10.22
  */
 
 #define GST_BYTE_READER_PEEK_GET(bits,type,name) \
@@ -710,8 +673,6 @@ GST_BYTE_READER_PEEK_GET(64,gint64,int64_be)
  * and update the current position.
  *
  * Returns: %TRUE if successful, %FALSE otherwise.
- * 
- * Since: 0.10.22
  */
 
 /**
@@ -723,8 +684,6 @@ GST_BYTE_READER_PEEK_GET(64,gint64,int64_be)
  * but keep the current position.
  *
  * Returns: %TRUE if successful, %FALSE otherwise.
- * 
- * Since: 0.10.22
  */
 
 /**
@@ -736,8 +695,6 @@ GST_BYTE_READER_PEEK_GET(64,gint64,int64_be)
  * and update the current position.
  *
  * Returns: %TRUE if successful, %FALSE otherwise.
- * 
- * Since: 0.10.22
  */
 
 /**
@@ -749,8 +706,6 @@ GST_BYTE_READER_PEEK_GET(64,gint64,int64_be)
  * but keep the current position.
  *
  * Returns: %TRUE if successful, %FALSE otherwise.
- * 
- * Since: 0.10.22
  */
 
 /**
@@ -762,8 +717,6 @@ GST_BYTE_READER_PEEK_GET(64,gint64,int64_be)
  * and update the current position.
  *
  * Returns: %TRUE if successful, %FALSE otherwise.
- * 
- * Since: 0.10.22
  */
 
 /**
@@ -775,8 +728,6 @@ GST_BYTE_READER_PEEK_GET(64,gint64,int64_be)
  * but keep the current position.
  *
  * Returns: %TRUE if successful, %FALSE otherwise.
- * 
- * Since: 0.10.22
  */
 
 /**
@@ -788,8 +739,6 @@ GST_BYTE_READER_PEEK_GET(64,gint64,int64_be)
  * and update the current position.
  *
  * Returns: %TRUE if successful, %FALSE otherwise.
- * 
- * Since: 0.10.22
  */
 
 /**
@@ -801,8 +750,6 @@ GST_BYTE_READER_PEEK_GET(64,gint64,int64_be)
  * but keep the current position.
  *
  * Returns: %TRUE if successful, %FALSE otherwise.
- * 
- * Since: 0.10.22
  */
 
 GST_BYTE_READER_PEEK_GET(32,gfloat,float32_le)
@@ -823,10 +770,7 @@ GST_BYTE_READER_PEEK_GET(64,gdouble,float64_be)
  * position if at least @size bytes are left and
  * updates the current position.
  *
- *
  * Returns: %TRUE if successful, %FALSE otherwise.
- * 
- * Since: 0.10.22
  */
 gboolean
 gst_byte_reader_get_data (GstByteReader * reader, guint size,
@@ -846,10 +790,7 @@ gst_byte_reader_get_data (GstByteReader * reader, guint size,
  * position if at least @size bytes are left and
  * keeps the current position.
  *
- *
  * Returns: %TRUE if successful, %FALSE otherwise.
- * 
- * Since: 0.10.22
  */
 gboolean
 gst_byte_reader_peek_data (const GstByteReader * reader, guint size,
@@ -872,8 +813,6 @@ gst_byte_reader_peek_data (const GstByteReader * reader, guint size,
  * updates the current position. Free with g_free() when no longer needed.
  *
  * Returns: %TRUE if successful, %FALSE otherwise.
- *
- * Since: 0.10.24
  */
 gboolean
 gst_byte_reader_dup_data (GstByteReader * reader, guint size, guint8 ** val)
@@ -881,6 +820,78 @@ gst_byte_reader_dup_data (GstByteReader * reader, guint size, guint8 ** val)
   return _gst_byte_reader_dup_data_inline (reader, size, val);
 }
 
+/* Special optimized scan for mask 0xffffff00 and pattern 0x00000100 */
+static inline gint
+_scan_for_start_code (const guint8 * data, guint offset, guint size)
+{
+  guint8 *pdata = (guint8 *) data;
+  guint8 *pend = (guint8 *) (data + size - 4);
+
+  while (pdata <= pend) {
+    if (pdata[2] > 1) {
+      pdata += 3;
+    } else if (pdata[1]) {
+      pdata += 2;
+    } else if (pdata[0] || pdata[2] != 1) {
+      pdata++;
+    } else {
+      return (pdata - data + offset);
+    }
+  }
+
+  /* nothing found */
+  return -1;
+}
+
+static inline guint
+_masked_scan_uint32_peek (const GstByteReader * reader,
+    guint32 mask, guint32 pattern, guint offset, guint size, guint32 * value)
+{
+  const guint8 *data;
+  guint32 state;
+  guint i;
+
+  g_return_val_if_fail (size > 0, -1);
+  g_return_val_if_fail ((guint64) offset + size <= reader->size - reader->byte,
+      -1);
+
+  /* we can't find the pattern with less than 4 bytes */
+  if (G_UNLIKELY (size < 4))
+    return -1;
+
+  data = reader->data + reader->byte + offset;
+
+  /* Handle special case found in MPEG and H264 */
+  if ((pattern == 0x00000100) && (mask == 0xffffff00)) {
+    guint ret = _scan_for_start_code (data, offset, size);
+    if (G_UNLIKELY (value))
+      *value = (1 << 8) | data[ret + 3];
+    return ret;
+  }
+
+  /* set the state to something that does not match */
+  state = ~pattern;
+
+  /* now find data */
+  for (i = 0; i < size; i++) {
+    /* throw away one byte and move in the next byte */
+    state = ((state << 8) | data[i]);
+    if (G_UNLIKELY ((state & mask) == pattern)) {
+      /* we have a match but we need to have skipped at
+       * least 4 bytes to fill the state. */
+      if (G_LIKELY (i >= 3)) {
+        if (value)
+          *value = state;
+        return offset + i - 3;
+      }
+    }
+  }
+
+  /* nothing found */
+  return -1;
+}
+
+
 /**
  * gst_byte_reader_masked_scan_uint32:
  * @reader: a #GstByteReader
@@ -904,7 +915,7 @@ gst_byte_reader_dup_data (GstByteReader * reader, guint size, guint8 ** val)
  * Returns: offset of the first match, or -1 if no match was found.
  *
  * Example:
- * <programlisting>
+ * |[
  * // Assume the reader contains 0x00 0x01 0x02 ... 0xfe 0xff
  *
  * gst_byte_reader_masked_scan_uint32 (reader, 0xffffffff, 0x00010203, 0, 256);
@@ -921,45 +932,45 @@ gst_byte_reader_dup_data (GstByteReader * reader, guint size, guint8 ** val)
  * // -> returns 2
  * gst_byte_reader_masked_scan_uint32 (reader, 0xffff0000, 0x02030000, 0, 4);
  * // -> returns -1
- * </programlisting>
- *
- * Since: 0.10.24
+ * ]|
  */
 guint
 gst_byte_reader_masked_scan_uint32 (const GstByteReader * reader, guint32 mask,
     guint32 pattern, guint offset, guint size)
 {
-  const guint8 *data;
-  guint32 state;
-  guint i;
-
-  g_return_val_if_fail (size > 0, -1);
-  g_return_val_if_fail ((guint64) offset + size <= reader->size - reader->byte,
-      -1);
-
-  /* we can't find the pattern with less than 4 bytes */
-  if (G_UNLIKELY (size < 4))
-    return -1;
-
-  data = reader->data + reader->byte + offset;
-
-  /* set the state to something that does not match */
-  state = ~pattern;
-
-  /* now find data */
-  for (i = 0; i < size; i++) {
-    /* throw away one byte and move in the next byte */
-    state = ((state << 8) | data[i]);
-    if (G_UNLIKELY ((state & mask) == pattern)) {
-      /* we have a match but we need to have skipped at
-       * least 4 bytes to fill the state. */
-      if (G_LIKELY (i >= 3))
-        return offset + i - 3;
-    }
-  }
+  return _masked_scan_uint32_peek (reader, mask, pattern, offset, size, NULL);
+}
 
-  /* nothing found */
-  return -1;
+/**
+ * gst_byte_reader_masked_scan_uint32_peek:
+ * @reader: a #GstByteReader
+ * @mask: mask to apply to data before matching against @pattern
+ * @pattern: pattern to match (after mask is applied)
+ * @offset: offset from which to start scanning, relative to the current
+ *     position
+ * @size: number of bytes to scan from offset
+ * @value: pointer to uint32 to return matching data
+ *
+ * Scan for pattern @pattern with applied mask @mask in the byte reader data,
+ * starting from offset @offset relative to the current position.
+ *
+ * The bytes in @pattern and @mask are interpreted left-to-right, regardless
+ * of endianness.  All four bytes of the pattern must be present in the
+ * byte reader data for it to match, even if the first or last bytes are masked
+ * out.
+ *
+ * It is an error to call this function without making sure that there is
+ * enough data (offset+size bytes) in the byte reader.
+ *
+ * Returns: offset of the first match, or -1 if no match was found.
+ *
+ * Since: 1.6
+ */
+guint
+gst_byte_reader_masked_scan_uint32_peek (const GstByteReader * reader,
+    guint32 mask, guint32 pattern, guint offset, guint size, guint32 * value)
+{
+  return _masked_scan_uint32_peek (reader, mask, pattern, offset, size, value);
 }
 
 #define GST_BYTE_READER_SCAN_STRING(bits) \
@@ -1019,8 +1030,6 @@ gst_byte_reader_skip_string_utf##bits (GstByteReader * reader) \
  * This function will fail if no NUL-terminator was found in in the data.
  *
  * Returns: %TRUE if a string could be skipped, %FALSE otherwise.
- *
- * Since: 0.10.24
  */
 /**
  * gst_byte_reader_skip_string_utf8:
@@ -1034,8 +1043,6 @@ gst_byte_reader_skip_string_utf##bits (GstByteReader * reader) \
  * This function will fail if no NUL-terminator was found in in the data.
  *
  * Returns: %TRUE if a string could be skipped, %FALSE otherwise.
- *
- * Since: 0.10.24
  */
 GST_BYTE_READER_SKIP_STRING (8);
 
@@ -1051,8 +1058,6 @@ GST_BYTE_READER_SKIP_STRING (8);
  * This function will fail if no NUL-terminator was found in in the data.
  *
  * Returns: %TRUE if a string could be skipped, %FALSE otherwise.
- *
- * Since: 0.10.24
  */
 GST_BYTE_READER_SKIP_STRING (16);
 
@@ -1068,8 +1073,6 @@ GST_BYTE_READER_SKIP_STRING (16);
  * This function will fail if no NUL-terminator was found in in the data.
  *
  * Returns: %TRUE if a string could be skipped, %FALSE otherwise.
- *
- * Since: 0.10.24
  */
 GST_BYTE_READER_SKIP_STRING (32);
 
@@ -1077,7 +1080,7 @@ GST_BYTE_READER_SKIP_STRING (32);
  * gst_byte_reader_peek_string:
  * @reader: a #GstByteReader instance
  * @str: (out) (transfer none) (array zero-terminated=1): address of a
- *     #gchar pointer varieble in which to store the result
+ *     #gchar pointer variable in which to store the result
  *
  * Returns a constant pointer to the current data position if there is
  * a NUL-terminated string in the data (this could be just a NUL terminator).
@@ -1088,14 +1091,12 @@ GST_BYTE_READER_SKIP_STRING (32);
  * This function will fail if no NUL-terminator was found in in the data.
  *
  * Returns: %TRUE if a string could be skipped, %FALSE otherwise.
- *
- * Since: 0.10.24
  */
 /**
  * gst_byte_reader_peek_string_utf8:
  * @reader: a #GstByteReader instance
  * @str: (out) (transfer none) (array zero-terminated=1): address of a
- *     #gchar pointer varieble in which to store the result
+ *     #gchar pointer variable in which to store the result
  *
  * Returns a constant pointer to the current data position if there is
  * a NUL-terminated string in the data (this could be just a NUL terminator).
@@ -1108,8 +1109,6 @@ GST_BYTE_READER_SKIP_STRING (32);
  * This function will fail if no NUL-terminator was found in in the data.
  *
  * Returns: %TRUE if a string could be skipped, %FALSE otherwise.
- *
- * Since: 0.10.24
  */
 gboolean
 gst_byte_reader_peek_string_utf8 (const GstByteReader * reader,
@@ -1130,7 +1129,7 @@ gst_byte_reader_peek_string_utf8 (const GstByteReader * reader,
  * gst_byte_reader_get_string_utf8:
  * @reader: a #GstByteReader instance
  * @str: (out) (transfer none) (array zero-terminated=1): address of a
- *     #gchar pointer varieble in which to store the result
+ *     #gchar pointer variable in which to store the result
  *
  * Returns a constant pointer to the current data position if there is
  * a NUL-terminated string in the data (this could be just a NUL terminator),
@@ -1143,8 +1142,6 @@ gst_byte_reader_peek_string_utf8 (const GstByteReader * reader,
  * This function will fail if no NUL-terminator was found in in the data.
  *
  * Returns: %TRUE if a string could be found, %FALSE otherwise.
- *
- * Since: 0.10.24
  */
 gboolean
 gst_byte_reader_get_string_utf8 (GstByteReader * reader, const gchar ** str)
@@ -1188,7 +1185,7 @@ gst_byte_reader_dup_string_utf##bits (GstByteReader * reader, type ** str) \
  * gst_byte_reader_dup_string_utf8:
  * @reader: a #GstByteReader instance
  * @str: (out) (transfer full) (array zero-terminated=1): address of a
- *     #gchar pointer varieble in which to store the result
+ *     #gchar pointer variable in which to store the result
  *
  * Free-function: g_free
  *
@@ -1201,8 +1198,6 @@ gst_byte_reader_dup_string_utf##bits (GstByteReader * reader, type ** str) \
  *
  * Returns: %TRUE if a string could be read into @str, %FALSE otherwise. The
  *     string put into @str must be freed with g_free() when no longer needed.
- *
- * Since: 0.10.24
  */
 GST_BYTE_READER_DUP_STRING (8, gchar);
 
@@ -1210,7 +1205,7 @@ GST_BYTE_READER_DUP_STRING (8, gchar);
  * gst_byte_reader_dup_string_utf16:
  * @reader: a #GstByteReader instance
  * @str: (out) (transfer full) (array zero-terminated=1): address of a
- *     #guint16 pointer varieble in which to store the result
+ *     #guint16 pointer variable in which to store the result
  *
  * Free-function: g_free
  *
@@ -1229,8 +1224,6 @@ GST_BYTE_READER_DUP_STRING (8, gchar);
  *
  * Returns: %TRUE if a string could be read, %FALSE otherwise. The
  *     string put into @str must be freed with g_free() when no longer needed.
- *
- * Since: 0.10.24
  */
 GST_BYTE_READER_DUP_STRING (16, guint16);
 
@@ -1238,7 +1231,7 @@ GST_BYTE_READER_DUP_STRING (16, guint16);
  * gst_byte_reader_dup_string_utf32:
  * @reader: a #GstByteReader instance
  * @str: (out) (transfer full) (array zero-terminated=1): address of a
- *     #guint32 pointer varieble in which to store the result
+ *     #guint32 pointer variable in which to store the result
  *
  * Free-function: g_free
  *
@@ -1257,7 +1250,5 @@ GST_BYTE_READER_DUP_STRING (16, guint16);
  *
  * Returns: %TRUE if a string could be read, %FALSE otherwise. The
  *     string put into @str must be freed with g_free() when no longer needed.
- *
- * Since: 0.10.24
  */
 GST_BYTE_READER_DUP_STRING (32, guint32);