diff options
author | Tim-Philipp Müller <tim.muller@collabora.co.uk> | 2009-08-19 01:36:33 +0100 |
---|---|---|
committer | Tim-Philipp Müller <tim.muller@collabora.co.uk> | 2009-09-23 16:54:42 +0100 |
commit | 3abeb1e57804272c11ec5d61946000b010d8191a (patch) | |
tree | 76b736f088d327ca699b8625035235d84bab5dbd /gst/qtdemux/qtatomparser.h | |
parent | c8c9b0f35d2330617fe71b89a1828dd84c6a8c91 (diff) |
qtdemux: use GstByteReader for atom dumping and fix a few bugs
Diffstat (limited to 'gst/qtdemux/qtatomparser.h')
-rw-r--r-- | gst/qtdemux/qtatomparser.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/gst/qtdemux/qtatomparser.h b/gst/qtdemux/qtatomparser.h index dbd6b820..ce32b980 100644 --- a/gst/qtdemux/qtatomparser.h +++ b/gst/qtdemux/qtatomparser.h @@ -148,4 +148,32 @@ qt_atom_parser_get_offset_unchecked (QtAtomParser * parser, guint off_size) } } +static inline guint8 * +qt_atom_parser_peek_bytes_unchecked (QtAtomParser * parser) +{ + return (guint8 *) parser->data + parser->byte; +} + +static inline gboolean +qt_atom_parser_get_fourcc (QtAtomParser * parser, guint32 * fourcc) +{ + guint32 f_be; + + if (G_UNLIKELY (qt_atom_parser_get_remaining (parser) < 4)) + return FALSE; + + f_be = qt_atom_parser_get_uint32_unchecked (parser); + *fourcc = GUINT32_SWAP_LE_BE (f_be); + return TRUE; +} + +static inline guint32 +qt_atom_parser_get_fourcc_unchecked (QtAtomParser * parser) +{ + guint32 fourcc; + + fourcc = qt_atom_parser_get_uint32_unchecked (parser); + return GUINT32_SWAP_LE_BE (fourcc); +} + #endif /* QT_ATOM_PARSER_H */ |