return caps;
}
+/* Check if the given codec ID is an image format -- for now this is just
+ * anything whose caps is image/... */
+gboolean
+gst_ffmpeg_codecid_is_image (enum AVCodecID codec_id)
+{
+ switch (codec_id) {
+ case AV_CODEC_ID_MJPEG:
+ case AV_CODEC_ID_LJPEG:
+ case AV_CODEC_ID_GIF:
+ case AV_CODEC_ID_PPM:
+ case AV_CODEC_ID_PBM:
+ case AV_CODEC_ID_PCX:
+ case AV_CODEC_ID_SGI:
+ case AV_CODEC_ID_TARGA:
+ case AV_CODEC_ID_TIFF:
+ case AV_CODEC_ID_SUNRAST:
+ case AV_CODEC_ID_BMP:
+ return TRUE;
+
+ default:
+ return FALSE;
+ }
+}
+
/* Convert a FFMPEG codec ID and optional AVCodecContext
* to a GstCaps. If the context is ommitted, no fixed values
* for video/audio size will be included in the GstCaps
#define FFMPEG_DEFAULT_COMPLIANCE GST_FFMPEG_NORMAL
/*
+ * _codecid_is_image() returns TRUE for image formats
+ */
+gboolean
+gst_ffmpeg_codecid_is_image (enum AVCodecID codec_id);
+
+/*
* _codecid_to_caps () gets the GstCaps that belongs to
* a certain CodecID for a pad with compressed data.
*/
GstPadTemplate *srctempl = NULL, *sinktempl = NULL;
GstCaps *srccaps = NULL, *sinkcaps = NULL;
gchar *longname, *description;
+ const gchar *klass;
in_plugin =
(AVCodec *) g_type_get_qdata (G_OBJECT_CLASS_TYPE (klass),
/* construct the element details struct */
longname = g_strdup_printf ("libav %s encoder", in_plugin->long_name);
description = g_strdup_printf ("libav %s encoder", in_plugin->name);
+ klass =
+ gst_ffmpeg_codecid_is_image (in_plugin->id) ? "Codec/Encoder/Image" :
+ "Codec/Encoder/Video";
gst_element_class_set_metadata (element_class, longname,
- "Codec/Encoder/Video", description,
+ klass, description,
"Wim Taymans <wim.taymans@gmail.com>, "
"Ronald Bultje <rbultje@ronald.bitfreak.net>");
g_free (longname);