Commit 2a18fb35 authored by Tim-Philipp Müller's avatar Tim-Philipp Müller
Browse files

gst/typefind/gsttypefindfunctions.c: Add typefinder for VIVO files (my...

gst/typefind/gsttypefindfunctions.c: Add typefinder for VIVO files (my christmas present to the 90s).

Original commit message from CVS:
* gst/typefind/gsttypefindfunctions.c: (vivo_type_find),
(plugin_init):
Add typefinder for VIVO files (my christmas present to the 90s).
parent a4c0d0b8
2006-12-20 Tim-Philipp Müller <tim at centricular dot net>
* gst/typefind/gsttypefindfunctions.c: (vivo_type_find),
(plugin_init):
Add typefinder for VIVO files (my christmas present to the 90s).
2006-12-16 Tim-Philipp Müller <tim at centricular dot net>
 
* gst/playback/gstdecodebin.c: (type_found):
......@@ -2430,6 +2430,47 @@ mmsh_type_find (GstTypeFind * tf, gpointer unused)
}
}
/*** video/vivo ***/
static GstStaticCaps vivo_caps = GST_STATIC_CAPS ("video/vivo");
#define VIVO_CAPS gst_static_caps_get(&vivo_caps)
static void
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;
guint hdr_len, pos;
data = gst_type_find_peek (tf, 0, 1024);
if (data == NULL || data[0] != 0x00)
return;
if ((data[1] & 0x80)) {
if ((data[2] & 0x80))
return;
hdr_len = ((guint) (data[1] & 0x7f)) << 7;
hdr_len += data[2];
if (hdr_len > 2048)
return;
pos = 3;
} else {
hdr_len = data[1];
pos = 2;
}
/* 1008 = 1022 - strlen ("Version:Vivo/") - 1 */
while (pos < 1008 && data[pos] == '\r' && data[pos + 1] == '\n')
pos += 2;
if (memcmp (data + pos, vivo_marker, sizeof (vivo_marker)) == 0) {
gst_type_find_suggest (tf, GST_TYPE_FIND_MAXIMUM, VIVO_CAPS);
}
}
/*** generic typefind for streams that have some data at a specific position***/
typedef struct
{
......@@ -2798,6 +2839,8 @@ plugin_init (GstPlugin * plugin)
multipart_type_find, NULL, MULTIPART_CAPS, NULL, NULL);
TYPE_FIND_REGISTER (plugin, "application/x-mmsh", GST_RANK_SECONDARY,
mmsh_type_find, NULL, MMSH_CAPS, NULL, NULL);
TYPE_FIND_REGISTER (plugin, "video/vivo", GST_RANK_SECONDARY,
vivo_type_find, NULL, VIVO_CAPS, NULL, NULL);
return TRUE;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment