mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-02 06:31:08 +00:00
add notify back to filesrc, it's needed for MVC applications remove notify printouts from gst-launch cleanup in gst-p...
Original commit message from CVS: * add notify back to filesrc, it's needed for MVC applications * remove notify printouts from gst-launch * cleanup in gst-plugins configure.ac * some jack updates * remove SELF_ITERATING flag in favor of SEF_SCHEDULABLE (not a clear name, but it's what we have for the moment) * improve parsing of request pad names, no more sscanf * fixes to the fastscheduler Makefile.am
This commit is contained in:
parent
0d2aa4c6d2
commit
cfb228b0f9
7 changed files with 38 additions and 35 deletions
|
@ -549,7 +549,7 @@ gst_filesrc_get (GstPad *pad)
|
||||||
|
|
||||||
/* we're done, return the buffer */
|
/* we're done, return the buffer */
|
||||||
src->curoffset += GST_BUFFER_SIZE(buf);
|
src->curoffset += GST_BUFFER_SIZE(buf);
|
||||||
//g_object_notify (G_OBJECT (src), "offset");
|
g_object_notify (G_OBJECT (src), "offset");
|
||||||
return buf;
|
return buf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -590,7 +590,7 @@ gst_filesrc_open_file (GstFileSrc *src)
|
||||||
/* now notify of the changes */
|
/* now notify of the changes */
|
||||||
g_object_freeze_notify (G_OBJECT (src));
|
g_object_freeze_notify (G_OBJECT (src));
|
||||||
g_object_notify (G_OBJECT (src), "filesize");
|
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));
|
g_object_thaw_notify (G_OBJECT (src));
|
||||||
|
|
||||||
GST_FLAG_SET (src, GST_FILESRC_OPEN);
|
GST_FLAG_SET (src, GST_FILESRC_OPEN);
|
||||||
|
@ -614,7 +614,7 @@ gst_filesrc_close_file (GstFileSrc *src)
|
||||||
/* and notify that things changed */
|
/* and notify that things changed */
|
||||||
g_object_freeze_notify (G_OBJECT (src));
|
g_object_freeze_notify (G_OBJECT (src));
|
||||||
g_object_notify (G_OBJECT (src), "filesize");
|
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));
|
g_object_thaw_notify (G_OBJECT (src));
|
||||||
|
|
||||||
if (src->mapbuf)
|
if (src->mapbuf)
|
||||||
|
|
|
@ -51,7 +51,8 @@ extern GType _gst_bin_type;
|
||||||
typedef enum {
|
typedef enum {
|
||||||
/* this bin is a manager of child elements, i.e. a pipeline or thread */
|
/* this bin is a manager of child elements, i.e. a pipeline or thread */
|
||||||
GST_BIN_FLAG_MANAGER = GST_ELEMENT_FLAG_LAST,
|
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,
|
GST_BIN_SELF_SCHEDULABLE,
|
||||||
|
|
||||||
/* we prefer to have cothreads when its an option, over chain-based */
|
/* we prefer to have cothreads when its an option, over chain-based */
|
||||||
|
@ -59,9 +60,6 @@ typedef enum {
|
||||||
|
|
||||||
GST_BIN_FLAG_FIXED_CLOCK,
|
GST_BIN_FLAG_FIXED_CLOCK,
|
||||||
|
|
||||||
/* bin iterates itself, like a bin with a jack element in it */
|
|
||||||
GST_BIN_SELF_ITERATING,
|
|
||||||
|
|
||||||
/* padding */
|
/* padding */
|
||||||
GST_BIN_FLAG_LAST = GST_ELEMENT_FLAG_LAST + 5,
|
GST_BIN_FLAG_LAST = GST_ELEMENT_FLAG_LAST + 5,
|
||||||
} GstBinFlags;
|
} GstBinFlags;
|
||||||
|
|
|
@ -717,7 +717,7 @@ gst_element_request_pad_by_name (GstElement *element, const gchar *name)
|
||||||
gboolean templ_found = FALSE;
|
gboolean templ_found = FALSE;
|
||||||
GList *list;
|
GList *list;
|
||||||
gint n;
|
gint n;
|
||||||
gchar *str;
|
gchar *str, *data, *endptr;
|
||||||
|
|
||||||
g_return_val_if_fail (element != NULL, NULL);
|
g_return_val_if_fail (element != NULL, NULL);
|
||||||
g_return_val_if_fail (GST_IS_ELEMENT (element), NULL);
|
g_return_val_if_fail (GST_IS_ELEMENT (element), NULL);
|
||||||
|
@ -734,16 +734,22 @@ gst_element_request_pad_by_name (GstElement *element, const gchar *name)
|
||||||
while (!templ_found && list) {
|
while (!templ_found && list) {
|
||||||
templ = (GstPadTemplate*) list->data;
|
templ = (GstPadTemplate*) list->data;
|
||||||
if (templ->presence == GST_PAD_REQUEST) {
|
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 */
|
checks in gst_padtemplate_new */
|
||||||
if (strstr (templ->name_template, "%d")) {
|
if ((str = strchr (templ->name_template, '%')) &&
|
||||||
if (sscanf(name, templ->name_template, &n)) {
|
strncmp (templ->name_template, name, str - templ->name_template) == 0 &&
|
||||||
templ_found = TRUE;
|
strlen (name) > str - templ->name_template) {
|
||||||
req_name = name;
|
data = name + (str - templ->name_template);
|
||||||
break;
|
if (*(str+1) == 'd') {
|
||||||
}
|
/* it's an int */
|
||||||
} else if (strstr (templ->name_template, "%s")) {
|
n = (gint) strtol (data, &endptr, 10);
|
||||||
if (sscanf(name, templ->name_template, &str)) {
|
if (endptr == NULL) {
|
||||||
|
templ_found = TRUE;
|
||||||
|
req_name = name;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
/* it's a string */
|
||||||
templ_found = TRUE;
|
templ_found = TRUE;
|
||||||
req_name = name;
|
req_name = name;
|
||||||
break;
|
break;
|
||||||
|
@ -774,7 +780,6 @@ gst_element_request_pad_by_name (GstElement *element, const gchar *name)
|
||||||
*
|
*
|
||||||
* Returns: the pad to which a connection can be made
|
* Returns: the pad to which a connection can be made
|
||||||
*/
|
*/
|
||||||
|
|
||||||
GstPad*
|
GstPad*
|
||||||
gst_element_get_compatible_pad_filtered (GstElement *element, GstPad *pad, GstCaps *filtercaps)
|
gst_element_get_compatible_pad_filtered (GstElement *element, GstPad *pad, GstCaps *filtercaps)
|
||||||
{
|
{
|
||||||
|
|
|
@ -2039,6 +2039,11 @@ name_is_valid (const gchar *name, GstPadPresence presence)
|
||||||
" type '%%d' or '%%s' for GST_PAD_REQUEST padtemplate", name);
|
" type '%%d' or '%%s' for GST_PAD_REQUEST padtemplate", name);
|
||||||
return FALSE;
|
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;
|
return TRUE;
|
||||||
|
|
|
@ -14,8 +14,8 @@ libgststandardscheduler_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
|
||||||
|
|
||||||
libgstfastscheduler_la_SOURCES = gstfastscheduler.c
|
libgstfastscheduler_la_SOURCES = gstfastscheduler.c
|
||||||
libgstfastscheduler_la_CFLAGS = $(GST_CFLAGS)
|
libgstfastscheduler_la_CFLAGS = $(GST_CFLAGS)
|
||||||
libgstfastscheduler_la_LIBADD = $(GST_LIBS) ../libcothreads.la
|
libgstfastscheduler_la_LIBADD = ../libcothreads.la
|
||||||
libgstfastscheduler_la_LDFLAGS = @GST_LT_LDFLAGS@
|
libgstfastscheduler_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
|
||||||
|
|
||||||
## this is a REALLY evil hack
|
## this is a REALLY evil hack
|
||||||
## but we need to keep it as long as we have libs/gst and libs/ext
|
## but we need to keep it as long as we have libs/gst and libs/ext
|
||||||
|
|
|
@ -549,7 +549,7 @@ gst_filesrc_get (GstPad *pad)
|
||||||
|
|
||||||
/* we're done, return the buffer */
|
/* we're done, return the buffer */
|
||||||
src->curoffset += GST_BUFFER_SIZE(buf);
|
src->curoffset += GST_BUFFER_SIZE(buf);
|
||||||
//g_object_notify (G_OBJECT (src), "offset");
|
g_object_notify (G_OBJECT (src), "offset");
|
||||||
return buf;
|
return buf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -590,7 +590,7 @@ gst_filesrc_open_file (GstFileSrc *src)
|
||||||
/* now notify of the changes */
|
/* now notify of the changes */
|
||||||
g_object_freeze_notify (G_OBJECT (src));
|
g_object_freeze_notify (G_OBJECT (src));
|
||||||
g_object_notify (G_OBJECT (src), "filesize");
|
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));
|
g_object_thaw_notify (G_OBJECT (src));
|
||||||
|
|
||||||
GST_FLAG_SET (src, GST_FILESRC_OPEN);
|
GST_FLAG_SET (src, GST_FILESRC_OPEN);
|
||||||
|
@ -614,7 +614,7 @@ gst_filesrc_close_file (GstFileSrc *src)
|
||||||
/* and notify that things changed */
|
/* and notify that things changed */
|
||||||
g_object_freeze_notify (G_OBJECT (src));
|
g_object_freeze_notify (G_OBJECT (src));
|
||||||
g_object_notify (G_OBJECT (src), "filesize");
|
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));
|
g_object_thaw_notify (G_OBJECT (src));
|
||||||
|
|
||||||
if (src->mapbuf)
|
if (src->mapbuf)
|
||||||
|
|
|
@ -44,14 +44,11 @@ property_change_callback (GObject *object, GstObject *orig, GParamSpec *pspec)
|
||||||
GValue value = { 0, }; /* the important thing is that value.type = 0 */
|
GValue value = { 0, }; /* the important thing is that value.type = 0 */
|
||||||
gchar *str = 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_value_init(&value, G_PARAM_SPEC_VALUE_TYPE (pspec));
|
||||||
g_object_get_property (G_OBJECT (orig), pspec->name, &value);
|
g_object_get_property (G_OBJECT (orig), pspec->name, &value);
|
||||||
/* fix current bug with g_strdup_value_contents not working with gint64 */
|
str = g_strdup_value_contents (&value);
|
||||||
if (G_IS_PARAM_SPEC_INT64 (pspec))
|
|
||||||
str = g_strdup_printf ("%lld", g_value_get_int64 (&value));
|
|
||||||
else
|
|
||||||
str = g_strdup_value_contents (&value);
|
|
||||||
g_print ("%s: %s = %s\n", GST_OBJECT_NAME (orig), pspec->name, str);
|
g_print ("%s: %s = %s\n", GST_OBJECT_NAME (orig), pspec->name, str);
|
||||||
g_free (str);
|
g_free (str);
|
||||||
g_value_unset(&value);
|
g_value_unset(&value);
|
||||||
|
@ -162,8 +159,6 @@ main(int argc, char *argv[])
|
||||||
launch_argc = argc;
|
launch_argc = argc;
|
||||||
launch_argv = argv;
|
launch_argv = argv;
|
||||||
|
|
||||||
//gst_schedulerfactory_set_default_name ("fast");
|
|
||||||
|
|
||||||
/* make a null-terminated version of argv */
|
/* make a null-terminated version of argv */
|
||||||
argvn = g_new0 (char *,argc);
|
argvn = g_new0 (char *,argc);
|
||||||
memcpy (argvn, argv+1, sizeof (char*) * (argc-1));
|
memcpy (argvn, argv+1, sizeof (char*) * (argc-1));
|
||||||
|
@ -196,12 +191,12 @@ main(int argc, char *argv[])
|
||||||
exit (-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);
|
g_idle_add (idle_func, pipeline);
|
||||||
gst_main ();
|
gst_main ();
|
||||||
} else {
|
} else {
|
||||||
g_print ("sleeping 100...\n");
|
g_print ("waiting for the state change...\n");
|
||||||
sleep (100);
|
gst_element_wait_state_change (pipeline);
|
||||||
}
|
}
|
||||||
|
|
||||||
gst_element_set_state (pipeline, GST_STATE_NULL);
|
gst_element_set_state (pipeline, GST_STATE_NULL);
|
||||||
|
|
Loading…
Reference in a new issue