+2008-05-20 Jan Schmidt <jan.schmidt@sun.com>
+
+ * gst/videomixer/videomixer.c:
+ * gst/videomixer/videomixer.h:
+ Instead of a random number for the request pad id's,
+ use a counter.
+
+ Register the videomixerpad class from the element's class_init
+ where it's safer, and allows the docs generator to scan it.
+
2008-05-20 Wim Taymans <wim.taymans@collabora.co.uk>
* gst/smpte/Makefile.am:
#include <gst/base/gstcollectpads.h>
#include <gst/controller/gstcontroller.h>
-#include <stdlib.h>
#include <string.h>
#include "videomixer.h"
GST_DEBUG_FUNCPTR (gst_videomixer_release_pad);
gstelement_class->change_state =
GST_DEBUG_FUNCPTR (gst_videomixer_change_state);
+
+ /* Register the pad class */
+ (void) (GST_TYPE_VIDEO_MIXER_PAD);
}
static void
gst_videomixer_collect_free (data);
walk = g_slist_next (walk);
}
+
+ mix->next_sinkpad = 0;
}
static void
GstVideoMixerCollect *mixcol = NULL;
if (req_name == NULL || strlen (req_name) < 6) {
- /* no name given when requesting the pad, use random serial number */
- serial = rand ();
+ /* no name given when requesting the pad, use next available int */
+ serial = mix->next_sinkpad++;
} else {
/* parse serial number from requested padname */
serial = atoi (&req_name[5]);
+ if (serial >= mix->next_sinkpad)
+ mix->next_sinkpad = serial + 1;
}
/* create new pad with the name */
name = g_strdup_printf ("sink_%d", serial);