Fix decoder caps to report codec aliases.
authorgb <gb@5584edef-b1fe-4b99-b61b-dd2bab72e969>
Sun, 16 May 2010 21:17:49 +0000 (21:17 +0000)
committerGwenole Beauchesne <gbeauchesne@splitted-desktop.com>
Mon, 20 Sep 2010 10:55:46 +0000 (12:55 +0200)
NEWS
README
gst-libs/gst/vaapi/gstvaapiprofile.c

diff --git a/NEWS b/NEWS
index 43e6745..e6ece4b 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,7 @@ Copyright (C) 2010 Splitted-Desktop Systems
 
 Version 0.2.3 - DD.May.2010
 * Fix memory leak of encoded buffers
+* Fix decoder caps to report codec aliases
 * Fix VC-1 decoding through the playbin2 pipeline
 
 Version 0.2.2 - 14.May.2010
diff --git a/README b/README
index 3c4fed1..9a28115 100644 (file)
--- a/README
+++ b/README
@@ -71,4 +71,3 @@ Caveats
 -------
 
   * No ad-hoc parser, vaapidecoder currently relies on FFmpeg
-  * MPEG-4 Part-2 (DivX) has decoding bugs
index 1c9f561..40c9760 100644 (file)
@@ -285,18 +285,27 @@ gst_vaapi_profile_get_va_profile(GstVaapiProfile profile)
 GstCaps *
 gst_vaapi_profile_get_caps(GstVaapiProfile profile)
 {
-    const GstVaapiProfileMap * const m = get_profiles_map(profile);
-    GstCaps *caps;
-
-    if (!m)
-        return NULL;
+    const GstVaapiProfileMap *m;
+    GstCaps *out_caps, *caps;
 
-    caps = gst_caps_from_string(m->caps_str);
-    if (!caps)
+    out_caps = gst_caps_new_empty();
+    if (!out_caps)
         return NULL;
 
-    gst_caps_set_simple(caps, "profile", G_TYPE_STRING, m->profile_str, NULL);
-    return caps;
+    for (m = gst_vaapi_profiles; m->profile; m++) {
+        if (m->profile != profile)
+            continue;
+        caps = gst_caps_from_string(m->caps_str);
+        if (!caps)
+            continue;
+        gst_caps_set_simple(
+            caps,
+            "profile", G_TYPE_STRING, m->profile_str,
+            NULL
+        );
+        gst_caps_merge(out_caps, caps);
+    }
+    return out_caps;
 }
 
 /**