diff --git a/src/gstducatividdec.h b/src/gstducatividdec.h
index 23a06a8a8ff4a7d056b350d9b60a34f758c60c55..7f83e90eea4145eb16f8227c53c221bd32b0c8de 100644 (file)
--- a/src/gstducatividdec.h
+++ b/src/gstducatividdec.h
/* helper methods for derived classes: */
static inline void
-push_input (GstDucatiVidDec * self, guint8 *in, gint sz)
+push_input (GstDucatiVidDec * self, const guint8 *in, gint sz)
{
GST_DEBUG_OBJECT (self, "push: %d bytes)", sz);
memcpy (self->input + self->in_size, in, sz);
self->in_size += sz;
}
+static inline int
+check_start_code (const guint8 *sc, gint scsize,
+ const guint8 *inbuf, gint insize)
+{
+ if (insize < scsize)
+ return FALSE;
+
+ while (scsize) {
+ if (*sc != *inbuf)
+ return FALSE;
+ scsize--;
+ sc++;
+ inbuf++;
+ }
+
+ return TRUE;
+}
+
+static inline int
+find_start_code (const guint8 *sc, gint scsize,
+ const guint8 *inbuf, gint insize)
+{
+ gint size = 0;
+ while (insize) {
+ if (check_start_code (sc, scsize, inbuf, insize))
+ break;
+ insize--;
+ size++;
+ inbuf++;
+ }
+ return size;
+}
+
G_END_DECLS
#endif /* __GST_DUCATIVIDDEC_H__ */