| 1 | // Generated by gmmproc 2.50.1 -- DO NOT MODIFY! |
| 2 | |
| 3 | |
| 4 | #include <glibmm.h> |
| 5 | |
| 6 | #include <gstreamermm/sdpmessage.h> |
| 7 | #include <gstreamermm/private/sdpmessage_p.h> |
| 8 | |
| 9 | |
| 10 | /* gstreamermm - a C++ wrapper for gstreamer |
| 11 | * |
| 12 | * Copyright 2016 The gstreamermm Development Team |
| 13 | * |
| 14 | * This library is free software; you can redistribute it and/or |
| 15 | * modify it under the terms of the GNU Lesser General Public |
| 16 | * License as published by the Free Software Foundation; either |
| 17 | * version 2.1 of the License, or (at your option) any later version. |
| 18 | * |
| 19 | * This library is distributed in the hope that it will be useful, |
| 20 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 21 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 22 | * Lesser General Public License for more details. |
| 23 | * |
| 24 | * You should have received a copy of the GNU Lesser General Public |
| 25 | * License along with this library; if not, write to the Free |
| 26 | * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
| 27 | * |
| 28 | * Last reviewed on 2016-12-11 (1.10.0) |
| 29 | */ |
| 30 | |
| 31 | #include <gstreamermm/caps.h> |
| 32 | |
| 33 | namespace Gst |
| 34 | { |
| 35 | namespace SDP |
| 36 | { |
| 37 | |
| 38 | Key::Key(const GstSDPKey* gobject_) |
| 39 | { |
| 40 | this->gobject_.type = g_strdup(gobject_->type); |
| 41 | this->gobject_.data = g_strdup(gobject_->data); |
| 42 | } |
| 43 | |
| 44 | Key::Key(const Key& other) |
| 45 | : Key(&other.gobject_) |
| 46 | { |
| 47 | } |
| 48 | |
| 49 | Key::Key(Key&& other) |
| 50 | { |
| 51 | gobject_.type = other.gobject_.type; |
| 52 | gobject_.data = other.gobject_.data; |
| 53 | other.gobject_.type = nullptr; |
| 54 | other.gobject_.data = nullptr; |
| 55 | } |
| 56 | |
| 57 | Key::~Key() |
| 58 | { |
| 59 | g_free(gobject_.type); |
| 60 | g_free(gobject_.data); |
| 61 | } |
| 62 | |
| 63 | Media::Media() |
| 64 | { |
| 65 | gst_sdp_media_new(&gobject_); |
| 66 | } |
| 67 | |
| 68 | Media::~Media() |
| 69 | { |
| 70 | if (gobject_) |
| 71 | gst_sdp_media_free(gobject_); |
| 72 | } |
| 73 | |
| 74 | Media::Media(const Media& other) |
| 75 | { |
| 76 | gst_sdp_media_copy(other.gobject_, &gobject_); |
| 77 | } |
| 78 | |
| 79 | Media::Media(Media&& other) |
| 80 | { |
| 81 | std::swap(other.gobject_, gobject_); |
| 82 | } |
| 83 | |
| 84 | } |
| 85 | } |
| 86 | |
| 87 | namespace |
| 88 | { |
| 89 | } // anonymous namespace |
| 90 | |
| 91 | |
| 92 | namespace Gst |
| 93 | { |
| 94 | |
| 95 | namespace SDP |
| 96 | { |
| 97 | |
| 98 | |
| 99 | Glib::ustring Key::get_type() const |
| 100 | { |
| 101 | return Glib::convert_const_gchar_ptr_to_ustring(gobj()->type); |
| 102 | } |
| 103 | |
| 104 | Glib::ustring Key::get_data() const |
| 105 | { |
| 106 | return Glib::convert_const_gchar_ptr_to_ustring(gobj()->data); |
| 107 | } |
| 108 | |
| 109 | |
| 110 | } // namespace SDP |
| 111 | |
| 112 | } // namespace Gst |
| 113 | |
| 114 | |
| 115 | namespace Gst |
| 116 | { |
| 117 | |
| 118 | namespace SDP |
| 119 | { |
| 120 | |
| 121 | |
| 122 | Glib::ustring Media::as_text() const |
| 123 | { |
| 124 | return Glib::convert_return_gchar_ptr_to_ustring(gst_sdp_media_as_text(const_cast<GstSDPMedia*>(gobj()))); |
| 125 | } |
| 126 | |
| 127 | Glib::ustring Media::get_media() const |
| 128 | { |
| 129 | return Glib::convert_const_gchar_ptr_to_ustring(gst_sdp_media_get_media(const_cast<GstSDPMedia*>(gobj()))); |
| 130 | } |
| 131 | |
| 132 | Result Media::set_media(const Glib::ustring& med) |
| 133 | { |
| 134 | return ((Result)(gst_sdp_media_set_media(gobj(), med.c_str()))); |
| 135 | } |
| 136 | |
| 137 | guint Media::get_port() const |
| 138 | { |
| 139 | return gst_sdp_media_get_port(const_cast<GstSDPMedia*>(gobj())); |
| 140 | } |
| 141 | |
| 142 | guint Media::get_num_ports() const |
| 143 | { |
| 144 | return gst_sdp_media_get_num_ports(const_cast<GstSDPMedia*>(gobj())); |
| 145 | } |
| 146 | |
| 147 | Result Media::set_port_info(guint port, guint num_ports) |
| 148 | { |
| 149 | return ((Result)(gst_sdp_media_set_port_info(gobj(), port, num_ports))); |
| 150 | } |
| 151 | |
| 152 | Glib::ustring Media::get_proto() const |
| 153 | { |
| 154 | return Glib::convert_const_gchar_ptr_to_ustring(gst_sdp_media_get_proto(const_cast<GstSDPMedia*>(gobj()))); |
| 155 | } |
| 156 | |
| 157 | Result Media::set_proto(const Glib::ustring& proto) |
| 158 | { |
| 159 | return ((Result)(gst_sdp_media_set_proto(gobj(), proto.c_str()))); |
| 160 | } |
| 161 | |
| 162 | guint Media::formats_len() const |
| 163 | { |
| 164 | return gst_sdp_media_formats_len(const_cast<GstSDPMedia*>(gobj())); |
| 165 | } |
| 166 | |
| 167 | Glib::ustring Media::get_format(guint idx) const |
| 168 | { |
| 169 | return Glib::convert_const_gchar_ptr_to_ustring(gst_sdp_media_get_format(const_cast<GstSDPMedia*>(gobj()), idx)); |
| 170 | } |
| 171 | |
| 172 | Result Media::insert_format(gint idx, const Glib::ustring& format) |
| 173 | { |
| 174 | return ((Result)(gst_sdp_media_insert_format(gobj(), idx, format.c_str()))); |
| 175 | } |
| 176 | |
| 177 | Result Media::replace_format(guint idx, const Glib::ustring& format) |
| 178 | { |
| 179 | return ((Result)(gst_sdp_media_replace_format(gobj(), idx, format.c_str()))); |
| 180 | } |
| 181 | |
| 182 | Result Media::remove_format(guint idx) |
| 183 | { |
| 184 | return ((Result)(gst_sdp_media_remove_format(gobj(), idx))); |
| 185 | } |
| 186 | |
| 187 | Result Media::add_format(const Glib::ustring& format) |
| 188 | { |
| 189 | return ((Result)(gst_sdp_media_add_format(gobj(), format.c_str()))); |
| 190 | } |
| 191 | |
| 192 | Glib::ustring Media::get_information() const |
| 193 | { |
| 194 | return Glib::convert_const_gchar_ptr_to_ustring(gst_sdp_media_get_information(const_cast<GstSDPMedia*>(gobj()))); |
| 195 | } |
| 196 | |
| 197 | Result Media::set_information(const Glib::ustring& information) |
| 198 | { |
| 199 | return ((Result)(gst_sdp_media_set_information(gobj(), information.c_str()))); |
| 200 | } |
| 201 | |
| 202 | guint Media::connections_len() const |
| 203 | { |
| 204 | return gst_sdp_media_connections_len(const_cast<GstSDPMedia*>(gobj())); |
| 205 | } |
| 206 | |
| 207 | Result Media::remove_connection(guint idx) |
| 208 | { |
| 209 | return ((Result)(gst_sdp_media_remove_connection(gobj(), idx))); |
| 210 | } |
| 211 | |
| 212 | Result Media::add_connection(const Glib::ustring& nettype, const Glib::ustring& addrtype, const Glib::ustring& address, guint ttl, guint addr_number) |
| 213 | { |
| 214 | return ((Result)(gst_sdp_media_add_connection(gobj(), nettype.c_str(), addrtype.c_str(), address.c_str(), ttl, addr_number))); |
| 215 | } |
| 216 | |
| 217 | guint Media::bandwidths_len() const |
| 218 | { |
| 219 | return gst_sdp_media_bandwidths_len(const_cast<GstSDPMedia*>(gobj())); |
| 220 | } |
| 221 | |
| 222 | Result Media::remove_bandwidth(guint idx) |
| 223 | { |
| 224 | return ((Result)(gst_sdp_media_remove_bandwidth(gobj(), idx))); |
| 225 | } |
| 226 | |
| 227 | Result Media::add_bandwidth(const Glib::ustring& bwtype, guint bandwith) |
| 228 | { |
| 229 | return ((Result)(gst_sdp_media_add_bandwidth(gobj(), bwtype.c_str(), bandwith))); |
| 230 | } |
| 231 | |
| 232 | Gst::SDP::Key Media::get_key() const |
| 233 | { |
| 234 | return Gst::SDP::Key(gst_sdp_media_get_key(const_cast<GstSDPMedia*>(gobj()))); |
| 235 | } |
| 236 | |
| 237 | Result Media::set_key(const Glib::ustring& key, const Glib::ustring& data) |
| 238 | { |
| 239 | return ((Result)(gst_sdp_media_set_key(gobj(), key.c_str(), data.c_str()))); |
| 240 | } |
| 241 | |
| 242 | guint Media::attributes_len() const |
| 243 | { |
| 244 | return gst_sdp_media_attributes_len(const_cast<GstSDPMedia*>(gobj())); |
| 245 | } |
| 246 | |
| 247 | Glib::ustring Media::get_attribute_val(const Glib::ustring& key) const |
| 248 | { |
| 249 | return Glib::convert_const_gchar_ptr_to_ustring(gst_sdp_media_get_attribute_val(const_cast<GstSDPMedia*>(gobj()), key.c_str())); |
| 250 | } |
| 251 | |
| 252 | Glib::ustring Media::get_attribute_val(const Glib::ustring& key, guint nth) const |
| 253 | { |
| 254 | return Glib::convert_const_gchar_ptr_to_ustring(gst_sdp_media_get_attribute_val_n(const_cast<GstSDPMedia*>(gobj()), key.c_str(), nth)); |
| 255 | } |
| 256 | |
| 257 | Result Media::remove_attribute(guint idx) |
| 258 | { |
| 259 | return ((Result)(gst_sdp_media_remove_attribute(gobj(), idx))); |
| 260 | } |
| 261 | |
| 262 | Result Media::add_attribute(const Glib::ustring& key, const Glib::ustring& value) |
| 263 | { |
| 264 | return ((Result)(gst_sdp_media_add_attribute(gobj(), key.c_str(), value.c_str()))); |
| 265 | } |
| 266 | |
| 267 | Glib::RefPtr<Gst::Caps> Media::get_caps_from_media(int pt) const |
| 268 | { |
| 269 | return Glib::wrap(gst_sdp_media_get_caps_from_media(const_cast<GstSDPMedia*>(gobj()), pt)); |
| 270 | } |
| 271 | |
| 272 | Result Media::attributes_to_caps(const Glib::RefPtr<Gst::Caps>& caps) const |
| 273 | { |
| 274 | return ((Result)(gst_sdp_media_attributes_to_caps(const_cast<GstSDPMedia*>(gobj()), Glib::unwrap(caps)))); |
| 275 | } |
| 276 | |
| 277 | |
| 278 | } // namespace SDP |
| 279 | |
| 280 | } // namespace Gst |
| 281 | |
| 282 |