+/**
+ * GstBufferMapInfo: (skip):
+ *
+ * Alias for #GstMapInfo to be used with g_auto():
+ * ```c
+ * void my_func(GstBuffer *buf)
+ * {
+ * g_auto(GstBufferMapInfo) map = GST_MAP_INFO_INIT;
+ * if (!gst_buffer_map(buf, &map, GST_MAP_READWRITE))
+ * return;
+ * ...
+ * // No need to call gst_buffer_unmap()
+ * }
+ * ```
+ *
+ * #GstMapInfo cannot be used with g_auto() because it is ambiguous whether it
+ * needs to be unmapped using gst_buffer_unmap() or gst_memory_unmap().
+ *
+ * See also #GstMemoryMapInfo.
+ *
+ * Since: 1.22
+ */
+typedef GstMapInfo GstBufferMapInfo;
+
+static inline void _gst_buffer_map_info_clear(GstBufferMapInfo *info)
+{
+ /* we need to check for NULL, it is possible that we tried to map a buffer
+ * without memory and we should be able to unmap that fine */
+ if (G_LIKELY (info->memory)) {
+ gst_memory_unmap (info->memory, info);
+ gst_memory_unref (info->memory);
+ }
+}
+
+G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC(GstBufferMapInfo, _gst_buffer_map_info_clear)
+