Merge pull request #255 from Rafostar/fixes

Misc fixes
This commit is contained in:
Rafał Dzięgiel
2022-05-11 21:21:33 +02:00
committed by GitHub
5 changed files with 44 additions and 15 deletions

View File

@@ -43,6 +43,10 @@ if not gtk4_dep.version().version_compare('>=4.0.0')
error('GTK4 version on this system is too old')
endif
if not gir.found()
error('Cannot build lib without GIR support')
endif
if gst_gl_have_window_x11 and (gst_gl_have_platform_egl or gst_gl_have_platform_glx)
gtk_x11_dep = dependency('gtk4-x11', required: false)
if gtk_x11_dep.found()
@@ -76,6 +80,18 @@ gstclapper_mpris_gdbus = gnome.gdbus_codegen('gstclapper-mpris-gdbus',
namespace: 'GstClapperMpris'
)
gstclapper_deps = [
gtk4_dep, glib_dep, gio_dep,
gstbase_dep, gstvideo_dep, gstaudio_dep,
gsttag_dep, gstpbutils_dep, libm
] + gtk_deps
if os_unix
gstclapper_deps += giounix_dep
else
gstclapper_deps += giowin_dep
endif
gstclapper = library('gstclapper-' + api_version,
gstclapper_sources + gstclapper_mpris_gdbus,
c_args: gstclapper_defines,
@@ -84,9 +100,7 @@ gstclapper = library('gstclapper-' + api_version,
version: libversion,
install: true,
install_dir: pkglibdir,
dependencies: [gtk4_dep, glib_dep, gio_dep, giounix_dep,
gstbase_dep, gstvideo_dep, gstaudio_dep,
gsttag_dep, gstpbutils_dep, libm] + gtk_deps,
dependencies: gstclapper_deps,
)
clapper_gir = gnome.generate_gir(gstclapper,

View File

@@ -119,6 +119,8 @@ gst_clapper_importer_finalize (GObject *object)
GST_TRACE ("Finalize");
gst_clear_caps (&self->pending_caps);
gst_clear_buffer (&self->pending_buffer);
gst_clear_buffer (&self->buffer);
@@ -320,7 +322,7 @@ gst_clapper_importer_set_caps (GstClapperImporter *self, GstCaps *caps)
GstClapperImporterClass *importer_class = GST_CLAPPER_IMPORTER_GET_CLASS (self);
GST_OBJECT_LOCK (self);
self->has_pending_v_info = gst_video_info_from_caps (&self->pending_v_info, caps);
gst_caps_replace (&self->pending_caps, caps);
GST_OBJECT_UNLOCK (self);
if (importer_class->set_caps)
@@ -330,10 +332,14 @@ gst_clapper_importer_set_caps (GstClapperImporter *self, GstCaps *caps)
void
gst_clapper_importer_set_buffer (GstClapperImporter *self, GstBuffer *buffer)
{
/* Both overlays and pending buffer must be
* set within a single importer locking */
GST_OBJECT_LOCK (self);
/* Pending v_info, buffer and overlays must be
* set within a single importer locking */
if (self->pending_caps) {
self->has_pending_v_info = gst_video_info_from_caps (&self->pending_v_info, self->pending_caps);
gst_clear_caps (&self->pending_caps);
}
gst_buffer_replace (&self->pending_buffer, buffer);
gst_clapper_importer_prepare_overlays_locked (self);
@@ -380,15 +386,13 @@ gst_clapper_importer_snapshot (GstClapperImporter *self, GdkSnapshot *snapshot,
* lock ourselves to make sure everything matches */
GST_OBJECT_LOCK (self);
buffer_changed = gst_buffer_replace (&self->buffer, self->pending_buffer);
/* Only replace v_info when buffer changed, this way
* we still use old (correct) v_info when resizing */
if (buffer_changed && self->has_pending_v_info) {
if (self->has_pending_v_info) {
self->v_info = self->pending_v_info;
self->has_pending_v_info = FALSE;
}
buffer_changed = gst_buffer_replace (&self->buffer, self->pending_buffer);
/* Ref overlays associated with current buffer */
for (i = 0; i < self->pending_overlays->len; i++) {
GstClapperGdkOverlay *overlay = g_ptr_array_index (self->pending_overlays, i);

View File

@@ -49,6 +49,7 @@ struct _GstClapperImporter
{
GstObject parent;
GstCaps *pending_caps;
GstBuffer *pending_buffer, *buffer;
GPtrArray *pending_overlays, *overlays;
GstVideoInfo pending_v_info, v_info;

View File

@@ -46,8 +46,11 @@ if gst_gl_have_window_wayland and gst_gl_have_platform_egl
endif
endif
if gl_support_required and not have_gtk_gl_windowing
error('GL-based importer was enabled, but support for current GL windowing is missing')
if not have_gtk_gl_windowing
if gl_support_required
error('GL-based importer was enabled, but support for current GL windowing is missing')
endif
build_glbase = false
endif
if gst_gl_have_platform_egl

11
lib/meson.build vendored
View File

@@ -9,6 +9,8 @@ cxx = meson.get_compiler('cpp')
cdata = configuration_data()
os_unix = host_machine.system() != 'windows'
if cc.get_id() == 'msvc'
msvc_args = [
# Ignore several spurious warnings for things gstreamer does very commonly
@@ -243,7 +245,12 @@ libm = cc.find_library('m', required: false)
glib_dep = dependency('glib-2.0', version: glib_req, fallback: ['glib', 'libglib_dep'])
gmodule_dep = dependency('gmodule-2.0', fallback: ['glib', 'libgmodule_dep'])
gio_dep = dependency('gio-2.0', fallback: ['glib', 'libgio_dep'])
giounix_dep = dependency('gio-unix-2.0', version: glib_req, fallback: ['glib', 'libgiounix_dep'])
if os_unix
giounix_dep = dependency('gio-unix-2.0', version: glib_req, fallback: ['glib', 'libgio_dep'])
else
giowin_dep = dependency('gio-windows-2.0', version: glib_req, fallback : ['glib', 'libgio_dep'])
endif
cdata.set('DISABLE_ORC', 1)
cdata.set('GST_ENABLE_EXTRA_CHECKS', get_option('devel-checks'))
@@ -251,7 +258,7 @@ cdata.set('GST_ENABLE_EXTRA_CHECKS', get_option('devel-checks'))
configinc = include_directories('.')
libsinc = include_directories('gst')
gir = find_program('g-ir-scanner')
gir = find_program('g-ir-scanner', required: false)
gir_init_section = ['--add-init-section=extern void gst_init(gint*,gchar**);' + \
'g_setenv("GST_REGISTRY_1.0", "@0@", TRUE);'.format(meson.current_build_dir() + '/gir_empty_registry.reg') + \
'g_setenv("GST_PLUGIN_PATH_1_0", "", TRUE);' + \