diff options
author | David Schleef <ds@schleef.org> | 2010-06-25 15:59:24 -0700 |
---|---|---|
committer | Edward Hervey <bilboed@bilboed.com> | 2010-06-27 10:38:25 +0200 |
commit | 00d87bcd8300ceb949fb841280ab18a90ad21f2f (patch) | |
tree | 64fda7d82d0c926808154eb6683d3fb5a0d26b03 /ext | |
parent | 52e8d6251307c32b412e0f40b3be4351c71a4de0 (diff) |
ffmpegmux: Add alternate element in description
For muxers where there is a better GStreamer alternative, add
"(not recommended, use alternate_element_name instead)" to
the description.
https://bugzilla.gnome.org/show_bug.cgi?id=622773
Diffstat (limited to 'ext')
-rw-r--r-- | ext/ffmpeg/gstffmpegmux.c | 49 |
1 files changed, 47 insertions, 2 deletions
diff --git a/ext/ffmpeg/gstffmpegmux.c b/ext/ffmpeg/gstffmpegmux.c index b6f4a4b..50ee9ba 100644 --- a/ext/ffmpeg/gstffmpegmux.c +++ b/ext/ffmpeg/gstffmpegmux.c @@ -137,6 +137,40 @@ static GstElementClass *parent_class = NULL; /*static guint gst_ffmpegmux_signals[LAST_SIGNAL] = { 0 }; */ +typedef struct +{ + const char *name; + const char *replacement; +} GstFFMpegMuxReplacement; + +static const char * +gst_ffmpegmux_get_replacement (const char *name) +{ + static const GstFFMpegMuxReplacement blacklist[] = { + {"avi", "avimux"}, + {"matroska", "matroskamux"}, + {"mov", "qtmux"}, + {"mpegts", "mpegtsmux"}, + {"mp4", "mp4mux"}, + {"mpjpeg", "multipartmux"}, + {"ogg", "oggmux"}, + {"wav", "wavenc"}, + {"webm", "webmmux"}, + {"mxf", "mxfmux"}, + {"3gp", "gppmux"}, + {"yuv4mpegpipe", "y4menc"} + }; + int i; + + for (i = 0; i < sizeof (blacklist) / sizeof (blacklist[0]); i++) { + if (strcmp (blacklist[i].name, name) == 0) { + return blacklist[i].replacement; + } + } + + return NULL; +} + static void gst_ffmpegmux_base_init (gpointer g_class) { @@ -147,6 +181,7 @@ gst_ffmpegmux_base_init (gpointer g_class) GstCaps *srccaps, *audiosinkcaps, *videosinkcaps; enum CodecID *video_ids = NULL, *audio_ids = NULL; gchar *longname, *description; + const char *replacement; in_plugin = (AVOutputFormat *) g_type_get_qdata (G_OBJECT_CLASS_TYPE (klass), @@ -154,8 +189,18 @@ gst_ffmpegmux_base_init (gpointer g_class) g_assert (in_plugin != NULL); /* construct the element details struct */ - longname = g_strdup_printf ("FFmpeg %s muxer", in_plugin->long_name); - description = g_strdup_printf ("FFmpeg %s muxer", in_plugin->long_name); + replacement = gst_ffmpegmux_get_replacement (in_plugin->name); + if (replacement != NULL) { + longname = + g_strdup_printf ("FFmpeg %s muxer (not recommended, use %s instead)", + in_plugin->long_name, replacement); + description = + g_strdup_printf ("FFmpeg %s muxer (not recommended, use %s instead)", + in_plugin->long_name, replacement); + } else { + longname = g_strdup_printf ("FFmpeg %s muxer", in_plugin->long_name); + description = g_strdup_printf ("FFmpeg %s muxer", in_plugin->long_name); + } gst_element_class_set_details_simple (element_class, longname, "Codec/Muxer", description, "Wim Taymans <wim.taymans@chello.be>, " |