[gst-devel] typefinding

Benjamin Otte in7y118 at public.uni-hamburg.de
Mon Oct 27 05:14:07 CET 2003


On Mon, 27 Oct 2003, Ronald Bultje wrote:

> In bugzilla, there's a bug because of files that have an ID3v2 header at
> offset 512 instead of at the beginning of the file. We need to support
> this too, I'm affraid, so you might want to request a bigger buffer and
> scan the whole buffer for the ID3v2 header... Yeah, this sucks, I know.
> ;).
>
I'm going to read the spec on that in think very closely about supporting
those files, but if it's common, I guess it's ok.

> Lastly, why is the offset for id3v1 -128 bytes?
>
Because an ID3v1 tag appears at the end of the file, not at the beginning.
It's the last 128 bytes of the file.

> #define WAV_CAPS GST_CAPS_NEW ("wav_type_find", "audio/x-wav", NULL)
> static void
> wav_type_find (GstTypeFind *tf, gpointer unused)
> {
>   guint8 *data = gst_type_find_peek (tf, 0, 4);
>
>   if (data) {
>     if (memcmp (data, "RIFF", 4) == 0) {
>       data = gst_type_find_peek (tf, 8, 4);
>       if (data) {
> 	if (memcmp (data, "WAVE", 4) == 0)
> 	  gst_type_find_suggest (tf, GST_TYPE_FIND_MAXIMUM, AVI_CAPS);
>       } else {
> 	gst_type_find_suggest (tf, GST_TYPE_FIND_POSSIBLE, AVI_CAPS);
>       }
>     }
>   }
> }
>
> This should be WAV_CAPS, not AVI_CAPS. Also, note that you see "RIFF" as
> POSSIBLE (50). I personally see no reason to make this more than 10 or
> even 1, since RIFF is a generic storage format. You might laugh at this
> now, but back in college, I've used RIFF as a network data transport
> protocol. ;).
>
Thanks for pointing out that bug, most of the typefind functions werre a
copy/paste job.
Yeah, we probably don't want to suggest something on just reading "RIFF".
I'll change that.

> Last point: matroska typefinding isn't in there. You probably want to
> move that over, too. It doesn't depend on the lib. (Btw: matroska
> typefinding is semi-broken, it only detects 50% of the files out there,
> but I'll fix that soon... :) ).
>
I only fixed plugins I have installed as I can't test the other. And I
don't have matroska installed. Audiofile is anopther example that's not
yet converted.

Benjamin

> Ronald
>
> --
> Ronald Bultje <rbultje at ronald.bitfreak.net>
> Linux Video/Multimedia developer
>
>





More information about the gstreamer-devel mailing list