Blame gst/gstparse.h

Packit a6ee4b
/* GStreamer
Packit a6ee4b
 * Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
Packit a6ee4b
 *                    2000 Wim Taymans <wtay@chello.be>
Packit a6ee4b
 *
Packit a6ee4b
 * gstparse.h: get a pipeline from a text pipeline description
Packit a6ee4b
 *
Packit a6ee4b
 * This library is free software; you can redistribute it and/or
Packit a6ee4b
 * modify it under the terms of the GNU Library General Public
Packit a6ee4b
 * License as published by the Free Software Foundation; either
Packit a6ee4b
 * version 2 of the License, or (at your option) any later version.
Packit a6ee4b
 *
Packit a6ee4b
 * This library is distributed in the hope that it will be useful,
Packit a6ee4b
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit a6ee4b
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit a6ee4b
 * Library General Public License for more details.
Packit a6ee4b
 *
Packit a6ee4b
 * You should have received a copy of the GNU Library General Public
Packit a6ee4b
 * License along with this library; if not, write to the
Packit a6ee4b
 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
Packit a6ee4b
 * Boston, MA 02110-1301, USA.
Packit a6ee4b
 */
Packit a6ee4b
Packit a6ee4b
#ifndef __GST_PARSE_H__
Packit a6ee4b
#define __GST_PARSE_H__
Packit a6ee4b
Packit a6ee4b
#include <gst/gstelement.h>
Packit a6ee4b
Packit a6ee4b
G_BEGIN_DECLS
Packit a6ee4b
Packit a6ee4b
GST_API
Packit a6ee4b
GQuark gst_parse_error_quark (void);
Packit a6ee4b
/**
Packit a6ee4b
 * GST_PARSE_ERROR:
Packit a6ee4b
 *
Packit a6ee4b
 * Get access to the error quark of the parse subsystem.
Packit a6ee4b
 */
Packit a6ee4b
#define GST_PARSE_ERROR gst_parse_error_quark ()
Packit a6ee4b
Packit a6ee4b
/* FIXME 2.0: rename to GstParseLaunchError, this is not only related to
Packit a6ee4b
 *parsing */
Packit a6ee4b
/**
Packit a6ee4b
 * GstParseError:
Packit a6ee4b
 * @GST_PARSE_ERROR_SYNTAX: A syntax error occurred.
Packit a6ee4b
 * @GST_PARSE_ERROR_NO_SUCH_ELEMENT: The description contained an unknown element
Packit a6ee4b
 * @GST_PARSE_ERROR_NO_SUCH_PROPERTY: An element did not have a specified property
Packit a6ee4b
 * @GST_PARSE_ERROR_LINK: There was an error linking two pads.
Packit a6ee4b
 * @GST_PARSE_ERROR_COULD_NOT_SET_PROPERTY: There was an error setting a property
Packit a6ee4b
 * @GST_PARSE_ERROR_EMPTY_BIN: An empty bin was specified.
Packit a6ee4b
 * @GST_PARSE_ERROR_EMPTY: An empty description was specified
Packit a6ee4b
 * @GST_PARSE_ERROR_DELAYED_LINK: A delayed link did not get resolved.
Packit a6ee4b
 *
Packit a6ee4b
 * The different parsing errors that can occur.
Packit a6ee4b
 */
Packit a6ee4b
typedef enum
Packit a6ee4b
{
Packit a6ee4b
  GST_PARSE_ERROR_SYNTAX,
Packit a6ee4b
  GST_PARSE_ERROR_NO_SUCH_ELEMENT,
Packit a6ee4b
  GST_PARSE_ERROR_NO_SUCH_PROPERTY,
Packit a6ee4b
  GST_PARSE_ERROR_LINK,
Packit a6ee4b
  GST_PARSE_ERROR_COULD_NOT_SET_PROPERTY,
Packit a6ee4b
  GST_PARSE_ERROR_EMPTY_BIN,
Packit a6ee4b
  GST_PARSE_ERROR_EMPTY,
Packit a6ee4b
  GST_PARSE_ERROR_DELAYED_LINK
Packit a6ee4b
} GstParseError;
Packit a6ee4b
Packit a6ee4b
/**
Packit a6ee4b
 * GstParseFlags:
Packit a6ee4b
 * @GST_PARSE_FLAG_NONE: Do not use any special parsing options.
Packit a6ee4b
 * @GST_PARSE_FLAG_FATAL_ERRORS: Always return %NULL when an error occurs
Packit a6ee4b
 *     (default behaviour is to return partially constructed bins or elements
Packit a6ee4b
 *      in some cases)
Packit a6ee4b
 * @GST_PARSE_FLAG_NO_SINGLE_ELEMENT_BINS: If a bin only has a single element,
Packit a6ee4b
 *     just return the element.
Packit a6ee4b
 * @GST_PARSE_FLAG_PLACE_IN_BIN: If more than one toplevel element is described
Packit a6ee4b
 *     by the pipeline description string, put them in a #GstBin instead of a
Packit a6ee4b
 *     #GstPipeline. (Since: 1.10)
Packit a6ee4b
 *
Packit a6ee4b
 * Parsing options.
Packit a6ee4b
 */
