Commit 3b118e2c authored by He Junyan's avatar He Junyan Committed by Víctor Manuel Jáquez Leal

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: <!315>
parent 0b57e6e0
Pipeline #147742 waiting for manual action with stages
in 18 seconds
......@@ -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;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment