| 1 | // Generated by gmmproc 2.50.1 -- DO NOT MODIFY!cxx . . $ `<file>/gstreamer/gstreamermm/bufferlist.cc`/ |
| 2 | |
| 3 | |
| 4 | #include <glibmm.h> |
| 5 | |
| 6 | #include <gstreamermm/bufferlist.h>cxx . . $ `<file>/gstreamer/gstreamermm/bufferlist.h`/ |
| 7 | #include <gstreamermm/private/bufferlist_p.h>cxx . . $ `<file>/gstreamer/gstreamermm/private/bufferlist_p.h`/ |
| 8 | |
| 9 | |
| 10 | /* gstreamermm - a C++ wrapper for gstreamer |
| 11 | * |
| 12 | * Copyright 2008-2015 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 | #include <gstreamermm/buffer.h>cxx . . $ `<file>/gstreamer/gstreamermm/buffer.h`/ |
| 30 | |
| 31 | |
| 32 | extern "C" |
| 33 | { |
| 34 | |
| 35 | static gboolean BufferList_Foreach_gstreamermm_callback(GstBuffer** buffer, guint idx, void* data) |
| 36 | { |
| 37 | Gstcxx . . $ Gst/::BufferListcxx . . $ Gst/BufferList#::SlotForeachcxx . . $ Gst/BufferList#SlotForeach#* the_slot = |
| 38 | static_cast<Gstcxx . . $ Gst/::BufferListcxx . . $ Gst/BufferList#::SlotForeachcxx . . $ Gst/BufferList#SlotForeach#*>(data); |
| 39 | |
| 40 | try |
| 41 | { |
| 42 | // First wrap the original buffer. |
| 43 | Glibcxx . . $ Glib/::RefPtrcxx . . $ Glib/RefPtr#<Gstcxx . . $ Gst/::Buffercxx . . $ Gst/Buffer#> temp = Glibcxx . . $ Glib/::wrapcxx . . $ Glib/wrap(3c551c778c6a14a5).(*buffer, true); |
| 44 | |
| 45 | // Call the slot which can modify the buffer (ie. set it to a new one or |
| 46 | // clear it altogether). |
| 47 | bool result = |
| 48 | static_cast<bool>((*the_slot)(cxx . . $ sigc/slot2#`operator()`(d6f853cadabc373b).temp, idx)); |
| 49 | |
| 50 | // Set the reference to the buffer according to how the temp buffer has |
| 51 | // been altered. |
| 52 | if(!temp) |
| 53 | { |
| 54 | // Clear the reference to the original buffer also. |
| 55 | *buffer = nullptr; |
| 56 | } |
| 57 | else if(*buffer != temp->cxx . . $ Glib/RefPtr#`operator->`(34d6acfd341ba7ab).gobjcxx . . $ Gst/Buffer#gobj(fb1b615d1bc4ac88).()) |
| 58 | { |
| 59 | // The temp buffer has been set to a new one so make the reference point |
| 60 | // to it and take an extra reference for when the temp wrapper is |
| 61 | // destroyed (I think that's right). |
| 62 | *buffer = temp->cxx . . $ Glib/RefPtr#`operator->`(34d6acfd341ba7ab).gobjcxx . . $ Gst/Buffer#gobj(fb1b615d1bc4ac88).(); |
| 63 | temp->cxx . . $ Glib/RefPtr#`operator->`(34d6acfd341ba7ab).referencecxx . . $ Gst/Buffer#reference(83f5f38750778ac8).(); |
| 64 | } |
| 65 | |
| 66 | return result; |
| 67 | } |
| 68 | catch(...) |
| 69 | { |
| 70 | Glibcxx . . $ Glib/::exception_handlers_invokecxx . . $ Glib/exception_handlers_invoke(ced63f7c635d850d).(); |
| 71 | } |
| 72 | |
| 73 | return true; // continue |
| 74 | } |
| 75 | |
| 76 | } // extern "C" |
| 77 | |
| 78 | |
| 79 | namespace Gstcxx . . $ Gst/ |
| 80 | { |
| 81 | void BufferListcxx . . $ Gst/BufferList#::insertcxx . . $ Gst/BufferList#insert(8172da470e1f0204).(gint idx, const Glibcxx . . $ Glib/::RefPtrcxx . . $ Glib/RefPtr#<Gstcxx . . $ Gst/::Buffercxx . . $ Gst/Buffer#>& buffer) |
| 82 | { |
| 83 | buffer->cxx . . $ Glib/RefPtr#`operator->`(34d6acfd341ba7ab).referencecxx . . $ Gst/Buffer#reference(83f5f38750778ac8).(); |
| 84 | gst_buffer_list_insert(gobjcxx . . $ Gst/BufferList#gobj(f747027740825790).(), idx, buffer->cxx . . $ Glib/RefPtr#`operator->`(34d6acfd341ba7ab).gobjcxx . . $ Gst/Buffer#gobj(fb1b615d1bc4ac88).()); |
| 85 | } |
| 86 | |
| 87 | void BufferListcxx . . $ Gst/BufferList#::foreachcxx . . $ Gst/BufferList#foreach(c48cb8dd577552de).(const SlotForeachcxx . . $ Gst/BufferList#SlotForeach#& slot) |
| 88 | { |
| 89 | gst_buffer_list_foreach(gobjcxx . . $ Gst/BufferList#gobj(f747027740825790).(), &BufferList_Foreach_gstreamermm_callback, |
| 90 | const_cast<SlotForeachcxx . . $ Gst/BufferList#SlotForeach#*>(&slot)); |
| 91 | } |
| 92 | |
| 93 | } //namespace Gst |
| 94 | |
| 95 | namespacecxx . . $ `$anonymous_namespace_gstreamer/gstreamermm/bufferlist.cc`/ |
| 96 | { |
| 97 | } // anonymous namespace |
| 98 | |
| 99 | |
| 100 | /* Why reinterpret_cast<BufferList*>(gobject) is needed: |
| 101 | * |
| 102 | * A BufferList instance is in fact always a GstBufferList instance. |
| 103 | * Unfortunately, GstBufferList cannot be a member of BufferList, |
| 104 | * because it is an opaque struct. Also, the C interface does not provide |
| 105 | * any hooks to install a destroy notification handler, thus we cannot |
| 106 | * wrap it dynamically either. |
| 107 | * |
| 108 | * The cast works because BufferList does not have any member data, and |
| 109 | * it is impossible to derive from it. This is ensured by using final on the |
| 110 | * class and by using = delete on the default constructor. |
| 111 | */ |
| 112 | |
| 113 | namespace Glibcxx . . $ Glib/ |
| 114 | { |
| 115 | |
| 116 | Glibcxx . . $ Glib/::RefPtrcxx . . $ Glib/RefPtr#<Gstcxx . . $ Gst/::BufferListcxx . . $ Gst/BufferList#> wrapcxx . . $ Glib/wrap(3f30d858dd1cdfe1).(GstBufferList* object, bool take_copy) |
| 117 | { |
| 118 | if(take_copy && object) |
| 119 | gst_buffer_list_ref(object); |
| 120 | |
| 121 | // See the comment at the top of this file, if you want to know why the cast works. |
| 122 | return Glibcxx . . $ Glib/::RefPtrcxx . . $ Glib/RefPtr#<Gstcxx . . $ Gst/::BufferListcxx . . $ Gst/BufferList#>(reinterpret_cast<Gstcxx . . $ Gst/::BufferListcxx . . $ Gst/BufferList#*>(object)); |
| 123 | } |
| 124 | |
| 125 | } // namespace Glib |
| 126 | |
| 127 | |
| 128 | namespace Gstcxx . . $ Gst/ |
| 129 | { |
| 130 | |
| 131 | |
| 132 | // static |
| 133 | Glibcxx . . $ Glib/::RefPtrcxx . . $ Glib/RefPtr#<BufferListcxx . . $ Gst/BufferList#> BufferListcxx . . $ Gst/BufferList#::createcxx . . $ Gst/BufferList#create(a537beb5731b3dd6).() |
| 134 | { |
| 135 | // See the comment at the top of this file, if you want to know why the cast works. |
| 136 | return Glibcxx . . $ Glib/::RefPtrcxx . . $ Glib/RefPtr#<BufferListcxx . . $ Gst/BufferList#>(reinterpret_cast<BufferListcxx . . $ Gst/BufferList#*>(gst_buffer_list_new())); |
| 137 | } |
| 138 | |
| 139 | void BufferListcxx . . $ Gst/BufferList#::referencecxx . . $ Gst/BufferList#reference(83f5f38750778ac8).() const |
| 140 | { |
| 141 | // See the comment at the top of this file, if you want to know why the cast works. |
| 142 | gst_buffer_list_ref(reinterpret_cast<GstBufferList*>(const_cast<BufferListcxx . . $ Gst/BufferList#*>(this))); |
| 143 | } |
| 144 | |
| 145 | void BufferListcxx . . $ Gst/BufferList#::unreferencecxx . . $ Gst/BufferList#unreference(83f5f38750778ac8).() const |
| 146 | { |
| 147 | // See the comment at the top of this file, if you want to know why the cast works. |
| 148 | gst_buffer_list_unref(reinterpret_cast<GstBufferList*>(const_cast<BufferListcxx . . $ Gst/BufferList#*>(this))); |
| 149 | } |
| 150 | |
| 151 | GstBufferList* BufferListcxx . . $ Gst/BufferList#::gobjcxx . . $ Gst/BufferList#gobj(f747027740825790).() |
| 152 | { |
| 153 | // See the comment at the top of this file, if you want to know why the cast works. |
| 154 | return reinterpret_cast<GstBufferList*>(this); |
| 155 | } |
| 156 | |
| 157 | const GstBufferList* BufferListcxx . . $ Gst/BufferList#::gobjcxx . . $ Gst/BufferList#gobj(ec35faee4019f4c1).() const |
| 158 | { |
| 159 | // See the comment at the top of this file, if you want to know why the cast works. |
| 160 | return reinterpret_cast<const GstBufferList*>(this); |
| 161 | } |
| 162 | |
| 163 | GstBufferList* BufferListcxx . . $ Gst/BufferList#::gobj_copycxx . . $ Gst/BufferList#gobj_copy(cafa8c742a4460c2).() const |
| 164 | { |
| 165 | // See the comment at the top of this file, if you want to know why the cast works. |
| 166 | const auto gobject = reinterpret_cast<GstBufferList*>(const_cast<BufferListcxx . . $ Gst/BufferList#*>(this)); |
| 167 | gst_buffer_list_ref(gobject); |
| 168 | return gobject; |
| 169 | } |
| 170 | |
| 171 | |
| 172 | void BufferListcxx . . $ Gst/BufferList#::removecxx . . $ Gst/BufferList#remove(b4d55b1286ff73e8).(guint idx, guint length) |
| 173 | { |
| 174 | gst_buffer_list_remove(gobjcxx . . $ Gst/BufferList#gobj(f747027740825790).(), idx, length); |
| 175 | } |
| 176 | |
| 177 | Glibcxx . . $ Glib/::RefPtrcxx . . $ Glib/RefPtr#<Gstcxx . . $ Gst/::Buffercxx . . $ Gst/Buffer#> BufferListcxx . . $ Gst/BufferList#::removecxx . . $ Gst/BufferList#remove(94e900a164794708).(guint idx) |
| 178 | { |
| 179 | return Glibcxx . . $ Glib/::wrapcxx . . $ Glib/wrap(3c551c778c6a14a5).(gst_buffer_list_get(gobjcxx . . $ Gst/BufferList#gobj(f747027740825790).(), idx)); |
| 180 | } |
| 181 | |
| 182 | guint BufferListcxx . . $ Gst/BufferList#::lengthcxx . . $ Gst/BufferList#length(ddd8539a2fcdd4ce).() const |
| 183 | { |
| 184 | return gst_buffer_list_length(const_cast<GstBufferList*>(gobjcxx . . $ Gst/BufferList#gobj(ec35faee4019f4c1).())); |
| 185 | } |
| 186 | |
| 187 | void BufferListcxx . . $ Gst/BufferList#::copycxx . . $ Gst/BufferList#copy(83f5f38750778ac8).() const |
| 188 | { |
| 189 | gst_buffer_list_copy(const_cast<GstBufferList*>(gobjcxx . . $ Gst/BufferList#gobj(ec35faee4019f4c1).())); |
| 190 | } |
| 191 | |
| 192 | void BufferListcxx . . $ Gst/BufferList#::copy_deepcxx . . $ Gst/BufferList#copy_deep(83f5f38750778ac8).() const |
| 193 | { |
| 194 | gst_buffer_list_copy_deep(const_cast<GstBufferList*>(gobjcxx . . $ Gst/BufferList#gobj(ec35faee4019f4c1).())); |
| 195 | } |
| 196 | |
| 197 | void BufferListcxx . . $ Gst/BufferList#::insertcxx . . $ Gst/BufferList#insert(3e993c5ba5b571e2).(gint idx, Glibcxx . . $ Glib/::RefPtrcxx . . $ Glib/RefPtr#<Gstcxx . . $ Gst/::Buffercxx . . $ Gst/Buffer#>&& buffer) |
| 198 | { |
| 199 | gst_buffer_list_insert(gobjcxx . . $ Gst/BufferList#gobj(f747027740825790).(), idx, (buffer) ? buffer.releasecxx . . $ Glib/RefPtr#release(258ee1c9e0a18a5c).()->gobjcxx . . $ Gst/Buffer#gobj(fb1b615d1bc4ac88).() : nullptr); |
| 200 | } |
| 201 | |
| 202 | Glibcxx . . $ Glib/::RefPtrcxx . . $ Glib/RefPtr#<Gstcxx . . $ Gst/::Buffercxx . . $ Gst/Buffer#> BufferListcxx . . $ Gst/BufferList#::getcxx . . $ Gst/BufferList#get(94e900a164794708).(guint idx) |
| 203 | { |
| 204 | return Glibcxx . . $ Glib/::wrapcxx . . $ Glib/wrap(3c551c778c6a14a5).(gst_buffer_list_get(gobjcxx . . $ Gst/BufferList#gobj(f747027740825790).(), idx)); |
| 205 | } |
| 206 | |
| 207 | Glibcxx . . $ Glib/::RefPtrcxx . . $ Glib/RefPtr#<const Gstcxx . . $ Gst/::Buffercxx . . $ Gst/Buffer#> BufferListcxx . . $ Gst/BufferList#::getcxx . . $ Gst/BufferList#get(526dfe0a6477b75c).(guint idx) const |
| 208 | { |
| 209 | return const_castcxx . . $ Glib/RefPtr#RefPtr(9e4c744904342adc).<BufferListcxx . . $ Gst/BufferList#*>(this)->getcxx . . $ Gst/BufferList#get(94e900a164794708).(idx); |
| 210 | } |
| 211 | |
| 212 | |
| 213 | } // namespace Gst |
| 214 | |
| 215 |