/* 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. */ #include #include #include #include _PINCLUDE(gstreamermm/private/pad_p.h) namespace Gst { GhostPad::GhostPad(const Glib::RefPtr& target, const Glib::ustring& name) : _CONSTRUCT("name", (name.empty() ? static_cast(0) : name.c_str()), "direction", (target ? ((GstPadDirection) target->get_direction()) : GST_PAD_UNKNOWN)) { if(!target) gstreamermm_handle_error("Gst::GhostPad::GhostPad(const Glib::ustring&," " const Glib::RefPtr&): " "Failed to construct ghost pad (name = " + name + ") from null target."); if(!gst_ghost_pad_construct(gobj()) || !gst_ghost_pad_set_target(gobj(), target->gobj())) { gstreamermm_handle_error("Gst::GhostPad::GhostPad(const Glib::ustring&," " const Glib::RefPtr&): " "Unsuccessful construction of ghost pad (name = " + name + ", target = " + target->get_name() + ")."); } } GhostPad::GhostPad( PadDirection direction, const Glib::ustring& name) : _CONSTRUCT("name", (name.empty() ? static_cast(0) : name.c_str()), "direction", static_cast(direction)) { if(!gst_ghost_pad_construct(gobj())) { std::stringstream int_conv_stream; int_conv_stream << direction; gstreamermm_handle_error("Gst::GhostPad::GhostPad(const Glib::ustring&, " "PadDirection): Unsuccessful construction of ghost pad (name = " + name + ", direction = " + int_conv_stream.str() + ")."); } } GhostPad::GhostPad( const Glib::RefPtr& target, const Glib::RefPtr& templ, const Glib::ustring& name) : _CONSTRUCT("name", (name.empty() ? static_cast(0) : name.c_str()), "direction", (target ? static_cast(target->get_direction()) : GST_PAD_UNKNOWN), "template", Glib::unwrap(templ)) { if(!target || !templ) gstreamermm_handle_error("Gst::GhostPad::GhostPad(const Glib::ustring&," " const Glib::RefPtr&, const Glib::RefPtr&):" " Failed to construct ghost pad (name = " + name + ") from null " "target or template."); if(!gst_ghost_pad_construct(gobj()) || !gst_ghost_pad_set_target(gobj(), target->gobj())) { gstreamermm_handle_error("Gst::GhostPad::GhostPad(const Glib::ustring&," " const Glib::RefPtr&, const Glib::RefPtr&):" " Unsuccessful construction of ghost pad (name = " + name + ", target = " + target->get_name() + ", templ = " + templ->get_name_template() + ")."); } } GhostPad::GhostPad( const Glib::RefPtr& templ, const Glib::ustring& name) : _CONSTRUCT("name", (name.empty() ? static_cast(0) : name.c_str()), "direction", (templ ? static_cast(templ->get_direction()) : GST_PAD_UNKNOWN), "template", Glib::unwrap(templ)) { if(!templ) gstreamermm_handle_error("Gst::GhostPad::GhostPad(const Glib::ustring&," " const Glib::RefPtr&): " "Failed to construct ghost pad (name = " + name + ") from null template."); if(!gst_ghost_pad_construct(gobj())) { gstreamermm_handle_error("Gst::GhostPad::GhostPad(const Glib::ustring&," " const Glib::RefPtr&): " "Unsuccessful construction of ghost pad (name = " + name + ", templ = " + templ->get_name_template() + ")."); } } } //namespace Gst