1 // Generated by gmmproc 2.50.1 -- DO NOT MODIFY! 2 #ifndef _GSTREAMERMM_PARSE_H 3 #define _GSTREAMERMM_PARSE_H 4 5 6 #include <glibmm/ustring.h> 7 #include <sigc++/sigc++.h> 8 9 /* gstreamermm - a C++ wrapper for gstreamer 10 * 11 * Copyright 2008 The gstreamermm Development Team 12 * 13 * This library is free software; you can redistribute it and/or 14 * modify it under the terms of the GNU Lesser General Public 15 * License as published by the Free Software Foundation; either 16 * version 2.1 of the License, or (at your option) any later version. 17 * 18 * This library is distributed in the hope that it will be useful, 19 * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 21 * Lesser General Public License for more details. 22 * 23 * You should have received a copy of the GNU Lesser General Public 24 * License along with this library; if not, write to the Free 25 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 26 */ 27 28 #include <gst/gst.h> 29 30 31 namespace Gst 32 { 33 34 class Element; 35 36 /** The different parsing errors that can occur. 37 * 38 * - SYNTAX - A syntax error occured. 39 * - NO_SUCH_ELEMENT - The description contained an unknown element 40 * - NO_SUCH_PROPERTY - An element did not have a specified property 41 * - LINK - There was an error linking two pads. 42 * - COULD_NOT_SET_PROPERTY - There was an error setting a property 43 * - EMPTY_BIN - An empty bin was specified. 44 * - EMPTY - An empty description was specified 45 */ 46 class ParseError : public Glib::Error 47 { 48 public: 49 /** @var Code SYNTAX 50 * A syntax error occurred. 51 * 52 * @var Code NO_SUCH_ELEMENT 53 * The description contained an unknown element. 54 * 55 * @var Code NO_SUCH_PROPERTY 56 * An element did not have a specified property. 57 * 58 * @var Code LINK 59 * There was an error linking two pads. 60 * 61 * @var Code COULD_NOT_SET_PROPERTY 62 * There was an error setting a property. 63 * 64 * @var Code EMPTY_BIN 65 * An empty bin was specified. 66 * 67 * @var Code EMPTY 68 * An empty description was specified. 69 * 70 * @var Code DELAYED_LINK 71 * A delayed link did not get resolved. 72 * 73 * @enum Code 74 * 75 * The different parsing errors that can occur. 76 */ 77 enum Code 78 { 79 SYNTAX, 80 NO_SUCH_ELEMENT, 81 NO_SUCH_PROPERTY, 82 LINK, 83 COULD_NOT_SET_PROPERTY, 84 EMPTY_BIN, 85 EMPTY, 86 DELAYED_LINK 87 }; 88 89 ParseError(Code error_code, const Glib::ustring& error_message); 90 explicit ParseError(GError* gobject); 91 Code code() const; 92 93 #ifndef DOXYGEN_SHOULD_SKIP_THIS 94 private: 95 96 static void throw_func(GError* gobject); 97 98 friend void wrap_init(); // uses throw_func() 99 100 #endif //DOXYGEN_SHOULD_SKIP_THIS 101 }; 102 103 } // namespace Gst 104 105 #ifndef DOXYGEN_SHOULD_SKIP_THIS 106 namespace Glib 107 { 108 109 template <> 110 class Value<Gst::ParseError::Code> : public Glib::Value_Enum<Gst::ParseError::Code> 111 { 112 public: 113 static GType value_type() G_GNUC_CONST; 114 }; 115 116 } // namespace Glib 117 #endif /* DOXYGEN_SHOULD_SKIP_THIS */ 118 119 namespace Gst 120 { 121 122 123 /** A class that gets a pipeline from a text pipeline description. 124 * The methods in this class allow to create a pipeline based on the syntax 125 * used in the gst-launch utillity. 126 */ 127 class Parse 128 { 129 public: 130 /** Get the error quark used by the parsing subsystem. 131 * @return The quark of the parse errors. 132 */ 133 static Glib::QueryQuark error_quark(); 134 135 /** Create a new pipeline based on command line syntax. Please note that you 136 * might get a return value that is not a null RefPtr<> even though the error 137 * is set. In this case there was a recoverable parsing error and you can try 138 * to play the pipeline. 139 * @param pipeline_description The command line describing the pipeline. 140 * @return A new element on success, a null RefPtr<> on failure. If more than 141 * one toplevel element is specified by the pipeline_description, all 142 * elements are put into a Gst::Pipeline, which than is returned. 143 * @throw Gst::CoreError 144 * @throw Gst::ParseError 145 */ 146 static Glib::RefPtr<Gst::Element> launch(const Glib::ustring& pipeline_description); 147 148 /** Create a new element based on command line syntax. An error does not 149 * mean that the pipeline could not be constructed. 150 * @param argv null-terminated array of arguments. 151 * specified. 152 * @return A new element on success and null on failure. 153 * @throw Gst::CoreError 154 * @throw Gst::ParseError 155 */ 156 static Glib::RefPtr<Gst::Element> launchv(const gchar *argv[]); 157 158 /** This is a convenience wrapper around launch() to create a Gst::Bin from a 159 * gst-launch-style pipeline description. See launch() and the gst-launch man 160 * page for details about the syntax. Ghost pads on the bin for unconnected 161 * source or sink pads within the bin can automatically be created (but only 162 * a maximum of one ghost pad for each direction will be created; if you 163 * expect multiple unconnected source pads or multiple unconnected sink pads 164 * and want them all ghosted, you will have to create the ghost pads 165 * yourself). 166 * 167 * @param bin_description Command line describing the bin. 168 * @param ghost_unconnected_pads Whether to automatically create ghost pads 169 * for unconnected source or sink pads within the bin. 170 * @return A newly-created bin, or a null RefPtr<> if an error occurred. 171 * @throw Gst::CoreError 172 * @throw Gst::ParseError 173 */ 174 static Glib::RefPtr<Gst::Element> create_bin(const Glib::ustring& bin_description, bool ghost_unconnected_pads); 175 }; 176 177 } // namespace Gst 178 179 180 #endif /* _GSTREAMERMM_PARSE_H */ 181 182