return codecs;
}
+static GArray *
+display_get_decoder_codecs (GstVaapiDisplay * display)
+{
+ GArray *profiles, *codecs;
+
+ profiles = gst_vaapi_display_get_decode_profiles (display);
+ if (!profiles)
+ return NULL;
+
+ codecs = profiles_get_codecs (profiles);
+ g_array_unref (profiles);
+ return codecs;
+}
+
#if USE_ENCODERS
static GArray *
display_get_encoder_codecs (GstVaapiDisplay * display)
plugin_init (GstPlugin * plugin)
{
GstVaapiDisplay *display;
+ GArray *decoders;
plugin_add_dependencies (plugin);
if (!gst_vaapi_driver_is_whitelisted (display))
goto unsupported_driver;
- gst_vaapidecode_register (plugin);
+ decoders = display_get_decoder_codecs (display);
+ if (decoders) {
+ gst_vaapidecode_register (plugin, decoders);
+ g_array_unref (decoders);
+ }
if (gst_vaapi_display_has_video_processing (display)) {
gst_element_register (plugin, "vaapipostproc",
}
gboolean
-gst_vaapidecode_register (GstPlugin * plugin)
+gst_vaapidecode_register (GstPlugin * plugin, GArray * decoders)
{
gboolean ret = FALSE;
guint i, codec, rank;
rank = vaapi_decode_map[i].rank;
name = vaapi_decode_map[i].name;
+ if (codec && !gst_vaapi_codecs_has_codec (decoders, codec))
+ continue;
+
if (codec) {
type_name = g_strdup_printf ("GstVaapiDecode_%s", name);
element_name = g_strdup_printf ("vaapi%sdec", name);
GstVaapiPluginBaseClass parent_class;
};
-gboolean gst_vaapidecode_register (GstPlugin * plugin);
+gboolean gst_vaapidecode_register (GstPlugin * plugin, GArray * decoders);
G_END_DECLS