| 1 | // Generated by gmmproc 2.50.1 -- DO NOT MODIFY! |
| 2 | #ifndef _GSTREAMERMM_FORMAT_H |
| 3 | #define _GSTREAMERMM_FORMAT_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 | #include <glibmm/arrayhandle.h> |
| 30 | |
| 31 | |
| 32 | namespace Gst |
| 33 | { |
| 34 | |
| 35 | //Gst::IteratorBasic<> forward declaration. |
| 36 | template <class CppType> |
| 37 | class IteratorBasic; |
| 38 | |
| 39 | /** @addtogroup gstreamermmEnums gstreamermm Enums and Flags */ |
| 40 | |
| 41 | /** |
| 42 | * @var Format FORMAT_UNDEFINED |
| 43 | * Undefined format. |
| 44 | * |
| 45 | * @var Format FORMAT_DEFAULT |
| 46 | * The default format of the pad/element. This can be |
| 47 | * samples for raw audio, frames/fields for raw video (some, but not all, |
| 48 | * elements support this; use @a GST_FORMAT_TIME if you don't have a good |
| 49 | * reason to query for samples/frames). |
| 50 | * |
| 51 | * @var Format FORMAT_BYTES |
| 52 | * Bytes. |
| 53 | * |
| 54 | * @var Format FORMAT_TIME |
| 55 | * Time in nanoseconds. |
| 56 | * |
| 57 | * @var Format FORMAT_BUFFERS |
| 58 | * Buffers (few, if any, elements implement this as of |
| 59 | * May 2009). |
| 60 | * |
| 61 | * @var Format FORMAT_PERCENT |
| 62 | * Percentage of stream (few, if any, elements implement |
| 63 | * this as of May 2009). |
| 64 | * |
| 65 | * @enum Format |
| 66 | * |
| 67 | * Standard predefined formats |
| 68 | * |
| 69 | * @ingroup gstreamermmEnums |
| 70 | */ |
| 71 | enum Format |
| 72 | { |
| 73 | FORMAT_UNDEFINED, |
| 74 | FORMAT_DEFAULT, |
| 75 | FORMAT_BYTES, |
| 76 | FORMAT_TIME, |
| 77 | FORMAT_BUFFERS, |
| 78 | FORMAT_PERCENT |
| 79 | }; |
| 80 | |
| 81 | } // namespace Gst |
| 82 | |
| 83 | #ifndef DOXYGEN_SHOULD_SKIP_THIS |
| 84 | namespace Glib |
| 85 | { |
| 86 | |
| 87 | template <> |
| 88 | class Value<Gst::Format> : public Glib::Value_Enum<Gst::Format> |
| 89 | { |
| 90 | public: |
| 91 | static GType value_type() G_GNUC_CONST; |
| 92 | }; |
| 93 | |
| 94 | } // namespace Glib |
| 95 | #endif /* DOXYGEN_SHOULD_SKIP_THIS */ |
| 96 | |
| 97 | namespace Gst |
| 98 | { |
| 99 | |
| 100 | |
| 101 | /** A class to store the details of a Gst::Format retrieved by |
| 102 | * Gst::get_format_details(). |
| 103 | */ |
| 104 | class FormatDefinition |
| 105 | { |
| 106 | public: |
| 107 | #ifndef DOXYGEN_SHOULD_SKIP_THIS |
| 108 | using CppObjectType = FormatDefinition; |
| 109 | using BaseObjectType = GstFormatDefinition; |
| 110 | #endif /* DOXYGEN_SHOULD_SKIP_THIS */ |
| 111 | |
| 112 | private: |
| 113 | |
| 114 | |
| 115 | public: |
| 116 | /// Default constructor. |
| 117 | FormatDefinition(); |
| 118 | |
| 119 | /** Constructs a Gst::FormatDefinition from a C GstFormatDefinition type. |
| 120 | * The @a castitem is left unaffected; its contents are simply copied. |
| 121 | * @param castitem The GstFormatDefinition to copy contents from. |
| 122 | */ |
| 123 | explicit FormatDefinition(const GstFormatDefinition* castitem); |
| 124 | |
| 125 | /// The unique id of this format. |
| 126 | Gst::Format value; |
| 127 | |
| 128 | /// A short nick of the format. |
| 129 | Glib::ustring nick; |
| 130 | |
| 131 | /// A longer description of the format. |
| 132 | Glib::ustring description; |
| 133 | |
| 134 | /// A quark for the nick. |
| 135 | Glib::QueryQuark quark; |
| 136 | |
| 137 | |
| 138 | }; |
| 139 | |
| 140 | namespace Enums |
| 141 | { |
| 142 | |
| 143 | /** Gets a printable name for the given format. Do not modify or free. |
| 144 | * |
| 145 | * @param format A Gst::Format. |
| 146 | * @return The name of the format or an empty string if the format is unknown. |
| 147 | */ |
| 148 | Glib::ustring get_name(Format format); |
| 149 | |
| 150 | /** Gets the unique quark for the given format. |
| 151 | * |
| 152 | * @param format A Gst::Format. |
| 153 | * @return The quark associated with the format or 0 if the format is unknown. |
| 154 | */ |
| 155 | Glib::QueryQuark get_quark(Format format); |
| 156 | |
| 157 | } //namespace Enums |
| 158 | |
| 159 | /** Creates a new Gst::Format based on the nick or return an already |
| 160 | * registered format with that nick. |
| 161 | * |
| 162 | * @param nick The nick of the new format. |
| 163 | * @param description The description of the new format. |
| 164 | * @return A new Gst::Format or an already registered format with the same |
| 165 | * nick. MT safe. |
| 166 | */ |
| 167 | Format register_format(const Glib::ustring& nick, const Glib::ustring& |
| 168 | description); |
| 169 | |
| 170 | /** Returns the format registered with the given nick. |
| 171 | * |
| 172 | * @param nick The nick of the format. |
| 173 | * @return The format with nick or Gst::FORMAT_UNDEFINED if the format was not |
| 174 | * registered. |
| 175 | */ |
| 176 | Format get_format(const Glib::ustring& nick); |
| 177 | |
| 178 | /** Sees if the given format is inside the array of formats. |
| 179 | * |
| 180 | * @param formats The array of formats to search. |
| 181 | * @param format The format to find. |
| 182 | * @return true If the format is found inside the array. |
| 183 | */ |
| 184 | bool formats_contain(const Glib::ArrayHandle<Format>& formats, Format format); |
| 185 | |
| 186 | /** Gets details about the given format. |
| 187 | * |
| 188 | * @param format The format to get details of. |
| 189 | * @param def The Gst::FormatDefinition in which to store the details of |
| 190 | * the format. |
| 191 | * @return true if successful, false otherwise. MT safe. |
| 192 | */ |
| 193 | bool get_format_details(Format format, FormatDefinition& def); |
| 194 | |
| 195 | /** Iterates all the registered formats. The format definitions are read |
| 196 | * only. |
| 197 | * @return a Gst::IteratorBasic of Gst::FormatDefinition. |
| 198 | */ |
| 199 | IteratorBasic<const FormatDefinition> iterate_format_definitions(); |
| 200 | |
| 201 | } //namespace Gst |
| 202 | |
| 203 | |
| 204 | #endif /* _GSTREAMERMM_FORMAT_H */ |
| 205 |