2003-04-08 21:59:44 +00:00
|
|
|
#ifndef __GST_PARSE_TYPES_H__
|
|
|
|
#define __GST_PARSE_TYPES_H__
|
|
|
|
|
2002-04-01 06:30:39 +00:00
|
|
|
#include <glib-object.h>
|
2002-04-07 23:32:16 +00:00
|
|
|
#include "../gstelement.h"
|
API: gst_parse_launch_full()
Original commit message from CVS:
* docs/gst/gstreamer-sections.txt:
* gst/gst.c: (init_post):
* gst/gst_private.h: (_GstParseContext):
* gst/gstparse.c: (gst_parse_error_quark), (gst_parse_context_new),
(gst_parse_context_free), (gst_parse_context_get_missing_elements),
(gst_parse_launchv), (gst_parse_launchv_full), (gst_parse_launch),
(gst_parse_launch_full):
* gst/gstparse.h: (GST_PARSE_FLAG_NONE), (GST_PARSE_FLAG_FATAL_ERRORS),
(GstParseFlags), (GstParseContext):
* gst/gstutils.c: (gst_parse_bin_from_description),
(gst_parse_bin_from_description_full):
* gst/gstutils.h:
* gst/parse/grammar.y:
* gst/parse/types.h:
* win32/common/libgstreamer.def:
Add new gst_parse_*_full API (#528178):
API: gst_parse_launch_full()
API: gst_parse_launchv_full()
API: gst_parse_bin_from_description_full()
API: gst_parse_context_new()
API: gst_parse_context_free()
API: gst_parse_context_get_missing_elements()
2008-05-24 15:33:53 +00:00
|
|
|
#include "../gstparse.h"
|
2002-04-01 06:30:39 +00:00
|
|
|
|
2004-03-15 14:43:35 +00:00
|
|
|
typedef struct {
|
2014-01-10 20:10:17 +00:00
|
|
|
GstElement *element;
|
|
|
|
gchar *name;
|
|
|
|
GSList *pads;
|
|
|
|
} reference_t;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
reference_t src;
|
|
|
|
reference_t sink;
|
2003-04-08 21:59:44 +00:00
|
|
|
GstCaps *caps;
|
2004-03-15 14:43:35 +00:00
|
|
|
} link_t;
|
2002-04-01 06:30:39 +00:00
|
|
|
|
2004-03-15 14:43:35 +00:00
|
|
|
typedef struct {
|
2003-04-08 21:59:44 +00:00
|
|
|
GSList *elements;
|
2014-01-10 20:10:17 +00:00
|
|
|
reference_t first;
|
|
|
|
reference_t last;
|
2004-03-15 14:43:35 +00:00
|
|
|
} chain_t;
|
2002-04-01 06:30:39 +00:00
|
|
|
|
2002-04-07 23:32:16 +00:00
|
|
|
typedef struct _graph_t graph_t;
|
2004-03-15 14:43:35 +00:00
|
|
|
struct _graph_t {
|
|
|
|
chain_t *chain; /* links are supposed to be done now */
|
2003-04-08 21:59:44 +00:00
|
|
|
GSList *links;
|
|
|
|
GError **error;
|
API: gst_parse_launch_full()
Original commit message from CVS:
* docs/gst/gstreamer-sections.txt:
* gst/gst.c: (init_post):
* gst/gst_private.h: (_GstParseContext):
* gst/gstparse.c: (gst_parse_error_quark), (gst_parse_context_new),
(gst_parse_context_free), (gst_parse_context_get_missing_elements),
(gst_parse_launchv), (gst_parse_launchv_full), (gst_parse_launch),
(gst_parse_launch_full):
* gst/gstparse.h: (GST_PARSE_FLAG_NONE), (GST_PARSE_FLAG_FATAL_ERRORS),
(GstParseFlags), (GstParseContext):
* gst/gstutils.c: (gst_parse_bin_from_description),
(gst_parse_bin_from_description_full):
* gst/gstutils.h:
* gst/parse/grammar.y:
* gst/parse/types.h:
* win32/common/libgstreamer.def:
Add new gst_parse_*_full API (#528178):
API: gst_parse_launch_full()
API: gst_parse_launchv_full()
API: gst_parse_bin_from_description_full()
API: gst_parse_context_new()
API: gst_parse_context_free()
API: gst_parse_context_get_missing_elements()
2008-05-24 15:33:53 +00:00
|
|
|
GstParseContext *ctx; /* may be NULL */
|
|
|
|
GstParseFlags flags;
|
2002-04-07 23:32:16 +00:00
|
|
|
};
|
|
|
|
|
2002-04-01 06:30:39 +00:00
|
|
|
|
2005-10-15 15:30:24 +00:00
|
|
|
/*
|
|
|
|
* Memory checking. Should probably be done with gsttrace stuff, but that
|
2003-04-08 21:59:44 +00:00
|
|
|
* doesn't really work.
|
|
|
|
* This is not safe from reentrance issues, but that doesn't matter as long as
|
|
|
|
* we lock a mutex before parsing anyway.
|
2014-01-14 12:42:20 +00:00
|
|
|
*
|
|
|
|
* FIXME: Disable this for now for the above reasons
|
2003-04-08 21:59:44 +00:00
|
|
|
*/
|
2014-01-14 12:42:20 +00:00
|
|
|
#if 0
|
|
|
|
#ifdef GST_DEBUG_ENABLED
|
2003-04-08 21:59:44 +00:00
|
|
|
# define __GST_PARSE_TRACE
|
2014-01-14 12:42:20 +00:00
|
|
|
#endif
|
|
|
|
#endif
|
2003-04-08 21:59:44 +00:00
|
|
|
|
|
|
|
#ifdef __GST_PARSE_TRACE
|
2012-07-09 19:48:56 +00:00
|
|
|
G_GNUC_INTERNAL gchar *__gst_parse_strdup (gchar *org);
|
|
|
|
G_GNUC_INTERNAL void __gst_parse_strfree (gchar *str);
|
2014-01-10 20:10:17 +00:00
|
|
|
G_GNUC_INTERNAL link_t *__gst_parse_link_new (void);
|
2012-07-09 19:48:56 +00:00
|
|
|
G_GNUC_INTERNAL void __gst_parse_link_free (link_t *data);
|
2014-01-10 20:10:17 +00:00
|
|
|
G_GNUC_INTERNAL chain_t *__gst_parse_chain_new (void);
|
2012-07-09 19:48:56 +00:00
|
|
|
G_GNUC_INTERNAL void __gst_parse_chain_free (chain_t *data);
|
2003-04-08 21:59:44 +00:00
|
|
|
# define gst_parse_strdup __gst_parse_strdup
|
|
|
|
# define gst_parse_strfree __gst_parse_strfree
|
|
|
|
# define gst_parse_link_new __gst_parse_link_new
|
|
|
|
# define gst_parse_link_free __gst_parse_link_free
|
|
|
|
# define gst_parse_chain_new __gst_parse_chain_new
|
|
|
|
# define gst_parse_chain_free __gst_parse_chain_free
|
|
|
|
#else /* __GST_PARSE_TRACE */
|
|
|
|
# define gst_parse_strdup g_strdup
|
|
|
|
# define gst_parse_strfree g_free
|
2014-01-14 12:44:11 +00:00
|
|
|
# define gst_parse_link_new() g_slice_new0 (link_t)
|
|
|
|
# define gst_parse_link_free(l) g_slice_free (link_t, l)
|
|
|
|
# define gst_parse_chain_new() g_slice_new0 (chain_t)
|
|
|
|
# define gst_parse_chain_free(c) g_slice_free (chain_t, c)
|
2003-04-08 21:59:44 +00:00
|
|
|
#endif /* __GST_PARSE_TRACE */
|
|
|
|
|
2003-11-24 03:21:54 +00:00
|
|
|
static inline void
|
2004-03-15 14:43:35 +00:00
|
|
|
gst_parse_unescape (gchar *str)
|
2003-11-24 03:21:54 +00:00
|
|
|
{
|
|
|
|
gchar *walk;
|
2011-04-20 20:52:36 +00:00
|
|
|
gboolean in_quotes;
|
2005-10-15 15:30:24 +00:00
|
|
|
|
2003-11-24 03:21:54 +00:00
|
|
|
g_return_if_fail (str != NULL);
|
2005-10-15 15:30:24 +00:00
|
|
|
|
2003-11-24 03:21:54 +00:00
|
|
|
walk = str;
|
2011-04-20 20:52:36 +00:00
|
|
|
in_quotes = FALSE;
|
2005-10-15 15:30:24 +00:00
|
|
|
|
2012-07-17 07:57:47 +00:00
|
|
|
GST_DEBUG ("unescaping %s", str);
|
|
|
|
|
2003-11-24 03:21:54 +00:00
|
|
|
while (*walk) {
|
2011-04-20 20:52:36 +00:00
|
|
|
if (*walk == '\\' && !in_quotes) {
|
2003-11-24 03:21:54 +00:00
|
|
|
walk++;
|
2011-01-24 14:16:37 +00:00
|
|
|
/* make sure we don't read beyond the end of the string */
|
|
|
|
if (*walk == '\0')
|
|
|
|
break;
|
2011-04-20 20:52:36 +00:00
|
|
|
} else if (*walk == '"' && (!in_quotes || (in_quotes
|
|
|
|
&& (*(walk - 1) != '\\')))) {
|
|
|
|
/* don't unescape inside quotes and don't switch
|
|
|
|
* state with escaped quoted inside quotes */
|
|
|
|
in_quotes = !in_quotes;
|
2011-01-24 14:16:37 +00:00
|
|
|
}
|
2003-11-24 03:21:54 +00:00
|
|
|
*str = *walk;
|
|
|
|
str++;
|
|
|
|
walk++;
|
|
|
|
}
|
|
|
|
*str = '\0';
|
|
|
|
}
|
|
|
|
|
2012-07-09 19:48:56 +00:00
|
|
|
G_GNUC_INTERNAL GstElement *priv_gst_parse_launch (const gchar * str,
|
|
|
|
GError ** err,
|
|
|
|
GstParseContext * ctx,
|
|
|
|
GstParseFlags flags);
|
2010-03-02 21:58:06 +00:00
|
|
|
|
2003-04-08 21:59:44 +00:00
|
|
|
#endif /* __GST_PARSE_TYPES_H__ */
|