documentation: fixed a heap o' typos
[platform/upstream/gstreamer.git] / sys / winks / ksvideohelpers.c
index 8f51e50..a5b53c1 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) 2007 Haakon Sporsheim <hakon.sporsheim@tandberg.com>
- *               2008 Ole André Vadla Ravnås <ole.andre.ravnas@tandberg.com>
+ *               2008 Ole André Vadla Ravnås <ole.andre.ravnas@tandberg.com>
  *               2009 Knut Inge Hvidsten <knut.inge.hvidsten@tandberg.com>
  *
  * This library is free software; you can redistribute it and/or
@@ -164,10 +164,16 @@ ks_video_format_to_structure (GUID subtype_guid, GUID format_guid,
     GST_WARNING ("Unsupported video format ARGB4444");
   } else if (memcmp (&subtype_guid.Data2, &MEDIASUBTYPE_FOURCC.Data2,
           sizeof (subtype_guid) - sizeof (subtype_guid.Data1)) == 0) {
-    guint8 *p = (guint8 *) & subtype_guid.Data1;
-    gchar *format = g_strdup_printf ("%c%c%c%c", p[0], p[1], p[2], p[3]);
-    structure = gst_structure_new ("video/x-raw", "format",
-        G_TYPE_STRING, format, NULL);
+    guint32 fourcc = subtype_guid.Data1;
+    gchar *format =
+        g_strdup_printf ("%" GST_FOURCC_FORMAT, GST_FOURCC_ARGS (fourcc));
+    if (GST_STR_FOURCC (format) == GST_MAKE_FOURCC ('Y', '1', '6', ' ')) {
+      structure = gst_structure_new ("video/x-raw", "format",
+          G_TYPE_STRING, "GRAY16_LE", NULL);
+    } else {
+      structure = gst_structure_new ("video/x-raw", "format",
+          G_TYPE_STRING, format, NULL);
+    }
     g_free (format);
   } else if (IsEqualGUID (&subtype_guid, &MEDIASUBTYPE_dvsd)) {
     if (IsEqualGUID (&format_guid, &FORMAT_DvInfo)) {
@@ -206,7 +212,7 @@ static void
 guess_aspect (gint width, gint height, gint * par_width, gint * par_height)
 {
   /*
-   * As we dont have access to the actual pixel aspect, we will try to do a
+   * As we don't have access to the actual pixel aspect, we will try to do a
    * best-effort guess. The guess is based on most sensors being either 4/3
    * or 16/9, and most pixel aspects being close to 1/1.
    */
@@ -460,7 +466,7 @@ ks_video_probe_filter_for_caps (HANDLE filter_handle)
           if (IsEqualGUID (&range->MajorFormat, &MEDIATYPE_Video)
               || IsEqualGUID (&range->MajorFormat, &MEDIATYPE_Interleaved)) {
             KsVideoMediaType *entry;
-            gpointer src_vscc, src_format;
+            gpointer src_vscc = NULL, src_format = NULL;
             GstStructure *media_structure;
 
             entry = g_new0 (KsVideoMediaType, 1);