/* gstreamermm - a C++ wrapper for gstreamer * * Copyright 2008 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 namespace Gst { FormatDefinition::FormatDefinition() : value(Gst::FORMAT_UNDEFINED), quark(static_cast(0)) {} FormatDefinition::FormatDefinition(const GstFormatDefinition* castitem) : value(Gst::FORMAT_UNDEFINED), quark((castitem) ? castitem->quark : static_cast(0)) { if(castitem) { value = static_cast(castitem->value); nick = castitem->nick; description = castitem->description; } } namespace Enums { Glib::ustring get_name(Format f) { return gst_format_get_name(static_cast(f)); } Glib::QueryQuark get_quark(Format f) { return Glib::QueryQuark(gst_format_to_quark(static_cast(f))); } } //namespace Enums Format get_format(const Glib::ustring& nick) { return static_cast(gst_format_get_by_nick(nick.c_str())); } Format register_format(const Glib::ustring& nick, const Glib::ustring& description) { return static_cast(gst_format_register(nick.c_str(), description.c_str())); } bool formats_contain(const Glib::ArrayHandle& formats, Format format) { return gst_formats_contains(reinterpret_cast((formats).data()), static_cast(format)); } bool get_format_details(Format format, FormatDefinition& def) { const GstFormatDefinition* gstdef = gst_format_get_details(static_cast(format)); if(!gstdef) return false; def.value = Format(gstdef->value); def.nick = gstdef->nick; def.description = gstdef->description; def.quark = gstdef->quark; return true; } IteratorBasic iterate_format_definitions() { return IteratorBasic(gst_format_iterate_definitions()); } } //namespace Gst