while (in_plugin) {
gchar *type_name;
- gchar *plugin_name;
/* only decoders */
if (!av_codec_is_decoder (in_plugin)
}
/* construct the type */
- plugin_name = g_strdup ((gchar *) in_plugin->name);
- g_strdelimit (plugin_name, NULL, '_');
- type_name = g_strdup_printf ("avdec_%s", plugin_name);
- g_free (plugin_name);
+ type_name = g_strdup_printf ("avdec_%s", in_plugin->name);
+ g_strdelimit (type_name, ".,|-<> ", '_');
type = g_type_from_name (type_name);
{
GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
AVInputFormat *in_plugin;
- gchar *p, *name;
GstCaps *sinkcaps;
GstPadTemplate *sinktempl, *audiosrctempl, *videosrctempl;
- gchar *longname, *description;
+ gchar *longname, *description, *name;
in_plugin = (AVInputFormat *)
g_type_get_qdata (G_OBJECT_CLASS_TYPE (klass), GST_FFDEMUX_PARAMS_QDATA);
g_assert (in_plugin != NULL);
- p = name = g_strdup (in_plugin->name);
- while (*p) {
- if (*p == '.' || *p == ',')
- *p = '_';
- p++;
- }
+ name = g_strdup (in_plugin->name);
+ g_strdelimit (name, ".,|-<> ", '_');
/* construct the element details struct */
longname = g_strdup_printf ("libav %s demuxer", in_plugin->long_name);
while (in_plugin) {
gchar *type_name, *typefind_name;
- gchar *p, *name = NULL;
gint rank;
gboolean register_typefind_func = TRUE;
goto next;
}
- p = name = g_strdup (in_plugin->name);
- while (*p) {
- if (*p == '.' || *p == ',')
- *p = '_';
- p++;
- }
-
/* construct the type */
- type_name = g_strdup_printf ("avdemux_%s", name);
+ type_name = g_strdup_printf ("avdemux_%s", in_plugin->name);
+ g_strdelimit (type_name, ".,|-<> ", '_');
/* if it's already registered, drop it */
if (g_type_from_name (type_name)) {
goto next;
}
- typefind_name = g_strdup_printf ("avtype_%s", name);
+ typefind_name = g_strdup_printf ("avtype_%s", in_plugin->name);
+ g_strdelimit (typefind_name, ".,|-<> ", '_');
/* create the type now */
type = g_type_register_static (GST_TYPE_ELEMENT, type_name, &typeinfo, 0);
!gst_type_find_register (plugin, typefind_name, rank,
gst_ffmpegdemux_type_find, extensions, NULL, in_plugin,
NULL))) {
- g_warning ("Register of type avdemux_%s failed", name);
+ g_warning ("Registration of type %s failed", type_name);
g_free (type_name);
g_free (typefind_name);
g_free (extensions);
- g_free (name);
return FALSE;
}
g_free (extensions);
next:
- g_free (name);
in_plugin = av_iformat_next (in_plugin);
}
AVOutputFormat *in_plugin;
GstCaps *srccaps, *audiosinkcaps, *videosinkcaps;
enum AVCodecID *video_ids = NULL, *audio_ids = NULL;
- gchar *longname, *description;
+ gchar *longname, *description, *name;
const char *replacement;
gboolean is_formatter;
GST_FFMUX_PARAMS_QDATA);
g_assert (in_plugin != NULL);
+ name = g_strdup (in_plugin->name);
+ g_strdelimit (name, ".,|-<> ", '_');
+
/* construct the element details struct */
replacement = gst_ffmpegmux_get_replacement (in_plugin->name);
is_formatter = gst_ffmpegmux_is_formatter (in_plugin->name);
g_free (description);
/* Try to find the caps that belongs here */
- srccaps = gst_ffmpeg_formatid_to_caps (in_plugin->name);
+ srccaps = gst_ffmpeg_formatid_to_caps (name);
if (!srccaps) {
- GST_DEBUG ("Couldn't get source caps for muxer '%s', skipping format",
- in_plugin->name);
+ GST_DEBUG ("Couldn't get source caps for muxer '%s', skipping", name);
goto beach;
}
if (!gst_ffmpeg_formatid_get_codecids (in_plugin->name,
&video_ids, &audio_ids, in_plugin)) {
gst_caps_unref (srccaps);
- GST_DEBUG
- ("Couldn't get sink caps for muxer '%s'. Most likely because no input format mapping exists.",
- in_plugin->name);
+ GST_DEBUG ("Couldn't get sink caps for muxer '%s'. Most likely because "
+ "no input format mapping exists.", name);
goto beach;
}
beach:
klass->in_plugin = in_plugin;
+
+ g_free (name);
}
static void
while (in_plugin) {
gchar *type_name;
- gchar *p;
GstRank rank = GST_RANK_MARGINAL;
if ((!strncmp (in_plugin->name, "u16", 3)) ||
/* construct the type */
type_name = g_strdup_printf ("avmux_%s", in_plugin->name);
-
- p = type_name;
-
- while (*p) {
- if (*p == '.')
- *p = '_';
- if (*p == ',')
- *p = '_';
- p++;
- }
+ g_strdelimit (type_name, ".,|-<> ", '_');
type = g_type_from_name (type_name);