Packit a6ee4b
typedef enum
Packit a6ee4b
{
Packit a6ee4b
  GST_PARSE_FLAG_NONE = 0,
Packit a6ee4b
  GST_PARSE_FLAG_FATAL_ERRORS = (1 << 0),
Packit a6ee4b
  GST_PARSE_FLAG_NO_SINGLE_ELEMENT_BINS = (1 << 1),
Packit a6ee4b
  GST_PARSE_FLAG_PLACE_IN_BIN = (1 << 2)
Packit a6ee4b
} GstParseFlags;
Packit a6ee4b
Packit a6ee4b
#define GST_TYPE_PARSE_CONTEXT (gst_parse_context_get_type())
Packit a6ee4b
Packit a6ee4b
/**
Packit a6ee4b
 * GstParseContext:
Packit a6ee4b
 *
Packit a6ee4b
 * Opaque structure.
Packit a6ee4b
 */
Packit a6ee4b
typedef struct _GstParseContext GstParseContext;
Packit a6ee4b
Packit a6ee4b
/* create, process and free a parse context */
Packit a6ee4b
Packit a6ee4b
GST_API
Packit a6ee4b
GType             gst_parse_context_get_type (void);
Packit a6ee4b
Packit a6ee4b
GST_API
Packit a6ee4b
GstParseContext * gst_parse_context_new (void) G_GNUC_MALLOC;
Packit a6ee4b
Packit a6ee4b
GST_API
Packit a6ee4b
gchar          ** gst_parse_context_get_missing_elements (GstParseContext * context) G_GNUC_MALLOC;
Packit a6ee4b
Packit a6ee4b
GST_API
Packit a6ee4b
void              gst_parse_context_free (GstParseContext * context);
Packit a6ee4b
Packit a6ee4b
GST_API
Packit a6ee4b
GstParseContext * gst_parse_context_copy (const GstParseContext * context);
Packit a6ee4b
Packit a6ee4b
Packit a6ee4b
/* parse functions */
Packit a6ee4b
Packit a6ee4b
GST_API
Packit a6ee4b
GstElement      * gst_parse_launch       (const gchar      * pipeline_description,
Packit a6ee4b
                                          GError          ** error) G_GNUC_MALLOC;
Packit a6ee4b
GST_API
Packit a6ee4b
GstElement      * gst_parse_launchv      (const gchar     ** argv,
Packit a6ee4b
                                          GError          ** error) G_GNUC_MALLOC;
Packit a6ee4b
GST_API
Packit a6ee4b
GstElement      * gst_parse_launch_full  (const gchar      * pipeline_description,
Packit a6ee4b
                                          GstParseContext  * context,
Packit a6ee4b
                                          GstParseFlags      flags,
Packit a6ee4b
                                          GError          ** error) G_GNUC_MALLOC;
Packit a6ee4b
GST_API
Packit a6ee4b
GstElement      * gst_parse_launchv_full (const gchar     ** argv,
Packit a6ee4b
                                          GstParseContext  * context,
Packit a6ee4b
                                          GstParseFlags      flags,
Packit a6ee4b
                                          GError          ** error) G_GNUC_MALLOC;
Packit a6ee4b
Packit a6ee4b
#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
Packit a6ee4b
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstParseContext, gst_parse_context_free)
Packit a6ee4b
#endif
Packit a6ee4b
Packit a6ee4b
G_END_DECLS
Packit a6ee4b
Packit a6ee4b
#endif /* __GST_PARSE_H__ */