mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-23 00:36:51 +00:00
ffmpeg: fix template to %u
This commit is contained in:
parent
e98c1e2a95
commit
a70ce56cf8
2 changed files with 14 additions and 11 deletions
|
@ -213,9 +213,9 @@ gst_ffmpegdemux_base_init (GstFFMpegDemuxClass * klass)
|
|||
sinkcaps = gst_ffmpeg_formatid_to_caps (name);
|
||||
sinktempl = gst_pad_template_new ("sink",
|
||||
GST_PAD_SINK, GST_PAD_ALWAYS, sinkcaps);
|
||||
videosrctempl = gst_pad_template_new ("video_%02d",
|
||||
videosrctempl = gst_pad_template_new ("video_%u",
|
||||
GST_PAD_SRC, GST_PAD_SOMETIMES, GST_CAPS_ANY);
|
||||
audiosrctempl = gst_pad_template_new ("audio_%02d",
|
||||
audiosrctempl = gst_pad_template_new ("audio_%u",
|
||||
GST_PAD_SRC, GST_PAD_SOMETIMES, GST_CAPS_ANY);
|
||||
|
||||
gst_element_class_add_pad_template (element_class, videosrctempl);
|
||||
|
@ -921,9 +921,12 @@ gst_ffmpegdemux_create_padname (const gchar * templ, gint n)
|
|||
{
|
||||
GString *string;
|
||||
|
||||
/* FIXME, we just want to printf the number according to the template but
|
||||
* then the format string is not a literal and we can't check arguments and
|
||||
* this generates a compiler error */
|
||||
string = g_string_new (templ);
|
||||
g_string_truncate (string, string->len - 4);
|
||||
g_string_append_printf (string, "%02d", n);
|
||||
g_string_truncate (string, string->len - 2);
|
||||
g_string_append_printf (string, "%u", n);
|
||||
|
||||
return g_string_free (string, FALSE);
|
||||
}
|
||||
|
|
|
@ -56,7 +56,7 @@ struct _GstFFMpegMux
|
|||
AVFormatContext *context;
|
||||
gboolean opened;
|
||||
|
||||
gint videopads, audiopads;
|
||||
guint videopads, audiopads;
|
||||
|
||||
/*< private > */
|
||||
/* event_function is the collectpads default eventfunction */
|
||||
|
@ -273,13 +273,13 @@ gst_ffmpegmux_base_init (gpointer g_class)
|
|||
gst_element_class_add_pad_template (element_class, srctempl);
|
||||
|
||||
if (audiosinkcaps) {
|
||||
audiosinktempl = gst_pad_template_new ("audio_%d",
|
||||
audiosinktempl = gst_pad_template_new ("audio_%u",
|
||||
GST_PAD_SINK, GST_PAD_REQUEST, audiosinkcaps);
|
||||
gst_element_class_add_pad_template (element_class, audiosinktempl);
|
||||
}
|
||||
|
||||
if (videosinkcaps) {
|
||||
videosinktempl = gst_pad_template_new ("video_%d",
|
||||
videosinktempl = gst_pad_template_new ("video_%u",
|
||||
GST_PAD_SINK, GST_PAD_REQUEST, videosinkcaps);
|
||||
gst_element_class_add_pad_template (element_class, videosinktempl);
|
||||
}
|
||||
|
@ -419,13 +419,13 @@ gst_ffmpegmux_request_new_pad (GstElement * element,
|
|||
g_return_val_if_fail (ffmpegmux->opened == FALSE, NULL);
|
||||
|
||||
/* figure out a name that *we* like */
|
||||
if (templ == gst_element_class_get_pad_template (klass, "video_%d")) {
|
||||
padname = g_strdup_printf ("video_%d", ffmpegmux->videopads++);
|
||||
if (templ == gst_element_class_get_pad_template (klass, "video_%u")) {
|
||||
padname = g_strdup_printf ("video_%u", ffmpegmux->videopads++);
|
||||
type = AVMEDIA_TYPE_VIDEO;
|
||||
bitrate = 64 * 1024;
|
||||
framesize = 1152;
|
||||
} else if (templ == gst_element_class_get_pad_template (klass, "audio_%d")) {
|
||||
padname = g_strdup_printf ("audio_%d", ffmpegmux->audiopads++);
|
||||
} else if (templ == gst_element_class_get_pad_template (klass, "audio_%u")) {
|
||||
padname = g_strdup_printf ("audio_%u", ffmpegmux->audiopads++);
|
||||
type = AVMEDIA_TYPE_AUDIO;
|
||||
bitrate = 285 * 1024;
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue