const guint8 *data;
guint size;
+ guint n_epb; /* Number of emulation prevention bytes */
guint byte; /* Byte position */
guint bits_in_cache; /* bitpos in the cache of next bit */
guint8 first_byte;
{
nr->data = data;
nr->size = size;
+ nr->n_epb = 0;
nr->byte = 0;
nr->bits_in_cache = 0;
((nr->cache & 0xff) == 0)) {
/* next byte goes unconditionally to the cache, even if it's 0x03 */
check_three_byte = FALSE;
+ nr->n_epb++;
goto next_byte;
}
nr->cache = (nr->cache << 8) | nr->first_byte;
return (nr->size - nr->byte) * 8 + nr->bits_in_cache;
}
+static inline guint
+nal_reader_get_epb_count (const NalReader * nr)
+{
+ return nr->n_epb;
+}
+
#define GST_NAL_READER_READ_BITS(bits) \
static gboolean \
nal_reader_get_bits_uint##bits (NalReader *nr, guint##bits *val, guint nbits) \
}
slice->header_size = nal_reader_get_pos (&nr);
+ slice->n_emulation_prevention_bytes = nal_reader_get_epb_count (&nr);
return GST_H264_PARSER_OK;