mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-26 19:51:11 +00:00
ffmpegmux: Use information from AVOutputFormat to expose more muxers.
AVOutputFormat does *NOT* contain the full list of codecs a muxer can handle, but does contain the recommended audio and video codecs. Therefore we use that information to expose more muxers, until AVOutputFormat contains a list of *ALL* compatible codecs.
This commit is contained in:
parent
2334478f8d
commit
269698f020
3 changed files with 41 additions and 3 deletions
|
@ -2344,8 +2344,17 @@ gst_ffmpeg_formatid_to_caps (const gchar * format_name)
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
gst_ffmpeg_formatid_get_codecids (const gchar * format_name,
|
gst_ffmpeg_formatid_get_codecids (const gchar * format_name,
|
||||||
enum CodecID ** video_codec_list, enum CodecID ** audio_codec_list)
|
enum CodecID ** video_codec_list, enum CodecID ** audio_codec_list,
|
||||||
|
AVOutputFormat * plugin)
|
||||||
{
|
{
|
||||||
|
static enum CodecID tmp_vlist[] = {
|
||||||
|
CODEC_ID_NONE,
|
||||||
|
CODEC_ID_NONE
|
||||||
|
};
|
||||||
|
static enum CodecID tmp_alist[] = {
|
||||||
|
CODEC_ID_NONE,
|
||||||
|
CODEC_ID_NONE
|
||||||
|
};
|
||||||
|
|
||||||
GST_LOG ("format_name : %s", format_name);
|
GST_LOG ("format_name : %s", format_name);
|
||||||
|
|
||||||
|
@ -2471,6 +2480,13 @@ gst_ffmpeg_formatid_get_codecids (const gchar * format_name,
|
||||||
};
|
};
|
||||||
*video_codec_list = gif_image_list;
|
*video_codec_list = gif_image_list;
|
||||||
*audio_codec_list = NULL;
|
*audio_codec_list = NULL;
|
||||||
|
} else if ((plugin->audio_codec != CODEC_ID_NONE) ||
|
||||||
|
(plugin->video_codec != CODEC_ID_NONE)) {
|
||||||
|
tmp_vlist[0] = plugin->video_codec;
|
||||||
|
tmp_alist[0] = plugin->audio_codec;
|
||||||
|
|
||||||
|
*video_codec_list = tmp_vlist;
|
||||||
|
*audio_codec_list = tmp_alist;
|
||||||
} else {
|
} else {
|
||||||
GST_LOG ("Format %s not found", format_name);
|
GST_LOG ("Format %s not found", format_name);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
|
@ -110,7 +110,8 @@ gst_ffmpeg_formatid_to_caps (const gchar *format_name);
|
||||||
gboolean
|
gboolean
|
||||||
gst_ffmpeg_formatid_get_codecids (const gchar *format_name,
|
gst_ffmpeg_formatid_get_codecids (const gchar *format_name,
|
||||||
enum CodecID ** video_codec_list,
|
enum CodecID ** video_codec_list,
|
||||||
enum CodecID ** audio_codec_list);
|
enum CodecID ** audio_codec_list,
|
||||||
|
AVOutputFormat * plugin);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Since FFMpeg has such really cool and useful descriptions
|
* Since FFMpeg has such really cool and useful descriptions
|
||||||
|
|
|
@ -703,6 +703,27 @@ gst_ffmpegmux_register (GstPlugin * plugin)
|
||||||
GstCaps *srccaps, *audiosinkcaps, *videosinkcaps;
|
GstCaps *srccaps, *audiosinkcaps, *videosinkcaps;
|
||||||
enum CodecID *video_ids = NULL, *audio_ids = NULL;
|
enum CodecID *video_ids = NULL, *audio_ids = NULL;
|
||||||
|
|
||||||
|
if ((!strncmp (in_plugin->name, "u16", 3)) ||
|
||||||
|
(!strncmp (in_plugin->name, "s16", 3)) ||
|
||||||
|
(!strncmp (in_plugin->name, "u24", 3)) ||
|
||||||
|
(!strncmp (in_plugin->name, "s24", 3)) ||
|
||||||
|
(!strncmp (in_plugin->name, "u8", 2)) ||
|
||||||
|
(!strncmp (in_plugin->name, "s8", 2)) ||
|
||||||
|
(!strncmp (in_plugin->name, "u32", 3)) ||
|
||||||
|
(!strncmp (in_plugin->name, "s32", 3)) ||
|
||||||
|
(!strncmp (in_plugin->name, "f32", 3)) ||
|
||||||
|
(!strncmp (in_plugin->name, "f64", 3)) ||
|
||||||
|
(!strncmp (in_plugin->name, "raw", 3)) ||
|
||||||
|
(!strncmp (in_plugin->name, "crc", 3)) ||
|
||||||
|
(!strncmp (in_plugin->name, "null", 4)) ||
|
||||||
|
(!strncmp (in_plugin->name, "gif", 3)) ||
|
||||||
|
(!strncmp (in_plugin->name, "frame", 5)) ||
|
||||||
|
(!strncmp (in_plugin->name, "image", 5))
|
||||||
|
) {
|
||||||
|
GST_LOG ("Ignoring muxer %s", in_plugin->name);
|
||||||
|
goto next;
|
||||||
|
}
|
||||||
|
|
||||||
/* Try to find the caps that belongs here */
|
/* Try to find the caps that belongs here */
|
||||||
srccaps = gst_ffmpeg_formatid_to_caps (in_plugin->name);
|
srccaps = gst_ffmpeg_formatid_to_caps (in_plugin->name);
|
||||||
if (!srccaps) {
|
if (!srccaps) {
|
||||||
|
@ -710,7 +731,7 @@ gst_ffmpegmux_register (GstPlugin * plugin)
|
||||||
goto next;
|
goto next;
|
||||||
}
|
}
|
||||||
if (!gst_ffmpeg_formatid_get_codecids (in_plugin->name,
|
if (!gst_ffmpeg_formatid_get_codecids (in_plugin->name,
|
||||||
&video_ids, &audio_ids)) {
|
&video_ids, &audio_ids, in_plugin)) {
|
||||||
gst_caps_unref (srccaps);
|
gst_caps_unref (srccaps);
|
||||||
GST_WARNING
|
GST_WARNING
|
||||||
("Couldn't get sink caps for muxer %s. Most likely because no input format mapping exists.",
|
("Couldn't get sink caps for muxer %s. Most likely because no input format mapping exists.",
|
||||||
|
|
Loading…
Reference in a new issue