| 1 | // Generated by gmmproc 2.50.1 -- DO NOT MODIFY! |
| 2 | #ifndef _GSTREAMERMM_SDPMESSAGE_H |
| 3 | #define _GSTREAMERMM_SDPMESSAGE_H |
| 4 | |
| 5 | |
| 6 | #include <glibmm/ustring.h> |
| 7 | #include <sigc++/sigc++.h> |
| 8 | |
| 9 | /* gstreamermm - a C++ wrapper for gstreamer |
| 10 | * |
| 11 | * Copyright 2016 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 | * Last reviewed on 2016-12-11 (1.10.0) |
| 28 | */ |
| 29 | |
| 30 | |
| 31 | #include <gst/sdp/gstsdpmessage.h> |
| 32 | |
| 33 | namespace Gst |
| 34 | { |
| 35 | |
| 36 | class Caps; |
| 37 | |
| 38 | namespace SDP |
| 39 | { |
| 40 | /** @addtogroup gstreamermmEnums gstreamermm Enums and Flags */ |
| 41 | |
| 42 | /** |
| 43 | * @var Result SDP_OK |
| 44 | * A successful return value. |
| 45 | * |
| 46 | * @var Result SDP_EINVAL |
| 47 | * A function was given invalid parameters. |
| 48 | * |
| 49 | * @enum Result |
| 50 | * |
| 51 | * Return values for the SDP functions. |
| 52 | * |
| 53 | * @ingroup gstreamermmEnums |
| 54 | */ |
| 55 | enum Result |
| 56 | { |
| 57 | SDP_OK = 0, |
| 58 | SDP_EINVAL = -1 |
| 59 | }; |
| 60 | |
| 61 | |
| 62 | /** The contents of the SDP "k=" field which is used to convey encryption |
| 63 | * keys. |
| 64 | */ |
| 65 | class Key |
| 66 | { |
| 67 | public: |
| 68 | #ifndef DOXYGEN_SHOULD_SKIP_THIS |
| 69 | using CppObjectType = Key; |
| 70 | using BaseObjectType = GstSDPKey; |
| 71 | #endif /* DOXYGEN_SHOULD_SKIP_THIS */ |
| 72 | |
| 73 | private: |
| 74 | |
| 75 | |
| 76 | public: |
| 77 | explicit Key(const GstSDPKey* gobject_); |
| 78 | Key(const Key& other); |
| 79 | Key(Key&& other); |
| 80 | ~Key(); |
| 81 | |
| 82 | GstSDPKey* gobj() { return &gobject_; } |
| 83 | const GstSDPKey* gobj() const { return &gobject_; } |
| 84 | |
| 85 | Glib::ustring get_type() const; |
| 86 | Glib::ustring get_data() const; |
| 87 | |
| 88 | protected: |
| 89 | GstSDPKey gobject_; |
| 90 | |
| 91 | |
| 92 | }; |
| 93 | |
| 94 | /** The contents of the SDP "m=" field with all related fields. |
| 95 | */ |
| 96 | class Media |
| 97 | { |
| 98 | public: |
| 99 | #ifndef DOXYGEN_SHOULD_SKIP_THIS |
| 100 | using CppObjectType = Media; |
| 101 | using BaseObjectType = GstSDPMedia; |
| 102 | #endif /* DOXYGEN_SHOULD_SKIP_THIS */ |
| 103 | |
| 104 | private: |
| 105 | |
| 106 | public: |
| 107 | Media(); |
| 108 | Media(const Media& other); |
| 109 | Media(Media&& other); |
| 110 | virtual ~Media(); |
| 111 | |
| 112 | GstSDPMedia* gobj() { return gobject_; } |
| 113 | const GstSDPMedia* gobj() const { return gobject_; } |
| 114 | |
| 115 | |
| 116 | /** Convert the contents of @a media to a text string. |
| 117 | * |
| 118 | * @return A dynamically allocated string representing the media. |
| 119 | */ |
| 120 | Glib::ustring as_text() const; |
| 121 | |
| 122 | /** Get the media description of @a media. |
| 123 | * |
| 124 | * @return The media description. |
| 125 | */ |
| 126 | Glib::ustring get_media() const; |
| 127 | |
| 128 | /** Set the media description of @a media to @a med. |
| 129 | * |
| 130 | * @param med The media description. |
| 131 | * @return Gst::SDP_OK. |
| 132 | */ |
| 133 | Result set_media(const Glib::ustring& med); |
| 134 | |
| 135 | /** Get the port number for @a media. |
| 136 | * |
| 137 | * @return The port number of @a media. |
| 138 | */ |
| 139 | guint get_port() const; |
| 140 | |
| 141 | /** Get the number of ports for @a media. |
| 142 | * |
| 143 | * @return The number of ports for @a media. |
| 144 | */ |
| 145 | guint get_num_ports() const; |
| 146 | |
| 147 | /** Set the port information in @a media. |
| 148 | * |
| 149 | * @param port The port number. |
| 150 | * @param num_ports The number of ports. |
| 151 | * @return Gst::SDP_OK. |
| 152 | */ |
| 153 | Result set_port_info(guint port, guint num_ports); |
| 154 | |
| 155 | /** Get the transport protocol of @a media |
| 156 | * |
| 157 | * @return The transport protocol of @a media. |
| 158 | */ |
| 159 | Glib::ustring get_proto() const; |
| 160 | |
| 161 | /** Set the media transport protocol of @a media to @a proto. |
| 162 | * |
| 163 | * @param proto The media transport protocol. |
| 164 | * @return Gst::SDP_OK. |
| 165 | */ |
| 166 | Result set_proto(const Glib::ustring& proto); |
| 167 | |
| 168 | /** Get the number of formats in @a media. |
| 169 | * |
| 170 | * @return The number of formats in @a media. |
| 171 | */ |
| 172 | guint formats_len() const; |
| 173 | |
| 174 | /** Get the format information at position @a idx in @a media. |
| 175 | * |
| 176 | * @param idx An index. |
| 177 | * @return The format at position @a idx. |
| 178 | */ |
| 179 | Glib::ustring get_format(guint idx) const; |
| 180 | |
| 181 | /** Insert the format information to @a media at @a idx. When @a idx is -1, |
| 182 | * the format is appended. |
| 183 | * |
| 184 | * @param idx An index. |
| 185 | * @param format The format. |
| 186 | * @return Gst::SDP_OK. |
| 187 | */ |
| 188 | Result insert_format(gint idx, const Glib::ustring& format); |
| 189 | |
| 190 | /** Replace the format information in @a media at @a idx with @a format. |
| 191 | * |
| 192 | * @param idx An index. |
| 193 | * @param format The format. |
| 194 | * @return Gst::SDP_OK. |
| 195 | */ |
| 196 | Result replace_format(guint idx, const Glib::ustring& format); |
| 197 | |
| 198 | /** Remove the format information in @a media at @a idx. |
| 199 | * |
| 200 | * @param idx An index. |
| 201 | * @return Gst::SDP_OK. |
| 202 | */ |
| 203 | Result remove_format(guint idx); |
| 204 | |
| 205 | /** Add the format information to @a media. |
| 206 | * |
| 207 | * @param format The format. |
| 208 | * @return Gst::SDP_OK. |
| 209 | */ |
| 210 | Result add_format(const Glib::ustring& format); |
| 211 | |
| 212 | /** Get the information of @a media |
| 213 | * |
| 214 | * @return The information of @a media. |
| 215 | */ |
| 216 | Glib::ustring get_information() const; |
| 217 | |
| 218 | /** Set the media information of @a media to @a information. |
| 219 | * |
| 220 | * @param information The media information. |
| 221 | * @return Gst::SDP_OK. |
| 222 | */ |
| 223 | Result set_information(const Glib::ustring& information); |
| 224 | |
| 225 | /** Get the number of connection fields in @a media. |
| 226 | * |
| 227 | * @return The number of connections in @a media. |
| 228 | */ |
| 229 | guint connections_len() const; |
| 230 | |
| 231 | /** Remove the connection information in @a media at @a idx. |
| 232 | * |
| 233 | * @param idx An index. |
| 234 | * @return Gst::SDP_OK. |
| 235 | */ |
| 236 | Result remove_connection(guint idx); |
| 237 | |
| 238 | /** Add the given connection parameters to @a media. |
| 239 | * |
| 240 | * @param nettype The type of network. "IN" is defined to have the meaning |
| 241 | * "Internet". |
| 242 | * @param addrtype The type of address. |
| 243 | * @param address The address. |
| 244 | * @param ttl The time to live of the address. |
| 245 | * @param addr_number The number of layers. |
| 246 | * @return A Gst::SDPResult. |
| 247 | */ |
| 248 | Result add_connection(const Glib::ustring& nettype, const Glib::ustring& addrtype, const Glib::ustring& address, guint ttl, guint addr_number); |
| 249 | |
| 250 | /** Get the number of bandwidth fields in @a media. |
| 251 | * |
| 252 | * @return The number of bandwidths in @a media. |
| 253 | */ |
| 254 | guint bandwidths_len() const; |
| 255 | |
| 256 | /** Remove the bandwidth information in @a media at @a idx. |
| 257 | * |
| 258 | * @param idx An index. |
| 259 | * @return Gst::SDP_OK. |
| 260 | */ |
| 261 | Result remove_bandwidth(guint idx); |
| 262 | |
| 263 | /** Add the bandwidth information with @a bwtype and @a bandwith to @a media. |
| 264 | * |
| 265 | * @param bwtype The bandwidth modifier type. |
| 266 | * @param bandwith The bandwidth in kilobits per second. |
| 267 | * @return Gst::SDP_OK. |
| 268 | */ |
| 269 | Result add_bandwidth(const Glib::ustring& bwtype, guint bandwith); |
| 270 | |
| 271 | |
| 272 | /** Get the encryption information from @a media. |
| 273 | * |
| 274 | * @return A Gst::SDPKey. |
| 275 | */ |
| 276 | Gst::SDP::Key get_key() const; |
| 277 | |
| 278 | |
| 279 | /** Adds the encryption information to @a media. |
| 280 | * |
| 281 | * @param key The encryption type. |
| 282 | * @param data The encryption data. |
| 283 | * @return A Gst::SDPResult. |
| 284 | */ |
| 285 | Result set_key(const Glib::ustring& key, const Glib::ustring& data); |
| 286 | |
| 287 | /** Get the number of attribute fields in @a media. |
| 288 | * |
| 289 | * @return The number of attributes in @a media. |
| 290 | */ |
| 291 | guint attributes_len() const; |
| 292 | |
| 293 | /** Get the first attribute value for @a key in @a media. |
| 294 | * |
| 295 | * @param key A key. |
| 296 | * @return The first attribute value for @a key. |
| 297 | */ |
| 298 | Glib::ustring get_attribute_val(const Glib::ustring& key) const; |
| 299 | |
| 300 | /** Get the @a nth attribute value for @a key in @a media. |
| 301 | * |
| 302 | * @param key A key. |
| 303 | * @param nth An index. |
| 304 | * @return The @a nth attribute value. |
| 305 | */ |
| 306 | Glib::ustring get_attribute_val(const Glib::ustring& key, guint nth) const; |
| 307 | |
| 308 | /** Remove the attribute in @a media at @a idx. |
| 309 | * |
| 310 | * @param idx An index. |
| 311 | * @return Gst::SDP_OK. |
| 312 | */ |
| 313 | Result remove_attribute(guint idx); |
| 314 | |
| 315 | /** Add the attribute with @a key and @a value to @a media. |
| 316 | * |
| 317 | * @param key A key. |
| 318 | * @param value A value. |
| 319 | * @return Gst::SDP_OK. |
| 320 | */ |
| 321 | Result add_attribute(const Glib::ustring& key, const Glib::ustring& value); |
| 322 | |
| 323 | /** Mapping of caps from SDP fields: |
| 324 | * |
| 325 | * a=rtpmap:(payload) (encoding_name)/(clock_rate)[/(encoding_params)] |
| 326 | * |
| 327 | * a=framesize:(payload) (width)-(height) |
| 328 | * |
| 329 | * a=fmtp:(payload) (param)[=(value)];... |
| 330 | * |
| 331 | * @param pt A payload type. |
| 332 | * @return A Gst::Caps, or <tt>nullptr</tt> if an error happened. |
| 333 | */ |
| 334 | Glib::RefPtr<Gst::Caps> get_caps_from_media(int pt) const; |
| 335 | |
| 336 | /** Mapping of attributes of Gst::SDPMedia to Gst::Caps |
| 337 | * |
| 338 | * @param caps A Gst::Caps. |
| 339 | * @return A Gst::SDPResult. |
| 340 | */ |
| 341 | Result attributes_to_caps(const Glib::RefPtr<Gst::Caps>& caps) const; |
| 342 | |
| 343 | protected: |
| 344 | GstSDPMedia *gobject_ = nullptr; |
| 345 | |
| 346 | |
| 347 | }; |
| 348 | |
| 349 | } // SDP |
| 350 | } // Gst |
| 351 | |
| 352 | |
| 353 | #endif /* _GSTREAMERMM_SDPMESSAGE_H */ |
| 354 |