| 1 | // Generated by gmmproc 2.50.1 -- DO NOT MODIFY!cxx . . $ `<file>/gstreamer/gstreamermm/memory.cc`/ |
| 2 | |
| 3 | |
| 4 | #include <glibmm.h> |
| 5 | |
| 6 | #include <gstreamermm/memory.h>cxx . . $ `<file>/gstreamer/gstreamermm/memory.h`/ |
| 7 | #include <gstreamermm/private/memory_p.h>cxx . . $ `<file>/gstreamer/gstreamermm/private/memory_p.h`/ |
| 8 | |
| 9 | |
| 10 | /* gstreamermm - a C++ wrapper for gstreamer |
| 11 | * |
| 12 | * Copyright 2008-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 | |
| 29 | |
| 30 | #include <gstreamermm/allocator.h>cxx . . $ `<file>/gstreamer/gstreamermm/allocator.h`/ |
| 31 | |
| 32 | namespace Gstcxx . . $ Gst/ |
| 33 | { |
| 34 | |
| 35 | Glibcxx . . $ Glib/::RefPtrcxx . . $ Glib/RefPtr#<Gstcxx . . $ Gst/::Memorycxx . . $ Gst/Memory#> Memorycxx . . $ Gst/Memory#::createcxx . . $ Gst/Memory#create(c21e9815abc8ab8e).(Gstcxx . . $ Gst/::MemoryFlagscxx . . $ Gst/MemoryFlags# flags, gpointer data, gsize maxsize, gsize offset, gsize size) |
| 36 | { |
| 37 | return Glibcxx . . $ Glib/::RefPtrcxx . . $ Glib/RefPtr#<Memorycxx . . $ Gst/Memory#>(reinterpret_cast<Memorycxx . . $ Gst/Memory#*>(gst_memory_new_wrapped(GstMemoryFlags(flags), data, maxsize, offset, size, 0, 0))); |
| 38 | } |
| 39 | |
| 40 | Glibcxx . . $ Glib/::RefPtrcxx . . $ Glib/RefPtr#<Gstcxx . . $ Gst/::Memorycxx . . $ Gst/Memory#> Memorycxx . . $ Gst/Memory#::make_mappedcxx . . $ Gst/Memory#make_mapped(9882f4f86bdf99aa).(Gstcxx . . $ Gst/::MapInfocxx . . $ Gst/MapInfo#& info, Gstcxx . . $ Gst/::MapFlagscxx . . $ Gst/MapFlags# flags) |
| 41 | { |
| 42 | referencecxx . . $ Gst/Memory#reference(83f5f38750778ac8).(); |
| 43 | GstMemory* new_mem = gst_memory_make_mapped(gobjcxx . . $ Gst/Memory#gobj(f4325ef78aa51f39).(), info.gobjcxx . . $ Gst/MapInfo#gobj(77500a54d235baf).(), static_cast<GstMapFlags>(flags)); |
| 44 | return Glibcxx . . $ Glib/::wrapcxx . . $ Glib/wrap(61e990c27e905542).(new_mem, gobjcxx . . $ Gst/Memory#gobj(f4325ef78aa51f39).() != new_mem); |
| 45 | } |
| 46 | |
| 47 | } |
| 48 | |
| 49 | namespacecxx . . $ `$anonymous_namespace_gstreamer/gstreamermm/memory.cc`/ |
| 50 | { |
| 51 | } // anonymous namespace |
| 52 | |
| 53 | // static |
| 54 | GType Glibcxx . . $ Glib/::Valuecxx . . $ Glib/Value#<Gst::MemoryFlags>::value_typecxx . . $ Glib/Value#value_type(f708dce9a8856c70).() |
| 55 | { |
| 56 | return gst_memory_flags_get_type(); |
| 57 | } |
| 58 | |
| 59 | |
| 60 | /* Why reinterpret_cast<Memory*>(gobject) is needed: |
| 61 | * |
| 62 | * A Memory instance is in fact always a GstMemory instance. |
| 63 | * Unfortunately, GstMemory cannot be a member of Memory, |
| 64 | * because it is an opaque struct. Also, the C interface does not provide |
| 65 | * any hooks to install a destroy notification handler, thus we cannot |
| 66 | * wrap it dynamically either. |
| 67 | * |
| 68 | * The cast works because Memory does not have any member data, and |
| 69 | * it is impossible to derive from it. This is ensured by using final on the |
| 70 | * class and by using = delete on the default constructor. |
| 71 | */ |
| 72 | |
| 73 | namespace Glibcxx . . $ Glib/ |
| 74 | { |
| 75 | |
| 76 | Glibcxx . . $ Glib/::RefPtrcxx . . $ Glib/RefPtr#<Gstcxx . . $ Gst/::Memorycxx . . $ Gst/Memory#> wrapcxx . . $ Glib/wrap(61e990c27e905542).(GstMemory* object, bool take_copy) |
| 77 | { |
| 78 | if(take_copy && object) |
| 79 | gst_memory_ref(object); |
| 80 | |
| 81 | // See the comment at the top of this file, if you want to know why the cast works. |
| 82 | return Glibcxx . . $ Glib/::RefPtrcxx . . $ Glib/RefPtr#<Gstcxx . . $ Gst/::Memorycxx . . $ Gst/Memory#>(reinterpret_cast<Gstcxx . . $ Gst/::Memorycxx . . $ Gst/Memory#*>(object)); |
| 83 | } |
| 84 | |
| 85 | } // namespace Glib |
| 86 | |
| 87 | |
| 88 | namespace Gstcxx . . $ Gst/ |
| 89 | { |
| 90 | |
| 91 | |
| 92 | void Memorycxx . . $ Gst/Memory#::referencecxx . . $ Gst/Memory#reference(83f5f38750778ac8).() const |
| 93 | { |
| 94 | // See the comment at the top of this file, if you want to know why the cast works. |
| 95 | gst_memory_ref(reinterpret_cast<GstMemory*>(const_cast<Memorycxx . . $ Gst/Memory#*>(this))); |
| 96 | } |
| 97 | |
| 98 | void Memorycxx . . $ Gst/Memory#::unreferencecxx . . $ Gst/Memory#unreference(83f5f38750778ac8).() const |
| 99 | { |
| 100 | // See the comment at the top of this file, if you want to know why the cast works. |
| 101 | gst_memory_unref(reinterpret_cast<GstMemory*>(const_cast<Memorycxx . . $ Gst/Memory#*>(this))); |
| 102 | } |
| 103 | |
| 104 | GstMemory* Memorycxx . . $ Gst/Memory#::gobjcxx . . $ Gst/Memory#gobj(f4325ef78aa51f39).() |
| 105 | { |
| 106 | // See the comment at the top of this file, if you want to know why the cast works. |
| 107 | return reinterpret_cast<GstMemory*>(this); |
| 108 | } |
| 109 | |
| 110 | const GstMemory* Memorycxx . . $ Gst/Memory#::gobjcxx . . $ Gst/Memory#gobj(a2e020f300680f1d).() const |
| 111 | { |
| 112 | // See the comment at the top of this file, if you want to know why the cast works. |
| 113 | return reinterpret_cast<const GstMemory*>(this); |
| 114 | } |
| 115 | |
| 116 | GstMemory* Memorycxx . . $ Gst/Memory#::gobj_copycxx . . $ Gst/Memory#gobj_copy(f334c12b327e446b).() const |
| 117 | { |
| 118 | // See the comment at the top of this file, if you want to know why the cast works. |
| 119 | const auto gobject = reinterpret_cast<GstMemory*>(const_cast<Memorycxx . . $ Gst/Memory#*>(this)); |
| 120 | gst_memory_ref(gobject); |
| 121 | return gobject; |
| 122 | } |
| 123 | |
| 124 | |
| 125 | gsize Memorycxx . . $ Gst/Memory#::get_maxsizecxx . . $ Gst/Memory#get_maxsize(fe4d2d262d4164a8).() const |
| 126 | { |
| 127 | return gobjcxx . . $ Gst/Memory#gobj(a2e020f300680f1d).()->maxsizecxx . . $ _GstMemory#maxsize.; |
| 128 | } |
| 129 | |
| 130 | gsize Memorycxx . . $ Gst/Memory#::get_aligncxx . . $ Gst/Memory#get_align(fe4d2d262d4164a8).() const |
| 131 | { |
| 132 | return gobjcxx . . $ Gst/Memory#gobj(a2e020f300680f1d).()->aligncxx . . $ _GstMemory#align.; |
| 133 | } |
| 134 | |
| 135 | gsize Memorycxx . . $ Gst/Memory#::get_offsetcxx . . $ Gst/Memory#get_offset(fe4d2d262d4164a8).() const |
| 136 | { |
| 137 | return gobjcxx . . $ Gst/Memory#gobj(a2e020f300680f1d).()->offsetcxx . . $ _GstMemory#offset.; |
| 138 | } |
| 139 | |
| 140 | gsize Memorycxx . . $ Gst/Memory#::get_sizecxx . . $ Gst/Memory#get_size(fe4d2d262d4164a8).() const |
| 141 | { |
| 142 | return gobjcxx . . $ Gst/Memory#gobj(a2e020f300680f1d).()->sizecxx . . $ _GstMemory#size.; |
| 143 | } |
| 144 | |
| 145 | Glibcxx . . $ Glib/::RefPtrcxx . . $ Glib/RefPtr#<Gstcxx . . $ Gst/::Memorycxx . . $ Gst/Memory#> Memorycxx . . $ Gst/Memory#::get_parentcxx . . $ Gst/Memory#get_parent(955135cc9c3888a).() |
| 146 | { |
| 147 | Glibcxx . . $ Glib/::RefPtrcxx . . $ Glib/RefPtr#<Gstcxx . . $ Gst/::Memorycxx . . $ Gst/Memory#> ref_ptr(Glibcxx . . $ Glib/::wrapcxx . . $ Glib/wrap(61e990c27e905542).(gobjcxx . . $ Gst/Memory#gobj(f4325ef78aa51f39).()->parentcxx . . $ _GstMemory#parent.)); |
| 148 | |
| 149 | if(ref_ptr) |
| 150 | ref_ptr->cxx . . $ Glib/RefPtr#`operator->`(34d6acfd341ba7ab).referencecxx . . $ Gst/Memory#reference(83f5f38750778ac8).(); |
| 151 | |
| 152 | return ref_ptrcxx . . $ Glib/RefPtr#RefPtr(560c7fdd049cdfe1).; |
| 153 | } |
| 154 | |
| 155 | Glibcxx . . $ Glib/::RefPtrcxx . . $ Glib/RefPtr#<const Gstcxx . . $ Gst/::Memorycxx . . $ Gst/Memory#> Memorycxx . . $ Gst/Memory#::get_parentcxx . . $ Gst/Memory#get_parent(7bc160d1054d73e3).() const |
| 156 | { |
| 157 | Glibcxx . . $ Glib/::RefPtrcxx . . $ Glib/RefPtr#<const Gstcxx . . $ Gst/::Memorycxx . . $ Gst/Memory#> ref_ptrcxx . . $ Glib/RefPtr#RefPtr(9e4c744904342adc).(Glibcxx . . $ Glib/::wrapcxx . . $ Glib/wrap(61e990c27e905542).(gobjcxx . . $ Gst/Memory#gobj(a2e020f300680f1d).()->parentcxx . . $ _GstMemory#parent.)); |
| 158 | |
| 159 | if(ref_ptr) |
| 160 | ref_ptr->cxx . . $ Glib/RefPtr#`operator->`(34d6acfd341ba7ab).referencecxx . . $ Gst/Memory#reference(83f5f38750778ac8).(); |
| 161 | |
| 162 | return ref_ptrcxx . . $ Glib/RefPtr#RefPtr(560c7fdd049cdfe1).; |
| 163 | } |
| 164 | |
| 165 | Glibcxx . . $ Glib/::RefPtrcxx . . $ Glib/RefPtr#<Gstcxx . . $ Gst/::Allocatorcxx . . $ Gst/Allocator#> Memorycxx . . $ Gst/Memory#::get_allocatorcxx . . $ Gst/Memory#get_allocator(e013e171d5b5f839).() |
| 166 | { |
| 167 | Glibcxx . . $ Glib/::RefPtrcxx . . $ Glib/RefPtr#<Gstcxx . . $ Gst/::Allocatorcxx . . $ Gst/Allocator#> ref_ptr(Glibcxx . . $ Glib/::wrapcxx . . $ Glib/wrap(c608c0ab6ce247e5).(gobjcxx . . $ Gst/Memory#gobj(f4325ef78aa51f39).()->allocatorcxx . . $ _GstMemory#allocator.)); |
| 168 | |
| 169 | if(ref_ptr) |
| 170 | ref_ptr->cxx . . $ Glib/RefPtr#`operator->`(34d6acfd341ba7ab).referencecxx . . $ Glib/ObjectBase#reference(83f5f38750778ac8).(); |
| 171 | |
| 172 | return ref_ptrcxx . . $ Glib/RefPtr#RefPtr(560c7fdd049cdfe1).; |
| 173 | } |
| 174 | |
| 175 | Glibcxx . . $ Glib/::RefPtrcxx . . $ Glib/RefPtr#<const Gstcxx . . $ Gst/::Allocatorcxx . . $ Gst/Allocator#> Memorycxx . . $ Gst/Memory#::get_allocatorcxx . . $ Gst/Memory#get_allocator(4cebbc3f4b1cbad1).() const |
| 176 | { |
| 177 | Glibcxx . . $ Glib/::RefPtrcxx . . $ Glib/RefPtr#<const Gstcxx . . $ Gst/::Allocatorcxx . . $ Gst/Allocator#> ref_ptrcxx . . $ Glib/RefPtr#RefPtr(9e4c744904342adc).(Glibcxx . . $ Glib/::wrapcxx . . $ Glib/wrap(c608c0ab6ce247e5).(gobjcxx . . $ Gst/Memory#gobj(a2e020f300680f1d).()->allocatorcxx . . $ _GstMemory#allocator.)); |
| 178 | |
| 179 | if(ref_ptr) |
| 180 | ref_ptr->cxx . . $ Glib/RefPtr#`operator->`(34d6acfd341ba7ab).referencecxx . . $ Glib/ObjectBase#reference(83f5f38750778ac8).(); |
| 181 | |
| 182 | return ref_ptrcxx . . $ Glib/RefPtr#RefPtr(560c7fdd049cdfe1).; |
| 183 | } |
| 184 | |
| 185 | bool Memorycxx . . $ Gst/Memory#::is_typecxx . . $ Gst/Memory#is_type(51a66224d46a21f).(const Glibcxx . . $ Glib/::ustringcxx . . $ Glib/ustring#& mem_type) const |
| 186 | { |
| 187 | return gst_memory_is_type(const_cast<GstMemory*>(gobjcxx . . $ Gst/Memory#gobj(a2e020f300680f1d).()), mem_type.c_strcxx . . $ Glib/ustring#c_str(a9f41ea0e82d88cf).()); |
| 188 | } |
| 189 | |
| 190 | Glibcxx . . $ Glib/::RefPtrcxx . . $ Glib/RefPtr#<Gstcxx . . $ Gst/::Memorycxx . . $ Gst/Memory#> Memorycxx . . $ Gst/Memory#::sharecxx . . $ Gst/Memory#share(e8d9a30bac03104a).(gssize offset, gssize size) |
| 191 | { |
| 192 | return Glibcxx . . $ Glib/::wrapcxx . . $ Glib/wrap(61e990c27e905542).(gst_memory_share(gobjcxx . . $ Gst/Memory#gobj(f4325ef78aa51f39).(), offset, size)); |
| 193 | } |
| 194 | |
| 195 | void Memorycxx . . $ Gst/Memory#::resizecxx . . $ Gst/Memory#resize(db89e77d5153c127).(gssize offset, gsize size) |
| 196 | { |
| 197 | gst_memory_resize(gobjcxx . . $ Gst/Memory#gobj(f4325ef78aa51f39).(), offset, size); |
| 198 | } |
| 199 | |
| 200 | bool Memorycxx . . $ Gst/Memory#::is_spancxx . . $ Gst/Memory#is_span(7853e4fa72149fbd).(const Glibcxx . . $ Glib/::RefPtrcxx . . $ Glib/RefPtr#<Gstcxx . . $ Gst/::Memorycxx . . $ Gst/Memory#>& mem2, gsize& offset) |
| 201 | { |
| 202 | return gst_memory_is_span(gobjcxx . . $ Gst/Memory#gobj(f4325ef78aa51f39).(), Glibcxx . . $ Glib/::unwrapcxx . . $ Glib/unwrap(d8611424b789c87e).(mem2), &(offset)); |
| 203 | } |
| 204 | |
| 205 | bool Memorycxx . . $ Gst/Memory#::mapcxx . . $ Gst/Memory#map(124242df5d0d5e99).(Gstcxx . . $ Gst/::MapInfocxx . . $ Gst/MapInfo#& info, Gstcxx . . $ Gst/::MapFlagscxx . . $ Gst/MapFlags# flags) |
| 206 | { |
| 207 | return gst_memory_map(gobjcxx . . $ Gst/Memory#gobj(f4325ef78aa51f39).(), (info.gobjcxx . . $ Gst/MapInfo#gobj(77500a54d235baf).()), ((GstMapFlags)(flags))); |
| 208 | } |
| 209 | |
| 210 | void Memorycxx . . $ Gst/Memory#::unmapcxx . . $ Gst/Memory#unmap(f42c961c2eb148b0).(Gstcxx . . $ Gst/::MapInfocxx . . $ Gst/MapInfo#& info) |
| 211 | { |
| 212 | gst_memory_unmap(gobjcxx . . $ Gst/Memory#gobj(f4325ef78aa51f39).(), (info.gobjcxx . . $ Gst/MapInfo#gobj(77500a54d235baf).())); |
| 213 | } |
| 214 | |
| 215 | Glibcxx . . $ Glib/::RefPtrcxx . . $ Glib/RefPtr#<Gstcxx . . $ Gst/::Memorycxx . . $ Gst/Memory#> Memorycxx . . $ Gst/Memory#::copycxx . . $ Gst/Memory#copy(e8d9a30bac03104a).(gssize offset, gssize size) |
| 216 | { |
| 217 | return Glibcxx . . $ Glib/::wrapcxx . . $ Glib/wrap(61e990c27e905542).(gst_memory_copy(gobjcxx . . $ Gst/Memory#gobj(f4325ef78aa51f39).(), offset, size)); |
| 218 | } |
| 219 | |
| 220 | void Memorycxx . . $ Gst/Memory#::initcxx . . $ Gst/Memory#init(8ba6d9a4c26bb727).(Gstcxx . . $ Gst/::MemoryFlagscxx . . $ Gst/MemoryFlags# flags, const Glibcxx . . $ Glib/::RefPtrcxx . . $ Glib/RefPtr#<Gstcxx . . $ Gst/::Allocatorcxx . . $ Gst/Allocator#>& allocator, const Glibcxx . . $ Glib/::RefPtrcxx . . $ Glib/RefPtr#<Gstcxx . . $ Gst/::Memorycxx . . $ Gst/Memory#>& parent, gsize maxsize, gsize align, gsize offset, gsize size) |
| 221 | { |
| 222 | gst_memory_init(gobjcxx . . $ Gst/Memory#gobj(f4325ef78aa51f39).(), ((GstMemoryFlags)(flags)), const_cast<GstAllocatorcxx . . $ GstAllocator#*>(Glibcxx . . $ Glib/::unwrapcxx . . $ Glib/unwrap(d8611424b789c87e).(allocator)), Glibcxx . . $ Glib/::unwrapcxx . . $ Glib/unwrap(d8611424b789c87e).(parent), maxsize, align, offset, size); |
| 223 | } |
| 224 | |
| 225 | gsize Memorycxx . . $ Gst/Memory#::get_sizescxx . . $ Gst/Memory#get_sizes(6dba9aa10304239a).(gsize& offset, gsize& maxsize) |
| 226 | { |
| 227 | return gst_memory_get_sizes(gobjcxx . . $ Gst/Memory#gobj(f4325ef78aa51f39).(), &(offset), &(maxsize)); |
| 228 | } |
| 229 | |
| 230 | |
| 231 | } // namespace Gst |
| 232 | |
| 233 |