mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-26 11:41:09 +00:00
ffmpeg: Use gst_element_set_details_simple()
This commit is contained in:
parent
3230d4da09
commit
2e079b742a
7 changed files with 51 additions and 65 deletions
|
@ -99,19 +99,16 @@ static GstFlowReturn gst_ffmpegaudioresample_transform (GstBaseTransform *
|
|||
static void
|
||||
gst_ffmpegaudioresample_base_init (gpointer g_class)
|
||||
{
|
||||
static GstElementDetails plugin_details = {
|
||||
"FFMPEG Audio resampling element",
|
||||
"Filter/Converter/Audio",
|
||||
"Converts audio from one samplerate to another",
|
||||
"Edward Hervey <bilboed@bilboed.com>",
|
||||
};
|
||||
GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
|
||||
|
||||
gst_element_class_add_pad_template (element_class,
|
||||
gst_static_pad_template_get (&src_factory));
|
||||
gst_element_class_add_pad_template (element_class,
|
||||
gst_static_pad_template_get (&sink_factory));
|
||||
gst_element_class_set_details (element_class, &plugin_details);
|
||||
gst_element_class_set_details_simple (element_class,
|
||||
"FFMPEG Audio resampling element", "Filter/Converter/Audio",
|
||||
"Converts audio from one samplerate to another",
|
||||
"Edward Hervey <bilboed@bilboed.com>");
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -296,10 +296,10 @@ static void
|
|||
gst_ffmpegdec_base_init (GstFFMpegDecClass * klass)
|
||||
{
|
||||
GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
|
||||
GstElementDetails details;
|
||||
GstPadTemplate *sinktempl, *srctempl;
|
||||
GstCaps *sinkcaps, *srccaps;
|
||||
AVCodec *in_plugin;
|
||||
gchar *longname, *classification, *description;
|
||||
|
||||
in_plugin =
|
||||
(AVCodec *) g_type_get_qdata (G_OBJECT_CLASS_TYPE (klass),
|
||||
|
@ -307,18 +307,18 @@ gst_ffmpegdec_base_init (GstFFMpegDecClass * klass)
|
|||
g_assert (in_plugin != NULL);
|
||||
|
||||
/* construct the element details struct */
|
||||
details.longname = g_strdup_printf ("FFmpeg %s decoder",
|
||||
in_plugin->long_name);
|
||||
details.klass = g_strdup_printf ("Codec/Decoder/%s",
|
||||
longname = g_strdup_printf ("FFmpeg %s decoder", in_plugin->long_name);
|
||||
classification = g_strdup_printf ("Codec/Decoder/%s",
|
||||
(in_plugin->type == CODEC_TYPE_VIDEO) ? "Video" : "Audio");
|
||||
details.description = g_strdup_printf ("FFmpeg %s decoder", in_plugin->name);
|
||||
details.author = "Wim Taymans <wim.taymans@gmail.com>, "
|
||||
description = g_strdup_printf ("FFmpeg %s decoder", in_plugin->name);
|
||||
gst_element_class_set_details_simple (element_class, longname, classification,
|
||||
description,
|
||||
"Wim Taymans <wim.taymans@gmail.com>, "
|
||||
"Ronald Bultje <rbultje@ronald.bitfreak.net>, "
|
||||
"Edward Hervey <bilboed@bilboed.com>";
|
||||
gst_element_class_set_details (element_class, &details);
|
||||
g_free (details.longname);
|
||||
g_free (details.klass);
|
||||
g_free (details.description);
|
||||
"Edward Hervey <bilboed@bilboed.com>");
|
||||
g_free (longname);
|
||||
g_free (classification);
|
||||
g_free (description);
|
||||
|
||||
/* get the caps */
|
||||
sinkcaps = gst_ffmpeg_codecid_to_caps (in_plugin->id, NULL, FALSE);
|
||||
|
|
|
@ -87,19 +87,15 @@ static GstFlowReturn gst_ffmpegdeinterlace_chain (GstPad * pad,
|
|||
static void
|
||||
gst_ffmpegdeinterlace_base_init (gpointer g_class)
|
||||
{
|
||||
static GstElementDetails plugin_details = {
|
||||
"FFMPEG Deinterlace element",
|
||||
"Filter/Converter/Video",
|
||||
"Deinterlace video",
|
||||
"Luca Ognibene <luogni@tin.it>",
|
||||
};
|
||||
GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
|
||||
|
||||
gst_element_class_add_pad_template (element_class,
|
||||
gst_static_pad_template_get (&src_factory));
|
||||
gst_element_class_add_pad_template (element_class,
|
||||
gst_static_pad_template_get (&sink_factory));
|
||||
gst_element_class_set_details (element_class, &plugin_details);
|
||||
gst_element_class_set_details_simple (element_class,
|
||||
"FFMPEG Deinterlace element", "Filter/Converter/Video",
|
||||
"Deinterlace video", "Luca Ognibene <luogni@tin.it>");
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -182,9 +182,9 @@ gst_ffmpegdemux_base_init (GstFFMpegDemuxClass * klass)
|
|||
GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
|
||||
AVInputFormat *in_plugin;
|
||||
gchar *p, *name;
|
||||
GstElementDetails details;
|
||||
GstCaps *sinkcaps;
|
||||
GstPadTemplate *sinktempl, *audiosrctempl, *videosrctempl;
|
||||
gchar *longname, *description;
|
||||
|
||||
in_plugin = (AVInputFormat *)
|
||||
g_type_get_qdata (G_OBJECT_CLASS_TYPE (klass), GST_FFDEMUX_PARAMS_QDATA);
|
||||
|
@ -198,17 +198,15 @@ gst_ffmpegdemux_base_init (GstFFMpegDemuxClass * klass)
|
|||
}
|
||||
|
||||
/* construct the element details struct */
|
||||
details.longname = g_strdup_printf ("FFmpeg %s demuxer",
|
||||
in_plugin->long_name);
|
||||
details.klass = "Codec/Demuxer";
|
||||
details.description = g_strdup_printf ("FFmpeg %s demuxer",
|
||||
in_plugin->long_name);
|
||||
details.author = "Wim Taymans <wim@fluendo.com>, "
|
||||
longname = g_strdup_printf ("FFmpeg %s demuxer", in_plugin->long_name);
|
||||
description = g_strdup_printf ("FFmpeg %s demuxer", in_plugin->long_name);
|
||||
gst_element_class_set_details_simple (element_class, longname,
|
||||
"Codec/Demuxer", description,
|
||||
"Wim Taymans <wim@fluendo.com>, "
|
||||
"Ronald Bultje <rbultje@ronald.bitfreak.net>, "
|
||||
"Edward Hervey <bilboed@bilboed.com>";
|
||||
gst_element_class_set_details (element_class, &details);
|
||||
g_free (details.longname);
|
||||
g_free (details.description);
|
||||
"Edward Hervey <bilboed@bilboed.com>");
|
||||
g_free (longname);
|
||||
g_free (description);
|
||||
|
||||
/* pad templates */
|
||||
sinkcaps = gst_ffmpeg_formatid_to_caps (name);
|
||||
|
|
|
@ -124,9 +124,9 @@ gst_ffmpegenc_base_init (GstFFMpegEncClass * klass)
|
|||
{
|
||||
GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
|
||||
AVCodec *in_plugin;
|
||||
GstElementDetails details;
|
||||
GstPadTemplate *srctempl = NULL, *sinktempl = NULL;
|
||||
GstCaps *srccaps = NULL, *sinkcaps = NULL;
|
||||
gchar *longname, *classification, *description;
|
||||
|
||||
in_plugin =
|
||||
(AVCodec *) g_type_get_qdata (G_OBJECT_CLASS_TYPE (klass),
|
||||
|
@ -134,17 +134,17 @@ gst_ffmpegenc_base_init (GstFFMpegEncClass * klass)
|
|||
g_assert (in_plugin != NULL);
|
||||
|
||||
/* construct the element details struct */
|
||||
details.longname = g_strdup_printf ("FFmpeg %s encoder",
|
||||
in_plugin->long_name);
|
||||
details.klass = g_strdup_printf ("Codec/Encoder/%s",
|
||||
longname = g_strdup_printf ("FFmpeg %s encoder", in_plugin->long_name);
|
||||
classification = g_strdup_printf ("Codec/Encoder/%s",
|
||||
(in_plugin->type == CODEC_TYPE_VIDEO) ? "Video" : "Audio");
|
||||
details.description = g_strdup_printf ("FFmpeg %s encoder", in_plugin->name);
|
||||
details.author = "Wim Taymans <wim.taymans@gmail.com>, "
|
||||
"Ronald Bultje <rbultje@ronald.bitfreak.net>";
|
||||
gst_element_class_set_details (element_class, &details);
|
||||
g_free (details.longname);
|
||||
g_free (details.klass);
|
||||
g_free (details.description);
|
||||
description = g_strdup_printf ("FFmpeg %s encoder", in_plugin->name);
|
||||
gst_element_class_set_details_simple (element_class, longname, classification,
|
||||
description,
|
||||
"Wim Taymans <wim.taymans@gmail.com>, "
|
||||
"Ronald Bultje <rbultje@ronald.bitfreak.net>");
|
||||
g_free (longname);
|
||||
g_free (classification);
|
||||
g_free (description);
|
||||
|
||||
if (!(srccaps = gst_ffmpeg_codecid_to_caps (in_plugin->id, NULL, TRUE))) {
|
||||
GST_DEBUG ("Couldn't get source caps for encoder '%s'", in_plugin->name);
|
||||
|
|
|
@ -142,11 +142,11 @@ gst_ffmpegmux_base_init (gpointer g_class)
|
|||
{
|
||||
GstFFMpegMuxClass *klass = (GstFFMpegMuxClass *) g_class;
|
||||
GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
|
||||
GstElementDetails details;
|
||||
GstPadTemplate *videosinktempl, *audiosinktempl, *srctempl;
|
||||
AVOutputFormat *in_plugin;
|
||||
GstCaps *srccaps, *audiosinkcaps, *videosinkcaps;
|
||||
enum CodecID *video_ids = NULL, *audio_ids = NULL;
|
||||
gchar *longname, *description;
|
||||
|
||||
in_plugin =
|
||||
(AVOutputFormat *) g_type_get_qdata (G_OBJECT_CLASS_TYPE (klass),
|
||||
|
@ -154,16 +154,14 @@ gst_ffmpegmux_base_init (gpointer g_class)
|
|||
g_assert (in_plugin != NULL);
|
||||
|
||||
/* construct the element details struct */
|
||||
details.longname = g_strdup_printf ("FFmpeg %s muxer", in_plugin->long_name);
|
||||
details.klass = g_strdup ("Codec/Muxer");
|
||||
details.description = g_strdup_printf ("FFmpeg %s muxer",
|
||||
in_plugin->long_name);
|
||||
details.author = "Wim Taymans <wim.taymans@chello.be>, "
|
||||
"Ronald Bultje <rbultje@ronald.bitfreak.net>";
|
||||
gst_element_class_set_details (element_class, &details);
|
||||
g_free (details.longname);
|
||||
g_free (details.klass);
|
||||
g_free (details.description);
|
||||
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>, "
|
||||
"Ronald Bultje <rbultje@ronald.bitfreak.net>");
|
||||
g_free (longname);
|
||||
g_free (description);
|
||||
|
||||
/* Try to find the caps that belongs here */
|
||||
srccaps = gst_ffmpeg_formatid_to_caps (in_plugin->name);
|
||||
|
|
|
@ -101,19 +101,16 @@ static gboolean gst_ffmpegscale_handle_src_event (GstPad * pad,
|
|||
static void
|
||||
gst_ffmpegscale_base_init (gpointer g_class)
|
||||
{
|
||||
static GstElementDetails plugin_details = {
|
||||
"FFMPEG Scale element",
|
||||
"Filter/Converter/Video",
|
||||
"Converts video from one resolution to another",
|
||||
"Luca Ognibene <luogni@tin.it>",
|
||||
};
|
||||
GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
|
||||
|
||||
gst_element_class_add_pad_template (element_class,
|
||||
gst_static_pad_template_get (&src_factory));
|
||||
gst_element_class_add_pad_template (element_class,
|
||||
gst_static_pad_template_get (&sink_factory));
|
||||
gst_element_class_set_details (element_class, &plugin_details);
|
||||
gst_element_class_set_details_simple (element_class, "FFMPEG Scale element",
|
||||
"Filter/Converter/Video",
|
||||
"Converts video from one resolution to another",
|
||||
"Luca Ognibene <luogni@tin.it>");
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
Loading…
Reference in a new issue