aboutsummaryrefslogtreecommitdiff
path: root/gst
diff options
context:
space:
mode:
Diffstat (limited to 'gst')
-rw-r--r--gst/Makefile.in2
-rw-r--r--gst/gst.c46
-rw-r--r--gst/gstbin.c36
-rw-r--r--gst/gstbuffer.c2
-rw-r--r--gst/gstcaps.c10
-rw-r--r--gst/gstclock.c33
-rw-r--r--gst/gstelement.c2
-rw-r--r--gst/gstevent.c51
-rw-r--r--gst/gstevent.h3
-rw-r--r--gst/gstinfo.c222
-rw-r--r--gst/gstinfo.h20
-rw-r--r--gst/gstmessage.c85
-rw-r--r--gst/gstmessage.h5
-rw-r--r--gst/gstpad.c25
-rw-r--r--gst/gstquark.c3
-rw-r--r--gst/gstquark.h4
-rw-r--r--gst/gstquery.c64
-rw-r--r--gst/gstquery.h6
-rw-r--r--gst/gstutils.c17
-rw-r--r--gst/gstutils.h1
-rw-r--r--gst/gstvalue.c22
-rw-r--r--gst/parse/Makefile.in2
-rw-r--r--gst/printf/Makefile.in2
23 files changed, 537 insertions, 126 deletions
diff --git a/gst/Makefile.in b/gst/Makefile.in
index 7eb7607..f82da8d 100644
--- a/gst/Makefile.in
+++ b/gst/Makefile.in
@@ -483,6 +483,7 @@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@
GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@
GTKDOC_MKPDF = @GTKDOC_MKPDF@
GTKDOC_REBASE = @GTKDOC_REBASE@
+HAVE_DOCBOOK2HTML = @HAVE_DOCBOOK2HTML@
HAVE_DOCBOOK2PS = @HAVE_DOCBOOK2PS@
HAVE_DVIPS = @HAVE_DVIPS@
HAVE_EPSTOPDF = @HAVE_EPSTOPDF@
@@ -493,7 +494,6 @@ HAVE_PNGTOPNM = @HAVE_PNGTOPNM@
HAVE_PNMTOPS = @HAVE_PNMTOPS@
HAVE_PS2PDF = @HAVE_PS2PDF@
HAVE_XMLLINT = @HAVE_XMLLINT@
-HAVE_XSLTPROC = @HAVE_XSLTPROC@
HOST_CPU = @HOST_CPU@
HTML_DIR = @HTML_DIR@
INSTALL = @INSTALL@
diff --git a/gst/gst.c b/gst/gst.c
index 950fc18..dfed6d9 100644
--- a/gst/gst.c
+++ b/gst/gst.c
@@ -176,6 +176,7 @@ enum
ARG_DEBUG,
ARG_DEBUG_DISABLE,
ARG_DEBUG_NO_COLOR,
+ ARG_DEBUG_COLOR_MODE,
ARG_DEBUG_HELP,
#endif
ARG_PLUGIN_SPEW,
@@ -250,6 +251,11 @@ gst_init_get_option_group (void)
{"gst-debug-no-color", 0, G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK,
(gpointer) parse_goption_arg, N_("Disable colored debugging output"),
NULL},
+ {"gst-debug-color-mode", 0, 0, G_OPTION_ARG_CALLBACK,
+ (gpointer) parse_goption_arg,
+ N_("Changes coloring mode of the debug log. "
+ "Possible modes: off, on, disable, auto, unix"),
+ NULL},
{"gst-debug-disable", 0, G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK,
(gpointer) parse_goption_arg, N_("Disable debugging"), NULL},
#endif
@@ -475,9 +481,13 @@ init_pre (GOptionContext * context, GOptionGroup * group, gpointer data,
#ifndef GST_DISABLE_GST_DEBUG
{
const gchar *debug_list;
+ const gchar *color_mode;
if (g_getenv ("GST_DEBUG_NO_COLOR") != NULL)
- gst_debug_set_colored (FALSE);
+ gst_debug_set_color_mode (GST_DEBUG_COLOR_MODE_OFF);
+ color_mode = g_getenv ("GST_DEBUG_COLOR_MODE");
+ if (color_mode)
+ gst_debug_set_color_mode_from_string (color_mode);
debug_list = g_getenv ("GST_DEBUG");
if (debug_list) {
@@ -743,9 +753,27 @@ gst_debug_help (void)
g_print ("---------------------+--------+--------------------------------\n");
while (walk) {
+ gboolean on_unix;
GstDebugCategory *cat = (GstDebugCategory *) walk->data;
+ GstDebugColorMode coloring = gst_debug_get_color_mode ();
+#ifdef G_OS_UNIX
+ on_unix = TRUE;
+#else
+ on_unix = FALSE;
+#endif
+
+ if (GST_DEBUG_COLOR_MODE_UNIX == coloring
+ || (on_unix && GST_DEBUG_COLOR_MODE_ON == coloring)) {
+ gchar *color = gst_debug_construct_term_color (cat->color);
- if (gst_debug_is_colored ()) {
+ g_print ("%s%-20s\033[00m %1d %s %s%s\033[00m\n",
+ color,
+ gst_debug_category_get_name (cat),
+ gst_debug_category_get_threshold (cat),
+ gst_debug_level_get_name (gst_debug_category_get_threshold (cat)),
+ color, gst_debug_category_get_description (cat));
+ g_free (color);
+ } else if (GST_DEBUG_COLOR_MODE_ON == coloring && !on_unix) {
#ifdef G_OS_WIN32
gint color = gst_debug_construct_win_color (cat->color);
const gint clear = FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE;
@@ -759,16 +787,6 @@ gst_debug_help (void)
g_print ("%s", gst_debug_category_get_description (cat));
SetConsoleTextAttribute (GetStdHandle (STD_OUTPUT_HANDLE), clear);
g_print ("\n");
-#else /* G_OS_WIN32 */
- gchar *color = gst_debug_construct_term_color (cat->color);
-
- g_print ("%s%-20s\033[00m %1d %s %s%s\033[00m\n",
- color,
- gst_debug_category_get_name (cat),
- gst_debug_category_get_threshold (cat),
- gst_debug_level_get_name (gst_debug_category_get_threshold (cat)),
- color, gst_debug_category_get_description (cat));
- g_free (color);
#endif /* G_OS_WIN32 */
} else {
g_print ("%-20s %1d %s %s\n", gst_debug_category_get_name (cat),
@@ -815,6 +833,9 @@ parse_one_option (gint opt, const gchar * arg, GError ** err)
case ARG_DEBUG_NO_COLOR:
gst_debug_set_colored (FALSE);
break;
+ case ARG_DEBUG_COLOR_MODE:
+ gst_debug_set_color_mode_from_string (arg);
+ break;
case ARG_DEBUG_DISABLE:
gst_debug_set_active (FALSE);
break;
@@ -870,6 +891,7 @@ parse_goption_arg (const gchar * opt,
"--gst-debug", ARG_DEBUG}, {
"--gst-debug-disable", ARG_DEBUG_DISABLE}, {
"--gst-debug-no-color", ARG_DEBUG_NO_COLOR}, {
+ "--gst-debug-color-mode", ARG_DEBUG_COLOR_MODE}, {
"--gst-debug-help", ARG_DEBUG_HELP},
#endif
{
diff --git a/gst/gstbin.c b/gst/gstbin.c
index cc4de10..6da31e8 100644
--- a/gst/gstbin.c
+++ b/gst/gstbin.c
@@ -1011,12 +1011,16 @@ is_eos (GstBin * bin, guint32 * seqnum)
*
* call with bin LOCK */
static gboolean
-is_stream_start (GstBin * bin, guint32 * seqnum)
+is_stream_start (GstBin * bin, guint32 * seqnum, gboolean * have_group_id,
+ guint * group_id)
{
gboolean result;
- gint n_stream_start = 0;
GList *walk, *msgs;
+ guint tmp_group_id;
+ gboolean first = TRUE, same_group_id = TRUE;
+ *have_group_id = TRUE;
+ *group_id = 0;
result = TRUE;
for (walk = bin->children; walk; walk = g_list_next (walk)) {
GstElement *element;
@@ -1029,7 +1033,18 @@ is_stream_start (GstBin * bin, guint32 * seqnum)
GST_MESSAGE_STREAM_START))) {
GST_DEBUG ("sink '%s' posted STREAM_START", GST_ELEMENT_NAME (element));
*seqnum = gst_message_get_seqnum (GST_MESSAGE_CAST (msgs->data));
- n_stream_start++;
+ if (gst_message_parse_group_id (GST_MESSAGE_CAST (msgs->data),
+ &tmp_group_id)) {
+ if (first) {
+ first = FALSE;
+ *group_id = tmp_group_id;
+ } else {
+ if (tmp_group_id != *group_id)
+ same_group_id = FALSE;
+ }
+ } else {
+ *have_group_id = FALSE;
+ }
} else {
GST_DEBUG ("sink '%s' did not post STREAM_START yet",
GST_ELEMENT_NAME (element));
@@ -1039,6 +1054,14 @@ is_stream_start (GstBin * bin, guint32 * seqnum)
}
}
+ /* If all have a group_id we only consider this stream started
+ * if all group ids were the same and all sinks posted a stream-start
+ * message */
+ if (*have_group_id)
+ return same_group_id && result;
+ /* otherwise consider this stream started after all sinks
+ * have reported stream-start for backward compatibility.
+ * FIXME 2.0: This should go away! */
return result;
}
@@ -3195,12 +3218,14 @@ bin_do_stream_start (GstBin * bin)
{
guint32 seqnum = 0;
gboolean stream_start;
+ gboolean have_group_id = FALSE;
+ guint group_id = 0;
GST_OBJECT_LOCK (bin);
/* If all sinks are STREAM_START we forward the STREAM_START message
* to the parent bin or application
*/
- stream_start = is_stream_start (bin, &seqnum);
+ stream_start = is_stream_start (bin, &seqnum, &have_group_id, &group_id);
GST_OBJECT_UNLOCK (bin);
if (stream_start) {
@@ -3212,6 +3237,9 @@ bin_do_stream_start (GstBin * bin)
tmessage = gst_message_new_stream_start (GST_OBJECT_CAST (bin));
gst_message_set_seqnum (tmessage, seqnum);
+ if (have_group_id)
+ gst_message_set_group_id (tmessage, group_id);
+
GST_DEBUG_OBJECT (bin,
"all sinks posted STREAM_START, posting seqnum #%" G_GUINT32_FORMAT,
seqnum);
diff --git a/gst/gstbuffer.c b/gst/gstbuffer.c
index 8212ec2..00358f3 100644
--- a/gst/gstbuffer.c
+++ b/gst/gstbuffer.c
@@ -2096,7 +2096,7 @@ gst_buffer_foreach_meta (GstBuffer * buffer, GstBufferForeachMetaFunc func,
* Extracts a copy of at most @size bytes the data at @offset into a #GBytes.
* @dest must be freed using g_free() when done.
*
- * Since: 3.2
+ * Since: 1.2
*/
void
diff --git a/gst/gstcaps.c b/gst/gstcaps.c
index 12c49eb..7e10a2a 100644
--- a/gst/gstcaps.c
+++ b/gst/gstcaps.c
@@ -624,6 +624,8 @@ gst_caps_append_structure (GstCaps * caps, GstStructure * structure)
*
* Appends @structure with @features to @caps. The structure is not copied; @caps
* becomes the owner of @structure.
+ *
+ * Since: 1.2
*/
void
gst_caps_append_structure_full (GstCaps * caps, GstStructure * structure,
@@ -714,6 +716,8 @@ gst_caps_merge_structure (GstCaps * caps, GstStructure * structure)
* Appends @structure with @features to @caps if its not already expressed by @caps.
*
* Returns: (transfer full): the merged caps.
+ *
+ * Since: 1.2
*/
GstCaps *
gst_caps_merge_structure_full (GstCaps * caps, GstStructure * structure,
@@ -834,6 +838,8 @@ gst_caps_get_structure (const GstCaps * caps, guint index)
*
* Returns: (transfer none): a pointer to the #GstCapsFeatures corresponding
* to @index
+ *
+ * Since: 1.2
*/
GstCapsFeatures *
gst_caps_get_features (const GstCaps * caps, guint index)
@@ -857,6 +863,8 @@ gst_caps_get_features (const GstCaps * caps, guint index)
* @features: (allow-none) (transfer full): the #GstFeatures to set
*
* Sets the #GstCapsFeatures @features for the structure at @index.
+ *
+ * Since: 1.2
*/
void
gst_caps_set_features (GstCaps * caps, guint index, GstCapsFeatures * features)
@@ -1250,6 +1258,8 @@ gst_caps_is_subset_structure (const GstCaps * caps,
* for more information.
*
* Returns: %TRUE if @structure is a subset of @caps
+ *
+ * Since: 1.2
*/
gboolean
gst_caps_is_subset_structure_full (const GstCaps * caps,
diff --git a/gst/gstclock.c b/gst/gstclock.c
index 707f88b..f7ef07d 100644
--- a/gst/gstclock.c
+++ b/gst/gstclock.c
@@ -193,6 +193,36 @@ G_STMT_START { \
GST_OBJECT_UNLOCK (clock); \
} G_STMT_END;
+typedef struct
+{
+ const gint ret;
+ const gchar *name;
+ GQuark quark;
+} GstClockQuarks;
+
+static GstClockQuarks clock_quarks[] = {
+ {GST_CLOCK_OK, "ok", 0},
+ {GST_CLOCK_EARLY, "early", 0},
+ {GST_CLOCK_UNSCHEDULED, "unscheduled", 0},
+ {GST_CLOCK_BUSY, "busy", 0},
+ {GST_CLOCK_BADTIME, "bad-time", 0},
+ {GST_CLOCK_ERROR, "error", 0},
+ {GST_CLOCK_UNSUPPORTED, "unsupported", 0},
+ {GST_CLOCK_DONE, "done", 0}
+};
+
+static const gchar *
+gst_clock_return_get_name (GstClockReturn ret)
+{
+ gint i;
+
+ for (i = 0; i < G_N_ELEMENTS (clock_quarks); i++) {
+ if (ret == clock_quarks[i].ret)
+ return clock_quarks[i].name;
+ }
+ return "unknown";
+}
+
static void gst_clock_dispose (GObject * object);
static void gst_clock_finalize (GObject * object);
@@ -512,7 +542,8 @@ gst_clock_id_wait (GstClockID id, GstClockTimeDiff * jitter)
res = cclass->wait (clock, entry, jitter);
GST_CAT_DEBUG_OBJECT (GST_CAT_CLOCK, clock,
- "done waiting entry %p, res: %d", id, res);
+ "done waiting entry %p, res: %d (%s)", id, res,
+ gst_clock_return_get_name (res));
if (entry->type == GST_CLOCK_ENTRY_PERIODIC)
entry->time = requested + entry->interval;
diff --git a/gst/gstelement.c b/gst/gstelement.c
index 587de1b..7ee52e3 100644
--- a/gst/gstelement.c
+++ b/gst/gstelement.c
@@ -3082,5 +3082,5 @@ gst_element_get_context (GstElement * element)
context = gst_context_ref (element->context);
GST_OBJECT_UNLOCK (element);
- return context;
+ return context ? context : gst_context_new ();
}
diff --git a/gst/gstevent.c b/gst/gstevent.c
index 0874471..f47c928 100644
--- a/gst/gstevent.c
+++ b/gst/gstevent.c
@@ -1474,6 +1474,57 @@ gst_event_parse_stream_flags (GstEvent * event, GstStreamFlags * flags)
}
/**
+ * gst_event_set_group_id:
+ * @event: a stream-start event
+ * @group_id: the group id to set
+ *
+ * All streams that have the same group id are supposed to be played
+ * together, i.e. all streams inside a container file should have the
+ * same group id but different stream ids. The group id should change
+ * each time the stream is started, resulting in different group ids
+ * each time a file is played for example.
+ *
+ * Use gst_util_group_id_next() to get a new group id.
+ *
+ * Since: 1.2
+ */
+void
+gst_event_set_group_id (GstEvent * event, guint group_id)
+{
+ g_return_if_fail (event != NULL);
+ g_return_if_fail (GST_EVENT_TYPE (event) == GST_EVENT_STREAM_START);
+ g_return_if_fail (gst_event_is_writable (event));
+
+ gst_structure_id_set (GST_EVENT_STRUCTURE (event),
+ GST_QUARK (GROUP_ID), G_TYPE_UINT, group_id, NULL);
+}
+
+/**
+ * gst_event_parse_group_id:
+ * @event: a stream-start event
+ * @group_id: (out): address of variable where to store the group id
+ *
+ * Returns: %TRUE if a group id was set on the event and could be parsed,
+ * %FALSE otherwise.
+ *
+ * Since: 1.2
+ */
+gboolean
+gst_event_parse_group_id (GstEvent * event, guint * group_id)
+{
+ g_return_val_if_fail (event != NULL, FALSE);
+ g_return_val_if_fail (GST_EVENT_TYPE (event) == GST_EVENT_STREAM_START,
+ FALSE);
+
+ if (group_id) {
+ return gst_structure_id_get (GST_EVENT_STRUCTURE (event),
+ GST_QUARK (GROUP_ID), G_TYPE_UINT, group_id, NULL);
+ }
+
+ return TRUE;
+}
+
+/**
* gst_event_new_toc:
* @toc: (transfer none): #GstToc structure.
* @updated: whether @toc was updated or not.
diff --git a/gst/gstevent.h b/gst/gstevent.h
index 1c4104f..f4723ec 100644
--- a/gst/gstevent.h
+++ b/gst/gstevent.h
@@ -492,6 +492,9 @@ void gst_event_parse_stream_start (GstEvent *event, const gchar **
void gst_event_set_stream_flags (GstEvent *event, GstStreamFlags flags);
void gst_event_parse_stream_flags (GstEvent *event, GstStreamFlags *flags);
+void gst_event_set_group_id (GstEvent *event, guint group_id);
+gboolean gst_event_parse_group_id (GstEvent *event, guint *group_id);
+
/* flush events */
GstEvent * gst_event_new_flush_start (void) G_GNUC_MALLOC;
diff --git a/gst/gstinfo.c b/gst/gstinfo.c
index 93cb188..4419817 100644
--- a/gst/gstinfo.c
+++ b/gst/gstinfo.c
@@ -263,7 +263,7 @@ static GSList *__log_functions = NULL;
static gboolean pretty_tags = PRETTY_TAGS_DEFAULT;
static volatile gint G_GNUC_MAY_ALIAS __default_level = GST_LEVEL_DEFAULT;
-static volatile gint G_GNUC_MAY_ALIAS __use_color = 1;
+static volatile gint G_GNUC_MAY_ALIAS __use_color = GST_DEBUG_COLOR_MODE_ON;
static FILE *log_file;
@@ -438,7 +438,7 @@ gst_debug_log (GstDebugCategory * category, GstDebugLevel level,
va_end (var_args);
}
-#ifdef _MSC_VER
+#ifdef G_OS_WIN32
/* based on g_basename(), which we can't use because it was deprecated */
static inline const gchar *
gst_path_basename (const gchar * file_name)
@@ -494,7 +494,7 @@ gst_debug_log_valist (GstDebugCategory * category, GstDebugLevel level,
/* The predefined macro __FILE__ is always the exact path given to the
* compiler with MSVC, which may or may not be the basename. We work
* around it at runtime to improve the readability. */
-#ifdef _MSC_VER
+#ifdef G_OS_WIN32
file = gst_path_basename (file);
#endif
@@ -868,10 +868,12 @@ gst_debug_construct_win_color (guint colorinfo)
};
/* we draw black as white, as cmd.exe can only have black bg */
- if (colorinfo == 0) {
- return ansi_to_win_fg[7];
+ if ((colorinfo & (GST_DEBUG_FG_MASK | GST_DEBUG_BG_MASK)) == 0) {
+ color = ansi_to_win_fg[7];
+ }
+ if (colorinfo & GST_DEBUG_UNDERLINE) {
+ color |= BACKGROUND_INTENSITY;
}
-
if (colorinfo & GST_DEBUG_BOLD) {
color |= FOREGROUND_INTENSITY;
}
@@ -898,7 +900,7 @@ gst_debug_construct_win_color (guint colorinfo)
#define CAT_FMT "%20s %s:%d:%s:%s"
#ifdef G_OS_WIN32
-static const guchar levelcolormap[GST_LEVEL_COUNT] = {
+static const guchar levelcolormap_w32[GST_LEVEL_COUNT] = {
/* GST_LEVEL_NONE */
FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE,
/* GST_LEVEL_ERROR */
@@ -926,7 +928,7 @@ static const guchar available_colors[] = {
FOREGROUND_BLUE, FOREGROUND_RED | FOREGROUND_BLUE,
FOREGROUND_GREEN | FOREGROUND_BLUE,
};
-#else
+#endif /* G_OS_WIN32 */
static const gchar *levelcolormap[GST_LEVEL_COUNT] = {
"\033[37m", /* GST_LEVEL_NONE */
"\033[31;01m", /* GST_LEVEL_ERROR */
@@ -939,7 +941,6 @@ static const gchar *levelcolormap[GST_LEVEL_COUNT] = {
"\033[37m", /* placeholder for log level 8 */
"\033[37m" /* GST_LEVEL_MEMDUMP */
};
-#endif
/**
* gst_debug_log_default:
@@ -970,13 +971,13 @@ gst_debug_log_default (GstDebugCategory * category, GstDebugLevel level,
gint pid;
GstClockTime elapsed;
gchar *obj = NULL;
- gboolean is_colored;
+ GstDebugColorMode color_mode;
if (level > gst_debug_category_get_threshold (category))
return;
pid = getpid ();
- is_colored = gst_debug_is_colored ();
+ color_mode = gst_debug_get_color_mode ();
if (object) {
obj = gst_debug_print_object (object);
@@ -987,65 +988,70 @@ gst_debug_log_default (GstDebugCategory * category, GstDebugLevel level,
elapsed = GST_CLOCK_DIFF (_priv_gst_info_start_time,
gst_util_get_timestamp ());
- if (is_colored) {
-#ifndef G_OS_WIN32
- /* colors, non-windows */
- gchar *color = NULL;
- const gchar *clear;
- gchar pidcolor[10];
- const gchar *levelcolor;
-
- color = gst_debug_construct_term_color (gst_debug_category_get_color
- (category));
- clear = "\033[00m";
- g_sprintf (pidcolor, "\033[3%1dm", pid % 6 + 31);
- levelcolor = levelcolormap[level];
-
-#define PRINT_FMT " %s"PID_FMT"%s "PTR_FMT" %s%s%s %s"CAT_FMT"%s %s\n"
- fprintf (log_file, "%" GST_TIME_FORMAT PRINT_FMT, GST_TIME_ARGS (elapsed),
- pidcolor, pid, clear, g_thread_self (), levelcolor,
- gst_debug_level_get_name (level), clear, color,
- gst_debug_category_get_name (category), file, line, function, obj,
- clear, gst_debug_message_get (message));
- fflush (log_file);
-#undef PRINT_FMT
- g_free (color);
-#else
- /* colors, windows. We take a lock to keep colors and content together.
+ if (color_mode != GST_DEBUG_COLOR_MODE_OFF) {
+#ifdef G_OS_WIN32
+ /* We take a lock to keep colors and content together.
* Maybe there is a better way but for now this will do the right
* thing. */
static GMutex win_print_mutex;
- const gint clear = FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE;
+ g_mutex_lock (&win_print_mutex);
+ if (color_mode == GST_DEBUG_COLOR_MODE_UNIX) {
+#endif
+ /* colors, non-windows */
+ gchar *color = NULL;
+ const gchar *clear;
+ gchar pidcolor[10];
+ const gchar *levelcolor;
+
+ color = gst_debug_construct_term_color (gst_debug_category_get_color
+ (category));
+ clear = "\033[00m";
+ g_sprintf (pidcolor, "\033[3%1dm", pid % 6 + 31);
+ levelcolor = levelcolormap[level];
+
+#define PRINT_FMT " %s"PID_FMT"%s "PTR_FMT" %s%s%s %s"CAT_FMT"%s %s\n"
+ fprintf (log_file, "%" GST_TIME_FORMAT PRINT_FMT, GST_TIME_ARGS (elapsed),
+ pidcolor, pid, clear, g_thread_self (), levelcolor,
+ gst_debug_level_get_name (level), clear, color,
+ gst_debug_category_get_name (category), file, line, function, obj,
+ clear, gst_debug_message_get (message));
+ fflush (log_file);
+#undef PRINT_FMT
+ g_free (color);
+#ifdef G_OS_WIN32
+ } else {
+ /* colors, windows. */
+ const gint clear = FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE;
#define SET_COLOR(c) G_STMT_START { \
if (log_file == stderr) \
SetConsoleTextAttribute (GetStdHandle (STD_ERROR_HANDLE), (c)); \
} G_STMT_END
- g_mutex_lock (&win_print_mutex);
- /* timestamp */
- fprintf (log_file, "%" GST_TIME_FORMAT " ", GST_TIME_ARGS (elapsed));
- fflush (log_file);
- /* pid */
- SET_COLOR (available_colors[pid % G_N_ELEMENTS (available_colors)]);
- fprintf (log_file, PID_FMT, pid);
- fflush (log_file);
- /* thread */
- SET_COLOR (clear);
- fprintf (log_file, " " PTR_FMT " ", g_thread_self ());
- fflush (log_file);
- /* level */
- SET_COLOR (levelcolormap[level]);
- fprintf (log_file, "%s ", gst_debug_level_get_name (level));
- fflush (log_file);
- /* category */
- SET_COLOR (gst_debug_construct_win_color (gst_debug_category_get_color
- (category)));
- fprintf (log_file, CAT_FMT, gst_debug_category_get_name (category),
- file, line, function, obj);
- fflush (log_file);
- /* message */
- SET_COLOR (clear);
- fprintf (log_file, " %s\n", gst_debug_message_get (message));
- fflush (log_file);
+ /* timestamp */
+ fprintf (log_file, "%" GST_TIME_FORMAT " ", GST_TIME_ARGS (elapsed));
+ fflush (log_file);
+ /* pid */
+ SET_COLOR (available_colors[pid % G_N_ELEMENTS (available_colors)]);
+ fprintf (log_file, PID_FMT, pid);
+ fflush (log_file);
+ /* thread */
+ SET_COLOR (clear);
+ fprintf (log_file, " " PTR_FMT " ", g_thread_self ());
+ fflush (log_file);
+ /* level */
+ SET_COLOR (levelcolormap_w32[level]);
+ fprintf (log_file, "%s ", gst_debug_level_get_name (level));
+ fflush (log_file);
+ /* category */
+ SET_COLOR (gst_debug_construct_win_color (gst_debug_category_get_color
+ (category)));
+ fprintf (log_file, CAT_FMT, gst_debug_category_get_name (category),
+ file, line, function, obj);
+ fflush (log_file);
+ /* message */
+ SET_COLOR (clear);
+ fprintf (log_file, " %s\n", gst_debug_message_get (message));
+ fflush (log_file);
+ }
g_mutex_unlock (&win_print_mutex);
#endif
} else {
@@ -1246,13 +1252,55 @@ gst_debug_remove_log_function_by_data (gpointer data)
* @colored: Whether to use colored output or not
*
* Sets or unsets the use of coloured debugging output.
+ * Same as gst_debug_set_color_mode () with the argument being
+ * being GST_DEBUG_COLOR_MODE_ON or GST_DEBUG_COLOR_MODE_OFF.
*
* This function may be called before gst_init().
*/
void
gst_debug_set_colored (gboolean colored)
{
- g_atomic_int_set (&__use_color, (gint) colored);
+ GstDebugColorMode new_mode;
+ new_mode = colored ? GST_DEBUG_COLOR_MODE_ON : GST_DEBUG_COLOR_MODE_OFF;
+ g_atomic_int_set (&__use_color, (gint) new_mode);
+}
+
+/**
+ * gst_debug_set_color_mode:
+ * @mode: The coloring mode for debug output. See @GstDebugColorMode.
+ *
+ * Changes the coloring mode for debug output.
+ *
+ * This function may be called before gst_init().
+ *
+ * Since: 1.2
+ */
+void
+gst_debug_set_color_mode (GstDebugColorMode mode)
+{
+ g_atomic_int_set (&__use_color, mode);
+}
+
+/**
+ * gst_debug_set_color_mode_from_string:
+ * @mode: The coloring mode for debug output. One of the following:
+ * "on", "auto", "off", "disable", "unix".
+ *
+ * Changes the coloring mode for debug output.
+ *
+ * This function may be called before gst_init().
+ *
+ * Since: 1.2
+ */
+void
+gst_debug_set_color_mode_from_string (const gchar * str)
+{
+ if ((strcmp (str, "on") == 0) || (strcmp (str, "auto") == 0))
+ gst_debug_set_color_mode (GST_DEBUG_COLOR_MODE_ON);
+ else if ((strcmp (str, "off") == 0) || (strcmp (str, "disable") == 0))
+ gst_debug_set_color_mode (GST_DEBUG_COLOR_MODE_OFF);
+ else if (strcmp (str, "unix") == 0)
+ gst_debug_set_color_mode (GST_DEBUG_COLOR_MODE_UNIX);
}
/**
@@ -1265,7 +1313,23 @@ gst_debug_set_colored (gboolean colored)
gboolean
gst_debug_is_colored (void)
{
- return (gboolean) g_atomic_int_get (&__use_color);
+ GstDebugColorMode mode = g_atomic_int_get (&__use_color);
+ return (mode == GST_DEBUG_COLOR_MODE_UNIX || mode == GST_DEBUG_COLOR_MODE_ON);
+}
+
+/**
+ * gst_debug_get_color_mode:
+ *
+ * Changes the coloring mode for debug output.
+ *
+ * Returns: see @GstDebugColorMode for possible values.
+ *
+ * Since: 1.2
+ */
+GstDebugColorMode
+gst_debug_get_color_mode (void)
+{
+ return g_atomic_int_get (&__use_color);
}
/**
@@ -1653,9 +1717,15 @@ parse_debug_level (gchar * str, GstDebugLevel * level)
/* works in place */
g_strstrip (str);
- if (str[0] != '\0' && str[1] == '\0'
- && str[0] >= '0' && str[0] < '0' + GST_LEVEL_COUNT) {
- *level = (GstDebugLevel) (str[0] - '0');
+ if (g_ascii_isdigit (str[0])) {
+ unsigned long l;
+ char *endptr;
+ l = strtoul (str, &endptr, 10);
+ if (endptr > str && endptr[0] == 0) {
+ *level = (GstDebugLevel) l;
+ } else {
+ return FALSE;
+ }
} else if (strcmp (str, "ERROR") == 0) {
*level = GST_LEVEL_ERROR;
} else if (strncmp (str, "WARN", 4) == 0) {
@@ -1936,12 +2006,28 @@ gst_debug_set_colored (gboolean colored)
{
}
+void
+gst_debug_set_color_mode (GstDebugColorMode mode)
+{
+}
+
+void
+gst_debug_set_color_mode_from_string (const gchar * str)
+{
+}
+
gboolean
gst_debug_is_colored (void)
{
return FALSE;
}
+GstDebugColorMode
+gst_debug_get_color_mode (void)
+{
+ return GST_DEBUG_COLOR_MODE_OFF;
+}
+
void
gst_debug_set_threshold_from_string (const gchar * list, gboolean reset)
{
diff --git a/gst/gstinfo.h b/gst/gstinfo.h
index 68f099b..46a81f0 100644
--- a/gst/gstinfo.h
+++ b/gst/gstinfo.h
@@ -159,6 +159,20 @@ typedef enum {
GST_DEBUG_UNDERLINE = 0x0200
} GstDebugColorFlags;
+/**
+ * GstDebugColorMode:
+ * @GST_DEBUG_COLOR_MODE_OFF: Do not use colors in logs.
+ * @GST_DEBUG_COLOR_MODE_ON: Paint logs in a platform-specific way.
+ * @GST_DEBUG_COLOR_MODE_UNIX: Paint logs with UNIX terminal color codes
+ * no matter what platform GStreamer is running on.
+ */
+typedef enum {
+ GST_DEBUG_COLOR_MODE_OFF = 0,
+ GST_DEBUG_COLOR_MODE_ON = 1,
+ GST_DEBUG_COLOR_MODE_UNIX = 2
+} GstDebugColorMode;
+
+
#define GST_DEBUG_FG_MASK (0x000F)
#define GST_DEBUG_BG_MASK (0x00F0)
#define GST_DEBUG_FORMAT_MASK (0xFF00)
@@ -339,7 +353,10 @@ void gst_debug_set_active (gboolean active);
gboolean gst_debug_is_active (void);
void gst_debug_set_colored (gboolean colored);
+void gst_debug_set_color_mode (GstDebugColorMode mode);
+void gst_debug_set_color_mode_from_string (const gchar * str);
gboolean gst_debug_is_colored (void);
+GstDebugColorMode gst_debug_get_color_mode (void);
void gst_debug_set_default_threshold (GstDebugLevel level);
GstDebugLevel gst_debug_get_default_threshold (void);
@@ -1239,7 +1256,10 @@ GST_TRACE (const char *format, ...)
#define gst_debug_set_active(active) G_STMT_START{ }G_STMT_END
#define gst_debug_is_active() (FALSE)
#define gst_debug_set_colored(colored) G_STMT_START{ }G_STMT_END
+#define gst_debug_set_color_mode(mode) G_STMT_START{ }G_STMT_END
+#define gst_debug_set_color_mode_from_string(mode) G_STMT_START{ }G_STMT_END
#define gst_debug_is_colored() (FALSE)
+#define gst_debug_get_color_mode() (GST_DEBUG_COLOR_MODE_OFF)
#define gst_debug_set_default_threshold(level) G_STMT_START{ }G_STMT_END
#define gst_debug_get_default_threshold() (GST_LEVEL_NONE)
#define gst_debug_set_threshold_for_name(name,level) G_STMT_START{ }G_STMT_END
diff --git a/gst/gstmessage.c b/gst/gstmessage.c
index cb81bf7..7ed646b 100644
--- a/gst/gstmessage.c
+++ b/gst/gstmessage.c
@@ -2146,12 +2146,83 @@ GstMessage *
gst_message_new_stream_start (GstObject * src)
{
GstMessage *message;
+ GstStructure *s;
- message = gst_message_new_custom (GST_MESSAGE_STREAM_START, src, NULL);
+ s = gst_structure_new_id_empty (GST_QUARK (MESSAGE_STREAM_START));
+ message = gst_message_new_custom (GST_MESSAGE_STREAM_START, src, s);
return message;
}
+
+/**
+ * gst_message_set_group_id:
+ * @message: the message
+ * @group_id: the group id
+ *
+ * Sets the group id on the stream-start message.
+ *
+ * All streams that have the same group id are supposed to be played
+ * together, i.e. all streams inside a container file should have the
+ * same group id but different stream ids. The group id should change
+ * each time the stream is started, resulting in different group ids
+ * each time a file is played for example.
+ *
+ * MT safe.
+ *
+ * Since: 1.2
+ */
+void
+gst_message_set_group_id (GstMessage * message, guint group_id)
+{
+ GstStructure *structure;
+
+ g_return_if_fail (GST_IS_MESSAGE (message));
+ g_return_if_fail (GST_MESSAGE_TYPE (message) == GST_MESSAGE_STREAM_START);
+ g_return_if_fail (gst_message_is_writable (message));
+
+ structure = GST_MESSAGE_STRUCTURE (message);
+ gst_structure_id_set (structure, GST_QUARK (GROUP_ID), G_TYPE_UINT, group_id,
+ NULL);
+}
+
+/**
+ * gst_message_parse_group_id:
+ * @message: A valid #GstMessage of type GST_MESSAGE_STREAM_START.
+ * @group_id: (out) (allow-none): Result location for the group id or
+ * NULL
+ *
+ * Extract the group from the STREAM_START message.
+ *
+ * Returns: %TRUE if the message had a group id set, %FALSE otherwise
+ *
+ * MT safe.
+ *
+ * Since: 1.2
+ */
+gboolean
+gst_message_parse_group_id (GstMessage * message, guint * group_id)
+{
+ GstStructure *structure;
+ const GValue *v;
+
+ g_return_val_if_fail (GST_IS_MESSAGE (message), FALSE);
+ g_return_val_if_fail (GST_MESSAGE_TYPE (message) == GST_MESSAGE_STREAM_START,
+ FALSE);
+
+ if (!group_id)
+ return TRUE;
+
+ structure = GST_MESSAGE_STRUCTURE (message);
+
+ v = gst_structure_id_get_value (structure, GST_QUARK (GROUP_ID));
+ if (!v)
+ return FALSE;
+
+ *group_id = g_value_get_uint (v);
+ return TRUE;
+}
+
/**
* gst_message_new_need_context:
* @src: (transfer none): The object originating the message.
@@ -2161,6 +2232,8 @@ gst_message_new_stream_start (GstObject * src)
* Returns: (transfer full): The new need-context message.
*
* MT safe.
+ *
+ * Since: 1.2
*/
GstMessage *
gst_message_new_need_context (GstObject * src)
@@ -2212,6 +2285,8 @@ free_array_string (gpointer ptr)
* @context_type: a context type
*
* Add a new context type to @message.
+ *
+ * Since: 1.2
*/
void
gst_message_add_context_type (GstMessage * message, const gchar * context_type)
@@ -2239,6 +2314,8 @@ gst_message_add_context_type (GstMessage * message, const gchar * context_type)
* context-types array of the message's structure.
*
* Returns: the context-types array size as a #guint.
+ *
+ * Since: 1.2
*/
guint
gst_message_get_n_context_types (GstMessage * message)
@@ -2265,6 +2342,8 @@ gst_message_get_n_context_types (GstMessage * message)
* from @index.
*
* Returns: a #gboolean indicating if the parsing succeeded.
+ *
+ * Since: 1.2
*/
gboolean
gst_message_parse_nth_context_type (GstMessage * message, guint index,
@@ -2298,6 +2377,8 @@ gst_message_parse_nth_context_type (GstMessage * message, guint index,
* Returns: (transfer full): The new have-context message.
*
* MT safe.
+ *
+ * Since: 1.2
*/
GstMessage *
gst_message_new_have_context (GstObject * src, GstContext * context)
@@ -2322,6 +2403,8 @@ gst_message_new_have_context (GstObject * src, GstContext * context)
* Extract the context from the HAVE_CONTEXT message.
*
* MT safe.
+ *
+ * Since: 1.2
*/
void
gst_message_parse_have_context (GstMessage * message, GstContext ** context)
diff --git a/gst/gstmessage.h b/gst/gstmessage.h
index 802ee17..e359187 100644
--- a/gst/gstmessage.h
+++ b/gst/gstmessage.h
@@ -97,6 +97,8 @@ typedef struct _GstMessage GstMessage;
* e.g. when using playbin in gapless playback mode, to get notified when
* the next title actually starts playing (which will be some time after
* the URI for the next title has been set).
+ * @GST_MESSAGE_NEED_CONTEXT: Message indicating that an element wants a specific context (Since 1.2)
+ * @GST_MESSAGE_HAVE_CONTEXT: Message indicating that an element created a context (Since 1.2)
* @GST_MESSAGE_ANY: mask for all of the above messages.
*
* The different message types that are available.
@@ -559,6 +561,9 @@ void gst_message_parse_reset_time (GstMessage *message, GstClockTi
/* STREAM_START */
GstMessage * gst_message_new_stream_start (GstObject * src) G_GNUC_MALLOC;
+void gst_message_set_group_id (GstMessage *message, guint group_id);
+gboolean gst_message_parse_group_id (GstMessage *message, guint *group_id);
+
/* NEED_CONTEXT */
GstMessage * gst_message_new_need_context (GstObject * src) G_GNUC_MALLOC;
void gst_message_add_context_type (GstMessage * message, const gchar * context_type);
diff --git a/gst/gstpad.c b/gst/gstpad.c
index e1f386a..3c3f484 100644
--- a/gst/gstpad.c
+++ b/gst/gstpad.c
@@ -1072,6 +1072,9 @@ gst_pad_activate_mode (GstPad * pad, GstPadMode mode, gboolean active)
break;
}
+ /* Mark pad as needing reconfiguration */
+ if (active)
+ GST_OBJECT_FLAG_SET (pad, GST_PAD_FLAG_NEED_RECONFIGURE);
pre_activate (pad, new);
if (GST_PAD_ACTIVATEMODEFUNC (pad)) {
@@ -1400,13 +1403,8 @@ gst_pad_needs_reconfigure (GstPad * pad)
g_return_val_if_fail (GST_IS_PAD (pad), FALSE);
GST_OBJECT_LOCK (pad);
- if (GST_PAD_IS_FLUSHING (pad)) {
- GST_DEBUG_OBJECT (pad, "pad is flushing");
- reconfigure = FALSE;
- } else {
- reconfigure = GST_PAD_NEEDS_RECONFIGURE (pad);
- GST_DEBUG_OBJECT (pad, "peeking RECONFIGURE flag %d", reconfigure);
- }
+ reconfigure = GST_PAD_NEEDS_RECONFIGURE (pad);
+ GST_DEBUG_OBJECT (pad, "peeking RECONFIGURE flag %d", reconfigure);
GST_OBJECT_UNLOCK (pad);
return reconfigure;
@@ -1429,15 +1427,10 @@ gst_pad_check_reconfigure (GstPad * pad)
g_return_val_if_fail (GST_IS_PAD (pad), FALSE);
GST_OBJECT_LOCK (pad);
- if (GST_PAD_IS_FLUSHING (pad)) {
- GST_DEBUG_OBJECT (pad, "pad is flushing");
- reconfigure = FALSE;
- } else {
- reconfigure = GST_PAD_NEEDS_RECONFIGURE (pad);
- if (reconfigure) {
- GST_DEBUG_OBJECT (pad, "remove RECONFIGURE flag");
- GST_OBJECT_FLAG_UNSET (pad, GST_PAD_FLAG_NEED_RECONFIGURE);
- }
+ reconfigure = GST_PAD_NEEDS_RECONFIGURE (pad);
+ if (reconfigure) {
+ GST_DEBUG_OBJECT (pad, "remove RECONFIGURE flag");
+ GST_OBJECT_FLAG_UNSET (pad, GST_PAD_FLAG_NEED_RECONFIGURE);
}
GST_OBJECT_UNLOCK (pad);
diff --git a/gst/gstquark.c b/gst/gstquark.c
index 6343726..b3b6214 100644
--- a/gst/gstquark.c
+++ b/gst/gstquark.c
@@ -67,7 +67,8 @@ static const gchar *_quark_strings[] = {
"GstMessageToc", "GstEventTocGlobal", "GstEventTocCurrent",
"GstEventSegmentDone",
"GstEventStreamStart", "stream-id", "GstEventContext", "GstQueryContext",
- "GstMessageNeedContext", "GstMessageHaveContext", "context", "context-types"
+ "GstMessageNeedContext", "GstMessageHaveContext", "context", "context-types",
+ "GstMessageStreamStart", "group-id"
};
GQuark _priv_gst_quark_table[GST_QUARK_MAX];
diff --git a/gst/gstquark.h b/gst/gstquark.h
index 1abc2ee..cfa7e3f 100644
--- a/gst/gstquark.h
+++ b/gst/gstquark.h
@@ -194,7 +194,9 @@ typedef enum _GstQuarkId
GST_QUARK_MESSAGE_HAVE_CONTEXT = 165,
GST_QUARK_CONTEXT = 166,
GST_QUARK_CONTEXT_TYPES = 167,
- GST_QUARK_MAX = 168
+ GST_QUARK_MESSAGE_STREAM_START = 168,
+ GST_QUARK_GROUP_ID = 169,
+ GST_QUARK_MAX = 170
} GstQuarkId;
extern GQuark _priv_gst_quark_table[GST_QUARK_MAX];
diff --git a/gst/gstquery.c b/gst/gstquery.c
index d5f2962..31be0dc 100644
--- a/gst/gstquery.c
+++ b/gst/gstquery.c
@@ -1630,6 +1630,8 @@ gst_query_set_nth_allocation_pool (GstQuery * query, guint index,
* @index: position in the allocation pool array to remove
*
* Remove the allocation pool at @index of the allocation pool array.
+ *
+ * Since: 1.2
*/
void
gst_query_remove_nth_allocation_pool (GstQuery * query, guint index)
@@ -1972,6 +1974,8 @@ gst_query_set_nth_allocation_param (GstQuery * query, guint index,
* @index: position in the allocation param array to remove
*
* Remove the allocation param at @index of the allocation param array.
+ *
+ * Since: 1.2
*/
void
gst_query_remove_nth_allocation_param (GstQuery * query, guint index)
@@ -2440,6 +2444,8 @@ gst_query_new_drain (void)
* Free-function: gst_query_unref
*
* Returns: (transfer full): a new #GstQuery
+ *
+ * Since: 1.2
*/
GstQuery *
gst_query_new_context (void)
@@ -2459,6 +2465,8 @@ gst_query_new_context (void)
* @context: the requested #GstContext
*
* Answer a context query by setting the requested context.
+ *
+ * Since: 1.2
*/
void
gst_query_set_context (GstQuery * query, GstContext * context)
@@ -2480,18 +2488,24 @@ gst_query_set_context (GstQuery * query, GstContext * context)
*
* Get the context from the context @query. The context remains valid as long as
* @query remains valid.
+ *
+ * Since: 1.2
*/
void
gst_query_parse_context (GstQuery * query, GstContext ** context)
{
GstStructure *structure;
+ const GValue *v;
g_return_if_fail (GST_QUERY_TYPE (query) == GST_QUERY_CONTEXT);
g_return_if_fail (context != NULL);
structure = GST_QUERY_STRUCTURE (query);
- *context = g_value_get_boxed (gst_structure_id_get_value (structure,
- GST_QUARK (CONTEXT)));
+ v = gst_structure_id_get_value (structure, GST_QUARK (CONTEXT));
+ if (v)
+ *context = g_value_get_boxed (v);
+ else
+ *context = NULL;
}
static void
@@ -2503,10 +2517,12 @@ free_array_string (gpointer ptr)
/**
* gst_query_add_context_type:
- * @query: a GST_QUERY_NEED_CONTEXT type query
+ * @query: a GST_QUERY_CONTEXT type query
* @context_type: a context type
*
* Add a new context type to @query.
+ *
+ * Since: 1.2
*/
void
gst_query_add_context_type (GstQuery * query, const gchar * context_type)
@@ -2528,12 +2544,14 @@ gst_query_add_context_type (GstQuery * query, const gchar * context_type)
/**
* gst_query_get_n_context_types:
- * @query: a GST_QUERY_NEED_CONTEXT type query
+ * @query: a GST_QUERY_CONTEXT type query
*
* Retrieve the number of values currently stored in the
* context-types array of the query's structure.
*
* Returns: the context-types array size as a #guint.
+ *
+ * Since: 1.2
*/
guint
gst_query_get_n_context_types (GstQuery * query)
@@ -2552,13 +2570,15 @@ gst_query_get_n_context_types (GstQuery * query)
/**
* gst_query_parse_nth_context_type:
- * @query: a GST_QUERY_NEED_CONTEXT type query
+ * @query: a GST_QUERY_CONTEXT type query
* @context_type: (out) (allow-none): the context type, or NULL
*
- * Parse a context type from an existing GST_QUERY_NEED_CONTEXT query
+ * Parse a context type from an existing GST_QUERY_CONTEXT query
* from @index.
*
* Returns: a #gboolean indicating if the parsing succeeded.
+ *
+ * Since: 1.2
*/
gboolean
gst_query_parse_nth_context_type (GstQuery * query, guint index,
@@ -2580,3 +2600,35 @@ gst_query_parse_nth_context_type (GstQuery * query, guint index,
return TRUE;
}
+
+/**
+ * gst_query_has_context_type:
+ * @query: a GST_QUERY_CONTEXT type query
+ * @context_type: the context type
+ *
+ * Check if @query is asking for @context_type.
+ *
+ * Returns: %TRUE if @context_type is requested.
+ *
+ * Since: 1.2
+ */
+gboolean
+gst_query_has_context_type (GstQuery * query, const gchar * context_type)
+{
+ guint i, n;
+
+ g_return_val_if_fail (GST_QUERY_TYPE (query) == GST_QUERY_CONTEXT, FALSE);
+ g_return_val_if_fail (context_type != NULL, FALSE);
+
+ n = gst_query_get_n_context_types (query);
+ for (i = 0; i < n; i++) {
+ const gchar *tmp;
+
+ if (gst_query_parse_nth_context_type (query, i, &tmp) &&
+ strcmp (tmp, context_type) == 0)
+ return TRUE;
+ }
+
+
+ return FALSE;
+}
diff --git a/gst/gstquery.h b/gst/gstquery.h
index 57a9c06..97234d1 100644
--- a/gst/gstquery.h
+++ b/gst/gstquery.h
@@ -102,7 +102,8 @@ typedef enum {
* @GST_QUERY_ACCEPT_CAPS: the accept caps query
* @GST_QUERY_CAPS: the caps query
* @GST_QUERY_DRAIN: wait till all serialized data is consumed downstream
- * @GST_QUERY_CONTEXT: query the pipeline-local context from downstream
+ * @GST_QUERY_CONTEXT: query the pipeline-local context from
+ * downstream (since 1.2)
*
* Standard predefined Query types
*/
@@ -442,7 +443,7 @@ gboolean gst_query_find_allocation_meta (GstQuery *query, GType api
* GstSchedulingFlags:
* @GST_SCHEDULING_FLAG_SEEKABLE: if seeking is possible
* @GST_SCHEDULING_FLAG_SEQUENTIAL: if sequential access is recommended
- * @GST_SCHEDULING_FLAG_BANDWIDTH_LIMITED: if bandwidth is limited and buffering possible
+ * @GST_SCHEDULING_FLAG_BANDWIDTH_LIMITED: if bandwidth is limited and buffering possible (since 1.2)
*
* The different scheduling flags.
*/
@@ -487,6 +488,7 @@ GstQuery * gst_query_new_context (void) G_GNUC_MALLOC;
void gst_query_add_context_type (GstQuery * query, const gchar * context_type);
guint gst_query_get_n_context_types (GstQuery * query);
gboolean gst_query_parse_nth_context_type (GstQuery * query, guint i, const gchar ** context_type);
+gboolean gst_query_has_context_type (GstQuery * query, const gchar * context_type);
void gst_query_set_context (GstQuery *query, GstContext *context);
void gst_query_parse_context (GstQuery *query, GstContext **context);
diff --git a/gst/gstutils.c b/gst/gstutils.c
index 454c7fa..ece5abe 100644
--- a/gst/gstutils.c
+++ b/gst/gstutils.c
@@ -3752,3 +3752,20 @@ gst_pad_get_stream_id (GstPad * pad)
return ret;
}
+
+/**
+ * gst_util_group_id_next:
+ *
+ * Return a constantly incrementing group id.
+ *
+ * This function is used to generate a new group-id for the
+ * stream-start event.
+ *
+ * Returns: A constantly incrementing unsigned integer, which might
+ * overflow back to 0 at some point. */
+guint
+gst_util_group_id_next (void)
+{
+ static gint counter = 0;
+ return g_atomic_int_add (&counter, 1);
+}
diff --git a/gst/gstutils.h b/gst/gstutils.h
index 54b7e45..1530807 100644
--- a/gst/gstutils.h
+++ b/gst/gstutils.h
@@ -75,6 +75,7 @@ guint64 gst_util_uint64_scale_int_ceil (guint64 val, gint num, gint den
guint32 gst_util_seqnum_next (void);
gint32 gst_util_seqnum_compare (guint32 s1, guint32 s2);
+guint gst_util_group_id_next (void);
/**
* GST_CALL_PARENT:
diff --git a/gst/gstvalue.c b/gst/gstvalue.c
index 094064f..c2885cd 100644
--- a/gst/gstvalue.c
+++ b/gst/gstvalue.c
@@ -3084,16 +3084,20 @@ gst_value_deserialize_enum (GValue * dest, const gchar * s)
found = gst_iterator_find_custom (iter,
(GCompareFunc) gst_value_deserialize_enum_iter_cmp, &res, (gpointer) s);
- g_return_val_if_fail (found, FALSE);
- format_def = g_value_get_pointer (&res);
- g_return_val_if_fail (format_def != NULL, FALSE);
- g_value_set_enum (dest, (gint) format_def->value);
- g_value_unset (&res);
+ if (found) {
+ format_def = g_value_get_pointer (&res);
+ g_return_val_if_fail (format_def != NULL, FALSE);
+ g_value_set_enum (dest, (gint) format_def->value);
+ g_value_unset (&res);
+ }
gst_iterator_free (iter);
- return TRUE;
+ return found;
}
- g_return_val_if_fail (en, FALSE);
+ /* enum name/nick not found */
+ if (en == NULL)
+ return FALSE;
+
g_value_set_enum (dest, en->value);
return TRUE;
}
@@ -5678,7 +5682,7 @@ gst_value_lcopy_bitmask (const GValue * value, guint n_collect_values,
/**
* gst_value_set_bitmask:
- * @value: a GValue initialized to #GST_TYPE_FRACTION
+ * @value: a GValue initialized to #GST_TYPE_BITMASK
* @bitmask: the bitmask
*
* Sets @value to the bitmask specified by @bitmask.
@@ -5693,7 +5697,7 @@ gst_value_set_bitmask (GValue * value, guint64 bitmask)
/**
* gst_value_get_bitmask:
- * @value: a GValue initialized to #GST_TYPE_FRACTION
+ * @value: a GValue initialized to #GST_TYPE_BITMASK
*
* Gets the bitmask specified by @value.
*
diff --git a/gst/parse/Makefile.in b/gst/parse/Makefile.in
index c09ba42..6be215a 100644
--- a/gst/parse/Makefile.in
+++ b/gst/parse/Makefile.in
@@ -315,6 +315,7 @@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@
GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@
GTKDOC_MKPDF = @GTKDOC_MKPDF@
GTKDOC_REBASE = @GTKDOC_REBASE@
+HAVE_DOCBOOK2HTML = @HAVE_DOCBOOK2HTML@
HAVE_DOCBOOK2PS = @HAVE_DOCBOOK2PS@
HAVE_DVIPS = @HAVE_DVIPS@
HAVE_EPSTOPDF = @HAVE_EPSTOPDF@
@@ -325,7 +326,6 @@ HAVE_PNGTOPNM = @HAVE_PNGTOPNM@
HAVE_PNMTOPS = @HAVE_PNMTOPS@
HAVE_PS2PDF = @HAVE_PS2PDF@
HAVE_XMLLINT = @HAVE_XMLLINT@
-HAVE_XSLTPROC = @HAVE_XSLTPROC@
HOST_CPU = @HOST_CPU@
HTML_DIR = @HTML_DIR@
INSTALL = @INSTALL@
diff --git a/gst/printf/Makefile.in b/gst/printf/Makefile.in
index 16ab662..2d03d34 100644
--- a/gst/printf/Makefile.in
+++ b/gst/printf/Makefile.in
@@ -313,6 +313,7 @@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@
GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@
GTKDOC_MKPDF = @GTKDOC_MKPDF@
GTKDOC_REBASE = @GTKDOC_REBASE@
+HAVE_DOCBOOK2HTML = @HAVE_DOCBOOK2HTML@
HAVE_DOCBOOK2PS = @HAVE_DOCBOOK2PS@
HAVE_DVIPS = @HAVE_DVIPS@
HAVE_EPSTOPDF = @HAVE_EPSTOPDF@
@@ -323,7 +324,6 @@ HAVE_PNGTOPNM = @HAVE_PNGTOPNM@
HAVE_PNMTOPS = @HAVE_PNMTOPS@
HAVE_PS2PDF = @HAVE_PS2PDF@
HAVE_XMLLINT = @HAVE_XMLLINT@
-HAVE_XSLTPROC = @HAVE_XSLTPROC@
HOST_CPU = @HOST_CPU@
HTML_DIR = @HTML_DIR@
INSTALL = @INSTALL@