profile: match video/x-h263 as H.263 Baseline profile.
authorZhao Halley <halley.zhao@intel.com>
Wed, 18 Jan 2012 09:23:41 +0000 (10:23 +0100)
committerGwenole Beauchesne <gwenole.beauchesne@intel.com>
Tue, 24 Jan 2012 09:15:00 +0000 (10:15 +0100)
HACK: qtdemux does not report profiles for H.263. So, assume plain
"video/x-h263" is H.263 Baseline profile.

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
gst-libs/gst/vaapi/gstvaapiprofile.c
gst-libs/gst/vaapi/gstvaapiworkarounds.h

index 1c95bbb..e3cddd3 100644 (file)
@@ -29,6 +29,7 @@
 #include <gst/gstbuffer.h>
 #include "gstvaapicompat.h"
 #include "gstvaapiprofile.h"
+#include "gstvaapiworkarounds.h"
 
 typedef struct _GstVaapiProfileMap              GstVaapiProfileMap;
 typedef struct _GstVaapiEntrypointMap           GstVaapiEntrypointMap;
@@ -245,11 +246,18 @@ gst_vaapi_profile_from_caps(GstCaps *caps)
                 strcmp(profile_str, m->profile_str) == 0)
                 profile = best_profile;
         }
-        if (!profile)
+        if (!profile) {
             profile = gst_vaapi_profile_from_codec_data(
                 gst_vaapi_profile_get_codec(m->profile),
                 codec_data
             );
+            if (!profile &&
+                WORKAROUND_QTDEMUX_NO_H263_PROFILES &&
+                strncmp(name, "video/x-h263", namelen) == 0) {
+                /* HACK: qtdemux does not report profiles for h263 */
+                profile = m->profile;
+            }
+        }
         gst_caps_unref(caps_test);
     }
     return profile ? profile : best_profile;
index b060b13..a7276f4 100644 (file)
@@ -30,6 +30,12 @@ G_BEGIN_DECLS
  */
 #define WORKAROUND_H263_BASELINE_DECODE_PROFILE (1)
 
+/*
+ * Workaround for qtdemux that does not report profiles for
+ * video/x-h263. Assume H.263 Baseline profile in this case.
+ */
+#define WORKAROUND_QTDEMUX_NO_H263_PROFILES (1)
+
 G_END_DECLS
 
 #endif /* GST_VAAPI_WORKAROUNDS_H */