// Generated by gmmproc 2.50.1 -- DO NOT MODIFY!


#include <glibmm.h>

#include <gstreamermm/sdpmessage.h>
#include <gstreamermm/private/sdpmessage_p.h>


/* gstreamermm - a C++ wrapper for gstreamer
 *
 * Copyright 2016 The gstreamermm Development Team
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free
 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 *
 * Last reviewed on 2016-12-11 (1.10.0)
 */

#include <gstreamermm/caps.h>

namespace Gst
{
namespace SDP
{

Key::Key(const GstSDPKey* gobject_)
{
  this->gobject_.type = g_strdup(gobject_->type);
  this->gobject_.data = g_strdup(gobject_->data);
}

Key::Key(const Key& other)
: Key(&other.gobject_)
{
}

Key::Key(Key&& other)
{
  gobject_.type = other.gobject_.type;
  gobject_.data = other.gobject_.data;
  other.gobject_.type = nullptr;
  other.gobject_.data = nullptr;
}

Key::~Key()
{
  g_free(gobject_.type);
  g_free(gobject_.data);
}

Media::Media()
{
  gst_sdp_media_new(&gobject_);
}

Media::~Media()
{
  if (gobject_)
    gst_sdp_media_free(gobject_);
}

Media::Media(const Media& other)
{
  gst_sdp_media_copy(other.gobject_, &gobject_);
}

Media::Media(Media&& other)
{
  std::swap(other.gobject_, gobject_);
}

}
}

namespace
{
} // anonymous namespace


namespace Gst
{

namespace SDP
{


Glib::ustring Key::get_type() const
{
  return Glib::convert_const_gchar_ptr_to_ustring(gobj()->type);
}

Glib::ustring Key::get_data() const
{
  return Glib::convert_const_gchar_ptr_to_ustring(gobj()->data);
}


} // namespace SDP

} // namespace Gst


namespace Gst
{

namespace SDP
{


Glib::ustring Media::as_text() const
{
  return Glib::convert_return_gchar_ptr_to_ustring(gst_sdp_media_as_text(const_cast<GstSDPMedia*>(gobj())));
}

Glib::ustring Media::get_media() const
{
  return Glib::convert_const_gchar_ptr_to_ustring(gst_sdp_media_get_media(const_cast<GstSDPMedia*>(gobj())));
}

Result Media::set_media(const Glib::ustring& med)
{
  return ((Result)(gst_sdp_media_set_media(gobj(), med.c_str())));
}

guint Media::get_port() const
{
  return gst_sdp_media_get_port(const_cast<GstSDPMedia*>(gobj()));
}

guint Media::get_num_ports() const
{
  return gst_sdp_media_get_num_ports(const_cast<GstSDPMedia*>(gobj()));
}

Result Media::set_port_info(guint port, guint num_ports)
{
  return ((Result)(gst_sdp_media_set_port_info(gobj(), port, num_ports)));
}

Glib::ustring Media::get_proto() const
{
  return Glib::convert_const_gchar_ptr_to_ustring(gst_sdp_media_get_proto(const_cast<GstSDPMedia*>(gobj())));
}

Result Media::set_proto(const Glib::ustring& proto)
{
  return ((Result)(gst_sdp_media_set_proto(gobj(), proto.c_str())));
}

guint Media::formats_len() const
{
  return gst_sdp_media_formats_len(const_cast<GstSDPMedia*>(gobj()));
}

Glib::ustring Media::get_format(guint idx) const
{
  return Glib::convert_const_gchar_ptr_to_ustring(gst_sdp_media_get_format(const_cast<GstSDPMedia*>(gobj()), idx));
}

Result Media::insert_format(gint idx, const Glib::ustring& format)
{
  return ((Result)(gst_sdp_media_insert_format(gobj(), idx, format.c_str())));
}

Result Media::replace_format(guint idx, const Glib::ustring& format)
{
  return ((Result)(gst_sdp_media_replace_format(gobj(), idx, format.c_str())));
}

Result Media::remove_format(guint idx)
{
  return ((Result)(gst_sdp_media_remove_format(gobj(), idx)));
}

Result Media::add_format(const Glib::ustring& format)
{
  return ((Result)(gst_sdp_media_add_format(gobj(), format.c_str())));
}

Glib::ustring Media::get_information() const
{
  return Glib::convert_const_gchar_ptr_to_ustring(gst_sdp_media_get_information(const_cast<GstSDPMedia*>(gobj())));
}

Result Media::set_information(const Glib::ustring& information)
{
  return ((Result)(gst_sdp_media_set_information(gobj(), information.c_str())));
}

guint Media::connections_len() const
{
  return gst_sdp_media_connections_len(const_cast<GstSDPMedia*>(gobj()));
}

Result Media::remove_connection(guint idx)
{
  return ((Result)(gst_sdp_media_remove_connection(gobj(), idx)));
}

Result Media::add_connection(const Glib::ustring& nettype, const Glib::ustring& addrtype, const Glib::ustring& address, guint ttl, guint addr_number)
{
  return ((Result)(gst_sdp_media_add_connection(gobj(), nettype.c_str(), addrtype.c_str(), address.c_str(), ttl, addr_number)));
}

guint Media::bandwidths_len() const
{
  return gst_sdp_media_bandwidths_len(const_cast<GstSDPMedia*>(gobj()));
}

Result Media::remove_bandwidth(guint idx)
{
  return ((Result)(gst_sdp_media_remove_bandwidth(gobj(), idx)));
}

Result Media::add_bandwidth(const Glib::ustring& bwtype, guint bandwith)
{
  return ((Result)(gst_sdp_media_add_bandwidth(gobj(), bwtype.c_str(), bandwith)));
}

Gst::SDP::Key Media::get_key() const
{
  return Gst::SDP::Key(gst_sdp_media_get_key(const_cast<GstSDPMedia*>(gobj())));
}

Result Media::set_key(const Glib::ustring& key, const Glib::ustring& data)
{
  return ((Result)(gst_sdp_media_set_key(gobj(), key.c_str(), data.c_str())));
}

guint Media::attributes_len() const
{
  return gst_sdp_media_attributes_len(const_cast<GstSDPMedia*>(gobj()));
}

Glib::ustring Media::get_attribute_val(const Glib::ustring& key) const
{
  return Glib::convert_const_gchar_ptr_to_ustring(gst_sdp_media_get_attribute_val(const_cast<GstSDPMedia*>(gobj()), key.c_str()));
}

Glib::ustring Media::get_attribute_val(const Glib::ustring& key, guint nth) const
{
  return Glib::convert_const_gchar_ptr_to_ustring(gst_sdp_media_get_attribute_val_n(const_cast<GstSDPMedia*>(gobj()), key.c_str(), nth));
}

Result Media::remove_attribute(guint idx)
{
  return ((Result)(gst_sdp_media_remove_attribute(gobj(), idx)));
}

Result Media::add_attribute(const Glib::ustring& key, const Glib::ustring& value)
{
  return ((Result)(gst_sdp_media_add_attribute(gobj(), key.c_str(), value.c_str())));
}

Glib::RefPtr<Gst::Caps> Media::get_caps_from_media(int pt) const
{
  return Glib::wrap(gst_sdp_media_get_caps_from_media(const_cast<GstSDPMedia*>(gobj()), pt));
}

Result Media::attributes_to_caps(const Glib::RefPtr<Gst::Caps>& caps) const
{
  return ((Result)(gst_sdp_media_attributes_to_caps(const_cast<GstSDPMedia*>(gobj()), Glib::unwrap(caps))));
}


} // namespace SDP

} // namespace Gst


