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 <gwenole.beauchesne@intel.com>
This commit is contained in:
Zhao Halley 2012-01-18 10:23:41 +01:00 committed by Gwenole Beauchesne
parent c42ba571a8
commit b963ccb929
2 changed files with 15 additions and 1 deletions

View 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;

View 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 */