// Generated by gmmproc 2.50.1 -- DO NOT MODIFY! #include #include #include /* gstreamermm - a C++ wrapper for gstreamer * * Copyright 2008-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. */ namespace Gst { Glib::RefPtr Sample::create(const Glib::RefPtr& buffer, const Glib::RefPtr& caps, const Gst::Segment& segment, Gst::Structure&& info) { GstSample *sample = gst_sample_new(buffer->gobj(), caps->gobj(), segment.gobj(), info.gobj()); Gst::Structure empty_structure; info.swap(empty_structure); return Glib::wrap(sample, false); } } namespace { } // anonymous namespace /* Why reinterpret_cast(gobject) is needed: * * A Sample instance is in fact always a GstSample instance. * Unfortunately, GstSample cannot be a member of Sample, * because it is an opaque struct. Also, the C interface does not provide * any hooks to install a destroy notification handler, thus we cannot * wrap it dynamically either. * * The cast works because Sample does not have any member data, and * it is impossible to derive from it. This is ensured by using final on the * class and by using = delete on the default constructor. */ namespace Glib { Glib::RefPtr wrap(GstSample* object, bool take_copy) { if(take_copy && object) gst_sample_ref(object); // See the comment at the top of this file, if you want to know why the cast works. return Glib::RefPtr(reinterpret_cast(object)); } } // namespace Glib namespace Gst { void Sample::reference() const { // See the comment at the top of this file, if you want to know why the cast works. gst_sample_ref(reinterpret_cast(const_cast(this))); } void Sample::unreference() const { // See the comment at the top of this file, if you want to know why the cast works. gst_sample_unref(reinterpret_cast(const_cast(this))); } GstSample* Sample::gobj() { // See the comment at the top of this file, if you want to know why the cast works. return reinterpret_cast(this); } const GstSample* Sample::gobj() const { // See the comment at the top of this file, if you want to know why the cast works. return reinterpret_cast(this); } GstSample* Sample::gobj_copy() const { // See the comment at the top of this file, if you want to know why the cast works. const auto gobject = reinterpret_cast(const_cast(this)); gst_sample_ref(gobject); return gobject; } Glib::RefPtr Sample::get_buffer() { Glib::RefPtr retvalue = Glib::wrap(gst_sample_get_buffer(gobj())); if(retvalue) retvalue->reference(); //The function does not do a ref for us. return retvalue; } Glib::RefPtr Sample::get_buffer() const { return const_cast(this)->get_buffer(); } Glib::RefPtr Sample::get_caps() { Glib::RefPtr retvalue = Glib::wrap(gst_sample_get_caps(gobj())); if(retvalue) retvalue->reference(); //The function does not do a ref for us. return retvalue; } Glib::RefPtr Sample::get_caps() const { return const_cast(this)->get_caps(); } Gst::Structure Sample::get_info() const { return Glib::wrap(const_cast(gst_sample_get_info(const_cast(gobj()))), false); } Glib::RefPtr Sample::copy() const { return Glib::wrap(gst_sample_copy(const_cast(gobj()))); } Gst::Segment Sample::get_segment() const { return Glib::wrap(gst_sample_get_segment(const_cast(gobj())), true); } } // namespace Gst