typefind: extract SOF marker in jpeg typefinder
authorPhilip Jägenstedt <philipj@opera.com>
Tue, 26 Apr 2011 20:20:29 +0000 (22:20 +0200)
committerTim-Philipp Müller <tim.muller@collabora.co.uk>
Fri, 28 Oct 2011 08:45:02 +0000 (09:45 +0100)
The SOF types are defined by http://www.w3.org/Graphics/JPEG/itu-t81.pdf

This is needed to make sure that we plug a jpeg decoder that
can handle the type of JPEG we have (e.g. lossless JPEG)

https://bugzilla.gnome.org/show_bug.cgi?id=556648

gst/typefind/gsttypefindfunctions.c

index 2e2a567..1675add 100644 (file)
@@ -3012,7 +3012,9 @@ jpeg_type_find (GstTypeFind * tf, gpointer unused)
         prob = GST_TYPE_FIND_LIKELY;
 
       gst_caps_set_simple (caps, "width", G_TYPE_INT, w,
-          "height", G_TYPE_INT, h, NULL);
+          "height", G_TYPE_INT, h, "sof-marker", G_TYPE_INT, marker & 0xf,
+          NULL);
+
       break;
     } else {
       GST_WARNING ("bad length or unexpected JPEG marker 0xff 0x%02x", marker);