mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-23 16:50:47 +00:00
vulkan: make a gstvulkan library out of the existing API
This commit is contained in:
parent
8def3b3743
commit
25dd3b32e5
73 changed files with 618 additions and 577 deletions
70
configure.ac
70
configure.ac
|
@ -532,55 +532,6 @@ if test "x$HAVE_WINSOCK2_H" = "xyes"; then
|
|||
AC_SUBST(WINSOCK2_LIBS)
|
||||
fi
|
||||
|
||||
dnl Vulkan
|
||||
PKG_CHECK_MODULES(XCB, xcb >= 1.10, GST_VULKAN_HAVE_WINDOW_XCB=1, GST_VULKAN_HAVE_WINDOW_XCB=0)
|
||||
AM_CONDITIONAL(USE_XCB, test "x$GST_VULKAN_HAVE_WINDOW_XCB" = "x1")
|
||||
|
||||
PKG_CHECK_MODULES(VULKAN_WAYLAND, wayland-client >= 1.4, GST_VULKAN_HAVE_WINDOW_WAYLAND=1, GST_VULKAN_HAVE_WINDOW_WAYLAND=0)
|
||||
AM_CONDITIONAL(USE_WAYLAND, test "x$GST_VULKAN_HAVE_WINDOW_WAYLAND" = "x1")
|
||||
VULKAN_CONFIG_DEFINES="
|
||||
#define GST_VULKAN_HAVE_WINDOW_XCB $GST_VULKAN_HAVE_WINDOW_XCB
|
||||
#define GST_VULKAN_HAVE_WINDOW_WAYLAND $GST_VULKAN_HAVE_WINDOW_WAYLAND"
|
||||
|
||||
AC_CONFIG_COMMANDS([ext/vulkan/vkconfig.h], [
|
||||
outfile=vkconfig.h-tmp
|
||||
cat > $outfile <<\_______EOF
|
||||
/* vkconfig.h
|
||||
*
|
||||
* This is a generated file. Please modify `configure.ac'
|
||||
*/
|
||||
|
||||
#ifndef __GST_VULKAN_CONFIG_H__
|
||||
#define __GST_VULKAN_CONFIG_H__
|
||||
|
||||
#include <gst/gst.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
_______EOF
|
||||
|
||||
cat >>$outfile <<_______EOF
|
||||
$vulkan_config_defines
|
||||
_______EOF
|
||||
|
||||
cat >>$outfile <<_______EOF
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GST_VULKAN_CONFIG_H__ */
|
||||
_______EOF
|
||||
|
||||
|
||||
if cmp -s $outfile ext/vulkan/vkconfig.h; then
|
||||
AC_MSG_NOTICE([ext/vulkan/vkconfig.h is unchanged])
|
||||
rm -f $outfile
|
||||
else
|
||||
mv $outfile ext/vulkan/vkconfig.h
|
||||
fi
|
||||
],[
|
||||
vulkan_config_defines='$VULKAN_CONFIG_DEFINES'
|
||||
])
|
||||
|
||||
dnl *** sys plug-ins ***
|
||||
|
||||
dnl DirectSound
|
||||
|
@ -1974,23 +1925,6 @@ AG_GST_CHECK_FEATURE(GL, [gl elements], gl, [
|
|||
AM_CONDITIONAL(USE_GL, test "x$HAVE_GL" = "xyes")
|
||||
AM_CONDITIONAL(USE_OPENGL, test "x$GST_GL_HAVE_API_GL" = "x1")
|
||||
|
||||
dnl *** Vulkan ***
|
||||
translit(dnm, m, l) AM_CONDITIONAL(USE_VULKAN, true)
|
||||
AG_GST_CHECK_FEATURE(VULKAN, [Vulkan elements], vulkan, [
|
||||
AC_CHECK_HEADER(vulkan/vulkan.h, [
|
||||
AC_CHECK_LIB(vulkan, vkCreateDevice, [
|
||||
VULKAN_LIBS="-lvulkan"
|
||||
AC_SUBST(VULKAN_LIBS)
|
||||
if test "x$GST_VULKAN_HAVE_WINDOW_XCB" = "x1"; then
|
||||
HAVE_VULKAN="yes"
|
||||
fi
|
||||
if test "x$GST_VULKAN_HAVE_WINDOW_WAYLAND" = "x1"; then
|
||||
HAVE_VULKAN="yes"
|
||||
fi
|
||||
], [])
|
||||
], [])
|
||||
])
|
||||
|
||||
dnl *** teletextdec ***
|
||||
translit(dnm, m, l) AM_CONDITIONAL(USE_TELETEXTDEC, true)
|
||||
AG_GST_CHECK_FEATURE(TELETEXTDEC, [Teletext decoder], teletextdec, [
|
||||
|
@ -2397,7 +2331,6 @@ AM_CONDITIONAL(USE_WEBRTCDSP, false)
|
|||
AM_CONDITIONAL(USE_OPENH264, false)
|
||||
AM_CONDITIONAL(USE_X265, false)
|
||||
AM_CONDITIONAL(USE_DTLS, false)
|
||||
AM_CONDITIONAL(USE_VULKAN, false)
|
||||
AM_CONDITIONAL(USE_TTML, false)
|
||||
AM_CONDITIONAL(USE_SCTP, false)
|
||||
|
||||
|
@ -2684,9 +2617,6 @@ ext/srtp/Makefile
|
|||
ext/teletextdec/Makefile
|
||||
ext/gme/Makefile
|
||||
ext/wildmidi/Makefile
|
||||
ext/vulkan/Makefile
|
||||
ext/vulkan/xcb/Makefile
|
||||
ext/vulkan/wayland/Makefile
|
||||
ext/webp/Makefile
|
||||
ext/x265/Makefile
|
||||
ext/zbar/Makefile
|
||||
|
|
|
@ -370,12 +370,6 @@ else
|
|||
DTLS_DIR=
|
||||
endif
|
||||
|
||||
if USE_VULKAN
|
||||
VULKAN_DIR=vulkan
|
||||
else
|
||||
VULKAN_DIR=
|
||||
endif
|
||||
|
||||
if USE_WEBRTCDSP
|
||||
WEBRTCDSP_DIR=webrtcdsp
|
||||
else
|
||||
|
@ -464,7 +458,6 @@ SUBDIRS=\
|
|||
$(WEBP_DIR) \
|
||||
$(X265_DIR) \
|
||||
$(DTLS_DIR) \
|
||||
$(VULKAN_DIR) \
|
||||
$(WEBRTCDSP_DIR) \
|
||||
$(TTML_DIR) \
|
||||
$(WEBRTC_DIR) \
|
||||
|
@ -531,7 +524,6 @@ DIST_SUBDIRS = \
|
|||
webp \
|
||||
x265 \
|
||||
dtls \
|
||||
vulkan \
|
||||
webrtcdsp \
|
||||
ttml \
|
||||
webrtc \
|
||||
|
|
1
ext/vulkan/.gitignore
vendored
1
ext/vulkan/.gitignore
vendored
|
@ -1 +0,0 @@
|
|||
vkconfig.h
|
|
@ -1,77 +0,0 @@
|
|||
plugin_LTLIBRARIES = libgstvulkan.la
|
||||
|
||||
SUBDIRS =
|
||||
DIST_SUBDIRS = xcb wayland
|
||||
DISTCLEANFILES = vkconfig.h
|
||||
|
||||
libgstvulkan_la_SOURCES = \
|
||||
gstvulkan.c \
|
||||
vkdevice.c \
|
||||
vkdisplay.c \
|
||||
vkerror.c \
|
||||
vkfence.c \
|
||||
vkbuffermemory.c \
|
||||
vkimagememory.c \
|
||||
vkbufferpool.c \
|
||||
vkinstance.c \
|
||||
vkmemory.c \
|
||||
vkqueue.c \
|
||||
vktrash.c \
|
||||
vksink.c \
|
||||
vkswapper.c \
|
||||
vkupload.c \
|
||||
vkutils.c \
|
||||
vkwindow.c
|
||||
|
||||
noinst_HEADERS = \
|
||||
vk.h \
|
||||
vkapi.h \
|
||||
vk_fwd.h \
|
||||
vkbuffermemory.h \
|
||||
vkbufferpool.h \
|
||||
vkconfig.h \
|
||||
vkdevice.h \
|
||||
vkdisplay.h \
|
||||
vkerror.h \
|
||||
vkfence.h \
|
||||
vkimagememory.h \
|
||||
vkinstance.h \
|
||||
vkmacros.h \
|
||||
vkmemory.h \
|
||||
vkqueue.h \
|
||||
vktrash.h \
|
||||
vksink.h \
|
||||
vkswapper.h \
|
||||
vkupload.h \
|
||||
vkutils.h \
|
||||
vkutils_private.h \
|
||||
vkwindow.h
|
||||
|
||||
libgstvulkan_la_CFLAGS = \
|
||||
-I$(top_srcdir)/gst-libs \
|
||||
-I$(top_builddir)/gst-libs \
|
||||
-I$(top_builddir)/ext/vulkan \
|
||||
$(GST_CFLAGS) \
|
||||
$(GST_BASE_CFLAGS) \
|
||||
$(GST_PLUGINS_BASE_CFLAGS) \
|
||||
$(VULKAN_CFLAGS)
|
||||
|
||||
libgstvulkan_la_LIBADD = \
|
||||
$(GST_BASE_LIBS) \
|
||||
$(GST_PLUGINS_BASE_LIBS) \
|
||||
-lgstvideo-$(GST_API_VERSION) \
|
||||
$(VULKAN_LIBS)
|
||||
|
||||
if USE_XCB
|
||||
SUBDIRS += xcb
|
||||
libgstvulkan_la_LIBADD += xcb/libgstvulkan-xcb.la
|
||||
endif
|
||||
|
||||
if USE_WAYLAND
|
||||
SUBDIRS += wayland
|
||||
libgstvulkan_la_LIBADD += wayland/libgstvulkan-wayland.la
|
||||
endif
|
||||
|
||||
libgstvulkan_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
|
||||
|
||||
|
|
@ -1,132 +1,24 @@
|
|||
vulkan_sources = [
|
||||
'gstvulkan.c',
|
||||
'vkbuffermemory.c',
|
||||
'vkbufferpool.c',
|
||||
'vkdevice.c',
|
||||
'vkdisplay.c',
|
||||
'vkerror.c',
|
||||
'vkfence.c',
|
||||
'vkimagememory.c',
|
||||
'vkinstance.c',
|
||||
'vkmemory.c',
|
||||
'vkqueue.c',
|
||||
'vksink.c',
|
||||
'vkswapper.c',
|
||||
'vktrash.c',
|
||||
'vkupload.c',
|
||||
'vkutils.c',
|
||||
'vkwindow.c',
|
||||
]
|
||||
|
||||
vulkan_objc_args = []
|
||||
vulkan_defines = []
|
||||
optional_deps = []
|
||||
if get_option('vulkan').disabled()
|
||||
subdir_done()
|
||||
endif
|
||||
|
||||
if host_system == 'ios'
|
||||
vulkan_dep = cc.find_library('MoltenVK', required : get_option('vulkan'))
|
||||
else
|
||||
vulkan_dep = cc.find_library('vulkan', required : get_option('vulkan'))
|
||||
endif
|
||||
has_vulkan_header = cc.has_header('vulkan/vulkan.h')
|
||||
if not has_vulkan_header and get_option('vulkan').enabled()
|
||||
error('vulkan plugin enabled, but vulkan.h not found')
|
||||
endif
|
||||
|
||||
if vulkan_dep.found() and has_vulkan_header
|
||||
have_vulkan_windowing = false
|
||||
|
||||
vkconf = configuration_data()
|
||||
|
||||
xcb_dep = dependency('xcb', version : '>=1.10', required : get_option('x11'))
|
||||
if xcb_dep.found()
|
||||
vulkan_sources += [
|
||||
'xcb/vkdisplay_xcb.c',
|
||||
'xcb/vkwindow_xcb.c',
|
||||
'xcb/xcb_event_source.c',
|
||||
]
|
||||
|
||||
optional_deps += xcb_dep
|
||||
have_vulkan_windowing = true
|
||||
vkconf.set10('GST_VULKAN_HAVE_WINDOW_XCB', 1)
|
||||
endif
|
||||
|
||||
wayland_client_dep = dependency('wayland-client', version : '>=1.4', required : get_option('wayland'))
|
||||
if wayland_client_dep.found()
|
||||
vulkan_sources += [
|
||||
'wayland/vkdisplay_wayland.c',
|
||||
'wayland/vkwindow_wayland.c',
|
||||
'wayland/wayland_event_source.c',
|
||||
]
|
||||
|
||||
optional_deps += wayland_client_dep
|
||||
have_vulkan_windowing = true
|
||||
vkconf.set10('GST_VULKAN_HAVE_WINDOW_WAYLAND', 1)
|
||||
endif
|
||||
|
||||
if ['darwin', 'ios'].contains(host_system)
|
||||
objc = meson.get_compiler('objc')
|
||||
if not objc.has_argument('-fobjc-arc')
|
||||
error('ARC is required for building')
|
||||
endif
|
||||
|
||||
vulkan_objc_args += ['-fobjc-arc']
|
||||
|
||||
foundation_dep = dependency('appleframeworks', modules : ['Foundation'], required : get_option('vulkan'))
|
||||
quartzcore_dep = dependency('appleframeworks', modules : ['QuartzCore'], required : get_option('vulkan'))
|
||||
corefoundation_dep = dependency('appleframeworks', modules : ['CoreFoundation'], required : get_option('vulkan'))
|
||||
if foundation_dep.found() and quartzcore_dep.found() and corefoundation_dep.found()
|
||||
optional_deps += [foundation_dep, corefoundation_dep, quartzcore_dep]
|
||||
endif
|
||||
endif
|
||||
|
||||
if host_system == 'darwin'
|
||||
cocoa_dep = dependency('appleframeworks', modules : ['Cocoa'], required : get_option('vulkan'))
|
||||
|
||||
if cocoa_dep.found()
|
||||
vulkan_sources += [
|
||||
'cocoa/vkdisplay_cocoa.m',
|
||||
'cocoa/vkwindow_cocoa.m',
|
||||
]
|
||||
optional_deps += [cocoa_dep]
|
||||
have_vulkan_windowing = true
|
||||
vkconf.set10('GST_VULKAN_HAVE_WINDOW_COCOA', 1)
|
||||
endif
|
||||
endif
|
||||
|
||||
if host_system == 'ios'
|
||||
uikit_dep = dependency('appleframeworks', modules : ['UIKit'], required : get_option('vulkan'))
|
||||
|
||||
if uikit_dep.found()
|
||||
vulkan_sources += [
|
||||
'ios/vkdisplay_ios.m',
|
||||
'ios/vkwindow_ios.m',
|
||||
]
|
||||
optional_deps += [uikit_dep]
|
||||
have_vulkan_windowing = true
|
||||
vkconf.set10('GST_VULKAN_HAVE_WINDOW_IOS', 1)
|
||||
endif
|
||||
endif
|
||||
|
||||
if have_vulkan_windowing
|
||||
configure_file(input : 'vkconfig.h.meson',
|
||||
output : 'vkconfig.h',
|
||||
configuration : vkconf)
|
||||
|
||||
gstvulkan = library('gstvulkan',
|
||||
vulkan_sources,
|
||||
c_args : gst_plugins_bad_args + vulkan_defines,
|
||||
objc_args : gst_plugins_bad_args + vulkan_defines + vulkan_objc_args,
|
||||
link_args : noseh_link_args,
|
||||
include_directories : [configinc],
|
||||
dependencies : [gstvideo_dep, gstbase_dep, vulkan_dep] + optional_deps,
|
||||
install : true,
|
||||
install_dir : plugins_install_dir,
|
||||
)
|
||||
pkgconfig.generate(gstvulkan, install_dir : plugins_pkgconfig_install_dir)
|
||||
plugins += [gstvulkan]
|
||||
endif
|
||||
endif
|
||||
vulkan_sources = [
|
||||
'gstvulkan.c',
|
||||
'vksink.c',
|
||||
'vkswapper.c',
|
||||
'vktrash.c',
|
||||
'vkupload.c',
|
||||
]
|
||||
|
||||
gstvulkan_plugin = library('gstvulkan',
|
||||
vulkan_sources,
|
||||
c_args : gst_plugins_bad_args,
|
||||
objc_args : gst_plugins_bad_args,
|
||||
link_args : noseh_link_args,
|
||||
include_directories : [configinc],
|
||||
dependencies : [gstvideo_dep, gstbase_dep, gstvulkan_dep, vulkan_dep],
|
||||
install : true,
|
||||
install_dir : plugins_install_dir,
|
||||
)
|
||||
pkgconfig.generate(gstvulkan_plugin, install_dir : plugins_pkgconfig_install_dir)
|
||||
plugins += [gstvulkan_plugin]
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
//#include <gst/video/videooverlay.h>
|
||||
|
||||
#include "vksink.h"
|
||||
#include "vkdevice.h"
|
||||
#include "vkswapper.h"
|
||||
|
||||
GST_DEBUG_CATEGORY (gst_debug_vulkan_sink);
|
||||
#define GST_CAT_DEFAULT gst_debug_vulkan_sink
|
||||
|
|
|
@ -24,7 +24,8 @@
|
|||
#include <gst/gst.h>
|
||||
#include <gst/video/gstvideosink.h>
|
||||
#include <gst/video/video.h>
|
||||
#include "vk.h"
|
||||
#include <gst/vulkan/vulkan.h>
|
||||
#include "vkswapper.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
#include <string.h>
|
||||
|
||||
#include "vkswapper.h"
|
||||
#include "vktrash.h"
|
||||
|
||||
#define GST_CAT_DEFAULT gst_vulkan_swapper_debug
|
||||
GST_DEBUG_CATEGORY (GST_CAT_DEFAULT);
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
|
||||
#include <gst/video/video.h>
|
||||
|
||||
#include <vk.h>
|
||||
#include <gst/vulkan/vulkan.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
|
@ -37,6 +37,10 @@ GType gst_vulkan_swapper_get_type (void);
|
|||
|
||||
#define GST_VULKAN_SWAPPER_VIDEO_FORMATS " { RGBA, BGRA, RGB, BGR } "
|
||||
|
||||
typedef struct _GstVulkanSwapper GstVulkanSwapper;
|
||||
typedef struct _GstVulkanSwapperClass GstVulkanSwapperClass;
|
||||
typedef struct _GstVulkanSwapperPrivate GstVulkanSwapperPrivate;
|
||||
|
||||
struct _GstVulkanSwapper
|
||||
{
|
||||
GstObject parent;
|
||||
|
|
|
@ -23,7 +23,6 @@
|
|||
#endif
|
||||
|
||||
#include "vktrash.h"
|
||||
#include "vkutils_private.h"
|
||||
|
||||
GST_DEBUG_CATEGORY (gst_debug_vulkan_trash);
|
||||
#define GST_CAT_DEFAULT gst_debug_vulkan_trash
|
||||
|
|
|
@ -18,15 +18,17 @@
|
|||
* Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef _VK_TRASH_H_
|
||||
#define _VK_TRASH_H_
|
||||
#ifndef __GST_VULKAN_TRASH_H__
|
||||
#define __GST_VULKAN_TRASH_H__
|
||||
|
||||
#include <vk.h>
|
||||
#include <gst/vulkan/vulkan.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
typedef void (*GstVulkanTrashNotify) (GstVulkanDevice * device, gpointer user_data);
|
||||
|
||||
typedef struct _GstVulkanTrash GstVulkanTrash;
|
||||
|
||||
struct _GstVulkanTrash
|
||||
{
|
||||
GstVulkanFence *fence;
|
||||
|
@ -50,4 +52,4 @@ gboolean gst_vulkan_trash_list_wait (GList * trash_l
|
|||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* _VK_INSTANCE_H_ */
|
||||
#endif /* __GST_VULKAN_TRASH_H__ */
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
|
||||
#include <gst/gst.h>
|
||||
#include <gst/video/video.h>
|
||||
#include <vk.h>
|
||||
#include <gst/vulkan/vulkan.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
|
|
|
@ -1,42 +0,0 @@
|
|||
/*
|
||||
* GStreamer
|
||||
* Copyright (C) 2015 Matthew Waters <matthew@centricular.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 _VK_UTILS_H_
|
||||
#define _VK_UTILS_H_
|
||||
|
||||
#include <gst/gst.h>
|
||||
#include <vk.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
gboolean gst_vulkan_ensure_element_data (gpointer element,
|
||||
GstVulkanDisplay **display_ptr, GstVulkanInstance ** instance_ptr);
|
||||
gboolean gst_vulkan_handle_set_context (GstElement * element, GstContext * context,
|
||||
GstVulkanDisplay ** display, GstVulkanInstance ** instance);
|
||||
gboolean gst_vulkan_handle_context_query (GstElement * element, GstQuery * query,
|
||||
GstVulkanDisplay ** display, GstVulkanInstance ** instance, GstVulkanDevice ** device);
|
||||
|
||||
void gst_vulkan_global_context_query (GstElement * element, const gchar * context_type);
|
||||
GstQuery * gst_vulkan_local_context_query (GstElement * element, const gchar * context_type, gboolean set_context);
|
||||
gboolean gst_vulkan_run_query (GstElement * element,
|
||||
GstQuery * query, GstPadDirection direction);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /*_VK_UTILS_H_ */
|
|
@ -1,30 +0,0 @@
|
|||
## Process this file with automake to produce Makefile.in
|
||||
|
||||
noinst_LTLIBRARIES = libgstvulkan-wayland.la
|
||||
|
||||
libgstvulkan_wayland_la_SOURCES = \
|
||||
vkdisplay_wayland.c \
|
||||
vkwindow_wayland.c \
|
||||
wayland_event_source.c
|
||||
|
||||
noinst_HEADERS = \
|
||||
vkdisplay_wayland.h \
|
||||
vkwindow_wayland.h \
|
||||
wayland_event_source.h
|
||||
|
||||
libgstvulkan_wayland_la_CFLAGS = \
|
||||
-I$(top_srcdir)/gst-libs \
|
||||
-I$(top_builddir)/ext/vulkan \
|
||||
-I$(top_srcdir)/ext/vulkan \
|
||||
-I$(top_builddir)/gst-libs \
|
||||
$(GST_PLUGINS_BASE_CFLAGS) \
|
||||
$(GST_BASE_CFLAGS) \
|
||||
$(GST_CFLAGS) \
|
||||
$(VULKAN_WAYLAND_CFLAGS)
|
||||
|
||||
libgstvulkan_wayland_la_LIBADD = \
|
||||
$(VULKAN_WAYLAND_LIBS)
|
||||
|
||||
libgstvulkan_wayland_la_LDFLAGS = \
|
||||
$(GST_LIB_LDFLAGS) \
|
||||
$(GST_ALL_LDFLAGS)
|
|
@ -1,30 +0,0 @@
|
|||
## Process this file with automake to produce Makefile.in
|
||||
|
||||
noinst_LTLIBRARIES = libgstvulkan-xcb.la
|
||||
|
||||
libgstvulkan_xcb_la_SOURCES = \
|
||||
vkdisplay_xcb.c \
|
||||
vkwindow_xcb.c \
|
||||
xcb_event_source.c
|
||||
|
||||
noinst_HEADERS = \
|
||||
vkdisplay_xcb.h \
|
||||
vkwindow_xcb.h \
|
||||
xcb_event_source.h
|
||||
|
||||
libgstvulkan_xcb_la_CFLAGS = \
|
||||
-I$(top_srcdir)/gst-libs \
|
||||
-I$(top_builddir)/ext/vulkan \
|
||||
-I$(top_srcdir)/ext/vulkan \
|
||||
-I$(top_builddir)/gst-libs \
|
||||
$(GST_PLUGINS_BASE_CFLAGS) \
|
||||
$(GST_BASE_CFLAGS) \
|
||||
$(GST_CFLAGS) \
|
||||
$(XCB_CFLAGS)
|
||||
|
||||
libgstvulkan_xcb_la_LIBADD = \
|
||||
$(XCB_LIBS)
|
||||
|
||||
libgstvulkan_xcb_la_LDFLAGS = \
|
||||
$(GST_LIB_LDFLAGS) \
|
||||
$(GST_ALL_LDFLAGS)
|
|
@ -11,5 +11,6 @@ subdir('mpegts')
|
|||
subdir('opencv')
|
||||
subdir('player')
|
||||
subdir('sctp')
|
||||
subdir('vulkan')
|
||||
subdir('wayland')
|
||||
subdir('webrtc')
|
||||
|
|
1
gst-libs/gst/vulkan/.gitignore
vendored
Normal file
1
gst-libs/gst/vulkan/.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
gstvkconfig.h
|
|
@ -24,7 +24,7 @@
|
|||
#include <gst/gst.h>
|
||||
#include <Cocoa/Cocoa.h>
|
||||
|
||||
#include "vkwindow_cocoa.h"
|
||||
#include "gstvkwindow_cocoa.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* GStreamer
|
||||
* Copyright (C) 2019 Matthew Waters <ystreet00@gmail.com>
|
||||
* Copyright (C) 2019 Matthew Waters <matthew@centricular.com>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
|
@ -23,13 +23,14 @@
|
|||
|
||||
#include <gst/gst.h>
|
||||
|
||||
#include <vk.h>
|
||||
#ifndef VK_USE_PLATFORM_MACOS_MVK
|
||||
#error "VK_USE_PLATFORM_MACOS_MVK not defined before including this header"
|
||||
#error "Either include vkapi.h or define VK_USE_PLATFORM_MACOS_MVK before including this header"
|
||||
#endif
|
||||
#include <vulkan/vulkan.h>
|
||||
|
||||
#include <gst/vulkan/vulkan.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
GType gst_vulkan_display_cocoa_get_type (void);
|
|
@ -22,8 +22,10 @@
|
|||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include "vkdisplay_cocoa.h"
|
||||
#include "vkcocoa_utils.h"
|
||||
#include <gst/vulkan/vulkan.h>
|
||||
|
||||
#include "gstvkdisplay_cocoa.h"
|
||||
#include "gstvkcocoa_utils.h"
|
||||
|
||||
#define GST_CAT_DEFAULT gst_vulkan_display_debug
|
||||
GST_DEBUG_CATEGORY_STATIC (gst_vulkan_display_debug);
|
|
@ -21,7 +21,7 @@
|
|||
#ifndef __GST_VULKAN_WINDOW_COCOA_H__
|
||||
#define __GST_VULKAN_WINDOW_COCOA_H__
|
||||
|
||||
#include <vk.h>
|
||||
#include <gst/vulkan/vulkan.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
|
@ -27,10 +27,12 @@
|
|||
|
||||
#include <gst/gst.h>
|
||||
|
||||
#include "vkwindow_cocoa.h"
|
||||
#include "vkdisplay_cocoa.h"
|
||||
#include <gst/vulkan/vulkan.h>
|
||||
|
||||
#include "vkcocoa_utils.h"
|
||||
#include "gstvkwindow_cocoa.h"
|
||||
#include "gstvkdisplay_cocoa.h"
|
||||
|
||||
#include "gstvkcocoa_utils.h"
|
||||
|
||||
#define GST_VULKAN_WINDOW_COCOA_GET_PRIVATE(o) \
|
||||
(G_TYPE_INSTANCE_GET_PRIVATE((o), GST_TYPE_VULKAN_WINDOW_COCOA, GstVulkanWindowCocoaPrivate))
|
|
@ -18,14 +18,15 @@
|
|||
* Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef _VK_API_H_
|
||||
#define _VK_API_H_
|
||||
#ifndef __GST_VULKAN_API_H__
|
||||
#define __GST_VULKAN_API_H__
|
||||
|
||||
#define VK_PROTOTYPES
|
||||
|
||||
#include <vkconfig.h>
|
||||
#include "vk_fwd.h"
|
||||
#include "vkmacros.h"
|
||||
#include <gst/vulkan/gstvkconfig.h>
|
||||
#include <gst/vulkan/vulkan-prelude.h>
|
||||
#include <gst/vulkan/vulkan_fwd.h>
|
||||
#include <gst/vulkan/vulkan-enumtypes.h>
|
||||
|
||||
/* Need these defined to have access to winsys functions before including vulkan.h */
|
||||
#if GST_VULKAN_HAVE_WINDOW_XCB
|
||||
|
@ -54,4 +55,4 @@
|
|||
|
||||
#include <vulkan/vulkan.h>
|
||||
|
||||
#endif /* _VK_H_ */
|
||||
#endif /* __GST_VULKAN_API_H__ */
|
|
@ -22,7 +22,7 @@
|
|||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include "vkbuffermemory.h"
|
||||
#include "gstvkbuffermemory.h"
|
||||
|
||||
/**
|
||||
* SECTION:vkbuffermemory
|
|
@ -18,18 +18,19 @@
|
|||
* Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef _VK_BUFFER_MEMORY_H_
|
||||
#define _VK_BUFFER_MEMORY_H_
|
||||
#ifndef __GST_VULKAN_BUFFER_MEMORY_H__
|
||||
#define __GST_VULKAN_BUFFER_MEMORY_H__
|
||||
|
||||
#include <gst/gst.h>
|
||||
#include <gst/gstallocator.h>
|
||||
#include <gst/gstmemory.h>
|
||||
|
||||
#include <vk.h>
|
||||
#include <gst/vulkan/vulkan.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define GST_TYPE_VULKAN_BUFFER_MEMORY_ALLOCATOR (gst_vulkan_buffer_memory_allocator_get_type())
|
||||
GST_VULKAN_API
|
||||
GType gst_vulkan_buffer_memory_allocator_get_type(void);
|
||||
|
||||
#define GST_IS_VULKAN_BUFFER_MEMORY_ALLOCATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_VULKAN_BUFFER_MEMORY_ALLOCATOR))
|
||||
|
@ -81,15 +82,19 @@ struct _GstVulkanBufferMemoryAllocatorClass
|
|||
GstAllocatorClass parent_class;
|
||||
};
|
||||
|
||||
GST_VULKAN_API
|
||||
void gst_vulkan_buffer_memory_init_once (void);
|
||||
GST_VULKAN_API
|
||||
gboolean gst_is_vulkan_buffer_memory (GstMemory * mem);
|
||||
|
||||
GST_VULKAN_API
|
||||
GstMemory * gst_vulkan_buffer_memory_alloc (GstVulkanDevice * device,
|
||||
VkFormat format,
|
||||
gsize size,
|
||||
VkBufferUsageFlags usage,
|
||||
VkMemoryPropertyFlags mem_prop_flags);
|
||||
|
||||
GST_VULKAN_API
|
||||
GstMemory * gst_vulkan_buffer_memory_wrapped (GstVulkanDevice * device,
|
||||
VkBuffer buffer,
|
||||
VkFormat format,
|
||||
|
@ -99,4 +104,4 @@ GstMemory * gst_vulkan_buffer_memory_wrapped (GstVulkanDevice * devi
|
|||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* _VK_BUFFER_MEMORY_H_ */
|
||||
#endif /* __GST_VULKAN_BUFFER_MEMORY_H__ */
|
|
@ -22,7 +22,7 @@
|
|||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include "vkbufferpool.h"
|
||||
#include "gstvkbufferpool.h"
|
||||
|
||||
/**
|
||||
* SECTION:vkbufferpool
|
|
@ -18,18 +18,18 @@
|
|||
* Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef _GST_VULKAN_BUFFER_POOL_H_
|
||||
#define _GST_VULKAN_BUFFER_POOL_H_
|
||||
#ifndef __GST_VULKAN_BUFFER_POOL_H__
|
||||
#define __GST_VULKAN_BUFFER_POOL_H__
|
||||
|
||||
#include <gst/video/video.h>
|
||||
#include <gst/video/gstvideometa.h>
|
||||
#include <gst/video/gstvideopool.h>
|
||||
|
||||
#include <vk.h>
|
||||
#include <gst/vulkan/vulkan.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
/* buffer pool functions */
|
||||
GST_VULKAN_API
|
||||
GType gst_vulkan_buffer_pool_get_type (void);
|
||||
#define GST_TYPE_VULKAN_BUFFER_POOL (gst_vulkan_buffer_pool_get_type())
|
||||
#define GST_IS_VULKAN_BUFFER_POOL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_VULKAN_BUFFER_POOL))
|
||||
|
@ -60,8 +60,9 @@ struct _GstVulkanBufferPoolClass
|
|||
GstBufferPoolClass parent_class;
|
||||
};
|
||||
|
||||
GST_VULKAN_API
|
||||
GstBufferPool *gst_vulkan_buffer_pool_new (GstVulkanDevice * device);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* _GST_VULKAN_BUFFER_POOL_H_ */
|
||||
#endif /* __GST_VULKAN_BUFFER_POOL_H__ */
|
|
@ -22,8 +22,7 @@
|
|||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include "vkdevice.h"
|
||||
#include "vkutils_private.h"
|
||||
#include "gstvkdevice.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
|
@ -512,7 +511,7 @@ gst_vulkan_device_run_context_query (GstElement * element,
|
|||
|
||||
if ((query =
|
||||
gst_vulkan_local_context_query (element,
|
||||
GST_VULKAN_DEVICE_CONTEXT_TYPE_STR, FALSE))) {
|
||||
GST_VULKAN_DEVICE_CONTEXT_TYPE_STR))) {
|
||||
GstContext *context;
|
||||
|
||||
gst_query_parse_context (query, &context);
|
|
@ -18,11 +18,12 @@
|
|||
* Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef _VK_DEVICE_H_
|
||||
#define _VK_DEVICE_H_
|
||||
#ifndef __GST_VULKAN_DEVICE_H__
|
||||
#define __GST_VULKAN_DEVICE_H__
|
||||
|
||||
#include <gst/gst.h>
|
||||
#include "vk.h"
|
||||
|
||||
#include <gst/vulkan/vulkan.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
|
@ -32,6 +33,7 @@ G_BEGIN_DECLS
|
|||
#define GST_IS_VULKAN_DEVICE(o) (G_TYPE_CHECK_INSTANCE_TYPE((o), GST_TYPE_VULKAN_DEVICE))
|
||||
#define GST_IS_VULKAN_DEVICE_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE((k), GST_TYPE_VULKAN_DEVICE))
|
||||
#define GST_VULKAN_DEVICE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS((o), GST_TYPE_VULKAN_DEVICE, GstVulkanDeviceClass))
|
||||
GST_VULKAN_API
|
||||
GType gst_vulkan_device_get_type (void);
|
||||
|
||||
#define GST_VULKAN_DEVICE_CONTEXT_TYPE_STR "gst.vulkan.device"
|
||||
|
@ -66,34 +68,46 @@ struct _GstVulkanDeviceClass
|
|||
GstObjectClass parent_class;
|
||||
};
|
||||
|
||||
GST_VULKAN_API
|
||||
GstVulkanDevice * gst_vulkan_device_new (GstVulkanInstance * instance);
|
||||
GST_VULKAN_API
|
||||
GstVulkanInstance * gst_vulkan_device_get_instance (GstVulkanDevice * device);
|
||||
GST_VULKAN_API
|
||||
gboolean gst_vulkan_device_open (GstVulkanDevice * device,
|
||||
GError ** error);
|
||||
|
||||
GST_VULKAN_API
|
||||
gpointer gst_vulkan_device_get_proc_address (GstVulkanDevice * device,
|
||||
const gchar * name);
|
||||
GST_VULKAN_API
|
||||
void gst_vulkan_device_foreach_queue (GstVulkanDevice * device,
|
||||
GstVulkanDeviceForEachQueueFunc func,
|
||||
gpointer user_data);
|
||||
GST_VULKAN_API
|
||||
GstVulkanQueue * gst_vulkan_device_get_queue (GstVulkanDevice * device,
|
||||
guint32 queue_family,
|
||||
guint32 queue_i);
|
||||
GST_VULKAN_API
|
||||
VkPhysicalDevice gst_vulkan_device_get_physical_device (GstVulkanDevice * device);
|
||||
GST_VULKAN_API
|
||||
gboolean gst_vulkan_device_create_cmd_buffer (GstVulkanDevice * device,
|
||||
VkCommandBuffer * cmd,
|
||||
GError ** error);
|
||||
|
||||
GST_VULKAN_API
|
||||
void gst_context_set_vulkan_device (GstContext * context,
|
||||
GstVulkanDevice * device);
|
||||
GST_VULKAN_API
|
||||
gboolean gst_context_get_vulkan_device (GstContext * context,
|
||||
GstVulkanDevice ** device);
|
||||
GST_VULKAN_API
|
||||
gboolean gst_vulkan_device_handle_context_query (GstElement * element,
|
||||
GstQuery * query,
|
||||
GstVulkanDevice ** device);
|
||||
GST_VULKAN_API
|
||||
gboolean gst_vulkan_device_run_context_query (GstElement * element,
|
||||
GstVulkanDevice ** device);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* _VK_DEVICE_H_ */
|
||||
#endif /* __GST_VULKAN_DEVICE_H__ */
|
|
@ -25,19 +25,19 @@
|
|||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include "vkdisplay.h"
|
||||
#include "gstvkdisplay.h"
|
||||
|
||||
#if GST_VULKAN_HAVE_WINDOW_XCB
|
||||
#include "xcb/vkdisplay_xcb.h"
|
||||
#include "xcb/gstvkdisplay_xcb.h"
|
||||
#endif
|
||||
#if GST_VULKAN_HAVE_WINDOW_WAYLAND
|
||||
#include "wayland/vkdisplay_wayland.h"
|
||||
#include "wayland/gstvkdisplay_wayland.h"
|
||||
#endif
|
||||
#if GST_VULKAN_HAVE_WINDOW_COCOA
|
||||
#include "cocoa/vkdisplay_cocoa.h"
|
||||
#include "cocoa/gstvkdisplay_cocoa.h"
|
||||
#endif
|
||||
#if GST_VULKAN_HAVE_WINDOW_IOS
|
||||
#include "ios/vkdisplay_ios.h"
|
||||
#include "ios/gstvkdisplay_ios.h"
|
||||
#endif
|
||||
|
||||
GST_DEBUG_CATEGORY_STATIC (GST_CAT_CONTEXT);
|
|
@ -26,7 +26,7 @@
|
|||
|
||||
#include <gst/gst.h>
|
||||
|
||||
#include <vk.h>
|
||||
#include <gst/vulkan/vulkan.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
|
@ -37,6 +37,7 @@ G_BEGIN_DECLS
|
|||
#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"
|
||||
|
@ -85,28 +86,40 @@ struct _GstVulkanDisplayClass
|
|||
GstVulkanWindow * (*create_window) (GstVulkanDisplay * display);
|
||||
};
|
||||
|
||||
GST_VULKAN_API
|
||||
GstVulkanDisplay * gst_vulkan_display_new (GstVulkanInstance *instance);
|
||||
GST_VULKAN_API
|
||||
GstVulkanDisplay * gst_vulkan_display_new_with_type (GstVulkanInstance *instance,
|
||||
GstVulkanDisplayType type);
|
||||
GST_VULKAN_API
|
||||
GstVulkanDisplayType gst_vulkan_display_choose_type (GstVulkanInstance *instance);
|
||||
GST_VULKAN_API
|
||||
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);
|
||||
|
||||
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
#include <glib/gprintf.h>
|
||||
|
||||
#include "vkerror.h"
|
||||
#include "gstvkerror.h"
|
||||
|
||||
/* *INDENT-OFF* */
|
||||
static const struct
|
|
@ -18,15 +18,17 @@
|
|||
* Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef _VK_ERROR_H_
|
||||
#define _VK_ERROR_H_
|
||||
#ifndef __GST_VULKAN_ERROR_H__
|
||||
#define __GST_VULKAN_ERROR_H__
|
||||
|
||||
#include <gst/gst.h>
|
||||
#include <vulkan/vulkan.h>
|
||||
#include <gst/vulkan/vulkan-prelude.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define GST_VULKAN_ERROR (gst_vulkan_error_quark ())
|
||||
GST_VULKAN_API
|
||||
GQuark gst_vulkan_error_quark (void);
|
||||
|
||||
/* custom error values */
|
||||
|
@ -36,8 +38,9 @@ typedef enum
|
|||
} GstVulkanError;
|
||||
|
||||
/* only fills error iff error != NULL and result < 0 */
|
||||
GST_VULKAN_API
|
||||
VkResult gst_vulkan_error_to_g_error (VkResult result, GError ** error, const char * format, ...) G_GNUC_PRINTF (3, 4);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* _VK_INSTANCE_H_ */
|
||||
#endif /* __GST_VULKAN_ERROR_H__ */
|
|
@ -22,8 +22,7 @@
|
|||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include "vkfence.h"
|
||||
#include "vkutils_private.h"
|
||||
#include "gstvkfence.h"
|
||||
|
||||
GST_DEBUG_CATEGORY (gst_debug_vulkan_fence);
|
||||
#define GST_CAT_DEFAULT gst_debug_vulkan_fence
|
|
@ -18,12 +18,13 @@
|
|||
* Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef _VK_FENCE_H_
|
||||
#define _VK_FENCE_H_
|
||||
#ifndef __GST_VULKAN_FENCE_H__
|
||||
#define __GST_VULKAN_FENCE_H__
|
||||
|
||||
#include <vk.h>
|
||||
#include <gst/vulkan/vulkan.h>
|
||||
|
||||
#define GST_TYPE_VULKAN_FENCE (gst_vulkan_fence_get_type ())
|
||||
GST_VULKAN_API
|
||||
GType gst_vulkan_fence_get_type (void);
|
||||
|
||||
#define GST_VULKAN_FENCE_CAST(f) ((GstVulkanFence *) f)
|
||||
|
@ -40,10 +41,13 @@ struct _GstVulkanFence
|
|||
VkFence fence;
|
||||
};
|
||||
|
||||
GST_VULKAN_API
|
||||
GstVulkanFence * gst_vulkan_fence_new (GstVulkanDevice * device,
|
||||
VkFenceCreateFlags flags,
|
||||
GError ** error);
|
||||
GST_VULKAN_API
|
||||
GstVulkanFence * gst_vulkan_fence_wait (GstVulkanFence * fence);
|
||||
GST_VULKAN_API
|
||||
gboolean gst_vulkan_fence_is_signaled (GstVulkanFence * fence);
|
||||
|
||||
static inline GstVulkanFence *
|
||||
|
@ -60,4 +64,4 @@ gst_vulkan_fence_unref (GstVulkanFence * fence)
|
|||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* _VK_FENCE_H_ */
|
||||
#endif /* __GST_VULKAN_FENCE_H__ */
|
|
@ -22,7 +22,7 @@
|
|||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include "vkimagememory.h"
|
||||
#include "gstvkimagememory.h"
|
||||
|
||||
/**
|
||||
* SECTION:vkimagememory
|
|
@ -18,8 +18,8 @@
|
|||
* Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef _VK_IMAGE_MEMORY_H_
|
||||
#define _VK_IMAGE_MEMORY_H_
|
||||
#ifndef __GST_VULKAN_IMAGE_MEMORY_H__
|
||||
#define __GST_VULKAN_IMAGE_MEMORY_H__
|
||||
|
||||
#include <gst/gst.h>
|
||||
#include <gst/gstallocator.h>
|
||||
|
@ -27,11 +27,12 @@
|
|||
|
||||
#include <gst/video/video.h>
|
||||
|
||||
#include <vk.h>
|
||||
#include <gst/vulkan/vulkan.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define GST_TYPE_VULKAN_IMAGE_MEMORY_ALLOCATOR (gst_vulkan_image_memory_allocator_get_type())
|
||||
GST_VULKAN_API
|
||||
GType gst_vulkan_image_memory_allocator_get_type(void);
|
||||
|
||||
#define GST_IS_VULKAN_IMAGE_MEMORY_ALLOCATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_VULKAN_IMAGE_MEMORY_ALLOCATOR))
|
||||
|
@ -86,9 +87,12 @@ struct _GstVulkanImageMemoryAllocatorClass
|
|||
GstAllocatorClass parent_class;
|
||||
};
|
||||
|
||||
GST_VULKAN_API
|
||||
void gst_vulkan_image_memory_init_once (void);
|
||||
GST_VULKAN_API
|
||||
gboolean gst_is_vulkan_image_memory (GstMemory * mem);
|
||||
|
||||
GST_VULKAN_API
|
||||
GstMemory * gst_vulkan_image_memory_alloc (GstVulkanDevice * device,
|
||||
VkFormat format,
|
||||
gsize width,
|
||||
|
@ -97,6 +101,7 @@ GstMemory * gst_vulkan_image_memory_alloc (GstVulkanDevice * devic
|
|||
VkImageUsageFlags usage,
|
||||
VkMemoryPropertyFlags mem_prop_flags);
|
||||
|
||||
GST_VULKAN_API
|
||||
GstMemory * gst_vulkan_image_memory_wrapped (GstVulkanDevice * device,
|
||||
VkImage image,
|
||||
VkFormat format,
|
||||
|
@ -107,16 +112,20 @@ GstMemory * gst_vulkan_image_memory_wrapped (GstVulkanDevice * devic
|
|||
gpointer user_data,
|
||||
GDestroyNotify notify);
|
||||
|
||||
GST_VULKAN_API
|
||||
gboolean gst_vulkan_image_memory_set_layout (GstVulkanImageMemory * vk_mem,
|
||||
VkImageLayout,
|
||||
VkImageMemoryBarrier * barrier);
|
||||
|
||||
GST_VULKAN_API
|
||||
guint32 gst_vulkan_image_memory_get_width (GstVulkanImageMemory * image);
|
||||
GST_VULKAN_API
|
||||
guint32 gst_vulkan_image_memory_get_height (GstVulkanImageMemory * image);
|
||||
|
||||
GST_VULKAN_API
|
||||
VkFormat gst_vulkan_format_from_video_format (GstVideoFormat v_format,
|
||||
guint plane);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* _VK_IMAGE_MEMORY_H_ */
|
||||
#endif /* __GST_VULKAN_IMAGE_MEMORY_H__ */
|
|
@ -22,8 +22,7 @@
|
|||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include "vkinstance.h"
|
||||
#include "vkutils_private.h"
|
||||
#include "gstvkinstance.h"
|
||||
|
||||
#include <string.h>
|
||||
|
|
@ -18,10 +18,10 @@
|
|||
* Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef _VK_INSTANCE_H_
|
||||
#define _VK_INSTANCE_H_
|
||||
#ifndef __GST_VULKAN_INSTANCE_H__
|
||||
#define __GST_VULKAN_INSTANCE_H__
|
||||
|
||||
#include <vk.h>
|
||||
#include <gst/vulkan/vulkan.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
|
@ -31,6 +31,7 @@ G_BEGIN_DECLS
|
|||
#define GST_IS_VULKAN_INSTANCE(o) (G_TYPE_CHECK_INSTANCE_TYPE((o), GST_TYPE_VULKAN_INSTANCE))
|
||||
#define GST_IS_VULKAN_INSTANCE_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE((k), GST_TYPE_VULKAN_INSTANCE))
|
||||
#define GST_VULKAN_INSTANCE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS((o), GST_TYPE_VULKAN_INSTANCE, GstVulkanInstanceClass))
|
||||
GST_VULKAN_API
|
||||
GType gst_vulkan_instance_get_type (void);
|
||||
|
||||
#define GST_VULKAN_INSTANCE_CONTEXT_TYPE_STR "gst.vulkan.instance"
|
||||
|
@ -56,26 +57,34 @@ struct _GstVulkanInstanceClass
|
|||
GstObjectClass parent_class;
|
||||
};
|
||||
|
||||
GST_VULKAN_API
|
||||
GstVulkanInstance * gst_vulkan_instance_new (void);
|
||||
GST_VULKAN_API
|
||||
gboolean gst_vulkan_instance_open (GstVulkanInstance * instance,
|
||||
GError ** error);
|
||||
|
||||
GST_VULKAN_API
|
||||
gpointer gst_vulkan_instance_get_proc_address (GstVulkanInstance * instance,
|
||||
const gchar * name);
|
||||
|
||||
GST_VULKAN_API
|
||||
GstVulkanDevice * gst_vulkan_instance_create_device (GstVulkanInstance * instance,
|
||||
GError ** error);
|
||||
|
||||
GST_VULKAN_API
|
||||
void gst_context_set_vulkan_instance (GstContext * context,
|
||||
GstVulkanInstance * instance);
|
||||
GST_VULKAN_API
|
||||
gboolean gst_context_get_vulkan_instance (GstContext * context,
|
||||
GstVulkanInstance ** instance);
|
||||
GST_VULKAN_API
|
||||
gboolean gst_vulkan_instance_handle_context_query (GstElement * element,
|
||||
GstQuery * query,
|
||||
GstVulkanInstance ** instance);
|
||||
GST_VULKAN_API
|
||||
gboolean gst_vulkan_instance_run_context_query (GstElement * element,
|
||||
GstVulkanInstance ** instance);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* _VK_INSTANCE_H_ */
|
||||
#endif /* __GST_VULKAN_INSTANCE_H__ */
|
|
@ -17,11 +17,11 @@
|
|||
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
||||
* Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
#ifndef _VK_MACROS_H_
|
||||
#define _VK_MACROS_H_
|
||||
#ifndef __GST_VULKAN_MACROS_H__
|
||||
#define __GST_VULKAN_MACROS_H__
|
||||
|
||||
#include <gst/gst.h>
|
||||
#include <vk.h>
|
||||
#include <gst/vulkan/vulkan.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
|
@ -121,4 +121,4 @@ G_BEGIN_DECLS
|
|||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /*_VK_MACROS_H_ */
|
||||
#endif /*__GST_VULKAN_MACROS_H__ */
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
#include <string.h>
|
||||
|
||||
#include "vkmemory.h"
|
||||
#include "gstvkmemory.h"
|
||||
|
||||
/**
|
||||
* SECTION:vkmemory
|
|
@ -18,18 +18,19 @@
|
|||
* Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef _GST_VULKAN_BASE_BUFFER_H_
|
||||
#define _GST_VULKAN_BASE_BUFFER_H_
|
||||
#ifndef __GST_VULKAN_BASE_BUFFER_H__
|
||||
#define __GST_VULKAN_BASE_BUFFER_H__
|
||||
|
||||
#include <gst/gst.h>
|
||||
#include <gst/gstallocator.h>
|
||||
#include <gst/gstmemory.h>
|
||||
|
||||
#include <vk.h>
|
||||
#include <gst/vulkan/vulkan.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define GST_TYPE_VULKAN_MEMORY_ALLOCATOR (gst_vulkan_memory_allocator_get_type())
|
||||
GST_VULKAN_API
|
||||
GType gst_vulkan_memory_allocator_get_type(void);
|
||||
|
||||
#define GST_IS_VULKAN_MEMORY_ALLOCATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_VULKAN_MEMORY_ALLOCATOR))
|
||||
|
@ -87,15 +88,19 @@ struct _GstVulkanMemoryAllocatorClass
|
|||
GstAllocatorClass parent_class;
|
||||
};
|
||||
|
||||
GST_VULKAN_API
|
||||
void gst_vulkan_memory_init_once (void);
|
||||
GST_VULKAN_API
|
||||
gboolean gst_is_vulkan_memory (GstMemory * mem);
|
||||
|
||||
GST_VULKAN_API
|
||||
GstMemory * gst_vulkan_memory_alloc (GstVulkanDevice * device,
|
||||
guint32 memory_type_index,
|
||||
GstAllocationParams * params,
|
||||
gsize size,
|
||||
VkMemoryPropertyFlags mem_prop_flags);
|
||||
|
||||
GST_VULKAN_API
|
||||
gboolean gst_vulkan_memory_find_memory_type_index_with_type_properties (GstVulkanDevice * device,
|
||||
guint32 typeBits,
|
||||
VkMemoryPropertyFlags properties,
|
|
@ -22,7 +22,7 @@
|
|||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include "vkqueue.h"
|
||||
#include "gstvkqueue.h"
|
||||
|
||||
#define GST_CAT_DEFAULT gst_vulkan_queue_debug
|
||||
GST_DEBUG_CATEGORY (GST_CAT_DEFAULT);
|
||||
|
@ -168,7 +168,7 @@ gst_vulkan_queue_run_context_query (GstElement * element,
|
|||
|
||||
if ((query =
|
||||
gst_vulkan_local_context_query (element,
|
||||
GST_VULKAN_QUEUE_CONTEXT_TYPE_STR, FALSE))) {
|
||||
GST_VULKAN_QUEUE_CONTEXT_TYPE_STR))) {
|
||||
GstContext *context;
|
||||
|
||||
gst_query_parse_context (query, &context);
|
|
@ -18,10 +18,10 @@
|
|||
* Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef _VK_QUEUE_H_
|
||||
#define _VK_QUEUE_H_
|
||||
#ifndef __GST_VULKAN_QUEUE_H__
|
||||
#define __GST_VULKAN_QUEUE_H__
|
||||
|
||||
#include "vk.h"
|
||||
#include <gst/vulkan/vulkan.h>
|
||||
|
||||
#define GST_TYPE_VULKAN_QUEUE (gst_vulkan_queue_get_type())
|
||||
#define GST_VULKAN_QUEUE(o) (G_TYPE_CHECK_INSTANCE_CAST((o), GST_TYPE_VULKAN_QUEUE, GstVulkanQueue))
|
||||
|
@ -29,6 +29,7 @@
|
|||
#define GST_IS_VULKAN_QUEUE(o) (G_TYPE_CHECK_INSTANCE_TYPE((o), GST_TYPE_VULKAN_QUEUE))
|
||||
#define GST_IS_VULKAN_QUEUE_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE((k), GST_TYPE_VULKAN_QUEUE))
|
||||
#define GST_VULKAN_QUEUE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS((o), GST_TYPE_VULKAN_QUEUE, GstVulkanQueueClass))
|
||||
GST_VULKAN_API
|
||||
GType gst_vulkan_queue_get_type (void);
|
||||
|
||||
#define GST_VULKAN_QUEUE_CONTEXT_TYPE_STR "gst.vulkan.queue"
|
||||
|
@ -49,16 +50,21 @@ struct _GstVulkanQueueClass
|
|||
GstObjectClass parent_class;
|
||||
};
|
||||
|
||||
GST_VULKAN_API
|
||||
GstVulkanDevice * gst_vulkan_queue_get_device (GstVulkanQueue * queue);
|
||||
|
||||
GST_VULKAN_API
|
||||
void gst_context_set_vulkan_queue (GstContext * context,
|
||||
GstVulkanQueue * queue);
|
||||
GST_VULKAN_API
|
||||
gboolean gst_context_get_vulkan_queue (GstContext * context,
|
||||
GstVulkanQueue ** queue);
|
||||
GST_VULKAN_API
|
||||
gboolean gst_vulkan_queue_handle_context_query (GstElement * element,
|
||||
GstQuery * query,
|
||||
GstVulkanQueue ** queue);
|
||||
GST_VULKAN_API
|
||||
gboolean gst_vulkan_queue_run_context_query (GstElement * element,
|
||||
GstVulkanQueue ** queue);
|
||||
|
||||
#endif /* _VK_QUEUE_H_ */
|
||||
#endif /* __GST_VULKAN_QUEUE_H__ */
|
|
@ -22,8 +22,7 @@
|
|||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include "vkutils.h"
|
||||
#include "vkutils_private.h"
|
||||
#include "gstvkutils.h"
|
||||
|
||||
GST_DEBUG_CATEGORY_STATIC (GST_CAT_CONTEXT);
|
||||
|
||||
|
@ -85,38 +84,8 @@ gst_vulkan_run_query (GstElement * element, GstQuery * query,
|
|||
return g_value_get_boolean (&res);
|
||||
}
|
||||
|
||||
void
|
||||
gst_vulkan_global_context_query (GstElement * element,
|
||||
const gchar * context_type)
|
||||
{
|
||||
GstQuery *query;
|
||||
GstMessage *msg;
|
||||
|
||||
if ((query = gst_vulkan_local_context_query (element, context_type, TRUE))) {
|
||||
gst_query_unref (query);
|
||||
return;
|
||||
}
|
||||
|
||||
/* 3) Post a GST_MESSAGE_NEED_CONTEXT message on the bus with
|
||||
* the required context type and afterwards check if a
|
||||
* usable context was set now as in 1). The message could
|
||||
* be handled by the parent bins of the element and the
|
||||
* application.
|
||||
*/
|
||||
GST_CAT_INFO_OBJECT (GST_CAT_CONTEXT, element,
|
||||
"posting need context message");
|
||||
msg = gst_message_new_need_context (GST_OBJECT_CAST (element), context_type);
|
||||
gst_element_post_message (element, msg);
|
||||
|
||||
/*
|
||||
* Whomever responds to the need-context message performs a
|
||||
* GstElement::set_context() with the required context in which the element
|
||||
* is required to update the display_ptr or call gst_vulkan_handle_set_context().
|
||||
*/
|
||||
}
|
||||
|
||||
GstQuery *
|
||||
gst_vulkan_local_context_query (GstElement * element,
|
||||
static GstQuery *
|
||||
_vulkan_local_context_query (GstElement * element,
|
||||
const gchar * context_type, gboolean set_context)
|
||||
{
|
||||
GstQuery *query;
|
||||
|
@ -149,6 +118,43 @@ gst_vulkan_local_context_query (GstElement * element,
|
|||
return query;
|
||||
}
|
||||
|
||||
void
|
||||
gst_vulkan_global_context_query (GstElement * element,
|
||||
const gchar * context_type)
|
||||
{
|
||||
GstQuery *query;
|
||||
GstMessage *msg;
|
||||
|
||||
if ((query = _vulkan_local_context_query (element, context_type, TRUE))) {
|
||||
gst_query_unref (query);
|
||||
return;
|
||||
}
|
||||
|
||||
/* 3) Post a GST_MESSAGE_NEED_CONTEXT message on the bus with
|
||||
* the required context type and afterwards check if a
|
||||
* usable context was set now as in 1). The message could
|
||||
* be handled by the parent bins of the element and the
|
||||
* application.
|
||||
*/
|
||||
GST_CAT_INFO_OBJECT (GST_CAT_CONTEXT, element,
|
||||
"posting need context message");
|
||||
msg = gst_message_new_need_context (GST_OBJECT_CAST (element), context_type);
|
||||
gst_element_post_message (element, msg);
|
||||
|
||||
/*
|
||||
* Whomever responds to the need-context message performs a
|
||||
* GstElement::set_context() with the required context in which the element
|
||||
* is required to update the display_ptr or call gst_vulkan_handle_set_context().
|
||||
*/
|
||||
}
|
||||
|
||||
GstQuery *
|
||||
gst_vulkan_local_context_query (GstElement * element,
|
||||
const gchar * context_type)
|
||||
{
|
||||
return _vulkan_local_context_query (element, context_type, FALSE);
|
||||
}
|
||||
|
||||
static void
|
||||
_vk_display_context_query (GstElement * element,
|
||||
GstVulkanDisplay ** display_ptr)
|
57
gst-libs/gst/vulkan/gstvkutils.h
Normal file
57
gst-libs/gst/vulkan/gstvkutils.h
Normal file
|
@ -0,0 +1,57 @@
|
|||
/*
|
||||
* GStreamer
|
||||
* Copyright (C) 2015 Matthew Waters <matthew@centricular.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 _VK_UTILS_H_
|
||||
#define _VK_UTILS_H_
|
||||
|
||||
#include <gst/gst.h>
|
||||
#include <gst/vulkan/vulkan.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
GST_VULKAN_API
|
||||
gboolean gst_vulkan_ensure_element_data (gpointer element,
|
||||
GstVulkanDisplay ** display_ptr,
|
||||
GstVulkanInstance ** instance_ptr);
|
||||
GST_VULKAN_API
|
||||
gboolean gst_vulkan_handle_set_context (GstElement * element,
|
||||
GstContext * context,
|
||||
GstVulkanDisplay ** display,
|
||||
GstVulkanInstance ** instance);
|
||||
GST_VULKAN_API
|
||||
gboolean gst_vulkan_handle_context_query (GstElement * element,
|
||||
GstQuery * query,
|
||||
GstVulkanDisplay ** display,
|
||||
GstVulkanInstance ** instance,
|
||||
GstVulkanDevice ** device);
|
||||
|
||||
GST_VULKAN_API
|
||||
void gst_vulkan_global_context_query (GstElement * element,
|
||||
const gchar * context_type);
|
||||
GST_VULKAN_API
|
||||
GstQuery * gst_vulkan_local_context_query (GstElement * element,
|
||||
const gchar * context_type);
|
||||
GST_VULKAN_API
|
||||
gboolean gst_vulkan_run_query (GstElement * element,
|
||||
GstQuery * query,
|
||||
GstPadDirection direction);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /*_VK_UTILS_H_ */
|
|
@ -35,19 +35,19 @@
|
|||
#include <gmodule.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "vkwindow.h"
|
||||
#include "gstvkwindow.h"
|
||||
|
||||
#if GST_VULKAN_HAVE_WINDOW_XCB
|
||||
#include "xcb/vkwindow_xcb.h"
|
||||
#include "xcb/gstvkwindow_xcb.h"
|
||||
#endif
|
||||
#if GST_VULKAN_HAVE_WINDOW_WAYLAND
|
||||
#include "wayland/vkwindow_wayland.h"
|
||||
#include "wayland/gstvkwindow_wayland.h"
|
||||
#endif
|
||||
#if GST_VULKAN_HAVE_WINDOW_COCOA
|
||||
#include "cocoa/vkwindow_cocoa.h"
|
||||
#include "cocoa/gstvkwindow_cocoa.h"
|
||||
#endif
|
||||
#if GST_VULKAN_HAVE_WINDOW_IOS
|
||||
#include "ios/vkwindow_ios.h"
|
||||
#include "ios/gstvkwindow_ios.h"
|
||||
#endif
|
||||
|
||||
#define GST_CAT_DEFAULT gst_vulkan_window_debug
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
#include <gst/gst.h>
|
||||
|
||||
#include <vk.h>
|
||||
#include <gst/vulkan/vulkan.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
|
@ -34,6 +34,7 @@ G_BEGIN_DECLS
|
|||
#define GST_IS_VULKAN_WINDOW(o) (G_TYPE_CHECK_INSTANCE_TYPE((o), GST_TYPE_VULKAN_WINDOW))
|
||||
#define GST_IS_VULKAN_WINDOW_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE((k), GST_TYPE_VULKAN_WINDOW))
|
||||
#define GST_VULKAN_WINDOW_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS((o), GST_TYPE_VULKAN_WINDOW, GstVulkanWindowClass))
|
||||
GST_VULKAN_API
|
||||
GType gst_vulkan_window_get_type (void);
|
||||
|
||||
#define GST_VULKAN_WINDOW_LOCK(w) g_mutex_lock(&GST_VULKAN_WINDOW(w)->lock)
|
||||
|
@ -41,6 +42,7 @@ GType gst_vulkan_window_get_type (void);
|
|||
#define GST_VULKAN_WINDOW_GET_LOCK(w) (&GST_VULKAN_WINDOW(w)->lock)
|
||||
|
||||
#define GST_VULKAN_WINDOW_ERROR (gst_vulkan_window_error_quark ())
|
||||
GST_VULKAN_API
|
||||
GQuark gst_vulkan_window_error_quark (void);
|
||||
|
||||
typedef enum
|
||||
|
@ -94,24 +96,33 @@ struct _GstVulkanWindowClass {
|
|||
gpointer _reserved[GST_PADDING];
|
||||
};
|
||||
|
||||
GST_VULKAN_API
|
||||
GstVulkanWindow * gst_vulkan_window_new (GstVulkanDisplay *display);
|
||||
|
||||
GST_VULKAN_API
|
||||
GstVulkanDisplay * gst_vulkan_window_get_display (GstVulkanWindow *window);
|
||||
GST_VULKAN_API
|
||||
VkSurfaceKHR gst_vulkan_window_get_surface (GstVulkanWindow *window,
|
||||
GError **error);
|
||||
GST_VULKAN_API
|
||||
gboolean gst_vulkan_window_get_presentation_support (GstVulkanWindow *window,
|
||||
GstVulkanDevice *device,
|
||||
guint32 queue_family_idx);
|
||||
GST_VULKAN_API
|
||||
void gst_vulkan_window_set_window_handle (GstVulkanWindow *window,
|
||||
guintptr handle);
|
||||
|
||||
GST_VULKAN_API
|
||||
gboolean gst_vulkan_window_open (GstVulkanWindow *window,
|
||||
GError ** error);
|
||||
GST_VULKAN_API
|
||||
void gst_vulkan_window_close (GstVulkanWindow *window);
|
||||
|
||||
GST_VULKAN_API
|
||||
void gst_vulkan_window_resize (GstVulkanWindow *window,
|
||||
gint width,
|
||||
gint height);
|
||||
GST_VULKAN_API
|
||||
void gst_vulkan_window_redraw (GstVulkanWindow *window);
|
||||
|
||||
G_END_DECLS
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* GStreamer
|
||||
* Copyright (C) 2019 Matthew Waters <ystreet00@gmail.com>
|
||||
* Copyright (C) 2019 Matthew Waters <matthew@centricular.com>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
|
@ -23,13 +23,14 @@
|
|||
|
||||
#include <gst/gst.h>
|
||||
|
||||
#include <vk.h>
|
||||
#ifndef VK_USE_PLATFORM_IOS_MVK
|
||||
#error "VK_USE_PLATFORM_IOS_MVK not defined before including this header"
|
||||
#error "Either include vkapi.h or define VK_USE_PLATFORM_IOS_MVK before including this header"
|
||||
#endif
|
||||
#include <vulkan/vulkan.h>
|
||||
|
||||
#include <gst/vulkan/vulkan.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
GType gst_vulkan_display_ios_get_type (void);
|
|
@ -24,7 +24,9 @@
|
|||
|
||||
#include <UIKit/UIKit.h>
|
||||
|
||||
#include "vkdisplay_ios.h"
|
||||
#include <gst/vulkan/vulkan.h>
|
||||
|
||||
#include "gstvkdisplay_ios.h"
|
||||
|
||||
#define GST_CAT_DEFAULT gst_vulkan_display_debug
|
||||
GST_DEBUG_CATEGORY_STATIC (gst_vulkan_display_debug);
|
|
@ -24,7 +24,7 @@
|
|||
#include <gst/gst.h>
|
||||
#include <UIKit/UIKit.h>
|
||||
|
||||
#include "vkwindow_ios.h"
|
||||
#include "gstvkwindow_ios.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* GStreamer
|
||||
* Copyright (C) 2019 Matthew Waters <ystreet00@gmail.com>
|
||||
* Copyright (C) 2019 Matthew Waters <matthew@centricular.com>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
|
@ -21,7 +21,7 @@
|
|||
#ifndef __GST_VULKAN_WINDOW_IOS_H__
|
||||
#define __GST_VULKAN_WINDOW_IOS_H__
|
||||
|
||||
#include <vk.h>
|
||||
#include <gst/vulkan/vulkan.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
|
@ -26,10 +26,12 @@
|
|||
|
||||
#include <gst/gst.h>
|
||||
|
||||
#include "vkwindow_ios.h"
|
||||
#include "vkdisplay_ios.h"
|
||||
#include <gst/vulkan/vulkan.h>
|
||||
|
||||
#include "vkios_utils.h"
|
||||
#include "gstvkwindow_ios.h"
|
||||
#include "gstvkdisplay_ios.h"
|
||||
|
||||
#include "gstvkios_utils.h"
|
||||
|
||||
#define GST_VULKAN_WINDOW_IOS_GET_PRIVATE(o) \
|
||||
(G_TYPE_INSTANCE_GET_PRIVATE((o), GST_TYPE_VULKAN_WINDOW_IOS, GstVulkanWindowIosPrivate))
|
206
gst-libs/gst/vulkan/meson.build
Normal file
206
gst-libs/gst/vulkan/meson.build
Normal file
|
@ -0,0 +1,206 @@
|
|||
if get_option('vulkan').disabled()
|
||||
gstvulkan_dep = dependency('', required: false)
|
||||
subdir_done()
|
||||
endif
|
||||
|
||||
vulkan_sources = [
|
||||
'gstvkbuffermemory.c',
|
||||
'gstvkbufferpool.c',
|
||||
'gstvkdevice.c',
|
||||
'gstvkdisplay.c',
|
||||
'gstvkerror.c',
|
||||
'gstvkfence.c',
|
||||
'gstvkimagememory.c',
|
||||
'gstvkinstance.c',
|
||||
'gstvkmemory.c',
|
||||
'gstvkqueue.c',
|
||||
'gstvkutils.c',
|
||||
'gstvkwindow.c',
|
||||
]
|
||||
|
||||
vulkan_headers = [
|
||||
'gstvkbuffermemory.h',
|
||||
'gstvkbufferpool.h',
|
||||
'gstvkdevice.h',
|
||||
'gstvkdisplay.h',
|
||||
'gstvkerror.h',
|
||||
'gstvkfence.h',
|
||||
'gstvkimagememory.h',
|
||||
'gstvkinstance.h',
|
||||
'gstvkmemory.h',
|
||||
'gstvkqueue.h',
|
||||
'gstvkutils.h',
|
||||
'gstvkwindow.h',
|
||||
'vulkan-prelude.h',
|
||||
'vulkan.h',
|
||||
]
|
||||
|
||||
vulkan_xcb_headers = []
|
||||
vulkan_wayland_headers = []
|
||||
|
||||
vulkan_windowing = false
|
||||
vulkan_objc_args = []
|
||||
vulkan_defines = []
|
||||
optional_deps = []
|
||||
|
||||
vulkan_conf = configuration_data()
|
||||
vulkan_conf_options = [
|
||||
'GST_VULKAN_HAVE_WINDOW_XCB',
|
||||
'GST_VULKAN_HAVE_WINDOW_WAYLAND',
|
||||
'GST_VULKAN_HAVE_WINDOW_COCOA',
|
||||
'GST_VULKAN_HAVE_WINDOW_IOS',
|
||||
]
|
||||
|
||||
foreach option : vulkan_conf_options
|
||||
vulkan_conf.set10(option, false)
|
||||
endforeach
|
||||
|
||||
if host_system == 'ios'
|
||||
vulkan_dep = cc.find_library('MoltenVK', required : get_option('vulkan'))
|
||||
else
|
||||
vulkan_dep = cc.find_library('vulkan', required : get_option('vulkan'))
|
||||
endif
|
||||
has_vulkan_header = cc.has_header('vulkan/vulkan.h')
|
||||
if not has_vulkan_header and get_option('vulkan').enabled()
|
||||
error('vulkan plugin enabled, but vulkan.h not found')
|
||||
endif
|
||||
|
||||
xcb_dep = dependency('xcb', version : '>=1.10', required : get_option('x11'))
|
||||
if xcb_dep.found()
|
||||
vulkan_sources += [
|
||||
'xcb/gstvkdisplay_xcb.c',
|
||||
'xcb/gstvkwindow_xcb.c',
|
||||
'xcb/xcb_event_source.c',
|
||||
]
|
||||
vulkan_xcb_headers += [
|
||||
'xcb/gstvkdisplay_xcb.h'
|
||||
]
|
||||
|
||||
optional_deps += xcb_dep
|
||||
vulkan_windowing = true
|
||||
vulkan_conf.set10('GST_VULKAN_HAVE_WINDOW_XCB', 1)
|
||||
endif
|
||||
|
||||
wayland_client_dep = dependency('wayland-client', version : '>=1.4', required : get_option('wayland'))
|
||||
if wayland_client_dep.found()
|
||||
vulkan_sources += [
|
||||
'wayland/gstvkdisplay_wayland.c',
|
||||
'wayland/gstvkwindow_wayland.c',
|
||||
'wayland/wayland_event_source.c',
|
||||
]
|
||||
vulkan_wayland_headers += [
|
||||
'wayland/gstvkdisplay_wayland.h'
|
||||
]
|
||||
|
||||
optional_deps += wayland_client_dep
|
||||
vulkan_windowing = true
|
||||
vulkan_conf.set10('GST_VULKAN_HAVE_WINDOW_WAYLAND', 1)
|
||||
endif
|
||||
|
||||
if ['darwin', 'ios'].contains(host_system)
|
||||
objc = meson.get_compiler('objc')
|
||||
if not objc.has_argument('-fobjc-arc')
|
||||
error('ARC is required for building')
|
||||
endif
|
||||
|
||||
vulkan_objc_args += ['-fobjc-arc']
|
||||
|
||||
foundation_dep = dependency('appleframeworks', modules : ['Foundation'], required : get_option('vulkan'))
|
||||
quartzcore_dep = dependency('appleframeworks', modules : ['QuartzCore'], required : get_option('vulkan'))
|
||||
corefoundation_dep = dependency('appleframeworks', modules : ['CoreFoundation'], required : get_option('vulkan'))
|
||||
if foundation_dep.found() and quartzcore_dep.found() and corefoundation_dep.found()
|
||||
optional_deps += [foundation_dep, corefoundation_dep, quartzcore_dep]
|
||||
endif
|
||||
endif
|
||||
|
||||
if host_system == 'darwin'
|
||||
cocoa_dep = dependency('appleframeworks', modules : ['Cocoa'], required : get_option('vulkan'))
|
||||
|
||||
if cocoa_dep.found()
|
||||
vulkan_sources += [
|
||||
'cocoa/gstvkdisplay_cocoa.m',
|
||||
'cocoa/gstvkwindow_cocoa.m',
|
||||
]
|
||||
optional_deps += [cocoa_dep]
|
||||
vulkan_windowing = true
|
||||
vulkan_conf.set10('GST_VULKAN_HAVE_WINDOW_COCOA', 1)
|
||||
endif
|
||||
endif
|
||||
|
||||
if host_system == 'ios'
|
||||
uikit_dep = dependency('appleframeworks', modules : ['UIKit'], required : get_option('vulkan'))
|
||||
|
||||
if uikit_dep.found()
|
||||
vulkan_sources += [
|
||||
'ios/gstvkdisplay_ios.m',
|
||||
'ios/gstvkwindow_ios.m',
|
||||
]
|
||||
optional_deps += [uikit_dep]
|
||||
vulkan_windowing = true
|
||||
vulkan_conf.set10('GST_VULKAN_HAVE_WINDOW_IOS', 1)
|
||||
endif
|
||||
endif
|
||||
|
||||
if not vulkan_windowing
|
||||
warning('No Windowing system found. vulkansink will not work')
|
||||
endif
|
||||
|
||||
if vulkan_dep.found() and has_vulkan_header
|
||||
gen_sources = []
|
||||
|
||||
install_headers(vulkan_headers, subdir : 'gstreamer-1.0/gst/vulkan')
|
||||
install_headers(vulkan_xcb_headers, subdir : 'gstreamer-1.0/gst/vulkan/xcb')
|
||||
install_headers(vulkan_wayland_headers, subdir : 'gstreamer-1.0/gst/vulkan/wayland')
|
||||
|
||||
configure_file(input : 'gstvkconfig.h.meson',
|
||||
output : 'gstvkconfig.h',
|
||||
install_dir : join_paths(get_option('includedir'), 'gstreamer-1.0/gst/vulkan'),
|
||||
configuration : vulkan_conf)
|
||||
|
||||
vulkan_enums = gnome.mkenums_simple('vulkan-enumtypes',
|
||||
sources : vulkan_headers,
|
||||
body_prefix : '#ifdef HAVE_CONFIG_H\n#include "config.h"\n#endif',
|
||||
header_prefix : '#include <gst/vulkan/vulkan-prelude.h>',
|
||||
decorator : 'GST_VULKAN_API',
|
||||
install_header: true,
|
||||
install_dir : join_paths(get_option('includedir'), 'gstreamer-1.0/gst/vulkan'))
|
||||
vulkan_enumtypes_c = vulkan_enums[0]
|
||||
vulkan_enumtypes_h = vulkan_enums[1]
|
||||
gen_sources += [vulkan_enumtypes_h]
|
||||
|
||||
gstvulkan = library('gstvulkan-' + api_version,
|
||||
vulkan_sources, vulkan_enumtypes_c, vulkan_enumtypes_h,
|
||||
c_args : gst_plugins_bad_args + vulkan_defines + ['-DBUILDING_GST_VULKAN'],
|
||||
objc_args : gst_plugins_bad_args + vulkan_defines + vulkan_objc_args + ['-DBUILDING_GST_VULKAN'],
|
||||
include_directories : [configinc, libsinc],
|
||||
version : libversion,
|
||||
soversion : soversion,
|
||||
darwin_versions : osxversion,
|
||||
install : true,
|
||||
dependencies : [gstbase_dep, gstvideo_dep, vulkan_dep] + optional_deps)
|
||||
|
||||
if build_gir
|
||||
vulkan_gir = gnome.generate_gir(gstvulkan,
|
||||
sources : vulkan_sources + [vulkan_enumtypes_h, vulkan_enumtypes_c],
|
||||
namespace : 'GstVulkan',
|
||||
nsversion : api_version,
|
||||
identifier_prefix : 'Gst',
|
||||
symbol_prefix : 'gst',
|
||||
export_packages : 'gstreamer-vulkan-1.0',
|
||||
includes : ['Gst-1.0', 'GstBase-1.0', 'GstVideo-1.0'],
|
||||
install : true,
|
||||
extra_args : gir_init_section + ['--c-include=gst/vulkan/vulkan.h'],
|
||||
dependencies : [gstvideo_dep, gst_dep, gstbase_dep] + optional_deps
|
||||
)
|
||||
gen_sources += vulkan_gir
|
||||
endif
|
||||
|
||||
gstvulkan_dep = declare_dependency(link_with : gstvulkan,
|
||||
include_directories : [libsinc],
|
||||
sources: gen_sources,
|
||||
dependencies : [gstvideo_dep, gstbase_dep] + optional_deps)
|
||||
elif get_option('vulkan').enabled()
|
||||
error('GStreamer Vulkan integration required via options, but needed dependencies not found.')
|
||||
else
|
||||
gstvulkan_dep = dependency('', required : false)
|
||||
endif
|
|
@ -1,6 +1,7 @@
|
|||
/*
|
||||
* GStreamer
|
||||
* Copyright (C) 2015 Matthew Waters <matthew@centricular.com>
|
||||
/* GStreamer Vulkan Library
|
||||
* Copyright (C) 2019 GStreamer developers
|
||||
*
|
||||
* vulkan-prelude.h: prelude include header for gst-vulkan library
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
|
@ -17,14 +18,16 @@
|
|||
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
||||
* Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
#ifndef _VK_UTILS_PRIVATE_H_
|
||||
#define _VK_UTILS_PRIVATE_H_
|
||||
|
||||
#ifndef __GST_VULKAN_PRELUDE_H__
|
||||
#define __GST_VULKAN_PRELUDE_H__
|
||||
|
||||
#include <gst/gst.h>
|
||||
#include "vk.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
#ifdef BUILDING_GST_VULKAN
|
||||
#define GST_VULKAN_API GST_API_EXPORT /* from config.h */
|
||||
#else
|
||||
#define GST_VULKAN_API GST_API_IMPORT
|
||||
#endif
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /*_VK_UTILS_H_ */
|
||||
#endif /* __GST_VULKAN_PRELUDE_H__ */
|
|
@ -18,26 +18,25 @@
|
|||
* Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef _VK_H_
|
||||
#define _VK_H_
|
||||
#ifndef __GST_VULKAN_H__
|
||||
#define __GST_VULKAN_H__
|
||||
|
||||
#include <gst/gst.h>
|
||||
|
||||
#include "vkapi.h"
|
||||
#include <gst/vulkan/gstvkapi.h>
|
||||
#include <gst/vulkan/gstvkmacros.h>
|
||||
|
||||
#include "vkerror.h"
|
||||
#include "vkinstance.h"
|
||||
#include "vkdevice.h"
|
||||
#include "vkqueue.h"
|
||||
#include "vkfence.h"
|
||||
#include "vktrash.h"
|
||||
#include "vkdisplay.h"
|
||||
#include "vkwindow.h"
|
||||
#include "vkswapper.h"
|
||||
#include "vkmemory.h"
|
||||
#include "vkbuffermemory.h"
|
||||
#include "vkimagememory.h"
|
||||
#include "vkbufferpool.h"
|
||||
#include "vkutils.h"
|
||||
#include <gst/vulkan/gstvkerror.h>
|
||||
#include <gst/vulkan/gstvkinstance.h>
|
||||
#include <gst/vulkan/gstvkdevice.h>
|
||||
#include <gst/vulkan/gstvkqueue.h>
|
||||
#include <gst/vulkan/gstvkfence.h>
|
||||
#include <gst/vulkan/gstvkdisplay.h>
|
||||
#include <gst/vulkan/gstvkwindow.h>
|
||||
#include <gst/vulkan/gstvkmemory.h>
|
||||
#include <gst/vulkan/gstvkbuffermemory.h>
|
||||
#include <gst/vulkan/gstvkimagememory.h>
|
||||
#include <gst/vulkan/gstvkbufferpool.h>
|
||||
#include <gst/vulkan/gstvkutils.h>
|
||||
|
||||
#endif /* _VK_H_ */
|
||||
#endif /* __GST_VULKAN_H__ */
|
|
@ -18,8 +18,8 @@
|
|||
* Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef _VK_FWD_H_
|
||||
#define _VK_FWD_H_
|
||||
#ifndef __GST_VULKAN_FWD_H__
|
||||
#define __GST_VULKAN_FWD_H__
|
||||
|
||||
#include <gst/gst.h>
|
||||
|
||||
|
@ -46,12 +46,6 @@ typedef struct _GstVulkanWindow GstVulkanWindow;
|
|||
typedef struct _GstVulkanWindowClass GstVulkanWindowClass;
|
||||
typedef struct _GstVulkanWindowPrivate GstVulkanWindowPrivate;
|
||||
|
||||
typedef struct _GstVulkanSwapper GstVulkanSwapper;
|
||||
typedef struct _GstVulkanSwapperClass GstVulkanSwapperClass;
|
||||
typedef struct _GstVulkanSwapperPrivate GstVulkanSwapperPrivate;
|
||||
|
||||
typedef struct _GstVulkanTrash GstVulkanTrash;
|
||||
|
||||
typedef struct _GstVulkanFence GstVulkanFence;
|
||||
|
||||
typedef struct _GstVulkanMemory GstVulkanMemory;
|
||||
|
@ -72,4 +66,4 @@ typedef struct _GstVulkanBufferPoolPrivate GstVulkanBufferPoolPrivate;
|
|||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* _VK_FWD_H_ */
|
||||
#endif /* __GST_VULKAN_FWD_H__ */
|
|
@ -22,7 +22,8 @@
|
|||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include "wayland/vkdisplay_wayland.h"
|
||||
#include <gst/vulkan/wayland/gstvkdisplay_wayland.h>
|
||||
|
||||
#include "wayland_event_source.h"
|
||||
|
||||
GST_DEBUG_CATEGORY_STATIC (gst_vulkan_display_wayland_debug);
|
|
@ -25,13 +25,14 @@
|
|||
|
||||
#include <wayland-client.h>
|
||||
|
||||
#include <vk.h>
|
||||
#include <gst/vulkan/vulkan.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define GST_TYPE_VULKAN_DISPLAY_WAYLAND (gst_vulkan_display_wayland_get_type())
|
||||
GST_VULKAN_API
|
||||
GType gst_vulkan_display_wayland_get_type (void);
|
||||
|
||||
#define GST_TYPE_VULKAN_DISPLAY_WAYLAND (gst_vulkan_display_wayland_get_type())
|
||||
#define GST_VULKAN_DISPLAY_WAYLAND(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_VULKAN_DISPLAY_WAYLAND,GstVulkanDisplayWayland))
|
||||
#define GST_VULKAN_DISPLAY_WAYLAND_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GST_TYPE_VULKAN_DISPLAY_WAYLAND,GstVulkanDisplayWaylandClass))
|
||||
#define GST_IS_VULKAN_DISPLAY_WAYLAND(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_VULKAN_DISPLAY_WAYLAND))
|
||||
|
@ -68,11 +69,11 @@ struct _GstVulkanDisplayWaylandClass
|
|||
|
||||
#define GST_VULKAN_DISPLAY_WAYLAND_DISPLAY(display_) (GST_VULKAN_DISPLAY_WAYLAND (display_)->display)
|
||||
|
||||
GST_VULKAN_API
|
||||
GstVulkanDisplayWayland *gst_vulkan_display_wayland_new (const gchar * name);
|
||||
GST_VULKAN_API
|
||||
GstVulkanDisplayWayland *gst_vulkan_display_wayland_new_with_display (struct wl_display *display);
|
||||
|
||||
void gst_vulkan_display_wayland_roundtrip_async (GstVulkanDisplayWayland * display);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GST_VULKAN_DISPLAY_WAYLAND_H__ */
|
|
@ -26,10 +26,10 @@
|
|||
|
||||
#include <linux/input.h>
|
||||
|
||||
#include "wayland_event_source.h"
|
||||
#include <gst/vulkan/wayland/gstvkdisplay_wayland.h>
|
||||
#include "gstvkwindow_wayland.h"
|
||||
|
||||
#include "vkdisplay_wayland.h"
|
||||
#include "vkwindow_wayland.h"
|
||||
#include "wayland_event_source.h"
|
||||
|
||||
#define GST_CAT_DEFAULT gst_vulkan_window_wayland_debug
|
||||
GST_DEBUG_CATEGORY_STATIC (GST_CAT_DEFAULT);
|
|
@ -24,11 +24,13 @@
|
|||
#include <wayland-client.h>
|
||||
#include <wayland-cursor.h>
|
||||
|
||||
#include <vk.h>
|
||||
#include <gst/vulkan/vulkan.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define GST_TYPE_VULKAN_WINDOW_WAYLAND (gst_vulkan_window_wayland_get_type())
|
||||
GType gst_vulkan_window_wayland_get_type (void);
|
||||
|
||||
#define GST_VULKAN_WINDOW_WAYLAND(o) (G_TYPE_CHECK_INSTANCE_CAST((o), GST_TYPE_VULKAN_WINDOW_WAYLAND, GstVulkanWindowWayland))
|
||||
#define GST_VULKAN_WINDOW_WAYLAND_CLASS(k) (G_TYPE_CHECK_CLASS((k), GST_TYPE_VULKAN_WINDOW_WAYLAND, GstVulkanWindowWaylandClass))
|
||||
#define GST_IS_VULKAN_WINDOW_WAYLAND(o) (G_TYPE_CHECK_INSTANCE_TYPE((o), GST_TYPE_VULKAN_WINDOW_WAYLAND))
|
||||
|
@ -65,8 +67,6 @@ struct _GstVulkanWindowWaylandClass {
|
|||
gpointer _reserved[GST_PADDING];
|
||||
};
|
||||
|
||||
GType gst_vulkan_window_wayland_get_type (void);
|
||||
|
||||
GstVulkanWindowWayland * gst_vulkan_window_wayland_new (GstVulkanDisplay * display);
|
||||
|
||||
G_END_DECLS
|
|
@ -37,6 +37,8 @@
|
|||
#include <stdlib.h>
|
||||
#include <wayland-client.h>
|
||||
|
||||
#include <gst/vulkan/wayland/gstvkdisplay_wayland.h>
|
||||
|
||||
#include "wayland_event_source.h"
|
||||
|
||||
static void
|
|
@ -25,10 +25,14 @@
|
|||
|
||||
#include <wayland-client.h>
|
||||
|
||||
GSource * wayland_event_source_new (struct wl_display *display,
|
||||
struct wl_event_queue *queue);
|
||||
GSource * wayland_event_source_new (struct wl_display *display,
|
||||
struct wl_event_queue *queue);
|
||||
|
||||
G_GNUC_INTERNAL gint gst_vulkan_wl_display_roundtrip_queue (struct wl_display *display,
|
||||
struct wl_event_queue *queue);
|
||||
G_GNUC_INTERNAL
|
||||
void gst_vulkan_display_wayland_roundtrip_async (GstVulkanDisplayWayland * display);
|
||||
|
||||
G_GNUC_INTERNAL
|
||||
gint gst_vulkan_wl_display_roundtrip_queue (struct wl_display *display,
|
||||
struct wl_event_queue *queue);
|
||||
|
||||
#endif /* __WAYLAND_EVENT_SOURCE_H__ */
|
|
@ -22,7 +22,9 @@
|
|||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include "vkdisplay_xcb.h"
|
||||
#include <gst/vulkan/gstvkapi.h>
|
||||
|
||||
#include <gst/vulkan/xcb/gstvkdisplay_xcb.h>
|
||||
#include "xcb_event_source.h"
|
||||
|
||||
#define GST_CAT_DEFAULT gst_vulkan_display_debug
|
|
@ -25,15 +25,17 @@
|
|||
|
||||
#include <xcb/xcb.h>
|
||||
|
||||
#include <vk.h>
|
||||
#ifndef VK_USE_PLATFORM_XCB_KHR
|
||||
#error "VK_USE_PLATFORM_XCB_KHR not defined before including this header"
|
||||
#error "Either include vkapi.h or define VK_USE_PLATFORM_XCB_KHR before including this header"
|
||||
#endif
|
||||
#include <vulkan/vulkan.h>
|
||||
|
||||
#include <gst/vulkan/vulkan.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
GST_VULKAN_API
|
||||
GType gst_vulkan_display_xcb_get_type (void);
|
||||
|
||||
#define GST_TYPE_VULKAN_DISPLAY_XCB (gst_vulkan_display_xcb_get_type())
|
||||
|
@ -75,7 +77,9 @@ struct _GstVulkanDisplayXCBClass
|
|||
GstVulkanDisplayClass object_class;
|
||||
};
|
||||
|
||||
GST_VULKAN_API
|
||||
GstVulkanDisplayXCB * gst_vulkan_display_xcb_new (const gchar * name);
|
||||
GST_VULKAN_API
|
||||
GstVulkanDisplayXCB * gst_vulkan_display_xcb_new_with_connection (xcb_connection_t * connection,
|
||||
int screen_no);
|
||||
|
|
@ -25,8 +25,8 @@
|
|||
#include <gst/gst.h>
|
||||
#include <locale.h>
|
||||
|
||||
#include "vkwindow_xcb.h"
|
||||
#include "vkdisplay_xcb.h"
|
||||
#include "gstvkwindow_xcb.h"
|
||||
#include "gstvkdisplay_xcb.h"
|
||||
|
||||
#define GST_VULKAN_WINDOW_XCB_GET_PRIVATE(o) \
|
||||
(G_TYPE_INSTANCE_GET_PRIVATE((o), GST_TYPE_VULKAN_WINDOW_XCB, GstVulkanWindowXCBPrivate))
|
|
@ -23,7 +23,7 @@
|
|||
|
||||
#include <xcb/xcb.h>
|
||||
|
||||
#include <vk.h>
|
||||
#include <gst/vulkan/vulkan.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
|
@ -25,9 +25,12 @@
|
|||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <gst/vulkan/gstvkapi.h>
|
||||
|
||||
#include <gst/vulkan/xcb/gstvkdisplay_xcb.h>
|
||||
#include "gstvkwindow_xcb.h"
|
||||
|
||||
#include "xcb_event_source.h"
|
||||
#include "vkdisplay_xcb.h"
|
||||
#include "vkwindow_xcb.h"
|
||||
|
||||
static gint
|
||||
_compare_xcb_window (GstVulkanWindowXCB * window_xcb, xcb_window_t * window_id)
|
|
@ -22,7 +22,6 @@
|
|||
#define __VULKAN_XCB_EVENT_SOURCE_H__
|
||||
|
||||
#include <glib-object.h>
|
||||
#include "vkdisplay_xcb.h"
|
||||
|
||||
GSource *
|
||||
xcb_event_source_new (GstVulkanDisplayXCB *display_xcb);
|
12
pkgconfig/gstreamer-vulkan-uninstalled.pc.in
Normal file
12
pkgconfig/gstreamer-vulkan-uninstalled.pc.in
Normal file
|
@ -0,0 +1,12 @@
|
|||
prefix=
|
||||
exec_prefix=
|
||||
libdir=@vulkanlibdir@
|
||||
includedir=@abs_top_srcdir@/gst-libs
|
||||
|
||||
Name: GStreamer Vulkan, Uninstalled
|
||||
Description: GStreamer Vulkan support, uninstalled
|
||||
Requires: gstreamer-@GST_API_VERSION@ gstreamer-base-@GST_API_VERSION@ gstreamer-video-@GST_API_VERSION@
|
||||
Version: @VERSION@
|
||||
Libs: -L${libdir} -lgstvulkan-@GST_API_VERSION@
|
||||
Cflags: -I@abs_top_srcdir@/gst-libs -I@abs_top_builddir@/gst-libs
|
||||
|
12
pkgconfig/gstreamer-vulkan.pc.in
Normal file
12
pkgconfig/gstreamer-vulkan.pc.in
Normal file
|
@ -0,0 +1,12 @@
|
|||
prefix=@prefix@
|
||||
exec_prefix=@exec_prefix@
|
||||
libdir=@libdir@
|
||||
includedir=@includedir@/gstreamer-@GST_API_VERSION@
|
||||
|
||||
Name: GStreamer Vulkan
|
||||
Description: GStreamer Vulkan support
|
||||
Requires: gstreamer-@GST_API_VERSION@ gstreamer-base-@GST_API_VERSION@ gstreamer-video-@GST_API_VERSION@
|
||||
Version: @VERSION@
|
||||
Libs: -L${libdir} -lgstvulkan-@GST_API_VERSION@
|
||||
Cflags: -I${includedir}
|
||||
|
|
@ -37,6 +37,11 @@ pkg_libs = [
|
|||
# pkg_libs += 'wayland'
|
||||
#endif
|
||||
|
||||
if gstvulkan_dep.found()
|
||||
pkgconf.set('vulkanlibdir', join_paths(meson.build_root(), gstvulkan.outdir()))
|
||||
pkg_libs += 'vulkan'
|
||||
endif
|
||||
|
||||
foreach p : pkg_libs
|
||||
infile = 'gstreamer-@0@.pc.in'.format(p)
|
||||
outfile = 'gstreamer-@0@-@1@.pc'.format(p, api_version)
|
||||
|
|
Loading…
Reference in a new issue