gstreamer/gst-libs/gst/vulkan/gstvkdisplay.h

129 lines
5 KiB
C
Raw Normal View History

/*
* GStreamer
* Copyright (C) 2007 David A. Schleef <ds@schleef.org>
* Copyright (C) 2008 Julien Isorce <julien.isorce@gmail.com>
* Copyright (C) 2008 Filippo Argiolas <filippo.argiolas@gmail.com>
* Copyright (C) 2013 Matthew Waters <ystreet00@gmail.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef __GST_VULKAN_DISPLAY_H__
#define __GST_VULKAN_DISPLAY_H__
#include <gst/gst.h>
#include <gst/vulkan/vulkan.h>
G_BEGIN_DECLS
#define GST_TYPE_VULKAN_DISPLAY (gst_vulkan_display_get_type())
#define GST_VULKAN_DISPLAY(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_VULKAN_DISPLAY,GstVulkanDisplay))
#define GST_VULKAN_DISPLAY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GST_TYPE_VULKAN_DISPLAY,GstVulkanDisplayClass))
#define GST_IS_VULKAN_DISPLAY(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_VULKAN_DISPLAY))
#define GST_IS_VULKAN_DISPLAY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), GST_TYPE_VULKAN_DISPLAY))
#define GST_VULKAN_DISPLAY_CAST(obj) ((GstVulkanDisplay*)(obj))
#define GST_VULKAN_DISPLAY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS((o), GST_TYPE_VULKAN_DISPLAY, GstVulkanDisplayClass))
GST_VULKAN_API
GType gst_vulkan_display_get_type (void);
#define GST_VULKAN_DISPLAY_CONTEXT_TYPE_STR "gst.vulkan.display"
enum _GstVulkanDisplayType
{
GST_VULKAN_DISPLAY_TYPE_NONE = 0,
GST_VULKAN_DISPLAY_TYPE_XCB = (1 << 0),
GST_VULKAN_DISPLAY_TYPE_WAYLAND = (1 << 1),
GST_VULKAN_DISPLAY_TYPE_COCOA = (1 << 2),
GST_VULKAN_DISPLAY_TYPE_IOS = (1 << 3),
GST_VULKAN_DISPLAY_TYPE_ANY = G_MAXUINT32
};
/**
* GstVulkanDisplay:
*
* The contents of a #GstVulkanDisplay are private and should only be accessed
* through the provided API
*/
struct _GstVulkanDisplay
{
/* <private> */
GstObject object;
GstVulkanDisplayType type;
2015-12-29 05:05:17 +00:00
GstVulkanInstance *instance;
/* <protected> */
GList *windows; /* OBJECT lock */
GMainContext *main_context;
GMainLoop *main_loop;
GSource *event_source;
/* <private> */
GstVulkanDisplayPrivate *priv;
};
struct _GstVulkanDisplayClass
{
GstObjectClass object_class;
gpointer (*get_handle) (GstVulkanDisplay * display);
GstVulkanWindow * (*create_window) (GstVulkanDisplay * display);
};
GST_VULKAN_API
2015-12-29 05:05:17 +00:00
GstVulkanDisplay * gst_vulkan_display_new (GstVulkanInstance *instance);
GST_VULKAN_API
2015-12-29 05:05:17 +00:00
GstVulkanDisplay * gst_vulkan_display_new_with_type (GstVulkanInstance *instance,
GstVulkanDisplayType type);
GST_VULKAN_API
2015-12-29 05:05:17 +00:00
GstVulkanDisplayType gst_vulkan_display_choose_type (GstVulkanInstance *instance);
GST_VULKAN_API
2015-12-29 05:05:17 +00:00
const gchar * gst_vulkan_display_type_to_extension_string (GstVulkanDisplayType type);
GST_VULKAN_API
gpointer gst_vulkan_display_get_handle (GstVulkanDisplay * display);
GST_VULKAN_API
GstVulkanDisplayType gst_vulkan_display_get_handle_type (GstVulkanDisplay * display);
GST_VULKAN_API
GstVulkanWindow * gst_vulkan_display_create_window (GstVulkanDisplay * display);
GST_VULKAN_API
gboolean gst_context_get_vulkan_display (GstContext * context,
GstVulkanDisplay ** display);
GST_VULKAN_API
void gst_context_set_vulkan_display (GstContext * context,
GstVulkanDisplay * display);
GST_VULKAN_API
gboolean gst_vulkan_display_handle_context_query (GstElement * element,
GstQuery * query,
GstVulkanDisplay ** display);
GST_VULKAN_API
gboolean gst_vulkan_display_run_context_query (GstElement * element,
GstVulkanDisplay ** display);
/* GstVulkanWindow usage only */
GST_VULKAN_API
gboolean gst_vulkan_display_remove_window (GstVulkanDisplay * display, GstVulkanWindow * window);
G_END_DECLS
#endif /* __GST_VULKAN_DISPLAY_H__ */