GstV4l2Iterator *it;
gint video_fd = -1;
struct v4l2_capability vcap;
- gboolean ret = TRUE;
guint32 device_caps;
it = gst_v4l2_iterator_new ();
basename = g_path_get_basename (it->device_path);
- if (gst_v4l2_is_video_dec (sink_caps, src_caps))
- ret = gst_v4l2_video_dec_register (plugin, basename, it->device_path,
+ if (gst_v4l2_is_video_dec (sink_caps, src_caps)) {
+ gst_v4l2_video_dec_register (plugin, basename, it->device_path,
sink_caps, src_caps);
- else if (gst_v4l2_is_h264_enc (sink_caps, src_caps))
- ret = gst_v4l2_h264_enc_register (plugin, basename, it->device_path,
+ } else if (gst_v4l2_is_h264_enc (sink_caps, src_caps)) {
+ gst_v4l2_h264_enc_register (plugin, basename, it->device_path,
sink_caps, src_caps);
- else if (gst_v4l2_is_transform (sink_caps, src_caps))
- ret = gst_v4l2_transform_register (plugin, basename, it->device_path,
+ } else if (gst_v4l2_is_transform (sink_caps, src_caps)) {
+ gst_v4l2_transform_register (plugin, basename, it->device_path,
sink_caps, src_caps);
+ }
/* else if ( ... etc. */
gst_caps_unref (sink_caps);
gst_caps_unref (src_caps);
g_free (basename);
-
- if (!ret)
- break;
}
if (video_fd >= 0)
gst_v4l2_iterator_free (it);
- return ret;
+ return TRUE;
}
#endif
return ret;
}
-gboolean
+void
gst_v4l2_h264_enc_register (GstPlugin * plugin, const gchar * basename,
const gchar * device_path, GstCaps * sink_caps, GstCaps * src_caps)
{
- return gst_v4l2_video_enc_register (plugin, GST_TYPE_V4L2_H264_ENC,
+ gst_v4l2_video_enc_register (plugin, GST_TYPE_V4L2_H264_ENC,
"h264", basename, device_path, sink_caps,
gst_static_caps_get (&src_template_caps), src_caps);
}
gboolean gst_v4l2_is_h264_enc (GstCaps * sink_caps, GstCaps * src_caps);
-gboolean gst_v4l2_h264_enc_register (GstPlugin * plugin, const gchar * basename,
+void gst_v4l2_h264_enc_register (GstPlugin * plugin, const gchar * basename,
const gchar * device_path, GstCaps * sink_caps, GstCaps * src_caps);
G_END_DECLS
return ret;
}
-gboolean
+void
gst_v4l2_transform_register (GstPlugin * plugin, const gchar * basename,
const gchar * device_path, GstCaps * sink_caps, GstCaps * src_caps)
{
type_name = g_strdup_printf ("v4l2%sconvert", basename);
subtype = g_type_register_static (type, type_name, &type_info, 0);
- gst_element_register (plugin, type_name, GST_RANK_NONE, subtype);
+ if (!gst_element_register (plugin, type_name, GST_RANK_NONE, subtype))
+ GST_WARNING ("Failed to register plugin '%s'", type_name);
g_free (type_name);
-
- return TRUE;
}
GType gst_v4l2_transform_get_type (void);
gboolean gst_v4l2_is_transform (GstCaps * sink_caps, GstCaps * src_caps);
-gboolean gst_v4l2_transform_register (GstPlugin * plugin,
+void gst_v4l2_transform_register (GstPlugin * plugin,
const gchar *basename,
const gchar *device_path,
GstCaps * sink_caps, GstCaps * src_caps);
#undef SET_META
}
-gboolean
+void
gst_v4l2_video_dec_register (GstPlugin * plugin, const gchar * basename,
const gchar * device_path, GstCaps * sink_caps, GstCaps * src_caps)
{
type_info.instance_init = gst_v4l2_video_dec_subinstance_init;
subtype = g_type_register_static (type, type_name, &type_info, 0);
- gst_element_register (plugin, type_name, GST_RANK_PRIMARY + 1, subtype);
+ if (!gst_element_register (plugin, type_name, GST_RANK_PRIMARY + 1,
+ subtype))
+ GST_WARNING ("Failed to register plugin '%s'", type_name);
g_free (type_name);
}
-
- return TRUE;
}
GType gst_v4l2_video_dec_get_type (void);
gboolean gst_v4l2_is_video_dec (GstCaps * sink_caps, GstCaps * src_caps);
-gboolean gst_v4l2_video_dec_register (GstPlugin * plugin,
+void gst_v4l2_video_dec_register (GstPlugin * plugin,
const gchar *basename,
const gchar *device_path,
GstCaps * sink_caps, GstCaps * src_caps);
}
/* Probing functions */
-gboolean
+void
gst_v4l2_video_enc_register (GstPlugin * plugin, GType type,
const char *codec, const gchar * basename, const gchar * device_path,
GstCaps * sink_caps, GstCaps * codec_caps, GstCaps * src_caps)
}
subtype = g_type_register_static (type, type_name, &type_info, 0);
- gst_element_register (plugin, type_name, GST_RANK_PRIMARY + 1, subtype);
- g_free (type_name);
+ if (!gst_element_register (plugin, type_name, GST_RANK_PRIMARY + 1, subtype))
+ GST_WARNING ("Failed to register plugin '%s'", type_name);
- return TRUE;
+ g_free (type_name);
}
GType gst_v4l2_video_enc_get_type (void);
-gboolean gst_v4l2_video_enc_register (GstPlugin * plugin, GType type,
+void gst_v4l2_video_enc_register (GstPlugin * plugin, GType type,
const char *codec, const gchar * basename, const gchar * device_path,
GstCaps * sink_caps, GstCaps *codec_caps, GstCaps * src_caps);