fix x-wmv format string
authorWim Taymans <wim.taymans@collabora.co.uk>
Wed, 27 Jun 2012 09:23:19 +0000 (11:23 +0200)
committerWim Taymans <wim.taymans@collabora.co.uk>
Wed, 27 Jun 2012 09:23:19 +0000 (11:23 +0200)
gst/asfmux/gstasfmux.c
sys/dshowdecwrapper/gstdshowvideodec.cpp

index 78b17de..c7d6743 100644 (file)
@@ -2200,27 +2200,25 @@ gst_asf_mux_video_set_caps (GstPad * pad, GstCaps * caps)
   }
 
   if (strcmp (caps_name, "video/x-wmv") == 0) {
-    guint32 fourcc;
+    gint wmvversion;
+    const gchar *fstr;
 
     videopad->vidinfo.bit_cnt = 24;
 
-    /* in case we have a fourcc, we use it */
-    if (gst_structure_get_uint (structure, "format", &fourcc)) {
-      videopad->vidinfo.compression = fourcc;
-    } else {
-      gint version;
-      if (!gst_structure_get_int (structure, "wmvversion", &version))
-        goto refuse_caps;
-      if (version == 2) {
+    /* in case we have a format, we use it */
+    fstr = gst_structure_get_string (structure, "format");
+    if (fstr && strlen (fstr) == 4) {
+      videopad->vidinfo.compression = GST_STR_FOURCC (fstr);
+    } else if (gst_structure_get_int (structure, "wmvversion", &wmvversion)) {
+      if (wmvversion == 2) {
         videopad->vidinfo.compression = GST_MAKE_FOURCC ('W', 'M', 'V', '2');
-      } else if (version == 1) {
+      } else if (wmvversion == 1) {
         videopad->vidinfo.compression = GST_MAKE_FOURCC ('W', 'M', 'V', '1');
-      } else if (version == 3) {
+      } else if (wmvversion == 3) {
         videopad->vidinfo.compression = GST_MAKE_FOURCC ('W', 'M', 'V', '3');
-      } else {
-        goto refuse_caps;
       }
-    }
+    } else
+      goto refuse_caps;
   } else {
     goto refuse_caps;
   }
index 2b90b6e..9ea1d5f 100644 (file)
@@ -161,7 +161,7 @@ static const VideoCodecEntry video_dec_codecs[] = {
   {"dshowvdec_wmv3", "Windows Media Video 9",
    GST_MAKE_FOURCC ('W', 'M', 'V', '3'),
    GUID_MEDIATYPE_VIDEO, GUID_MEDIASUBTYPE_WMVV3,
-   "video/x-wmv, wmvversion = (int) 3, " "format = (fourcc) WMV3",
+   "video/x-wmv, wmvversion = (int) 3, " "format = (string) WMV3",
    GUID_MEDIATYPE_VIDEO, GUID_MEDIASUBTYPE_YUY2,
    "video/x-raw-yuv, format=(fourcc)YUY2",
    preferred_wmv_filters},
@@ -169,7 +169,7 @@ static const VideoCodecEntry video_dec_codecs[] = {
   {"dshowvdec_wmvp", "Windows Media Video 9 Image",
    GST_MAKE_FOURCC ('W', 'M', 'V', 'P'),
    GUID_MEDIATYPE_VIDEO, GUID_MEDIASUBTYPE_WMVP,
-   "video/x-wmv, wmvversion = (int) 3, " "format = (fourcc) { WMVP, MSS1 }",
+   "video/x-wmv, wmvversion = (int) 3, " "format = (string) { WMVP, MSS1 }",
    GUID_MEDIATYPE_VIDEO, GUID_MEDIASUBTYPE_YUY2,
    "video/x-raw-yuv, format=(fourcc)YUY2",
    preferred_wmv_filters},
@@ -177,7 +177,7 @@ static const VideoCodecEntry video_dec_codecs[] = {
   {"dshowvdec_wmva", "Windows Media Video 9 Advanced",
    GST_MAKE_FOURCC ('W', 'M', 'V', 'A'),
    GUID_MEDIATYPE_VIDEO, GUID_MEDIASUBTYPE_WMVA,
-   "video/x-wmv, wmvversion = (int) 3, " "format = (fourcc) WMVA",
+   "video/x-wmv, wmvversion = (int) 3, " "format = (string) WMVA",
    GUID_MEDIATYPE_VIDEO, GUID_MEDIASUBTYPE_YUY2,
    "video/x-raw-yuv, format=(fourcc)YUY2",
    preferred_wmv_filters},
@@ -185,7 +185,7 @@ static const VideoCodecEntry video_dec_codecs[] = {
    {"dshowvdec_wvc1", "Windows Media VC1 video",
    GST_MAKE_FOURCC ('W', 'V', 'C', '1'),
    GUID_MEDIATYPE_VIDEO, GUID_MEDIASUBTYPE_WVC1,
-   "video/x-wmv, wmvversion = (int) 3, " "format = (fourcc) WVC1",
+   "video/x-wmv, wmvversion = (int) 3, " "format = (string) WVC1",
    GUID_MEDIATYPE_VIDEO, GUID_MEDIASUBTYPE_YUY2,
    "video/x-raw-yuv, format=(fourcc)YUY2",
    preferred_wmv_filters},