From 09e06add6600f1b627322da8c13669279abecd25 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim-Philipp=20M=C3=BCller?= Date: Sun, 25 Sep 2011 15:31:01 +0100 Subject: [PATCH] typefindfunctions: backport some const-ifications from 0.11 branch To keep code identical as much as possible between the two branches, for easier merging. --- gst/typefind/gsttypefindfunctions.c | 153 ++++++++++++++++++------------------ 1 file changed, 78 insertions(+), 75 deletions(-) diff --git a/gst/typefind/gsttypefindfunctions.c b/gst/typefind/gsttypefindfunctions.c index a5eb132..2e2a567 100644 --- a/gst/typefind/gsttypefindfunctions.c +++ b/gst/typefind/gsttypefindfunctions.c @@ -45,6 +45,10 @@ GST_DEBUG_CATEGORY_STATIC (type_find_debug); #define GST_CAT_DEFAULT type_find_debug +/* so our code stays ready for 0.11 */ +#define gst_type_find_peek(tf,off,len) \ + ((const guint8 *)gst_type_find_peek((tf),(off),(len))) + /* DataScanCtx: helper for typefind functions that scan through data * step-by-step, to avoid doing a peek at each and every offset */ @@ -130,7 +134,7 @@ static gboolean utf8_type_find_have_valid_utf8_at_offset (GstTypeFind * tf, guint64 offset, GstTypeFindProbability * prob) { - guint8 *data; + const guint8 *data; /* randomly decided values */ guint min_size = 16; /* minimum size */ @@ -222,7 +226,7 @@ static GstStaticCaps uri_caps = GST_STATIC_CAPS ("text/uri-list"); static void uri_type_find (GstTypeFind * tf, gpointer unused) { - guint8 *data = gst_type_find_peek (tf, 0, BUFFER_SIZE); + const guint8 *data = gst_type_find_peek (tf, 0, BUFFER_SIZE); guint pos = 0; guint offset = 0; @@ -322,7 +326,7 @@ xml_check_first_element (GstTypeFind * tf, const gchar * element, guint elen, gboolean strict) { gboolean got_xmldec; - guint8 *data; + const guint8 *data; guint offset = 0; guint pos = 0; @@ -386,7 +390,7 @@ static GstStaticCaps sdp_caps = GST_STATIC_CAPS ("application/sdp"); static gboolean sdp_check_header (GstTypeFind * tf) { - guint8 *data; + const guint8 *data; data = gst_type_find_peek (tf, 0, 5); if (!data) @@ -433,9 +437,9 @@ static GstStaticCaps html_caps = GST_STATIC_CAPS ("text/html"); static void html_type_find (GstTypeFind * tf, gpointer unused) { - gchar *d, *data; + const gchar *d, *data; - data = (gchar *) gst_type_find_peek (tf, 0, 16); + data = (const gchar *) gst_type_find_peek (tf, 0, 16); if (!data) return; @@ -444,7 +448,7 @@ html_type_find (GstTypeFind * tf, gpointer unused) } else if (xml_check_first_element (tf, "html", 4, FALSE)) { gst_type_find_suggest (tf, GST_TYPE_FIND_MAXIMUM, HTML_CAPS); } else if ((d = memchr (data, '<', 16))) { - data = (gchar *) gst_type_find_peek (tf, d - data, 6); + data = (const gchar *) gst_type_find_peek (tf, d - data, 6); if (data && g_ascii_strncasecmp (data, "", 6) == 0) { gst_type_find_suggest (tf, GST_TYPE_FIND_MAXIMUM, HTML_CAPS); } @@ -459,7 +463,7 @@ static GstStaticCaps mid_caps = GST_STATIC_CAPS ("audio/midi"); static void mid_type_find (GstTypeFind * tf, gpointer unused) { - guint8 *data = gst_type_find_peek (tf, 0, 4); + const guint8 *data = gst_type_find_peek (tf, 0, 4); /* http://jedi.ks.uiuc.edu/~johns/links/music/midifile.html */ if (data && data[0] == 'M' && data[1] == 'T' && data[2] == 'h' @@ -475,7 +479,7 @@ static GstStaticCaps mxmf_caps = GST_STATIC_CAPS ("audio/mobile-xmf"); static void mxmf_type_find (GstTypeFind * tf, gpointer unused) { - guint8 *data = NULL; + const guint8 *data = NULL; /* Search FileId "XMF_" 4 bytes */ data = gst_type_find_peek (tf, 0, 4); @@ -503,7 +507,7 @@ static GstStaticCaps flx_caps = GST_STATIC_CAPS ("video/x-fli"); static void flx_type_find (GstTypeFind * tf, gpointer unused) { - guint8 *data = gst_type_find_peek (tf, 0, 134); + const guint8 *data = gst_type_find_peek (tf, 0, 134); if (data) { /* check magic and the frame type of the first frame */ @@ -534,7 +538,7 @@ static GstStaticCaps id3_caps = GST_STATIC_CAPS ("application/x-id3"); static void id3v2_type_find (GstTypeFind * tf, gpointer unused) { - guint8 *data = gst_type_find_peek (tf, 0, 10); + const guint8 *data = gst_type_find_peek (tf, 0, 10); if (data && memcmp (data, "ID3", 3) == 0 && data[3] != 0xFF && data[4] != 0xFF && @@ -547,7 +551,7 @@ id3v2_type_find (GstTypeFind * tf, gpointer unused) static void id3v1_type_find (GstTypeFind * tf, gpointer unused) { - guint8 *data = gst_type_find_peek (tf, -128, 3); + const guint8 *data = gst_type_find_peek (tf, -128, 3); if (data && memcmp (data, "TAG", 3) == 0) { gst_type_find_suggest (tf, GST_TYPE_FIND_MAXIMUM, ID3_CAPS); @@ -562,7 +566,7 @@ static GstStaticCaps apetag_caps = GST_STATIC_CAPS ("application/x-apetag"); static void apetag_type_find (GstTypeFind * tf, gpointer unused) { - guint8 *data; + const guint8 *data; /* APEv1/2 at start of file */ data = gst_type_find_peek (tf, 0, 8); @@ -587,7 +591,7 @@ static GstStaticCaps tta_caps = GST_STATIC_CAPS ("audio/x-ttafile"); static void tta_type_find (GstTypeFind * tf, gpointer unused) { - guint8 *data = gst_type_find_peek (tf, 0, 3); + const guint8 *data = gst_type_find_peek (tf, 0, 3); if (data) { if (memcmp (data, "TTA", 3) == 0) { @@ -985,8 +989,8 @@ static void mp3_type_find_at_offset (GstTypeFind * tf, guint64 start_off, guint * found_layer, GstTypeFindProbability * found_prob) { - guint8 *data = NULL; - guint8 *data_end = NULL; + const guint8 *data = NULL; + const guint8 *data_end = NULL; guint size; guint64 skipped; gint last_free_offset = -1; @@ -1010,7 +1014,7 @@ mp3_type_find_at_offset (GstTypeFind * tf, guint64 start_off, data_end = data + size; } if (*data == 0xFF) { - guint8 *head_data = NULL; + const guint8 *head_data = NULL; guint layer = 0, bitrate, samplerate, channels; guint found = 0; /* number of valid headers found */ guint64 offset = skipped; @@ -1128,7 +1132,7 @@ static void mp3_type_find (GstTypeFind * tf, gpointer unused) { GstTypeFindProbability prob, mid_prob; - guint8 *data; + const guint8 *data; guint layer, mid_layer; guint64 length; @@ -1198,7 +1202,7 @@ GST_STATIC_CAPS ("audio/x-musepack, streamversion= (int) { 7, 8 }"); static void musepack_type_find (GstTypeFind * tf, gpointer unused) { - guint8 *data = gst_type_find_peek (tf, 0, 4); + const guint8 *data = gst_type_find_peek (tf, 0, 4); GstTypeFindProbability prop = GST_TYPE_FIND_MINIMUM; gint streamversion = -1; @@ -1520,7 +1524,7 @@ wavpack_type_find (GstTypeFind * tf, gpointer unused) { guint64 offset; guint32 blocksize; - guint8 *data; + const guint8 *data; data = gst_type_find_peek (tf, 0, 32); if (!data) @@ -1583,7 +1587,7 @@ GST_STATIC_CAPS ("application/postscript"); static void postscript_type_find (GstTypeFind * tf, gpointer unused) { - guint8 *data = gst_type_find_peek (tf, 0, 3); + const guint8 *data = gst_type_find_peek (tf, 0, 3); if (!data) return; @@ -1633,8 +1637,8 @@ GST_STATIC_CAPS ("multipart/x-mixed-replace"); static void multipart_type_find (GstTypeFind * tf, gpointer unused) { - guint8 *data; - guint8 *x; + const guint8 *data; + const guint8 *x; #define MULTIPART_MAX_BOUNDARY_OFFSET 16 data = gst_type_find_peek (tf, 0, MULTIPART_MAX_BOUNDARY_OFFSET); @@ -1743,7 +1747,7 @@ mpeg_sys_is_valid_pack (GstTypeFind * tf, const guint8 * data, guint len, } static gboolean -mpeg_sys_is_valid_pes (GstTypeFind * tf, guint8 * data, guint len, +mpeg_sys_is_valid_pes (GstTypeFind * tf, const guint8 * data, guint len, guint * pack_size) { guint pes_packet_len; @@ -1771,7 +1775,7 @@ mpeg_sys_is_valid_pes (GstTypeFind * tf, guint8 * data, guint len, } static gboolean -mpeg_sys_is_valid_sys (GstTypeFind * tf, guint8 * data, guint len, +mpeg_sys_is_valid_sys (GstTypeFind * tf, const guint8 * data, guint len, guint * pack_size) { guint sys_hdr_len; @@ -1812,7 +1816,7 @@ mpeg_sys_is_valid_sys (GstTypeFind * tf, guint8 * data, guint len, static void mpeg_sys_type_find (GstTypeFind * tf, gpointer unused) { - guint8 *data, *data0, *first_sync, *end; + const guint8 *data, *data0, *first_sync, *end; gint mpegversion = 0; guint pack_headers = 0; guint pes_headers = 0; @@ -1953,7 +1957,7 @@ mpeg_ts_probe_headers (GstTypeFind * tf, guint64 offset, gint packet_size) { /* We always enter this function having found at least one header already */ gint found = 1; - guint8 *data = NULL; + const guint8 *data = NULL; GST_LOG ("looking for mpeg-ts packets of size %u", packet_size); while (found < GST_MPEGTS_TYPEFIND_MAX_HEADERS) { @@ -1978,8 +1982,7 @@ mpeg_ts_type_find (GstTypeFind * tf, gpointer unused) /* TS packet sizes to test: normal, DVHS packet size and * FEC with 16 or 20 byte codes packet size. */ const gint pack_sizes[] = { 188, 192, 204, 208 }; - - guint8 *data = NULL; + const guint8 *data = NULL; guint size = 0; guint64 skipped = 0; @@ -2414,7 +2417,7 @@ static GstStaticCaps aiff_caps = GST_STATIC_CAPS ("audio/x-aiff"); static void aiff_type_find (GstTypeFind * tf, gpointer unused) { - guint8 *data = gst_type_find_peek (tf, 0, 4); + const guint8 *data = gst_type_find_peek (tf, 0, 4); if (data && memcmp (data, "FORM", 4) == 0) { data += 8; @@ -2431,7 +2434,7 @@ static GstStaticCaps svx_caps = GST_STATIC_CAPS ("audio/x-svx"); static void svx_type_find (GstTypeFind * tf, gpointer unused) { - guint8 *data = gst_type_find_peek (tf, 0, 4); + const guint8 *data = gst_type_find_peek (tf, 0, 4); if (data && memcmp (data, "FORM", 4) == 0) { data += 8; @@ -2448,7 +2451,7 @@ static GstStaticCaps shn_caps = GST_STATIC_CAPS ("audio/x-shorten"); static void shn_type_find (GstTypeFind * tf, gpointer unused) { - guint8 *data = gst_type_find_peek (tf, 0, 4); + const guint8 *data = gst_type_find_peek (tf, 0, 4); if (data && memcmp (data, "ajkg", 4) == 0) { gst_type_find_suggest (tf, GST_TYPE_FIND_MAXIMUM, SHN_CAPS); @@ -2467,7 +2470,7 @@ static GstStaticCaps ape_caps = GST_STATIC_CAPS ("application/x-ape"); static void ape_type_find (GstTypeFind * tf, gpointer unused) { - guint8 *data = gst_type_find_peek (tf, 0, 4); + const guint8 *data = gst_type_find_peek (tf, 0, 4); if (data && memcmp (data, "MAC ", 4) == 0) { gst_type_find_suggest (tf, GST_TYPE_FIND_LIKELY + 10, APE_CAPS); @@ -2484,7 +2487,7 @@ static GstStaticCaps m4a_caps = GST_STATIC_CAPS ("audio/x-m4a"); static void m4a_type_find (GstTypeFind * tf, gpointer unused) { - guint8 *data = gst_type_find_peek (tf, 4, 8); + const guint8 *data = gst_type_find_peek (tf, 4, 8); if (data && (memcmp (data, "ftypM4A ", 8) == 0)) { gst_type_find_suggest (tf, GST_TYPE_FIND_MAXIMUM, M4A_CAPS); @@ -2521,7 +2524,7 @@ q3gp_type_find (GstTypeFind * tf, gpointer unused) const gchar *profile; guint32 ftyp_size = 0; gint offset = 0; - guint8 *data = NULL; + const guint8 *data = NULL; if ((data = gst_type_find_peek (tf, 0, 12)) == NULL) { return; @@ -2571,7 +2574,7 @@ static GstStaticCaps jp2_caps = GST_STATIC_CAPS ("image/jp2"); static void jp2_type_find (GstTypeFind * tf, gpointer unused) { - guint8 *data; + const guint8 *data; data = gst_type_find_peek (tf, 0, 24); if (!data) @@ -2602,7 +2605,7 @@ static GstStaticCaps qt_caps = GST_STATIC_CAPS ("video/quicktime"); static void qt_type_find (GstTypeFind * tf, gpointer unused) { - guint8 *data; + const guint8 *data; guint tip = 0; guint64 offset = 0; guint64 size; @@ -2669,7 +2672,7 @@ qt_type_find (GstTypeFind * tf, gpointer unused) } } if (size == 1) { - guint8 *sizedata; + const guint8 *sizedata; sizedata = gst_type_find_peek (tf, offset + 8, 8); if (sizedata == NULL) @@ -2765,7 +2768,7 @@ static GstStaticCaps mod_caps = GST_STATIC_CAPS ("audio/x-mod"); static void mod_type_find (GstTypeFind * tf, gpointer unused) { - guint8 *data; + const guint8 *data; /* MOD */ if ((data = gst_type_find_peek (tf, 1080, 4)) != NULL) { @@ -2821,7 +2824,7 @@ mod_type_find (GstTypeFind * tf, gpointer unused) } /* DSM */ if (memcmp (data, "RIFF", 4) == 0) { - guint8 *data2 = gst_type_find_peek (tf, 8, 4); + const guint8 *data2 = gst_type_find_peek (tf, 8, 4); if (data2) { if (memcmp (data2, "DSMF", 4) == 0) { @@ -2832,7 +2835,7 @@ mod_type_find (GstTypeFind * tf, gpointer unused) } /* FAM */ if (memcmp (data, "FAM\xFE", 4) == 0) { - guint8 *data2 = gst_type_find_peek (tf, 44, 3); + const guint8 *data2 = gst_type_find_peek (tf, 44, 3); if (data2) { if (memcmp (data2, "compare", 3) == 0) { @@ -2846,7 +2849,7 @@ mod_type_find (GstTypeFind * tf, gpointer unused) } /* GDM */ if (memcmp (data, "GDM\xFE", 4) == 0) { - guint8 *data2 = gst_type_find_peek (tf, 71, 4); + const guint8 *data2 = gst_type_find_peek (tf, 71, 4); if (data2) { if (memcmp (data2, "GMFS", 4) == 0) { @@ -2877,7 +2880,7 @@ mod_type_find (GstTypeFind * tf, gpointer unused) if ((data = gst_type_find_peek (tf, 20, 8)) != NULL) { if (g_ascii_strncasecmp ((gchar *) data, "!Scream!", 8) == 0 || g_ascii_strncasecmp ((gchar *) data, "BMOD2STM", 8) == 0) { - guint8 *id, *stmtype; + const guint8 *id, *stmtype; if ((id = gst_type_find_peek (tf, 28, 1)) == NULL) return; @@ -2905,7 +2908,7 @@ GST_STATIC_CAPS ("application/x-shockwave-flash"); static void swf_type_find (GstTypeFind * tf, gpointer unused) { - guint8 *data = gst_type_find_peek (tf, 0, 4); + const guint8 *data = gst_type_find_peek (tf, 0, 4); if (data && (data[0] == 'F' || data[0] == 'C') && data[1] == 'W' && data[2] == 'S') { @@ -3096,7 +3099,7 @@ static GstStaticCaps tiff_le_caps = GST_STATIC_CAPS ("image/tiff, " static void tiff_type_find (GstTypeFind * tf, gpointer ununsed) { - guint8 *data = gst_type_find_peek (tf, 0, 8); + const guint8 *data = gst_type_find_peek (tf, 0, 8); guint8 le_header[4] = { 0x49, 0x49, 0x2A, 0x00 }; guint8 be_header[4] = { 0x4D, 0x4D, 0x00, 0x2A }; @@ -3213,7 +3216,7 @@ static GstStaticCaps sds_caps = GST_STATIC_CAPS ("audio/x-sds"); static void sds_type_find (GstTypeFind * tf, gpointer ununsed) { - guint8 *data = gst_type_find_peek (tf, 0, 4); + const guint8 *data = gst_type_find_peek (tf, 0, 4); guint8 mask[4] = { 0xFF, 0xFF, 0x80, 0xFF }; guint8 match[4] = { 0xF0, 0x7E, 0, 0x01 }; gint x; @@ -3234,7 +3237,7 @@ static GstStaticCaps ircam_caps = GST_STATIC_CAPS ("audio/x-ircam"); static void ircam_type_find (GstTypeFind * tf, gpointer ununsed) { - guint8 *data = gst_type_find_peek (tf, 0, 4); + const guint8 *data = gst_type_find_peek (tf, 0, 4); guint8 mask[4] = { 0xFF, 0xFF, 0xF8, 0xFF }; guint8 match[4] = { 0x64, 0xA3, 0x00, 0x00 }; gint x; @@ -3266,7 +3269,7 @@ static gboolean ebml_check_header (GstTypeFind * tf, const gchar * doctype, int doctype_len) { /* 4 bytes for EBML ID, 1 byte for header length identifier */ - guint8 *data = gst_type_find_peek (tf, 0, 4 + 1); + const guint8 *data = gst_type_find_peek (tf, 0, 4 + 1); gint len_mask = 0x80, size = 1, n = 1, total; if (!data) @@ -3394,7 +3397,7 @@ static GstStaticCaps dv_caps = GST_STATIC_CAPS ("video/x-dv, " static void dv_type_find (GstTypeFind * tf, gpointer private) { - guint8 *data; + const guint8 *data; data = gst_type_find_peek (tf, 0, 5); @@ -3426,7 +3429,7 @@ static GstStaticCaps ogg_annodex_caps = static void ogganx_type_find (GstTypeFind * tf, gpointer private) { - guint8 *data = gst_type_find_peek (tf, 0, 4); + const guint8 *data = gst_type_find_peek (tf, 0, 4); if ((data != NULL) && (memcmp (data, "OggS", 4) == 0)) { @@ -3448,7 +3451,7 @@ static GstStaticCaps vorbis_caps = GST_STATIC_CAPS ("audio/x-vorbis"); static void vorbis_type_find (GstTypeFind * tf, gpointer private) { - guint8 *data = gst_type_find_peek (tf, 0, 30); + const guint8 *data = gst_type_find_peek (tf, 0, 30); if (data) { guint blocksize_0; @@ -3493,7 +3496,7 @@ static GstStaticCaps theora_caps = GST_STATIC_CAPS ("video/x-theora"); static void theora_type_find (GstTypeFind * tf, gpointer private) { - guint8 *data = gst_type_find_peek (tf, 0, 7); //42); + const guint8 *data = gst_type_find_peek (tf, 0, 7); //42); if (data) { if (data[0] != 0x80) @@ -3510,7 +3513,7 @@ theora_type_find (GstTypeFind * tf, gpointer private) static void kate_type_find (GstTypeFind * tf, gpointer private) { - guint8 *data = gst_type_find_peek (tf, 0, 64); + const guint8 *data = gst_type_find_peek (tf, 0, 64); gchar category[16] = { 0, }; if (G_UNLIKELY (data == NULL)) @@ -3543,7 +3546,7 @@ GST_STATIC_CAPS ("application/x-ogm-video"); static void ogmvideo_type_find (GstTypeFind * tf, gpointer private) { - guint8 *data = gst_type_find_peek (tf, 0, 9); + const guint8 *data = gst_type_find_peek (tf, 0, 9); if (data) { if (memcmp (data, "\001video\000\000\000", 9) != 0) @@ -3558,7 +3561,7 @@ GST_STATIC_CAPS ("application/x-ogm-audio"); static void ogmaudio_type_find (GstTypeFind * tf, gpointer private) { - guint8 *data = gst_type_find_peek (tf, 0, 9); + const guint8 *data = gst_type_find_peek (tf, 0, 9); if (data) { if (memcmp (data, "\001audio\000\000\000", 9) != 0) @@ -3573,7 +3576,7 @@ static GstStaticCaps ogmtext_caps = GST_STATIC_CAPS ("application/x-ogm-text"); static void ogmtext_type_find (GstTypeFind * tf, gpointer private) { - guint8 *data = gst_type_find_peek (tf, 0, 9); + const guint8 *data = gst_type_find_peek (tf, 0, 9); if (data) { if (memcmp (data, "\001text\000\000\000\000", 9) != 0) @@ -3590,7 +3593,7 @@ static GstStaticCaps speex_caps = GST_STATIC_CAPS ("audio/x-speex"); static void speex_type_find (GstTypeFind * tf, gpointer private) { - guint8 *data = gst_type_find_peek (tf, 0, 80); + const guint8 *data = gst_type_find_peek (tf, 0, 80); if (data) { /* 8 byte string "Speex " @@ -3626,7 +3629,7 @@ static GstStaticCaps celt_caps = GST_STATIC_CAPS ("audio/x-celt"); static void celt_type_find (GstTypeFind * tf, gpointer private) { - guint8 *data = gst_type_find_peek (tf, 0, 8); + const guint8 *data = gst_type_find_peek (tf, 0, 8); if (data) { /* 8 byte string "CELT " */ @@ -3645,7 +3648,7 @@ GST_STATIC_CAPS ("application/x-ogg-skeleton, parsed=(boolean)FALSE"); static void oggskel_type_find (GstTypeFind * tf, gpointer private) { - guint8 *data = gst_type_find_peek (tf, 0, 12); + const guint8 *data = gst_type_find_peek (tf, 0, 12); if (data) { /* 8 byte string "fishead\0" for the ogg skeleton stream */ @@ -3671,7 +3674,7 @@ static void cmml_type_find (GstTypeFind * tf, gpointer private) { /* Header is 12 bytes minimum (though we don't check the minor version */ - guint8 *data = gst_type_find_peek (tf, 0, 12); + const guint8 *data = gst_type_find_peek (tf, 0, 12); if (data) { @@ -3698,7 +3701,7 @@ static GstStaticCaps tar_caps = GST_STATIC_CAPS ("application/x-tar"); static void tar_type_find (GstTypeFind * tf, gpointer unused) { - guint8 *data = gst_type_find_peek (tf, 257, 8); + const guint8 *data = gst_type_find_peek (tf, 257, 8); /* of course we are not certain, but we don't want other typefind funcs * to detect formats of files within the tar archive, e.g. mp3s */ @@ -3720,7 +3723,7 @@ static GstStaticCaps ar_caps = GST_STATIC_CAPS ("application/x-ar"); static void ar_type_find (GstTypeFind * tf, gpointer unused) { - guint8 *data = gst_type_find_peek (tf, 0, 24); + const guint8 *data = gst_type_find_peek (tf, 0, 24); if (data && memcmp (data, "!", 7) == 0) { gint i; @@ -3747,7 +3750,7 @@ static GstStaticCaps au_caps = GST_STATIC_CAPS ("audio/x-au"); static void au_type_find (GstTypeFind * tf, gpointer unused) { - guint8 *data = gst_type_find_peek (tf, 0, 4); + const guint8 *data = gst_type_find_peek (tf, 0, 4); if (data) { if (memcmp (data, ".snd", 4) == 0 || memcmp (data, "dns.", 4) == 0) { @@ -3769,7 +3772,7 @@ static GstStaticCaps nuv_caps = GST_STATIC_CAPS ("video/x-nuv"); static void nuv_type_find (GstTypeFind * tf, gpointer unused) { - guint8 *data = gst_type_find_peek (tf, 0, 11); + const guint8 *data = gst_type_find_peek (tf, 0, 11); if (data) { if (memcmp (data, "MythTVVideo", 11) == 0 @@ -3787,7 +3790,7 @@ static GstStaticCaps paris_caps = GST_STATIC_CAPS ("audio/x-paris"); static void paris_type_find (GstTypeFind * tf, gpointer unused) { - guint8 *data = gst_type_find_peek (tf, 0, 4); + const guint8 *data = gst_type_find_peek (tf, 0, 4); if (data) { if (memcmp (data, " paf", 4) == 0 || memcmp (data, "fap ", 4) == 0) { @@ -3804,7 +3807,7 @@ static GstStaticCaps ilbc_caps = GST_STATIC_CAPS ("audio/iLBC-sh"); static void ilbc_type_find (GstTypeFind * tf, gpointer unused) { - guint8 *data = gst_type_find_peek (tf, 0, 8); + const guint8 *data = gst_type_find_peek (tf, 0, 8); if (data) { if (memcmp (data, "#!iLBC30", 8) == 0 || memcmp (data, "#!iLBC20", 8) == 0) { @@ -3822,7 +3825,7 @@ GST_STATIC_CAPS ("application/x-ms-dos-executable"); static void msdos_type_find (GstTypeFind * tf, gpointer unused) { - guint8 *data = gst_type_find_peek (tf, 0, 64); + const guint8 *data = gst_type_find_peek (tf, 0, 64); if (data && data[0] == 'M' && data[1] == 'Z' && GST_READ_UINT16_LE (data + 8) == 4) { @@ -3849,7 +3852,7 @@ mmsh_type_find (GstTypeFind * tf, gpointer unused) 0xcf, 0x11, 0xa6, 0xd9, 0x00, 0xaa, 0x00, 0x62, 0xce, 0x6c }; - guint8 *data; + const guint8 *data; data = gst_type_find_peek (tf, 0, 2 + 2 + 4 + 2 + 2 + 16); if (data && data[0] == 0x24 && data[1] == 0x48 && @@ -3871,7 +3874,7 @@ static GstStaticCaps dirac_caps = GST_STATIC_CAPS ("video/x-dirac"); static void dirac_type_find (GstTypeFind * tf, gpointer unused) { - guint8 *data = gst_type_find_peek (tf, 0, 8); + const guint8 *data = gst_type_find_peek (tf, 0, 8); if (data) { if (memcmp (data, "BBCD", 4) == 0 || memcmp (data, "KW-DIRAC", 8) == 0) { @@ -3892,7 +3895,7 @@ vivo_type_find (GstTypeFind * tf, gpointer unused) static const guint8 vivo_marker[] = { 'V', 'e', 'r', 's', 'i', 'o', 'n', ':', 'V', 'i', 'v', 'o', '/' }; - guint8 *data; + const guint8 *data; guint hdr_len, pos; data = gst_type_find_peek (tf, 0, 1024); @@ -3930,7 +3933,7 @@ xdgmime_typefind (GstTypeFind * find, gpointer user_data) gchar *mimetype; gsize length = 16384; guint64 tf_length; - guint8 *data; + const guint8 *data; gchar *tmp; if ((tf_length = gst_type_find_get_length (find)) > 0) @@ -3982,7 +3985,7 @@ xdgmime_typefind (GstTypeFind * find, gpointer user_data) static void windows_icon_typefind (GstTypeFind * find, gpointer user_data) { - guint8 *data; + const guint8 *data; gint64 datalen; guint16 type, nimages; gint32 size, offset; @@ -4024,7 +4027,7 @@ windows_icon_typefind (GstTypeFind * find, gpointer user_data) static void wbmp_typefind (GstTypeFind * find, gpointer user_data) { - guint8 *data; + const guint8 *data; gint64 datalen; guint w, h, size; @@ -4142,7 +4145,7 @@ static void start_with_type_find (GstTypeFind * tf, gpointer private) { GstTypeFindData *start_with = (GstTypeFindData *) private; - guint8 *data; + const guint8 *data; GST_LOG ("trying to find mime type %s with the first %u bytes of data", gst_structure_get_name (gst_caps_get_structure (start_with->caps, 0)), @@ -4182,7 +4185,7 @@ static void riff_type_find (GstTypeFind * tf, gpointer private) { GstTypeFindData *riff_data = (GstTypeFindData *) private; - guint8 *data = gst_type_find_peek (tf, 0, 12); + const guint8 *data = gst_type_find_peek (tf, 0, 12); if (data && (memcmp (data, "RIFF", 4) == 0 || memcmp (data, "AVF0", 4) == 0)) { data += 8; -- 2.7.4