/* we're done, return the buffer */
src->curoffset += GST_BUFFER_SIZE(buf);
- //g_object_notify (G_OBJECT (src), "offset");
+ g_object_notify (G_OBJECT (src), "offset");
return buf;
}
/* now notify of the changes */
g_object_freeze_notify (G_OBJECT (src));
g_object_notify (G_OBJECT (src), "filesize");
- //g_object_notify (G_OBJECT (src), "offset");
+ g_object_notify (G_OBJECT (src), "offset");
g_object_thaw_notify (G_OBJECT (src));
GST_FLAG_SET (src, GST_FILESRC_OPEN);
/* and notify that things changed */
g_object_freeze_notify (G_OBJECT (src));
g_object_notify (G_OBJECT (src), "filesize");
- //g_object_notify (G_OBJECT (src), "offset");
+ g_object_notify (G_OBJECT (src), "offset");
g_object_thaw_notify (G_OBJECT (src));
if (src->mapbuf)
typedef enum {
/* this bin is a manager of child elements, i.e. a pipeline or thread */
GST_BIN_FLAG_MANAGER = GST_ELEMENT_FLAG_LAST,
- /* this bin is actually a meta-bin, and may need to be scheduled */
+
+ /* this bin iterates itself */
GST_BIN_SELF_SCHEDULABLE,
/* we prefer to have cothreads when its an option, over chain-based */
GST_BIN_FLAG_FIXED_CLOCK,
- /* bin iterates itself, like a bin with a jack element in it */
- GST_BIN_SELF_ITERATING,
-
/* padding */
GST_BIN_FLAG_LAST = GST_ELEMENT_FLAG_LAST + 5,
} GstBinFlags;
gboolean templ_found = FALSE;
GList *list;
gint n;
- gchar *str;
+ gchar *str, *data, *endptr;
g_return_val_if_fail (element != NULL, NULL);
g_return_val_if_fail (GST_IS_ELEMENT (element), NULL);
while (!templ_found && list) {
templ = (GstPadTemplate*) list->data;
if (templ->presence == GST_PAD_REQUEST) {
- /* we know that %s and %d are the ony possibilities because of sanity
+ /* we know that %s and %d are the only possibilities because of sanity
checks in gst_padtemplate_new */
- if (strstr (templ->name_template, "%d")) {
- if (sscanf(name, templ->name_template, &n)) {
- templ_found = TRUE;
- req_name = name;
- break;
- }
- } else if (strstr (templ->name_template, "%s")) {
- if (sscanf(name, templ->name_template, &str)) {
+ if ((str = strchr (templ->name_template, '%')) &&
+ strncmp (templ->name_template, name, str - templ->name_template) == 0 &&
+ strlen (name) > str - templ->name_template) {
+ data = name + (str - templ->name_template);
+ if (*(str+1) == 'd') {
+ /* it's an int */
+ n = (gint) strtol (data, &endptr, 10);
+ if (endptr == NULL) {
+ templ_found = TRUE;
+ req_name = name;
+ break;
+ }
+ } else {
+ /* it's a string */
templ_found = TRUE;
req_name = name;
break;
*
* Returns: the pad to which a connection can be made
*/
-
GstPad*
gst_element_get_compatible_pad_filtered (GstElement *element, GstPad *pad, GstCaps *filtercaps)
{
" type '%%d' or '%%s' for GST_PAD_REQUEST padtemplate", name);
return FALSE;
}
+ if (str && (*(str+2) != '\0')) {
+ g_warning ("invalid name template %s: conversion specification must appear"
+ " at the end of the GST_PAD_REQUEST padtemplate name", name);
+ return FALSE;
+ }
}
return TRUE;
libgstfastscheduler_la_SOURCES = gstfastscheduler.c
libgstfastscheduler_la_CFLAGS = $(GST_CFLAGS)
-libgstfastscheduler_la_LIBADD = $(GST_LIBS) ../libcothreads.la
-libgstfastscheduler_la_LDFLAGS = @GST_LT_LDFLAGS@
+libgstfastscheduler_la_LIBADD = ../libcothreads.la
+libgstfastscheduler_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
## this is a REALLY evil hack
## but we need to keep it as long as we have libs/gst and libs/ext
/* we're done, return the buffer */
src->curoffset += GST_BUFFER_SIZE(buf);
- //g_object_notify (G_OBJECT (src), "offset");
+ g_object_notify (G_OBJECT (src), "offset");
return buf;
}
/* now notify of the changes */
g_object_freeze_notify (G_OBJECT (src));
g_object_notify (G_OBJECT (src), "filesize");
- //g_object_notify (G_OBJECT (src), "offset");
+ g_object_notify (G_OBJECT (src), "offset");
g_object_thaw_notify (G_OBJECT (src));
GST_FLAG_SET (src, GST_FILESRC_OPEN);
/* and notify that things changed */
g_object_freeze_notify (G_OBJECT (src));
g_object_notify (G_OBJECT (src), "filesize");
- //g_object_notify (G_OBJECT (src), "offset");
+ g_object_notify (G_OBJECT (src), "offset");
g_object_thaw_notify (G_OBJECT (src));
if (src->mapbuf)
{
GValue value = { 0, }; /* the important thing is that value.type = 0 */
gchar *str = 0;
-
- if (pspec->flags & G_PARAM_READABLE) {
+
+ /* let's not print these out for the offset property... */
+ if (pspec->flags & G_PARAM_READABLE && strcmp (pspec->name, "offset") != 0) {
g_value_init(&value, G_PARAM_SPEC_VALUE_TYPE (pspec));
g_object_get_property (G_OBJECT (orig), pspec->name, &value);
- /* fix current bug with g_strdup_value_contents not working with gint64 */
- if (G_IS_PARAM_SPEC_INT64 (pspec))
- str = g_strdup_printf ("%lld", g_value_get_int64 (&value));
- else
- str = g_strdup_value_contents (&value);
+ str = g_strdup_value_contents (&value);
g_print ("%s: %s = %s\n", GST_OBJECT_NAME (orig), pspec->name, str);
g_free (str);
g_value_unset(&value);
launch_argc = argc;
launch_argv = argv;
- //gst_schedulerfactory_set_default_name ("fast");
-
/* make a null-terminated version of argv */
argvn = g_new0 (char *,argc);
memcpy (argvn, argv+1, sizeof (char*) * (argc-1));
exit (-1);
}
- if (!GST_FLAG_IS_SET (GST_OBJECT (pipeline), GST_BIN_SELF_ITERATING)) {
+ if (!GST_FLAG_IS_SET (GST_OBJECT (pipeline), GST_BIN_SELF_SCHEDULABLE)) {
g_idle_add (idle_func, pipeline);
gst_main ();
} else {
- g_print ("sleeping 100...\n");
- sleep (100);
+ g_print ("waiting for the state change...\n");
+ gst_element_wait_state_change (pipeline);
}
gst_element_set_state (pipeline, GST_STATE_NULL);