display: report H.263 Baseline profile.

HACK: expose GST_VAAPI_PROFILE_H263_BASELINE for decoding if MPEG-4:2 Simple
profile (VAProfileMPEG4Simple) is supported.
This commit is contained in:
Gwenole Beauchesne 2012-01-18 10:22:58 +01:00
parent 29623239b9
commit c42ba571a8
2 changed files with 38 additions and 0 deletions

View file

@ -30,6 +30,7 @@
#include "gstvaapiutils.h"
#include "gstvaapidisplay.h"
#include "gstvaapidisplay_priv.h"
#include "gstvaapiworkarounds.h"
#define DEBUG 1
#include "gstvaapidebug.h"
@ -182,6 +183,36 @@ find_config(
return FALSE;
}
/* HACK: append H.263 Baseline profile if MPEG-4:2 Simple profile is supported */
static void
append_h263_config(GArray *configs)
{
GstVaapiConfig *config, tmp_config;
GstVaapiConfig *mpeg4_simple_config = NULL;
GstVaapiConfig *h263_baseline_config = NULL;
guint i;
if (!WORKAROUND_H263_BASELINE_DECODE_PROFILE)
return;
if (!configs)
return;
for (i = 0; i < configs->len; i++) {
config = &g_array_index(configs, GstVaapiConfig, i);
if (config->profile == GST_VAAPI_PROFILE_MPEG4_SIMPLE)
mpeg4_simple_config = config;
else if (config->profile == GST_VAAPI_PROFILE_H263_BASELINE)
h263_baseline_config = config;
}
if (mpeg4_simple_config && !h263_baseline_config) {
tmp_config = *mpeg4_simple_config;
tmp_config.profile = GST_VAAPI_PROFILE_H263_BASELINE;
g_array_append_val(configs, tmp_config);
}
}
/* Convert configs array to profiles as GstCaps */
static GstCaps *
get_profile_caps(GArray *configs)
@ -439,6 +470,7 @@ gst_vaapi_display_create(GstVaapiDisplay *display)
}
}
}
append_h263_config(priv->decoders);
/* VA image formats */
formats = g_new(VAImageFormat, vaMaxNumImageFormats(priv->display));

View file

@ -24,6 +24,12 @@
G_BEGIN_DECLS
/*
* Workaround to expose H.263 Baseline decode profile for drivers that
* support MPEG-4:2 Simple profile decoding.
*/
#define WORKAROUND_H263_BASELINE_DECODE_PROFILE (1)
G_END_DECLS
#endif /* GST_VAAPI_WORKAROUNDS_H */