| 1 | // Generated by gmmproc 2.50.1 -- DO NOT MODIFY! |
| 2 | #ifndef _GSTREAMERMM_MAPINFO_H |
| 3 | #define _GSTREAMERMM_MAPINFO_H |
| 4 | |
| 5 | |
| 6 | #include <glibmm/ustring.h> |
| 7 | #include <sigc++/sigc++.h> |
| 8 | |
| 9 | /* gstreamermm - a C++ wrapper for gstreamer |
| 10 | * |
| 11 | * Copyright 2013-2016 The gstreamermm Development Team |
| 12 | * |
| 13 | * This library is free software; you can redistribute it and/or |
| 14 | * modify it under the terms of the GNU Lesser General Public |
| 15 | * License as published by the Free Software Foundation; either |
| 16 | * version 2.1 of the License, or (at your option) any later version. |
| 17 | * |
| 18 | * This library is distributed in the hope that it will be useful, |
| 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 21 | * Lesser General Public License for more details. |
| 22 | * |
| 23 | * You should have received a copy of the GNU Lesser General Public |
| 24 | * License along with this library; if not, write to the Free |
| 25 | * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
| 26 | */ |
| 27 | |
| 28 | #include <gst/gst.h> |
| 29 | |
| 30 | |
| 31 | namespace Gst |
| 32 | { |
| 33 | |
| 34 | class Memory; |
| 35 | |
| 36 | /** @addtogroup gstreamermmEnums gstreamermm Enums and Flags */ |
| 37 | |
| 38 | /** |
| 39 | * @var MapFlags MAP_READ |
| 40 | * Map for read access. |
| 41 | * |
| 42 | * @var MapFlags MAP_WRITE |
| 43 | * Map for write access. |
| 44 | * |
| 45 | * @var MapFlags MAP_FLAG_LAST |
| 46 | * First flag that can be used for custom purposes. |
| 47 | * |
| 48 | * @enum MapFlags |
| 49 | * |
| 50 | * Flags used when mapping memory |
| 51 | * |
| 52 | * @ingroup gstreamermmEnums |
| 53 | * @par Bitwise operators: |
| 54 | * <tt>%MapFlags operator|(MapFlags, MapFlags)</tt><br> |
| 55 | * <tt>%MapFlags operator&(MapFlags, MapFlags)</tt><br> |
| 56 | * <tt>%MapFlags operator^(MapFlags, MapFlags)</tt><br> |
| 57 | * <tt>%MapFlags operator~(MapFlags)</tt><br> |
| 58 | * <tt>%MapFlags& operator|=(MapFlags&, MapFlags)</tt><br> |
| 59 | * <tt>%MapFlags& operator&=(MapFlags&, MapFlags)</tt><br> |
| 60 | * <tt>%MapFlags& operator^=(MapFlags&, MapFlags)</tt><br> |
| 61 | */ |
| 62 | enum MapFlags |
| 63 | { |
| 64 | MAP_READ = GST_LOCK_FLAG_READ, |
| 65 | MAP_WRITE = GST_LOCK_FLAG_WRITE, |
| 66 | MAP_FLAG_LAST = (1 << 16) |
| 67 | }; |
| 68 | |
| 69 | /** @ingroup gstreamermmEnums */ |
| 70 | inline MapFlags operator|(MapFlags lhs, MapFlags rhs) |
| 71 | { return static_cast<MapFlags>(static_cast<unsigned>(lhs) | static_cast<unsigned>(rhs)); } |
| 72 | |
| 73 | /** @ingroup gstreamermmEnums */ |
| 74 | inline MapFlags operator&(MapFlags lhs, MapFlags rhs) |
| 75 | { return static_cast<MapFlags>(static_cast<unsigned>(lhs) & static_cast<unsigned>(rhs)); } |
| 76 | |
| 77 | /** @ingroup gstreamermmEnums */ |
| 78 | inline MapFlags operator^(MapFlags lhs, MapFlags rhs) |
| 79 | { return static_cast<MapFlags>(static_cast<unsigned>(lhs) ^ static_cast<unsigned>(rhs)); } |
| 80 | |
| 81 | /** @ingroup gstreamermmEnums */ |
| 82 | inline MapFlags operator~(MapFlags flags) |
| 83 | { return static_cast<MapFlags>(~static_cast<unsigned>(flags)); } |
| 84 | |
| 85 | /** @ingroup gstreamermmEnums */ |
| 86 | inline MapFlags& operator|=(MapFlags& lhs, MapFlags rhs) |
| 87 | { return (lhs = static_cast<MapFlags>(static_cast<unsigned>(lhs) | static_cast<unsigned>(rhs))); } |
| 88 | |
| 89 | /** @ingroup gstreamermmEnums */ |
| 90 | inline MapFlags& operator&=(MapFlags& lhs, MapFlags rhs) |
| 91 | { return (lhs = static_cast<MapFlags>(static_cast<unsigned>(lhs) & static_cast<unsigned>(rhs))); } |
| 92 | |
| 93 | /** @ingroup gstreamermmEnums */ |
| 94 | inline MapFlags& operator^=(MapFlags& lhs, MapFlags rhs) |
| 95 | { return (lhs = static_cast<MapFlags>(static_cast<unsigned>(lhs) ^ static_cast<unsigned>(rhs))); } |
| 96 | |
| 97 | } // namespace Gst |
| 98 | |
| 99 | #ifndef DOXYGEN_SHOULD_SKIP_THIS |
| 100 | namespace Glib |
| 101 | { |
| 102 | |
| 103 | template <> |
| 104 | class Value<Gst::MapFlags> : public Glib::Value_Flags<Gst::MapFlags> |
| 105 | { |
| 106 | public: |
| 107 | static GType value_type() G_GNUC_CONST; |
| 108 | }; |
| 109 | |
| 110 | } // namespace Glib |
| 111 | #endif /* DOXYGEN_SHOULD_SKIP_THIS */ |
| 112 | |
| 113 | namespace Gst |
| 114 | { |
| 115 | |
| 116 | |
| 117 | /* A structure containing the result of a map operation such as |
| 118 | * Memory::map(). It contains the data and size. |
| 119 | * |
| 120 | * Last reviewed on 2016-06-05 (1.8.0) |
| 121 | */ |
| 122 | class MapInfo |
| 123 | { |
| 124 | public: |
| 125 | #ifndef DOXYGEN_SHOULD_SKIP_THIS |
| 126 | using CppObjectType = MapInfo; |
| 127 | using BaseObjectType = GstMapInfo; |
| 128 | #endif /* DOXYGEN_SHOULD_SKIP_THIS */ |
| 129 | |
| 130 | private: |
| 131 | |
| 132 | public: |
| 133 | MapInfo(); |
| 134 | |
| 135 | explicit MapInfo(const GstMapInfo& castitem); |
| 136 | |
| 137 | MapInfo(MapInfo&& other); |
| 138 | MapInfo& operator=(MapInfo&& other); |
| 139 | |
| 140 | /** Get flags used when mapping the memory. |
| 141 | */ |
| 142 | MapFlags get_flags() const; |
| 143 | |
| 144 | /** Get a pointer to the mapped data. |
| 145 | */ |
| 146 | guint8* get_data(); |
| 147 | const guint8* get_data() const; |
| 148 | |
| 149 | /** Get the maximum bytes in data. |
| 150 | */ |
| 151 | gsize get_maxsize() const; |
| 152 | |
| 153 | /** Get the valid size in data. |
| 154 | */ |
| 155 | gsize get_size() const; |
| 156 | |
| 157 | /** Get a Glib::RefPtr to the mapped memory. |
| 158 | */ |
| 159 | Glib::RefPtr<Gst::Memory> get_memory(); |
| 160 | Glib::RefPtr<const Gst::Memory> get_memory() const; |
| 161 | |
| 162 | GstMapInfo* gobj() { return &m_spec; }; |
| 163 | const GstMapInfo* gobj() const { return &m_spec; }; |
| 164 | |
| 165 | protected: |
| 166 | #ifndef DOXYGEN_SHOULD_SKIP_THIS |
| 167 | GstMapInfo m_spec; |
| 168 | #endif /* DOXYGEN_SHOULD_SKIP_THIS */ |
| 169 | |
| 170 | |
| 171 | }; |
| 172 | |
| 173 | }//namespace Gst |
| 174 | |
| 175 | |
| 176 | #endif /* _GSTREAMERMM_MAPINFO_H */ |
| 177 |