Debian Codegraph @

gstreamer/src/sdpmessage.hg

raw
1 /* gstreamermm - a C++ wrapper for gstreamer
2 *
3 * Copyright 2016 The gstreamermm Development Team
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free
17 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 *
19 * Last reviewed on 2016-12-11 (1.10.0)
20 */
21
22 _DEFS(gstreamermm,gst)
23
24 #include <gst/sdp/gstsdpmessage.h>
25
26 namespace Gst
27 {
28
29 class Caps;
30
31 namespace SDP
32 {
33 _WRAP_ENUM(Result, GstSDPResult, NO_GTYPE)
34
35 /** The contents of the SDP "k=" field which is used to convey encryption
36 * keys.
37 */
38 class Key
39 {
40 _CLASS_GENERIC(Key, GstSDPKey)
41
42 public:
43 explicit Key(const GstSDPKey* gobject_);
44 Key(const Key& other);
45 Key(Key&& other);
46 ~Key();
47
48 GstSDPKey* gobj() { return &gobject_; }
49 const GstSDPKey* gobj() const { return &gobject_; }
50
51 _MEMBER_GET(type, type, Glib::ustring, gchar*)
52 _MEMBER_GET(data, data, Glib::ustring, gchar*)
53
54 protected:
55 GstSDPKey gobject_;
56 };
57
58 /** The contents of the SDP "m=" field with all related fields.
59 */
60 class Media
61 {
62 _CLASS_GENERIC(Media, GstSDPMedia)
63 public:
64 Media();
65 Media(const Media& other);
66 Media(Media&& other);
67 virtual ~Media();
68
69 GstSDPMedia* gobj() { return gobject_; }
70 const GstSDPMedia* gobj() const { return gobject_; }
71
72 _IGNORE(gst_sdp_media_free, gst_sdp_media_copy, gst_sdp_media_init, gst_sdp_media_uninit)
73
74 _WRAP_METHOD(Glib::ustring as_text() const, gst_sdp_media_as_text)
75 _WRAP_METHOD(Glib::ustring get_media() const, gst_sdp_media_get_media)
76 _WRAP_METHOD(Result set_media(const Glib::ustring& med), gst_sdp_media_set_media)
77 _WRAP_METHOD(guint get_port() const, gst_sdp_media_get_port)
78 _WRAP_METHOD(guint get_num_ports() const, gst_sdp_media_get_num_ports)
79 _WRAP_METHOD(Result set_port_info(guint port, guint num_ports), gst_sdp_media_set_port_info)
80 _WRAP_METHOD(Glib::ustring get_proto() const, gst_sdp_media_get_proto)
81 _WRAP_METHOD(Result set_proto(const Glib::ustring& proto), gst_sdp_media_set_proto)
82 _WRAP_METHOD(guint formats_len() const, gst_sdp_media_formats_len)
83 _WRAP_METHOD(Glib::ustring get_format(guint idx) const, gst_sdp_media_get_format)
84 _WRAP_METHOD(Result insert_format(gint idx, const Glib::ustring& format), gst_sdp_media_insert_format)
85 _WRAP_METHOD(Result replace_format(guint idx, const Glib::ustring& format), gst_sdp_media_replace_format)
86 _WRAP_METHOD(Result remove_format(guint idx), gst_sdp_media_remove_format)
87 _WRAP_METHOD(Result add_format(const Glib::ustring& format), gst_sdp_media_add_format)
88 _WRAP_METHOD(Glib::ustring get_information() const, gst_sdp_media_get_information)
89 _WRAP_METHOD(Result set_information(const Glib::ustring& information), gst_sdp_media_set_information)
90 _WRAP_METHOD(guint connections_len() const, gst_sdp_media_connections_len)
91 _WRAP_METHOD(Result remove_connection(guint idx), gst_sdp_media_remove_connection)
92 _WRAP_METHOD(Result add_connection(const Glib::ustring& nettype, const Glib::ustring& addrtype, const Glib::ustring& address, guint ttl, guint addr_number), gst_sdp_media_add_connection)
93 _WRAP_METHOD(guint bandwidths_len() const, gst_sdp_media_bandwidths_len)
94 _WRAP_METHOD(Result remove_bandwidth(guint idx), gst_sdp_media_remove_bandwidth)
95 _WRAP_METHOD(Result add_bandwidth(const Glib::ustring& bwtype, guint bandwith), gst_sdp_media_add_bandwidth)
96
97 #m4 _CONVERSION(`const GstSDPKey*',`Gst::SDP::Key',`Gst::SDP::Key($3)')
98 _WRAP_METHOD(Gst::SDP::Key get_key() const, gst_sdp_media_get_key)
99
100 _WRAP_METHOD(Result set_key(const Glib::ustring& key, const Glib::ustring& data), gst_sdp_media_set_key)
101 _WRAP_METHOD(guint attributes_len() const, gst_sdp_media_attributes_len)
102 _WRAP_METHOD(Glib::ustring get_attribute_val(const Glib::ustring& key) const, gst_sdp_media_get_attribute_val)
103 _WRAP_METHOD(Glib::ustring get_attribute_val(const Glib::ustring& key, guint nth) const, gst_sdp_media_get_attribute_val_n)
104 _WRAP_METHOD(Result remove_attribute(guint idx), gst_sdp_media_remove_attribute)
105 _WRAP_METHOD(Result add_attribute(const Glib::ustring& key, const Glib::ustring& value), gst_sdp_media_add_attribute)
106 _WRAP_METHOD(Glib::RefPtr<Gst::Caps> get_caps_from_media(int pt) const, gst_sdp_media_get_caps_from_media)
107 _WRAP_METHOD(Result attributes_to_caps(const Glib::RefPtr<Gst::Caps>& caps) const, gst_sdp_media_attributes_to_caps)
108
109 protected:
110 GstSDPMedia *gobject_ = nullptr;
111 };
112
113 } // SDP
114 } // Gst