Debian Codegraph @

gstreamer/src/sdpmessage.ccg

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 #include <gstreamermm/caps.h>
23
24 namespace Gst
25 {
26 namespace SDP
27 {
28
29 Key::Key(const GstSDPKey* gobject_)
30 {
31 this->gobject_.type = g_strdup(gobject_->type);
32 this->gobject_.data = g_strdup(gobject_->data);
33 }
34
35 Key::Key(const Key& other)
36 : Key(&other.gobject_)
37 {
38 }
39
40 Key::Key(Key&& other)
41 {
42 gobject_.type = other.gobject_.type;
43 gobject_.data = other.gobject_.data;
44 other.gobject_.type = nullptr;
45 other.gobject_.data = nullptr;
46 }
47
48 Key::~Key()
49 {
50 g_free(gobject_.type);
51 g_free(gobject_.data);
52 }
53
54 Media::Media()
55 {
56 gst_sdp_media_new(&gobject_);
57 }
58
59 Media::~Media()
60 {
61 if (gobject_)
62 gst_sdp_media_free(gobject_);
63 }
64
65 Media::Media(const Media& other)
66 {
67 gst_sdp_media_copy(other.gobject_, &gobject_);
68 }
69
70 Media::Media(Media&& other)
71 {
72 std::swap(other.gobject_, gobject_);
73 }
74
75 }
76 }