From 3b118e2c4501a69a2a5f4f37e1b26bf9d19efad4 Mon Sep 17 00:00:00 2001 From: He Junyan Date: Fri, 10 Apr 2020 22:20:35 +0800 Subject: [PATCH] plugin: use register_type to replace get_type for encode init. xxx_register_type will detect the template sink caps and is needed to be called at init time. Part-of: --- gst/vaapi/gstvaapi.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/gst/vaapi/gstvaapi.c b/gst/vaapi/gstvaapi.c index 71bdacf4d2..2a34ae6284 100644 --- a/gst/vaapi/gstvaapi.c +++ b/gst/vaapi/gstvaapi.c @@ -130,14 +130,14 @@ struct _GstVaapiEncoderMap GstVaapiCodec codec; guint rank; const gchar *name; - GType (*get_type) (void); + GType (*register_type) (GstVaapiDisplay * display); }; #define DEF_ENC(CODEC,codec) \ {GST_VAAPI_CODEC_##CODEC, \ GST_RANK_PRIMARY, \ "vaapi" G_STRINGIFY (codec) "enc", \ - gst_vaapiencode_##codec##_get_type} + gst_vaapiencode_##codec##_register_type} static const GstVaapiEncoderMap vaapi_encode_map[] = { DEF_ENC (H264, h264), @@ -168,7 +168,8 @@ gst_vaapiencode_register (GstPlugin * plugin, GstVaapiDisplay * display) for (j = 0; j < G_N_ELEMENTS (vaapi_encode_map); j++) { if (vaapi_encode_map[j].codec == codec) { gst_element_register (plugin, vaapi_encode_map[j].name, - vaapi_encode_map[j].rank, vaapi_encode_map[j].get_type ()); + vaapi_encode_map[j].rank, + vaapi_encode_map[j].register_type (display)); break; } }