From b963ccb92992de3941bce9c6cfc3ed70b651f1e6 Mon Sep 17 00:00:00 2001 From: Zhao Halley Date: Wed, 18 Jan 2012 10:23:41 +0100 Subject: [PATCH] profile: match video/x-h263 as H.263 Baseline profile. 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 --- gst-libs/gst/vaapi/gstvaapiprofile.c | 10 +++++++++- gst-libs/gst/vaapi/gstvaapiworkarounds.h | 6 ++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/gst-libs/gst/vaapi/gstvaapiprofile.c b/gst-libs/gst/vaapi/gstvaapiprofile.c index 1c95bbb..e3cddd3 100644 --- a/gst-libs/gst/vaapi/gstvaapiprofile.c +++ b/gst-libs/gst/vaapi/gstvaapiprofile.c @@ -29,6 +29,7 @@ #include #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; diff --git a/gst-libs/gst/vaapi/gstvaapiworkarounds.h b/gst-libs/gst/vaapi/gstvaapiworkarounds.h index b060b13..a7276f4 100644 --- a/gst-libs/gst/vaapi/gstvaapiworkarounds.h +++ b/gst-libs/gst/vaapi/gstvaapiworkarounds.h @@ -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 */ -- 2.7.4