av_iformat_next (deprecated) -> av_demuxer_iterate

https://bugzilla.gnome.org/show_bug.cgi?id=792900
This commit is contained in:
Mathieu Duponchelle 2018-06-29 21:37:06 +02:00
parent d059922f56
commit bc7160dd47

View file

@ -1961,7 +1961,7 @@ gboolean
gst_ffmpegdemux_register (GstPlugin * plugin) gst_ffmpegdemux_register (GstPlugin * plugin)
{ {
GType type; GType type;
AVInputFormat *in_plugin; const AVInputFormat *in_plugin;
gchar *extensions; gchar *extensions;
GTypeInfo typeinfo = { GTypeInfo typeinfo = {
sizeof (GstFFMpegDemuxClass), sizeof (GstFFMpegDemuxClass),
@ -1975,11 +1975,11 @@ gst_ffmpegdemux_register (GstPlugin * plugin)
(GInstanceInitFunc) gst_ffmpegdemux_init, (GInstanceInitFunc) gst_ffmpegdemux_init,
}; };
in_plugin = av_iformat_next (NULL); void *i = 0;
GST_LOG ("Registering demuxers"); GST_LOG ("Registering demuxers");
while (in_plugin) { while ((in_plugin = av_demuxer_iterate (&i))) {
gchar *type_name, *typefind_name; gchar *type_name, *typefind_name;
gint rank; gint rank;
gboolean register_typefind_func = TRUE; gboolean register_typefind_func = TRUE;
@ -2007,14 +2007,14 @@ gst_ffmpegdemux_register (GstPlugin * plugin)
!strncmp (in_plugin->name, "f64", 3) || !strncmp (in_plugin->name, "f64", 3) ||
!strcmp (in_plugin->name, "mulaw") || !strcmp (in_plugin->name, "alaw") !strcmp (in_plugin->name, "mulaw") || !strcmp (in_plugin->name, "alaw")
) )
goto next; continue;
/* no network demuxers */ /* no network demuxers */
if (!strcmp (in_plugin->name, "sdp") || if (!strcmp (in_plugin->name, "sdp") ||
!strcmp (in_plugin->name, "rtsp") || !strcmp (in_plugin->name, "rtsp") ||
!strcmp (in_plugin->name, "applehttp") !strcmp (in_plugin->name, "applehttp")
) )
goto next; continue;
/* these don't do what one would expect or /* these don't do what one would expect or
* are only partially functional/useful */ * are only partially functional/useful */
@ -2022,7 +2022,7 @@ gst_ffmpegdemux_register (GstPlugin * plugin)
!strcmp (in_plugin->name, "wv") || !strcmp (in_plugin->name, "wv") ||
!strcmp (in_plugin->name, "ass") || !strcmp (in_plugin->name, "ass") ||
!strcmp (in_plugin->name, "ffmetadata")) !strcmp (in_plugin->name, "ffmetadata"))
goto next; continue;
/* Don't use the typefind functions of formats for which we already have /* Don't use the typefind functions of formats for which we already have
* better typefind functions */ * better typefind functions */
@ -2103,7 +2103,7 @@ gst_ffmpegdemux_register (GstPlugin * plugin)
else { else {
GST_DEBUG ("ignoring %s", in_plugin->name); GST_DEBUG ("ignoring %s", in_plugin->name);
rank = GST_RANK_NONE; rank = GST_RANK_NONE;
goto next; continue;
} }
/* construct the type */ /* construct the type */
@ -2113,7 +2113,7 @@ gst_ffmpegdemux_register (GstPlugin * plugin)
/* if it's already registered, drop it */ /* if it's already registered, drop it */
if (g_type_from_name (type_name)) { if (g_type_from_name (type_name)) {
g_free (type_name); g_free (type_name);
goto next; continue;
} }
typefind_name = g_strdup_printf ("avtype_%s", in_plugin->name); typefind_name = g_strdup_printf ("avtype_%s", in_plugin->name);
@ -2131,8 +2131,8 @@ gst_ffmpegdemux_register (GstPlugin * plugin)
if (!gst_element_register (plugin, type_name, rank, type) || if (!gst_element_register (plugin, type_name, rank, type) ||
(register_typefind_func == TRUE && (register_typefind_func == TRUE &&
!gst_type_find_register (plugin, typefind_name, rank, !gst_type_find_register (plugin, typefind_name, rank,
gst_ffmpegdemux_type_find, extensions, NULL, in_plugin, gst_ffmpegdemux_type_find, extensions, NULL,
NULL))) { (gpointer) in_plugin, NULL))) {
g_warning ("Registration of type %s failed", type_name); g_warning ("Registration of type %s failed", type_name);
g_free (type_name); g_free (type_name);
g_free (typefind_name); g_free (typefind_name);
@ -2143,9 +2143,6 @@ gst_ffmpegdemux_register (GstPlugin * plugin)
g_free (type_name); g_free (type_name);
g_free (typefind_name); g_free (typefind_name);
g_free (extensions); g_free (extensions);
next:
in_plugin = av_iformat_next (in_plugin);
} }
GST_LOG ("Finished registering demuxers"); GST_LOG ("Finished registering demuxers");