diff --git a/Mk/bsd.gstreamer.mk b/Mk/bsd.gstreamer.mk index 8e77a7d4c771..c6009f416a50 100644 --- a/Mk/bsd.gstreamer.mk +++ b/Mk/bsd.gstreamer.mk @@ -1,558 +1,562 @@ #-*- tab-width: 4; -*- # ex:ts=4 # # bsd.gstreamer.mk - Support for gstreamer-plugins-based ports. # # Created by: Michael Johnson .if !defined(_POSTMKINCLUDED) && !defined(Gstreamer_Pre_Include) Gstreamer_Include_MAINTAINER= multimedia@FreeBSD.org Gstreamer_Pre_Include= bsd.gstreamer.mk .endif # Ports can use the following: # # For Gstreamer 1.x the same rules apply but instead of # USE_GSTREAMER=, USE_GSTREAMER1= is used. # # If you want to use USE_GSTREAMER after # you must follow one of the examples listed below # # .include # .if defined(WITH_VORBIS) # USE_GSTREAMER= vorbis # .endif # # or # USE_GSTREAMER= yes # .include # .if defined(WITH_FAAD) # USE_GSTREAMER+= faad # .endif # .include # # USE_GSTREAMER=yes will always add a dependency to # gstreamer-plugins # # "Normal" dependencies and variables # GSTREAMER1_PORT= ${PORTSDIR}/multimedia/gstreamer1-plugins _GST1_LIB_BASE= ${LOCALBASE}/lib/gstreamer-${GST1_VERSION} GST1_VERSION= 1.4 GST1_MINOR_VERSION= .0 GST1_SHLIB_VERSION= 0 GST1_MINIMAL_VERSION= .0 # These are the current supported gstreamer-plugins modules: # Supported plugins by both 0.10 and 1.0. _GSTREAMER_PLUGINS= \ a52dec \ aalib \ amrnb \ amrwbdec \ cairo \ cdio \ cdparanoia \ dts \ dv \ faac \ faad \ flac \ flite \ gdkpixbuf \ gl \ gme \ gnonlin \ gsm \ jack \ jpeg \ ladspa \ lame \ libcaca \ libmms \ libvisual \ mpeg2dec \ mpeg2enc \ musepack \ neon \ ogg \ opus \ pango \ pulse \ resindvd \ shout2 \ sndfile \ sndio \ sidplay \ soundtouch \ soup \ speex \ taglib \ theora \ twolame \ v4l2 \ vorbis \ wavpack \ x264 # plugins only in 1.0 .if defined(USE_GSTREAMER1) _GSTREAMER_PLUGINS+= \ aom \ assrender \ bs2b \ chromaprint \ curl \ dash \ dtls \ dvdread \ editing-services \ gtk \ + gtk4 \ hls \ kate \ kms \ libav \ libde265 \ lv2 \ mm \ modplug \ mpg123 \ mplex \ opencv \ openexr \ openh264 \ openjpeg \ openmpt \ png \ qt \ rsvg \ rtmp \ smoothstreaming \ spandsp \ srtp \ ttml \ vpx \ vulkan \ webp \ webrtcdsp \ x \ x265 \ ximagesrc \ zbar # vaapi .endif # USE_GSTREAMER1 # other plugins _USE_GSTREAMER_ALL= bad core good ugly yes ${_GSTREAMER_PLUGINS} #--------------------------------------------------------------------------# core_DEPENDS= multimedia/gstreamer-plugins-core core_IMPL= # yes_DEPENDS= multimedia/gstreamer-plugins yes_NAME= gstreamer-plugins yes_NAME10= gstreamer1-plugins yes_GST_PREFIX= # empty yes_IMPL= # empty # XXX check if IMPL is correct for both 0.10 and 1.0 #-- audio plugins section -------------------------------------------------# # Audio Plugins Section a52dec_DEPENDS= audio/gstreamer-plugins-a52dec a52dec_IMPL= ugly amrnb_DEPENDS= audio/gstreamer-plugins-amrnb amrnb_IMPL= ugly amrwbdec_DEPENDS= audio/gstreamer-plugins-amrwbdec amrwbdec_IMPL= ugly bs2b_DEPENDS= audio/gstreamer-plugins-bs2b bs2b_IMPL= bad cdparanoia_DEPENDS= audio/gstreamer-plugins-cdparanoia cdparanoia_IMPL= # chromaprint_DEPENDS= audio/gstreamer-plugins-chromaprint chromeprint_IMPL= bad faac_DEPENDS= audio/gstreamer-plugins-faac faac_IMPL= bad faad_DEPENDS= audio/gstreamer-plugins-faad faad_IMPL= bad flac_DEPENDS= audio/gstreamer-plugins-flac flac_IMPL= good flite_DEPENDS= audio/gstreamer-plugins-flite flite_IMPL= bad gme_DEPENDS= audio/gstreamer-plugins-gme gme_IMPL= bad gsm_DEPENDS= audio/gstreamer-plugins-gsm gsm_IMPL= bad hal_DEPENDS= sysutils/gstreamer-plugins-hal hal_IMPL= good jack_DEPENDS= audio/gstreamer-plugins-jack jack_IMPL= good ladspa_DEPENDS= audio/gstreamer-plugins-ladspa ladspa_IMPL= bad lame_DEPENDS= audio/gstreamer-plugins-lame lame_IMPL= ugly lv2_DEPENDS= audio/gstreamer-plugins-lv2 lv2_IMPL= bad modplug_DEPENDS= audio/gstreamer-plugins-modplug modplug_IMPL= bad mpg123_DEPENDS= audio/gstreamer-plugins-mpg123 mpg123_IMPL= ugly musepack_DEPENDS= audio/gstreamer-plugins-musepack musepack_IMPL= bad neon_DEPENDS= www/gstreamer-plugins-neon neon_IMPL= bad ogg_DEPENDS= audio/gstreamer-plugins-ogg ogg_IMPL= # opus_DEPENDS= audio/gstreamer-plugins-opus opus_IMPL= # pulse_DEPENDS= audio/gstreamer-plugins-pulse pulse_IMPL= good shout2_DEPENDS= audio/gstreamer-plugins-shout2 shout2_IMPL= good sidplay_DEPENDS= audio/gstreamer-plugins-sidplay sidplay_IMPL= ugly sndio_DEPENDS= audio/gstreamer-plugins-sndio sndio_IMPL= # sndfile_DEPENDS= audio/gstreamer-plugins-sndfile sndfile_IMPL= bad soundtouch_DEPENDS= audio/gstreamer-plugins-soundtouch soundtouch_IMPL= bad speex_DEPENDS= audio/gstreamer-plugins-speex speex_IMPL= good taglib_DEPENDS= audio/gstreamer-plugins-taglib taglib_IMPL= good twolame_DEPENDS= audio/gstreamer-plugins-twolame twolame_IMPL= ugly vorbis_DEPENDS= audio/gstreamer-plugins-vorbis vorbis_IMPL= # wavpack_DEPENDS= audio/gstreamer-plugins-wavpack wavpack_IMPL= good webrtcdsp_DEPENDS= audio/gstreamer-plugins-webrtcdsp webrtcdsp_IMPL= bad #-- comms plugin section --------------------------------------------------# spandsp_DEPENDS= comms/gstreamer-plugins-spandsp spandsp_IMPL= bad #-- devel plugin section --------------------------------------------------# soup_DEPENDS= devel/gstreamer-plugins-soup soup_IMPL= good #-- ftp plugin section ----------------------------------------------------# curl_DEPENDS= ftp/gstreamer-plugins-curl curl_IMPL= bad #-- graphics plugin section -----------------------------------------------# aalib_DEPENDS= graphics/gstreamer-plugins-aalib aalib_IMPL= good aom_DEPENDS= multimedia/gstreamer-plugins-aom aom_IMPL= bad assrender_DEPENDS= multimedia/gstreamer-plugins-assrender assrender_IMPL= bad cairo_DEPENDS= graphics/gstreamer-plugins-cairo cairo_IMPL= good gdkpixbuf_DEPENDS= graphics/gstreamer-plugins-gdkpixbuf gdkpixbuf_IMPL= good gl_DEPENDS= graphics/gstreamer-plugins-gl gl_IMPL= bad jpeg_DEPENDS= graphics/gstreamer-plugins-jpeg jpeg_IMPL= good kms_DEPENDS= graphics/gstreamer-plugins-kms kms_IMPL= bad libcaca_DEPENDS= graphics/gstreamer-plugins-libcaca libcaca_IMPL= good libvisual_DEPENDS= graphics/gstreamer-plugins-libvisual libvisual_IMPL= # opencv_DEPENDS= graphics/gstreamer-plugins-opencv opencv_IMPL= bad openexr_DEPENDS= graphics/gstreamer-plugins-openexr openexr_IMPL= bad openjpeg_DEPENDS= graphics/gstreamer-plugins-openjpeg openjpeg_IMPL= bad openmpt_DEPENDS= audio/gstreamer-plugins-openmpt openmpt_IMPL= bad png_DEPENDS= graphics/gstreamer-plugins-png png_IMPL= good qt_DEPENDS= graphics/gstreamer-plugins-qt qt_IMPL= good rsvg_DEPENDS= graphics/gstreamer-plugins-rsvg rsvg_IMPL= bad webp_DEPENDS= graphics/gstreamer-plugins-webp webp_IMPL= bad zbar_DEPENDS= graphics/gstreamer-plugins-zbar zbar_IMPL= bad #-- multimedia plugins section --------------------------------------------# bad_DEPENDS= multimedia/gstreamer-plugins-bad bad_IMPL= # dash_DEPENDS= multimedia/gstreamer-plugins-dash dash_IMPL= bad dvdread_DEPENDS= multimedia/gstreamer-plugins-dvdread dvdread_IMPL= ugly editing-services_DEPENDS= multimedia/gstreamer-editing-services editing-services_GST_PREFIX= gstreamer1- editing-services_GST_SUFX= # empty editing-services_GST_VERSION= 1.0.0 editing-services_IMPL= # dts_DEPENDS= multimedia/gstreamer-plugins-dts dts_IMPL= bad dv_DEPENDS= multimedia/gstreamer-plugins-dv dv_IMPL= good dvd_DEPENDS= multimedia/gstreamer-plugins-dvd dvd_IMPL= ugly good_DEPENDS= multimedia/gstreamer-plugins-good good_IMPL= # gnonlin_DEPENDS= multimedia/gstreamer-plugins-gnonlin gnonlin_IMPL= good hls_DEPENDS= multimedia/gstreamer-plugins-hls hls_IMPL= bad kate_DEPENDS= multimedia/gstreamer-plugins-kate kate_IMPL= bad libav_DEPENDS= multimedia/gstreamer-libav libav_GST_PREFIX= gstreamer1- libav_GST_SUFX= # empty libav_GST_VERSION= 1.0.0 libav_IMPL= # libde265_DEPENDS= multimedia/gstreamer-plugins-libde265 libde265_IMPL= bad mm_DEPENDS= multimedia/gstreamermm mm_GST_PREFIX= gstreamer mm_GST_SUFX= # empty mm_GST_VERSION= 1.10.0 mm_IMPL= # mpeg2dec_DEPENDS= multimedia/gstreamer-plugins-mpeg2dec mpeg2dec_IMPL= ugly mpeg2enc_DEPENDS= multimedia/gstreamer-plugins-mpeg2enc mpeg2enc_IMPL= bad mplex_DEPENDS= multimedia/gstreamer-plugins-mplex mplex_IMPL= bad openh264_DEPENDS= multimedia/gstreamer-plugins-openh264 openh264_IMPL= bad rtmp_DEPENDS= multimedia/gstreamer-plugins-rtmp rtmp_IMPL= bad smoothstreaming_DEPENDS= multimedia/gstreamer-plugins-smoothstreaming smoothstreaming_IMPL= bad ttml_DEPENDS= multimedia/gstreamer-plugins-ttml ttml_IMPL= bad v4l2_DEPENDS= multimedia/gstreamer-plugins-v4l2 v4l2_IMPL= good # hmmm vaapi_DEPENDS= multimedia/gstreamer-vaapi vaapi_IMPL= bad vpx_DEPENDS= multimedia/gstreamer-plugins-vpx vpx_IMPL= good vulkan_DEPENDS= graphics/gstreamer-plugins-vulkan vulkan_IMPL= bad resindvd_DEPENDS= multimedia/gstreamer-plugins-resindvd resindvd_IMPL= bad theora_DEPENDS= multimedia/gstreamer-plugins-theora theora_IMPL= # ugly_DEPENDS= multimedia/gstreamer-plugins-ugly ugly_IMPL= # x264_DEPENDS= multimedia/gstreamer-plugins-x264 x264_IMPL= ugly x265_DEPENDS= multimedia/gstreamer-plugins-x265 x265_IMPL= bad #-- Net Plugins Section ---------------------------------------------------# libmms_DEPENDS= net/gstreamer-plugins-libmms libmms_IMPL= bad srtp_DEPENDS= net/gstreamer-plugins-srtp srtp_IMPL= bad #-- security plugins section ----------------------------------------------# dtls_DEPENDS= security/gstreamer-plugins-dtls dtls_IMPL= bad #-- sysutils plugins section ----------------------------------------------# cdio_DEPENDS= sysutils/gstreamer-plugins-cdio cdio_IMPL= ugly #-- x11 plugins section ---------------------------------------------------# x_DEPENDS= x11/gstreamer-plugins-x x_IMPL= # ximagesrc_DEPENDS= x11/gstreamer-plugins-ximagesrc ximagesrc_IMPL= good #-- x11-toolkits plugins section ------------------------------------------# gtk_DEPENDS= x11-toolkits/gstreamer-plugins-gtk gtk_IMPL= bad +gtk4_DEPENDS= x11-toolkits/gstreamer-plugins-gtk4 +gtk4_IMPL= good + pango_DEPENDS= x11-toolkits/gstreamer-plugins-pango pango_IMPL= # #--------------------------------------------------------------------------# .if defined(_POSTMKINCLUDED) && !defined(Gstreamer_Post_Include) Gstreamer_Post_Include= bsd.gstreamer.mk .if (defined (USE_GSTREAMER) && defined(USE_GSTREAMER1)) IGNORE= USE_GSTREAMER and USE_GSTREAMER1 can't be used together .endif _GST_IMPL_LIST:= # .if defined(USE_GSTREAMER) # update this with the gst 1.0 version below . for ext in ${USE_GSTREAMER} ${ext}_GST_PREFIX?= gstreamer-plugins- ${ext}_GST_VERSION?= ${GST_VERSION}${GST_MINOR_VERSION} ${ext}_NAME?= ${ext} . if ${_USE_GSTREAMER_ALL:M${ext}}!= "" && exists(${PORTSDIR}/${${ext}_DEPENDS}) _GST_BUILD_DEPENDS+= ${${ext}_GST_PREFIX}${${ext}_NAME}>=${${ext}_GST_VERSION}:${${ext}_DEPENDS} _GST_RUN_DEPENDS+= ${${ext}_GST_PREFIX}${${ext}_NAME}>=${${ext}_GST_VERSION}:${${ext}_DEPENDS} _GST_GST_IMPL_LIST+= ${${ext}_IMPL} . else IGNORE= cannot install: unknown gstreamer ${GST_VERSION} plugin -- ${ext} . endif . endfor # everything wants this _GST_BUILD_DEPENDS+= gstreamer-plugins>=0:multimedia/gstreamer-plugins _GST_LIB_DEPENDS+= libgstreamer-0.10.so:multimedia/gstreamer _GST_RUN_DEPENDS+= gstreamer-plugins>=0:multimedia/gstreamer-plugins . for plugin in ${_GST_IMPL_LIST:O:u} _GST_BUILD_DEPENDS+= gstreamer-plugins-${plugin}>=0:multimedia/gstreamer-plugins-${plugin} _GST_RUN_DEPENDS+= gstreamer-plugins-${plugin}>=0:multimedia/gstreamer-plugins-${plugin} . endfor BUILD_DEPENDS+= ${_GST_BUILD_DEPENDS:O:u} LIB_DEPENDS+= ${_GST_LIB_DEPENDS:O:u} RUN_DEPENDS+= ${_GST_RUN_DEPENDS:O:u} .endif .if defined(USE_GSTREAMER1) . for ext in ${USE_GSTREAMER1} ${ext}_GST_PREFIX?= gstreamer1-plugins- ${ext}_GST_VERSION?= ${GST1_VERSION} ${ext}_NAME10?= ${ext} ${ext}_GST_DEPENDS?= ${${ext}_DEPENDS:S,gstreamer-,gstreamer1-,} . if ${_USE_GSTREAMER_ALL:M${ext}}!= "" && exists(${PORTSDIR}/${${ext}_GST_DEPENDS}) _GST_BUILD_DEPENDS+= ${${ext}_GST_PREFIX}${${ext}_NAME10}>=${${ext}_GST_VERSION}:${${ext}_GST_DEPENDS} _GST_RUN_DEPENDS+= ${${ext}_GST_PREFIX}${${ext}_NAME10}>=${${ext}_GST_VERSION}:${${ext}_GST_DEPENDS} . if defined(${ext}1_IMPL) _GST_IMPL_LIST+= ${${ext}1_IMPL} . else _GST_IMPL_LIST+= ${${ext}_IMPL} . endif . else IGNORE= cannot install: unknown gstreamer ${GST1_VERSION} plugin -- ${ext} . endif . endfor # everything wants this _GST_BUILD_DEPENDS+= gstreamer1-plugins>=${GST1_VERSION}:multimedia/gstreamer1-plugins _GST_LIB_DEPENDS+= libgstreamer-1.0.so:multimedia/gstreamer1 _GST_RUN_DEPENDS+= gstreamer1-plugins>=${GST1_VERSION}:multimedia/gstreamer1-plugins . for plugin in ${_GST_IMPL_LIST:O:u} _GST_BUILD_DEPENDS+= gstreamer1-plugins-${plugin}>=${GST1_VERSION}:multimedia/gstreamer1-plugins-${plugin} _GST_RUN_DEPENDS+= gstreamer1-plugins-${plugin}>=${GST1_VERSION}:multimedia/gstreamer1-plugins-${plugin} . endfor BUILD_DEPENDS+= ${_GST_BUILD_DEPENDS:O:u} LIB_DEPENDS+= ${_GST_LIB_DEPENDS:O:u} RUN_DEPENDS+= ${_GST_RUN_DEPENDS:O:u} .endif # The End .endif diff --git a/x11-toolkits/Makefile b/x11-toolkits/Makefile index 4c1274243d7b..a0a801bfc0e7 100644 --- a/x11-toolkits/Makefile +++ b/x11-toolkits/Makefile @@ -1,236 +1,237 @@ COMMENT = X11 toolkits SUBDIR += SoXt SUBDIR += Xaw3d SUBDIR += Xmt SUBDIR += amtk SUBDIR += blt SUBDIR += bwidget SUBDIR += color-widgets-qt5 SUBDIR += ctk SUBDIR += fltk SUBDIR += fox14 SUBDIR += fox16 SUBDIR += fox17 SUBDIR += fpc-gtk2 SUBDIR += fpc-xforms SUBDIR += fxscintilla SUBDIR += gdl SUBDIR += girara SUBDIR += gnocl SUBDIR += gnome-pty-helper SUBDIR += gnustep-back SUBDIR += gnustep-gui SUBDIR += granite SUBDIR += gstreamer1-plugins-gtk + SUBDIR += gstreamer1-plugins-gtk4 SUBDIR += gstreamer1-plugins-pango SUBDIR += gtk-layer-shell SUBDIR += gtk-sharp-beans SUBDIR += gtk-sharp20 SUBDIR += gtk-sharp30 SUBDIR += gtk20 SUBDIR += gtk30 SUBDIR += gtk40 SUBDIR += gtkada SUBDIR += gtkada3 SUBDIR += gtkd SUBDIR += gtkdatabox SUBDIR += gtkextra SUBDIR += gtkglarea2 SUBDIR += gtkglext SUBDIR += gtkglextmm SUBDIR += gtkimageview SUBDIR += gtkmathview SUBDIR += gtkmm24 SUBDIR += gtkmm30 SUBDIR += gtksourceview2 SUBDIR += gtksourceview3 SUBDIR += gtksourceview4 SUBDIR += gtksourceviewmm3 SUBDIR += guile-gnome-platform SUBDIR += irrlicht SUBDIR += itk SUBDIR += iwidgets SUBDIR += kf5-attica SUBDIR += kf5-kcompletion SUBDIR += kf5-kconfigwidgets SUBDIR += kf5-kdesignerplugin SUBDIR += kf5-kguiaddons SUBDIR += kf5-kirigami2 SUBDIR += kf5-kitemviews SUBDIR += kf5-kjobwidgets SUBDIR += kf5-ktextwidgets SUBDIR += kf5-kwidgetsaddons SUBDIR += kf5-kxmlgui SUBDIR += kproperty SUBDIR += lesstif SUBDIR += libXaw SUBDIR += libXmu SUBDIR += libXt SUBDIR += libadwaita SUBDIR += libdazzle SUBDIR += libdecor SUBDIR += libgdiplus SUBDIR += libhandy SUBDIR += libhandy0 SUBDIR += libsexy SUBDIR += libunique3 SUBDIR += libwnck SUBDIR += libwnck3 SUBDIR += libxaw3dxft SUBDIR += linux-c7-gtk2 SUBDIR += linux-c7-gtk3 SUBDIR += linux-c7-openmotif SUBDIR += linux-c7-pango SUBDIR += linux-c7-qt-x11 SUBDIR += linux-c7-tk85 SUBDIR += movingmotif SUBDIR += mowitz SUBDIR += mygui SUBDIR += mygui-dummy SUBDIR += mygui-ogre SUBDIR += mygui-opengl SUBDIR += nanogui SUBDIR += neXtaw SUBDIR += ntk SUBDIR += nuklear SUBDIR += ocaml-lablgtk2 SUBDIR += ocaml-labltk SUBDIR += open-motif SUBDIR += osm-gps-map SUBDIR += otk SUBDIR += p5-Alien-wxWidgets SUBDIR += p5-Glade2 SUBDIR += p5-Gtk2 SUBDIR += p5-Gtk2-Chmod SUBDIR += p5-Gtk2-Ex-Dialogs SUBDIR += p5-Gtk2-Ex-FormFactory SUBDIR += p5-Gtk2-Ex-PodViewer SUBDIR += p5-Gtk2-Ex-Simple-List SUBDIR += p5-Gtk2-Ex-Utils SUBDIR += p5-Gtk2-GladeXML SUBDIR += p5-Gtk2-ImageView SUBDIR += p5-Gtk2-PathButtonBar SUBDIR += p5-Gtk2-TrayIcon SUBDIR += p5-Gtk3 SUBDIR += p5-Gtk3-ImageView SUBDIR += p5-Gtk3-SimpleList SUBDIR += p5-Pango SUBDIR += p5-Prima SUBDIR += p5-Tk SUBDIR += p5-Tk-Action SUBDIR += p5-Tk-Autoscroll SUBDIR += p5-Tk-ColourChooser SUBDIR += p5-Tk-Contrib SUBDIR += p5-Tk-CursorControl SUBDIR += p5-Tk-DKW SUBDIR += p5-Tk-Date SUBDIR += p5-Tk-DynaTabFrame SUBDIR += p5-Tk-Enscript SUBDIR += p5-Tk-FileDialog SUBDIR += p5-Tk-FontDialog SUBDIR += p5-Tk-GBARR SUBDIR += p5-Tk-Getopt SUBDIR += p5-Tk-HistEntry SUBDIR += p5-Tk-JComboBox SUBDIR += p5-Tk-ResizeButton SUBDIR += p5-Tk-Role-Dialog SUBDIR += p5-Tk-Role-HasWidgets SUBDIR += p5-Tk-Splashscreen SUBDIR += p5-Tk-Sugar SUBDIR += p5-Tk-TableMatrix SUBDIR += p5-Tk-ToolBar SUBDIR += p5-Tk-WaitBox SUBDIR += pango SUBDIR += pangolin SUBDIR += pangomm SUBDIR += pangox-compat SUBDIR += pangoxsl SUBDIR += plasma5-kdeplasma-addons SUBDIR += plib SUBDIR += py-AnyQt SUBDIR += py-Pmw SUBDIR += py-easygui SUBDIR += py-fltk SUBDIR += py-guietta SUBDIR += py-qt5-chart SUBDIR += py-qt5-gui SUBDIR += py-qt5-quick SUBDIR += py-qt5-quick3d SUBDIR += py-qt5-quickwidgets SUBDIR += py-qt5-widgets SUBDIR += py-tkinter SUBDIR += py-tktreectrl SUBDIR += py-wxPython40 SUBDIR += py-xlib SUBDIR += qml-box2d SUBDIR += qt5-charts SUBDIR += qt5-datavis3d SUBDIR += qt5-declarative SUBDIR += qt5-gamepad SUBDIR += qt5-gui SUBDIR += qt5-quick3d SUBDIR += qt5-quickcontrols SUBDIR += qt5-quickcontrols2 SUBDIR += qt5-quicktimeline SUBDIR += qt5-uiplugin SUBDIR += qt5-virtualkeyboard SUBDIR += qt5-widgets SUBDIR += qt5pas SUBDIR += qtermwidget SUBDIR += qwt5-qt5 SUBDIR += qwt6 SUBDIR += redkite SUBDIR += rep-gtk2 SUBDIR += rubygem-gdk3 SUBDIR += rubygem-gdk4 SUBDIR += rubygem-gtk2 SUBDIR += rubygem-gtk3 SUBDIR += rubygem-gtk4 SUBDIR += rubygem-gtksourceview2 SUBDIR += rubygem-gtksourceview3 SUBDIR += rubygem-gtksourceview4 SUBDIR += rubygem-pango SUBDIR += rubygem-poppler SUBDIR += rubygem-tk SUBDIR += rubygem-uh SUBDIR += rubygem-vte SUBDIR += rubygem-vte3 SUBDIR += scintilla SUBDIR += sdl_pango SUBDIR += shared-desktop-ontologies SUBDIR += skinlf SUBDIR += soqt SUBDIR += swt SUBDIR += tepl SUBDIR += tepl6 SUBDIR += termit SUBDIR += tix SUBDIR += tk-wrapper SUBDIR += tk85 SUBDIR += tk86 SUBDIR += tk87 SUBDIR += tkdnd SUBDIR += tkshape SUBDIR += tktable SUBDIR += tktray SUBDIR += tktreectrl SUBDIR += unique SUBDIR += vdk SUBDIR += viewklass SUBDIR += vte SUBDIR += vte3 SUBDIR += wlroots SUBDIR += wmapp SUBDIR += wxgtk28 SUBDIR += wxgtk28-common SUBDIR += wxgtk28-contrib SUBDIR += wxgtk28-contrib-common SUBDIR += wxgtk30 SUBDIR += wxgtk31 SUBDIR += xbae SUBDIR += xforms SUBDIR += xmhtml SUBDIR += ztoolkit .include diff --git a/x11-toolkits/gstreamer1-plugins-gtk4/Makefile b/x11-toolkits/gstreamer1-plugins-gtk4/Makefile new file mode 100644 index 000000000000..61882b85e10e --- /dev/null +++ b/x11-toolkits/gstreamer1-plugins-gtk4/Makefile @@ -0,0 +1,20 @@ +PORTNAME= gstreamer1-plugins-gtk4 +DISTVERSION= 1.16.2 +CATEGORIES= x11-toolkits +MASTER_SITES= GNOME/sources/${DISTNAME:S/-${DISTVERSION}/\/${DISTVERSION:R}/} \ + https://gstreamer.freedesktop.org/src/${DISTNAME:S/-${DISTVERSION}//}/ +DISTNAME= gst-plugins-good-${DISTVERSION} + +MAINTAINER= jbeich@FreeBSD.org +COMMENT= GStreamer GTK4 video sink plugin + +LICENSE= LGPL21+ +LICENSE_FILE= ${WRKSRC}/COPYING + +USES= compiler:c11 gnome meson pkgconfig tar:xz +USE_GNOME= cairo gtk40 +USE_GSTREAMER1= gl +MESON_ARGS= --auto-features=disabled -Dgtk4=enabled +PLIST_FILES= lib/gstreamer-1.0/libgstgtk4.so + +.include diff --git a/x11-toolkits/gstreamer1-plugins-gtk4/distinfo b/x11-toolkits/gstreamer1-plugins-gtk4/distinfo new file mode 100644 index 000000000000..c4d7ce4bad12 --- /dev/null +++ b/x11-toolkits/gstreamer1-plugins-gtk4/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1575371194 +SHA256 (gst-plugins-good-1.16.2.tar.xz) = 40bb3bafda25c0b739c8fc36e48380fccf61c4d3f83747e97ac3f9b0171b1319 +SIZE (gst-plugins-good-1.16.2.tar.xz) = 3897172 diff --git a/x11-toolkits/gstreamer1-plugins-gtk4/files/patch-gtk4 b/x11-toolkits/gstreamer1-plugins-gtk4/files/patch-gtk4 new file mode 100644 index 000000000000..8b1fe8e0a512 --- /dev/null +++ b/x11-toolkits/gstreamer1-plugins-gtk4/files/patch-gtk4 @@ -0,0 +1,1145 @@ +https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/767 + +--- ext/gtk/gstgtkbasesink.c.orig 2019-12-03 11:06:37 UTC ++++ ext/gtk/gstgtkbasesink.c +@@ -1,6 +1,7 @@ + /* + * GStreamer + * Copyright (C) 2015 Matthew Waters ++ * Copyright (C) 2020 Rafał Dzięgiel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public +@@ -77,7 +78,7 @@ G_DEFINE_ABSTRACT_TYPE_WITH_CODE (GstGtkBaseSink, gst_ + G_IMPLEMENT_INTERFACE (GST_TYPE_NAVIGATION, + gst_gtk_base_sink_navigation_interface_init); + GST_DEBUG_CATEGORY_INIT (gst_debug_gtk_base_sink, +- "gtkbasesink", 0, "Gtk Video Sink base class")); ++ "gtkbasesink", 0, "GTK Video Sink base class")); + + + static void +@@ -97,7 +98,7 @@ gst_gtk_base_sink_class_init (GstGtkBaseSinkClass * kl + gobject_class->get_property = gst_gtk_base_sink_get_property; + + g_object_class_install_property (gobject_class, PROP_WIDGET, +- g_param_spec_object ("widget", "Gtk Widget", ++ g_param_spec_object ("widget", "GTK Widget", + "The GtkWidget to place in the widget hierarchy " + "(must only be get from the GTK main thread)", + GTK_TYPE_WIDGET, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); +@@ -114,10 +115,13 @@ gst_gtk_base_sink_class_init (GstGtkBaseSinkClass * kl + "The pixel aspect ratio of the device", DEFAULT_PAR_N, DEFAULT_PAR_D, + G_MAXINT, 1, 1, 1, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + ++ /* Disabling alpha was removed in GTK4 */ ++#if !defined(BUILD_FOR_GTK4) + g_object_class_install_property (gobject_class, PROP_IGNORE_ALPHA, + g_param_spec_boolean ("ignore-alpha", "Ignore Alpha", + "When enabled, alpha will be ignored and converted to black", + DEFAULT_IGNORE_ALPHA, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); ++#endif + + gobject_class->finalize = gst_gtk_base_sink_finalize; + +@@ -144,6 +148,8 @@ gst_gtk_base_sink_finalize (GObject * object) + { + GstGtkBaseSink *gtk_sink = GST_GTK_BASE_SINK (object); + ++ GST_DEBUG ("finalizing base sink"); ++ + GST_OBJECT_LOCK (gtk_sink); + if (gtk_sink->window && gtk_sink->window_destroy_id) + g_signal_handler_disconnect (gtk_sink->window, gtk_sink->window_destroy_id); +@@ -168,6 +174,14 @@ static void + window_destroy_cb (GtkWidget * widget, GstGtkBaseSink * gtk_sink) + { + GST_OBJECT_LOCK (gtk_sink); ++ if (gtk_sink->widget) { ++ if (gtk_sink->widget_destroy_id) { ++ g_signal_handler_disconnect (gtk_sink->widget, ++ gtk_sink->widget_destroy_id); ++ gtk_sink->widget_destroy_id = 0; ++ } ++ g_clear_object (>k_sink->widget); ++ } + gtk_sink->window = NULL; + GST_OBJECT_UNLOCK (gtk_sink); + } +@@ -180,7 +194,11 @@ gst_gtk_base_sink_get_widget (GstGtkBaseSink * gtk_sin + + /* Ensure GTK is initialized, this has no side effect if it was already + * initialized. Also, we do that lazily, so the application can be first */ +- if (!gtk_init_check (NULL, NULL)) { ++ if (!gtk_init_check ( ++#if !defined(BUILD_FOR_GTK4) ++ NULL, NULL ++#endif ++ )) { + GST_ERROR_OBJECT (gtk_sink, "Could not ensure GTK initialization."); + return NULL; + } +@@ -195,13 +213,16 @@ gst_gtk_base_sink_get_widget (GstGtkBaseSink * gtk_sin + gtk_sink->bind_pixel_aspect_ratio = + g_object_bind_property (gtk_sink, "pixel-aspect-ratio", gtk_sink->widget, + "pixel-aspect-ratio", G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE); ++#if !defined(BUILD_FOR_GTK4) + gtk_sink->bind_ignore_alpha = + g_object_bind_property (gtk_sink, "ignore-alpha", gtk_sink->widget, + "ignore-alpha", G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE); ++#endif + + /* Take the floating ref, other wise the destruction of the container will + * make this widget disapear possibly before we are done. */ + gst_object_ref_sink (gtk_sink->widget); ++ + gtk_sink->widget_destroy_id = g_signal_connect (gtk_sink->widget, "destroy", + G_CALLBACK (widget_destroy_cb), gtk_sink); + +@@ -311,25 +332,55 @@ gst_gtk_base_sink_start_on_main (GstBaseSink * bsink) + GstGtkBaseSink *gst_sink = GST_GTK_BASE_SINK (bsink); + GstGtkBaseSinkClass *klass = GST_GTK_BASE_SINK_GET_CLASS (bsink); + GtkWidget *toplevel; ++#if defined(BUILD_FOR_GTK4) ++ GtkRoot *root; ++#endif + + if (gst_gtk_base_sink_get_widget (gst_sink) == NULL) + return FALSE; + + /* After this point, gtk_sink->widget will always be set */ + ++#if defined(BUILD_FOR_GTK4) ++ root = gtk_widget_get_root (GTK_WIDGET (gst_sink->widget)); ++ if (!GTK_IS_ROOT (root)) { ++ GtkWidget *parent = gtk_widget_get_parent (GTK_WIDGET (gst_sink->widget)); ++ if (parent) { ++ GtkWidget *temp_parent; ++ while ((temp_parent = gtk_widget_get_parent (parent))) ++ parent = temp_parent; ++ } ++ toplevel = (parent) ? parent : GTK_WIDGET (gst_sink->widget); ++#else + toplevel = gtk_widget_get_toplevel (GTK_WIDGET (gst_sink->widget)); + if (!gtk_widget_is_toplevel (toplevel)) { ++#endif + /* sanity check */ + g_assert (klass->window_title); + + /* User did not add widget its own UI, let's popup a new GtkWindow to + * make gst-launch-1.0 work. */ +- gst_sink->window = gtk_window_new (GTK_WINDOW_TOPLEVEL); ++ gst_sink->window = gtk_window_new ( ++#if !defined(BUILD_FOR_GTK4) ++ GTK_WINDOW_TOPLEVEL ++#endif ++ ); + gtk_window_set_default_size (GTK_WINDOW (gst_sink->window), 640, 480); + gtk_window_set_title (GTK_WINDOW (gst_sink->window), klass->window_title); +- gtk_container_add (GTK_CONTAINER (gst_sink->window), toplevel); +- gst_sink->window_destroy_id = g_signal_connect (gst_sink->window, "destroy", +- G_CALLBACK (window_destroy_cb), gst_sink); ++#if defined(BUILD_FOR_GTK4) ++ gtk_window_set_child (GTK_WINDOW ( ++#else ++ gtk_container_add (GTK_CONTAINER ( ++#endif ++ gst_sink->window), toplevel); ++ ++ gst_sink->window_destroy_id = g_signal_connect ( ++#if defined(BUILD_FOR_GTK4) ++ GTK_WINDOW (gst_sink->window), ++#else ++ gst_sink->window, ++#endif ++ "destroy", G_CALLBACK (window_destroy_cb), gst_sink); + } + + return TRUE; +@@ -348,7 +399,11 @@ gst_gtk_base_sink_stop_on_main (GstBaseSink * bsink) + GstGtkBaseSink *gst_sink = GST_GTK_BASE_SINK (bsink); + + if (gst_sink->window) { ++#if defined(BUILD_FOR_GTK4) ++ gtk_window_destroy (GTK_WINDOW (gst_sink->window)); ++#else + gtk_widget_destroy (gst_sink->window); ++#endif + gst_sink->window = NULL; + gst_sink->widget = NULL; + } +@@ -369,10 +424,14 @@ gst_gtk_base_sink_stop (GstBaseSink * bsink) + } + + static void +-gst_gtk_widget_show_all_and_unref (GtkWidget * widget) ++gst_gtk_window_show_all_and_unref (GtkWidget * window) + { +- gtk_widget_show_all (widget); +- g_object_unref (widget); ++#if defined(BUILD_FOR_GTK4) ++ gtk_window_present (GTK_WINDOW (window)); ++#else ++ gtk_widget_show_all (window); ++#endif ++ g_object_unref (window); + } + + static GstStateChangeReturn +@@ -400,7 +459,7 @@ gst_gtk_base_sink_change_state (GstElement * element, + GST_OBJECT_UNLOCK (gtk_sink); + + if (window) +- gst_gtk_invoke_on_main ((GThreadFunc) gst_gtk_widget_show_all_and_unref, ++ gst_gtk_invoke_on_main ((GThreadFunc) gst_gtk_window_show_all_and_unref, + window); + + break; +--- ext/gtk/gstgtkbasesink.h.orig 2019-12-03 11:06:37 UTC ++++ ext/gtk/gstgtkbasesink.h +@@ -51,14 +51,14 @@ GType gst_gtk_base_sink_get_type (void); + struct _GstGtkBaseSink + { + /* */ +- GstVideoSink parent; ++ GstVideoSink parent; + +- GstVideoInfo v_info; ++ GstVideoInfo v_info; + + GtkGstBaseWidget *widget; + + /* properties */ +- gboolean force_aspect_ratio; ++ gboolean force_aspect_ratio; + GBinding *bind_aspect_ratio; + + gint par_n; +@@ -69,8 +69,8 @@ struct _GstGtkBaseSink + GBinding *bind_ignore_alpha; + + GtkWidget *window; +- gulong widget_destroy_id; +- gulong window_destroy_id; ++ gulong widget_destroy_id; ++ gulong window_destroy_id; + }; + + /** +--- ext/gtk/gstgtkglsink.c.orig 2019-12-03 11:06:37 UTC ++++ ext/gtk/gstgtkglsink.c +@@ -1,6 +1,7 @@ + /* + * GStreamer + * Copyright (C) 2015 Matthew Waters ++ * Copyright (C) 2020 Rafał Dzięgiel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public +@@ -23,12 +24,18 @@ + * @title: gtkglsink + */ + ++/** ++ * SECTION:element-gtk4glsink ++ * @title: gtk4glsink ++ */ ++ + #ifdef HAVE_CONFIG_H + #include "config.h" + #endif + + #include + ++#include "gtkconfig.h" + #include "gstgtkglsink.h" + #include "gtkgstglwidget.h" + +@@ -58,7 +65,7 @@ static GstStaticPadTemplate gst_gtk_gl_sink_template = + #define gst_gtk_gl_sink_parent_class parent_class + G_DEFINE_TYPE_WITH_CODE (GstGtkGLSink, gst_gtk_gl_sink, + GST_TYPE_GTK_BASE_SINK, GST_DEBUG_CATEGORY_INIT (gst_debug_gtk_gl_sink, +- "gtkglsink", 0, "Gtk GL Video Sink")); ++ GTKCONFIG_GLSINK, 0, GTKCONFIG_NAME " GL Video Sink")); + + static void + gst_gtk_gl_sink_class_init (GstGtkGLSinkClass * klass) +@@ -82,11 +89,13 @@ gst_gtk_gl_sink_class_init (GstGtkGLSinkClass * klass) + gstbasesink_class->get_caps = gst_gtk_gl_sink_get_caps; + + gstgtkbasesink_class->create_widget = gtk_gst_gl_widget_new; +- gstgtkbasesink_class->window_title = "Gtk+ GL renderer"; ++ gstgtkbasesink_class->window_title = GTKCONFIG_NAME " GL Renderer"; + +- gst_element_class_set_metadata (gstelement_class, "Gtk GL Video Sink", ++ gst_element_class_set_metadata (gstelement_class, ++ GTKCONFIG_NAME " GL Video Sink", + "Sink/Video", "A video sink that renders to a GtkWidget using OpenGL", +- "Matthew Waters "); ++ "Matthew Waters , " ++ "Rafał Dzięgiel "); + + gst_element_class_add_static_pad_template (gstelement_class, + &gst_gtk_gl_sink_template); +@@ -120,16 +129,18 @@ gst_gtk_gl_sink_query (GstBaseSink * bsink, GstQuery * + } + + static void +-_size_changed_cb (GtkWidget * widget, GdkRectangle * rectangle, +- GstGtkGLSink * gtk_sink) ++_size_changed_cb (GtkWidget * widget, gint width, ++ gint height, GstGtkGLSink * gtk_sink) + { +- gint scale_factor, width, height; + gboolean reconfigure; + +- scale_factor = gtk_widget_get_scale_factor (widget); +- width = scale_factor * gtk_widget_get_allocated_width (widget); +- height = scale_factor * gtk_widget_get_allocated_height (widget); ++ GtkGstBaseWidget *base_widget = GTK_GST_BASE_WIDGET (widget); + ++ /* Ignore size changes before widget is negotiated ++ * we are going to queue a resize after negotiation */ ++ if (!base_widget->negotiated) ++ return; ++ + GST_OBJECT_LOCK (gtk_sink); + reconfigure = + (width != gtk_sink->display_width || height != gtk_sink->display_height); +@@ -138,7 +149,7 @@ _size_changed_cb (GtkWidget * widget, GdkRectangle * r + GST_OBJECT_UNLOCK (gtk_sink); + + if (reconfigure) { +- GST_DEBUG_OBJECT (gtk_sink, "Sending reconfigure event on sinkpad."); ++ GST_DEBUG_OBJECT (gtk_sink, "Sending reconfigure event on sinkpad"); + gst_pad_push_event (GST_BASE_SINK (gtk_sink)->sinkpad, + gst_event_new_reconfigure ()); + } +@@ -147,9 +158,9 @@ _size_changed_cb (GtkWidget * widget, GdkRectangle * r + static void + destroy_cb (GtkWidget * widget, GstGtkGLSink * gtk_sink) + { +- if (gtk_sink->size_allocate_sig_handler) { +- g_signal_handler_disconnect (widget, gtk_sink->size_allocate_sig_handler); +- gtk_sink->size_allocate_sig_handler = 0; ++ if (gtk_sink->widget_resize_sig_handler) { ++ g_signal_handler_disconnect (widget, gtk_sink->widget_resize_sig_handler); ++ gtk_sink->widget_resize_sig_handler = 0; + } + + if (gtk_sink->widget_destroy_sig_handler) { +@@ -172,29 +183,34 @@ gst_gtk_gl_sink_start (GstBaseSink * bsink) + gst_widget = GTK_GST_GL_WIDGET (base_sink->widget); + + /* Track the allocation size */ +- gtk_sink->size_allocate_sig_handler = +- g_signal_connect (gst_widget, "size-allocate", +- G_CALLBACK (_size_changed_cb), gtk_sink); ++ if (!gtk_sink->widget_resize_sig_handler) { ++ gtk_sink->widget_resize_sig_handler = ++ g_signal_connect (gst_widget, "resize", ++ G_CALLBACK (_size_changed_cb), gtk_sink); ++ } + +- gtk_sink->widget_destroy_sig_handler = +- g_signal_connect (gst_widget, "destroy", G_CALLBACK (destroy_cb), +- gtk_sink); ++ if (!gtk_sink->widget_destroy_sig_handler) { ++ gtk_sink->widget_destroy_sig_handler = ++ g_signal_connect (gst_widget, "destroy", G_CALLBACK (destroy_cb), ++ gtk_sink); ++ } + +- _size_changed_cb (GTK_WIDGET (gst_widget), NULL, gtk_sink); +- + if (!gtk_gst_gl_widget_init_winsys (gst_widget)) { + GST_ELEMENT_ERROR (bsink, RESOURCE, NOT_FOUND, ("%s", +- "Failed to initialize OpenGL with Gtk"), (NULL)); ++ "Failed to initialize OpenGL with GTK"), (NULL)); + return FALSE; + } + +- gtk_sink->display = gtk_gst_gl_widget_get_display (gst_widget); +- gtk_sink->context = gtk_gst_gl_widget_get_context (gst_widget); +- gtk_sink->gtk_context = gtk_gst_gl_widget_get_gtk_context (gst_widget); ++ if (!gtk_sink->display) ++ gtk_sink->display = gtk_gst_gl_widget_get_display (gst_widget); ++ if (!gtk_sink->context) ++ gtk_sink->context = gtk_gst_gl_widget_get_context (gst_widget); ++ if (!gtk_sink->gtk_context) ++ gtk_sink->gtk_context = gtk_gst_gl_widget_get_gtk_context (gst_widget); + + if (!gtk_sink->display || !gtk_sink->context || !gtk_sink->gtk_context) { + GST_ELEMENT_ERROR (bsink, RESOURCE, NOT_FOUND, ("%s", +- "Failed to retrieve OpenGL context from Gtk"), (NULL)); ++ "Failed to retrieve OpenGL context from GTK"), (NULL)); + return FALSE; + } + +@@ -208,7 +224,14 @@ static gboolean + gst_gtk_gl_sink_stop (GstBaseSink * bsink) + { + GstGtkGLSink *gtk_sink = GST_GTK_GL_SINK (bsink); ++ GstGtkBaseSink *base_sink = GST_GTK_BASE_SINK (bsink); + ++ if (gtk_sink->widget_resize_sig_handler) { ++ g_signal_handler_disconnect (base_sink->widget, ++ gtk_sink->widget_resize_sig_handler); ++ gtk_sink->widget_resize_sig_handler = 0; ++ } ++ + if (gtk_sink->display) { + gst_object_unref (gtk_sink->display); + gtk_sink->display = NULL; +@@ -348,10 +371,10 @@ gst_gtk_gl_sink_finalize (GObject * object) + GstGtkGLSink *gtk_sink = GST_GTK_GL_SINK (object); + GstGtkBaseSink *base_sink = GST_GTK_BASE_SINK (object); + +- if (gtk_sink->size_allocate_sig_handler) { ++ if (gtk_sink->widget_resize_sig_handler) { + g_signal_handler_disconnect (base_sink->widget, +- gtk_sink->size_allocate_sig_handler); +- gtk_sink->size_allocate_sig_handler = 0; ++ gtk_sink->widget_resize_sig_handler); ++ gtk_sink->widget_resize_sig_handler = 0; + } + + if (gtk_sink->widget_destroy_sig_handler) { +--- ext/gtk/gstgtkglsink.h.orig 2019-12-03 11:06:37 UTC ++++ ext/gtk/gstgtkglsink.h +@@ -65,7 +65,7 @@ struct _GstGtkGLSink + gint display_width; + gint display_height; + +- gulong size_allocate_sig_handler; ++ gulong widget_resize_sig_handler; + gulong widget_destroy_sig_handler; + }; + +--- ext/gtk/gstgtksink.c.orig 2019-12-03 11:06:37 UTC ++++ ext/gtk/gstgtksink.c +@@ -19,15 +19,22 @@ + */ + + /** +- * SECTION:element-gtkgstsink +- * @title: gtkgstsink ++ * SECTION:element-gtksink ++ * @title: gtksink + * + */ + ++/** ++ * SECTION:element-gtk4sink ++ * @title: gtk4sink ++ * ++ */ ++ + #ifdef HAVE_CONFIG_H + #include "config.h" + #endif + ++#include "gtkconfig.h" + #include "gtkgstwidget.h" + #include "gstgtksink.h" + +@@ -49,8 +56,8 @@ GST_STATIC_PAD_TEMPLATE ("sink", + + #define gst_gtk_sink_parent_class parent_class + G_DEFINE_TYPE_WITH_CODE (GstGtkSink, gst_gtk_sink, GST_TYPE_GTK_BASE_SINK, +- GST_DEBUG_CATEGORY_INIT (gst_debug_gtk_sink, "gtksink", 0, +- "Gtk Video Sink")); ++ GST_DEBUG_CATEGORY_INIT (gst_debug_gtk_sink, GTKCONFIG_SINK, 0, ++ GTKCONFIG_NAME " Video Sink")); + + static void + gst_gtk_sink_class_init (GstGtkSinkClass * klass) +@@ -62,9 +69,10 @@ gst_gtk_sink_class_init (GstGtkSinkClass * klass) + base_class = (GstGtkBaseSinkClass *) klass; + + base_class->create_widget = gtk_gst_widget_new; +- base_class->window_title = "Gtk+ Cairo renderer"; ++ base_class->window_title = GTKCONFIG_NAME " Cairo Renderer"; + +- gst_element_class_set_metadata (gstelement_class, "Gtk Video Sink", ++ gst_element_class_set_metadata (gstelement_class, ++ GTKCONFIG_NAME " Video Sink", + "Sink/Video", "A video sink that renders to a GtkWidget", + "Matthew Waters "); + +--- ext/gtk/gstplugin.c.orig 2019-12-03 11:06:37 UTC ++++ ext/gtk/gstplugin.c +@@ -1,6 +1,7 @@ + /* + * GStreamer + * Copyright (C) 2015 Matthew Waters ++ * Copyright (C) 2020 Rafał Dzięgiel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public +@@ -22,31 +23,31 @@ + #include "config.h" + #endif + ++#include "gtkconfig.h" + #include "gstgtksink.h" +-#if defined(HAVE_GTK3_GL) ++ ++#if defined(HAVE_GTK_GL) + #include "gstgtkglsink.h" + #endif + + static gboolean + plugin_init (GstPlugin * plugin) + { +- if (!gst_element_register (plugin, "gtksink", ++ if (!gst_element_register (plugin, GTKCONFIG_SINK, + GST_RANK_NONE, GST_TYPE_GTK_SINK)) { + return FALSE; + } +-#if defined(HAVE_GTK3_GL) +- if (!gst_element_register (plugin, "gtkglsink", ++#if defined(HAVE_GTK_GL) ++ if (!gst_element_register (plugin, GTKCONFIG_GLSINK, + GST_RANK_NONE, GST_TYPE_GTK_GL_SINK)) { + return FALSE; + } + #endif +- + return TRUE; + } + + GST_PLUGIN_DEFINE (GST_VERSION_MAJOR, + GST_VERSION_MINOR, +- gtk, +- "Gtk+ sink", ++ GTKCONFIG_PLUGIN, GTKCONFIG_NAME " sink", + plugin_init, PACKAGE_VERSION, GST_LICENSE, GST_PACKAGE_NAME, + GST_PACKAGE_ORIGIN) +--- ext/gtk/gtkconfig.h.orig 2021-08-23 11:11:05 UTC ++++ ext/gtk/gtkconfig.h +@@ -0,0 +1,31 @@ ++/* ++ * GStreamer ++ * Copyright (C) 2020 Rafał Dzięgiel ++ * ++ * 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. ++ */ ++ ++#if defined(BUILD_FOR_GTK4) ++#define GTKCONFIG_PLUGIN gtk4 ++#define GTKCONFIG_NAME "GTK4" ++#define GTKCONFIG_SINK "gtk4sink" ++#define GTKCONFIG_GLSINK "gtk4glsink" ++#else ++#define GTKCONFIG_PLUGIN gtk ++#define GTKCONFIG_NAME "GTK" ++#define GTKCONFIG_SINK "gtksink" ++#define GTKCONFIG_GLSINK "gtkglsink" ++#endif +--- ext/gtk/gtkgstbasewidget.c.orig 2019-12-03 11:06:37 UTC ++++ ext/gtk/gtkgstbasewidget.c +@@ -1,6 +1,7 @@ + /* + * GStreamer + * Copyright (C) 2015 Matthew Waters ++ * Copyright (C) 2020 Rafał Dzięgiel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public +@@ -74,7 +75,23 @@ gtk_gst_base_widget_get_preferred_height (GtkWidget * + *natural = video_height; + } + ++#if defined(BUILD_FOR_GTK4) + static void ++gtk_gst_base_widget_measure (GtkWidget * widget, GtkOrientation orientation, ++ gint for_size, gint * min, gint * natural, ++ gint * minimum_baseline, gint * natural_baseline) ++{ ++ if (orientation == GTK_ORIENTATION_HORIZONTAL) ++ gtk_gst_base_widget_get_preferred_width (widget, min, natural); ++ else ++ gtk_gst_base_widget_get_preferred_height (widget, min, natural); ++ ++ *minimum_baseline = -1; ++ *natural_baseline = -1; ++} ++#endif ++ ++static void + gtk_gst_base_widget_set_property (GObject * object, guint prop_id, + const GValue * value, GParamSpec * pspec) + { +@@ -235,22 +252,46 @@ _gdk_key_to_navigation_string (guint keyval) + } + } + ++static GdkEvent * ++_get_current_event (GtkEventController * controller) ++{ ++#if defined(BUILD_FOR_GTK4) ++ return gtk_event_controller_get_current_event (controller); ++#else ++ return gtk_get_current_event (); ++#endif ++} ++ ++static void ++_gdk_event_free (GdkEvent * event) ++{ ++#if !defined(BUILD_FOR_GTK4) ++ if (event) ++ gdk_event_free (event); ++#endif ++} ++ + static gboolean +-gtk_gst_base_widget_key_event (GtkWidget * widget, GdkEventKey * event) ++gtk_gst_base_widget_key_event (GtkEventControllerKey * key_controller, ++ guint keyval, guint keycode, GdkModifierType state) + { ++ GtkEventController *controller = GTK_EVENT_CONTROLLER (key_controller); ++ GtkWidget *widget = gtk_event_controller_get_widget (controller); + GtkGstBaseWidget *base_widget = GTK_GST_BASE_WIDGET (widget); + GstElement *element; + + if ((element = g_weak_ref_get (&base_widget->element))) { + if (GST_IS_NAVIGATION (element)) { +- const gchar *str = _gdk_key_to_navigation_string (event->keyval); +- const gchar *key_type = +- event->type == GDK_KEY_PRESS ? "key-press" : "key-release"; ++ GdkEvent *event = _get_current_event (controller); ++ const gchar *str = _gdk_key_to_navigation_string (keyval); + +- if (!str) +- str = event->string; +- +- gst_navigation_send_key_event (GST_NAVIGATION (element), key_type, str); ++ if (str) { ++ const gchar *key_type = ++ gdk_event_get_event_type (event) == ++ GDK_KEY_PRESS ? "key-press" : "key-release"; ++ gst_navigation_send_key_event (GST_NAVIGATION (element), key_type, str); ++ } ++ _gdk_event_free (event); + } + g_object_unref (element); + } +@@ -325,22 +366,43 @@ _display_size_to_stream_size (GtkGstBaseWidget * base_ + } + + static gboolean +-gtk_gst_base_widget_button_event (GtkWidget * widget, GdkEventButton * event) ++gtk_gst_base_widget_button_event ( ++#if defined(BUILD_FOR_GTK4) ++ GtkGestureClick * gesture, ++#else ++ GtkGestureMultiPress * gesture, ++#endif ++ gint n_press, gdouble x, gdouble y) + { ++ GtkEventController *controller = GTK_EVENT_CONTROLLER (gesture); ++ GtkWidget *widget = gtk_event_controller_get_widget (controller); + GtkGstBaseWidget *base_widget = GTK_GST_BASE_WIDGET (widget); + GstElement *element; + + if ((element = g_weak_ref_get (&base_widget->element))) { + if (GST_IS_NAVIGATION (element)) { ++ GdkEvent *event = _get_current_event (controller); + const gchar *key_type = +- event->type == +- GDK_BUTTON_PRESS ? "mouse-button-press" : "mouse-button-release"; +- gdouble x, y; ++ gdk_event_get_event_type (event) == GDK_BUTTON_PRESS ++ ? "mouse-button-press" : "mouse-button-release"; ++ gdouble stream_x, stream_y; ++#if !defined(BUILD_FOR_GTK4) ++ guint button; ++ gdk_event_get_button (event, &button); ++#endif + +- _display_size_to_stream_size (base_widget, event->x, event->y, &x, &y); ++ _display_size_to_stream_size (base_widget, x, y, &stream_x, &stream_y); + + gst_navigation_send_mouse_event (GST_NAVIGATION (element), key_type, +- event->button, x, y); ++#if defined(BUILD_FOR_GTK4) ++ /* Gesture is set to ignore other buttons so we do not have to check */ ++ GDK_BUTTON_PRIMARY, ++#else ++ button, ++#endif ++ stream_x, stream_y); ++ ++ _gdk_event_free (event); + } + g_object_unref (element); + } +@@ -349,19 +411,22 @@ gtk_gst_base_widget_button_event (GtkWidget * widget, + } + + static gboolean +-gtk_gst_base_widget_motion_event (GtkWidget * widget, GdkEventMotion * event) ++gtk_gst_base_widget_motion_event (GtkEventControllerMotion * motion_controller, ++ gdouble x, gdouble y) + { ++ GtkEventController *controller = GTK_EVENT_CONTROLLER (motion_controller); ++ GtkWidget *widget = gtk_event_controller_get_widget (controller); + GtkGstBaseWidget *base_widget = GTK_GST_BASE_WIDGET (widget); + GstElement *element; + + if ((element = g_weak_ref_get (&base_widget->element))) { + if (GST_IS_NAVIGATION (element)) { +- gdouble x, y; ++ gdouble stream_x, stream_y; + +- _display_size_to_stream_size (base_widget, event->x, event->y, &x, &y); ++ _display_size_to_stream_size (base_widget, x, y, &stream_x, &stream_y); + + gst_navigation_send_mouse_event (GST_NAVIGATION (element), "mouse-move", +- 0, x, y); ++ 0, stream_x, stream_y); + } + g_object_unref (element); + } +@@ -395,23 +460,20 @@ gtk_gst_base_widget_class_init (GtkGstBaseWidgetClass + "When enabled, alpha will be ignored and converted to black", + DEFAULT_IGNORE_ALPHA, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + ++#if defined(BUILD_FOR_GTK4) ++ widget_klass->measure = gtk_gst_base_widget_measure; ++#else + widget_klass->get_preferred_width = gtk_gst_base_widget_get_preferred_width; + widget_klass->get_preferred_height = gtk_gst_base_widget_get_preferred_height; +- widget_klass->key_press_event = gtk_gst_base_widget_key_event; +- widget_klass->key_release_event = gtk_gst_base_widget_key_event; +- widget_klass->button_press_event = gtk_gst_base_widget_button_event; +- widget_klass->button_release_event = gtk_gst_base_widget_button_event; +- widget_klass->motion_notify_event = gtk_gst_base_widget_motion_event; ++#endif + + GST_DEBUG_CATEGORY_INIT (gst_debug_gtk_base_widget, "gtkbasewidget", 0, +- "Gtk Video Base Widget"); ++ "GTK Video Base Widget"); + } + + void + gtk_gst_base_widget_init (GtkGstBaseWidget * widget) + { +- int event_mask; +- + widget->force_aspect_ratio = DEFAULT_FORCE_ASPECT_RATIO; + widget->par_n = DEFAULT_PAR_N; + widget->par_d = DEFAULT_PAR_D; +@@ -423,20 +485,66 @@ gtk_gst_base_widget_init (GtkGstBaseWidget * widget) + g_weak_ref_init (&widget->element, NULL); + g_mutex_init (&widget->lock); + ++ widget->key_controller = gtk_event_controller_key_new ( ++#if !defined(BUILD_FOR_GTK4) ++ GTK_WIDGET (widget) ++#endif ++ ); ++ g_signal_connect (widget->key_controller, "key-pressed", ++ G_CALLBACK (gtk_gst_base_widget_key_event), NULL); ++ g_signal_connect (widget->key_controller, "key-released", ++ G_CALLBACK (gtk_gst_base_widget_key_event), NULL); ++ ++ widget->motion_controller = gtk_event_controller_motion_new ( ++#if !defined(BUILD_FOR_GTK4) ++ GTK_WIDGET (widget) ++#endif ++ ); ++ g_signal_connect (widget->motion_controller, "motion", ++ G_CALLBACK (gtk_gst_base_widget_motion_event), NULL); ++ ++ widget->click_gesture = ++#if defined(BUILD_FOR_GTK4) ++ gtk_gesture_click_new (); ++#else ++ gtk_gesture_multi_press_new (GTK_WIDGET (widget)); ++#endif ++ g_signal_connect (widget->click_gesture, "pressed", ++ G_CALLBACK (gtk_gst_base_widget_button_event), NULL); ++ g_signal_connect (widget->click_gesture, "released", ++ G_CALLBACK (gtk_gst_base_widget_button_event), NULL); ++ ++#if defined(BUILD_FOR_GTK4) ++ /* Otherwise widget in grid will appear as a 1x1px ++ * video which might be misleading for users */ ++ gtk_widget_set_hexpand (GTK_WIDGET (widget), TRUE); ++ gtk_widget_set_vexpand (GTK_WIDGET (widget), TRUE); ++ ++ gtk_widget_set_focusable (GTK_WIDGET (widget), TRUE); ++ gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (widget->click_gesture), ++ GDK_BUTTON_PRIMARY); ++ ++ gtk_widget_add_controller (GTK_WIDGET (widget), widget->key_controller); ++ gtk_widget_add_controller (GTK_WIDGET (widget), widget->motion_controller); ++ gtk_widget_add_controller (GTK_WIDGET (widget), ++ GTK_EVENT_CONTROLLER (widget->click_gesture)); ++#endif ++ + gtk_widget_set_can_focus (GTK_WIDGET (widget), TRUE); +- event_mask = gtk_widget_get_events (GTK_WIDGET (widget)); +- event_mask |= GDK_KEY_PRESS_MASK +- | GDK_KEY_RELEASE_MASK +- | GDK_BUTTON_PRESS_MASK +- | GDK_BUTTON_RELEASE_MASK +- | GDK_POINTER_MOTION_MASK | GDK_BUTTON_MOTION_MASK; +- gtk_widget_set_events (GTK_WIDGET (widget), event_mask); + } + + void + gtk_gst_base_widget_finalize (GObject * object) + { + GtkGstBaseWidget *widget = GTK_GST_BASE_WIDGET (object); ++ ++ /* GTK4 takes ownership of EventControllers ++ * while GTK3 still needs manual unref */ ++#if !defined(BUILD_FOR_GTK4) ++ g_object_unref (widget->key_controller); ++ g_object_unref (widget->motion_controller); ++ g_object_unref (widget->click_gesture); ++#endif + + gst_buffer_replace (&widget->pending_buffer, NULL); + gst_buffer_replace (&widget->buffer, NULL); +--- ext/gtk/gtkgstbasewidget.h.orig 2019-12-03 11:06:37 UTC ++++ ext/gtk/gtkgstbasewidget.h +@@ -1,6 +1,7 @@ + /* + * GStreamer + * Copyright (C) 2015 Matthew Waters ++ * Copyright (C) 2020 Rafał Dzięgiel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public +@@ -25,6 +26,10 @@ + #include + #include + ++#if !defined(BUILD_FOR_GTK4) ++#include ++#endif ++ + #define GTK_GST_BASE_WIDGET(w) ((GtkGstBaseWidget *)(w)) + #define GTK_GST_BASE_WIDGET_CLASS(k) ((GtkGstBaseWidgetClass *)(k)) + #define GTK_GST_BASE_WIDGET_LOCK(w) g_mutex_lock(&((GtkGstBaseWidget*)(w))->lock) +@@ -39,9 +44,7 @@ struct _GtkGstBaseWidget + { + union { + GtkDrawingArea drawing_area; +-#if GTK_CHECK_VERSION(3, 15, 0) + GtkGLArea gl_area; +-#endif + } parent; + + /* properties */ +@@ -67,6 +70,11 @@ struct _GtkGstBaseWidget + GMutex lock; + GWeakRef element; + ++ /* event controllers */ ++ GtkEventController *key_controller; ++ GtkEventController *motion_controller; ++ GtkGesture *click_gesture; ++ + /* Pending draw idles callback */ + guint draw_id; + }; +@@ -75,9 +83,7 @@ struct _GtkGstBaseWidgetClass + { + union { + GtkDrawingAreaClass drawing_area_class; +-#if GTK_CHECK_VERSION(3, 15, 0) + GtkGLAreaClass gl_area_class; +-#endif + } parent_class; + }; + +--- ext/gtk/gtkgstglwidget.c.orig 2019-12-03 11:06:37 UTC ++++ ext/gtk/gtkgstglwidget.c +@@ -1,6 +1,7 @@ + /* + * GStreamer + * Copyright (C) 2015 Matthew Waters ++ * Copyright (C) 2020 Rafał Dzięgiel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public +@@ -30,12 +31,20 @@ + #include + + #if GST_GL_HAVE_WINDOW_X11 && defined (GDK_WINDOWING_X11) ++#if defined(BUILD_FOR_GTK4) ++#include ++#else + #include ++#endif + #include + #endif + + #if GST_GL_HAVE_WINDOW_WAYLAND && defined (GDK_WINDOWING_WAYLAND) ++#if defined(BUILD_FOR_GTK4) ++#include ++#else + #include ++#endif + #include + #endif + +@@ -78,8 +87,7 @@ static const GLfloat vertices[] = { + G_DEFINE_TYPE_WITH_CODE (GtkGstGLWidget, gtk_gst_gl_widget, GTK_TYPE_GL_AREA, + G_ADD_PRIVATE (GtkGstGLWidget) + GST_DEBUG_CATEGORY_INIT (GST_CAT_DEFAULT, "gtkgstglwidget", 0, +- "Gtk Gst GL Widget"); +- ); ++ "GTK Gst GL Widget")); + + static void + gtk_gst_gl_widget_bind_buffer (GtkGstGLWidget * gst_widget) +@@ -407,8 +415,11 @@ gtk_gst_gl_widget_init (GtkGstGLWidget * gst_widget) + + GST_INFO ("Created %" GST_PTR_FORMAT, priv->display); + ++ /* GTK4 always has alpha */ ++#if !defined(BUILD_FOR_GTK4) + gtk_gl_area_set_has_alpha (GTK_GL_AREA (gst_widget), + !base_widget->ignore_alpha); ++#endif + } + + static void +--- ext/gtk/gtkgstwidget.c.orig 2019-12-03 11:06:37 UTC ++++ ext/gtk/gtkgstwidget.c +@@ -38,17 +38,15 @@ + + G_DEFINE_TYPE (GtkGstWidget, gtk_gst_widget, GTK_TYPE_DRAWING_AREA); + +-static gboolean +-gtk_gst_widget_draw (GtkWidget * widget, cairo_t * cr) ++static void ++_drawing_area_draw (GtkDrawingArea * da, cairo_t * cr, ++ gint widget_width, gint widget_height, gpointer data) + { ++ GtkWidget *widget = GTK_WIDGET (da); + GtkGstBaseWidget *gst_widget = (GtkGstBaseWidget *) widget; +- guint widget_width, widget_height; + cairo_surface_t *surface; + GstVideoFrame frame; + +- widget_width = gtk_widget_get_allocated_width (widget); +- widget_height = gtk_widget_get_allocated_height (widget); +- + GTK_GST_BASE_WIDGET_LOCK (gst_widget); + + /* There is not much to optimize in term of redisplay, so simply swap the +@@ -148,7 +146,10 @@ gtk_gst_widget_draw (GtkWidget * widget, cairo_t * cr) + color.alpha = 1.0; + } else { + gtk_style_context_get_color (gtk_widget_get_style_context (widget), +- GTK_STATE_FLAG_NORMAL, &color); ++#if !defined(BUILD_FOR_GTK4) ++ GTK_STATE_FLAG_NORMAL, ++#endif ++ &color); + } + gdk_cairo_set_source_rgba (cr, &color); + cairo_rectangle (cr, 0, 0, widget_width, widget_height); +@@ -156,8 +157,20 @@ gtk_gst_widget_draw (GtkWidget * widget, cairo_t * cr) + } + + GTK_GST_BASE_WIDGET_UNLOCK (gst_widget); ++} ++ ++#if !defined(BUILD_FOR_GTK4) ++static gboolean ++gtk_gst_widget_draw (GtkWidget * widget, cairo_t * cr) ++{ ++ gint width = gtk_widget_get_allocated_width (widget); ++ gint height = gtk_widget_get_allocated_height (widget); ++ ++ _drawing_area_draw (GTK_DRAWING_AREA (widget), cr, width, height, NULL); ++ + return FALSE; + } ++#endif + + static void + gtk_gst_widget_finalize (GObject * object) +@@ -171,17 +184,25 @@ static void + gtk_gst_widget_class_init (GtkGstWidgetClass * klass) + { + GObjectClass *gobject_klass = (GObjectClass *) klass; ++#if !defined(BUILD_FOR_GTK4) + GtkWidgetClass *widget_klass = (GtkWidgetClass *) klass; ++#endif + + gtk_gst_base_widget_class_init (GTK_GST_BASE_WIDGET_CLASS (klass)); + gobject_klass->finalize = gtk_gst_widget_finalize; ++#if !defined(BUILD_FOR_GTK4) + widget_klass->draw = gtk_gst_widget_draw; ++#endif + } + + static void + gtk_gst_widget_init (GtkGstWidget * widget) + { + gtk_gst_base_widget_init (GTK_GST_BASE_WIDGET (widget)); ++#if defined(BUILD_FOR_GTK4) ++ gtk_drawing_area_set_draw_func (GTK_DRAWING_AREA (widget), ++ _drawing_area_draw, NULL, NULL); ++#endif + } + + GtkWidget * +--- ext/gtk/meson.build.orig 2019-12-03 11:06:37 UTC ++++ ext/gtk/meson.build +@@ -1,3 +1,4 @@ ++gtk_versions = [3, 4] + gtk_sources = [ + 'gstgtkbasesink.c', + 'gstgtksink.c', +@@ -6,52 +7,86 @@ gtk_sources = [ + 'gtkgstbasewidget.c', + 'gtkgstwidget.c', + ] ++gtk_dep = dependency('gtk+-3.0', required : get_option('gtk3')) ++gtk_optional_deps = [] + +-gtk_defines = [] +-optional_deps = [] ++gtk4_dep = dependency('gtk4', required : get_option('gtk4')) ++gtk4_optional_deps = [] + +-gtk_dep = dependency('gtk+-3.0', required : get_option('gtk3')) +-if gtk_dep.found() +- if build_gstgl and gstgl_dep.found() and gtk_dep.version().version_compare('>=3.15.0') +- have_gtk3_gl_windowing = false ++foreach gtk_ver : gtk_versions ++ gtkv = 'gtk' + gtk_ver.to_string() + ++ gtk_state = get_option(gtkv) ++ if gtk_state.disabled() ++ continue ++ endif ++ ++ min_ver = gtk_ver >= 4 ? '3.99.2' : '3.24.0' ++ x11_str = gtk_ver >= 4 ? gtkv + '-x11' : 'gtk+-x11-3.0' ++ way_str = gtk_ver >= 4 ? gtkv + '-wayland' : 'gtk+-wayland-3.0' ++ lib_dep = gtk_ver >= 4 ? gtk4_dep : gtk_dep ++ ++ if not lib_dep.found() or not lib_dep.version().version_compare('>=' + min_ver) ++ continue ++ endif ++ ++ lib_sources = [] ++ gtk_defines = [] ++ optional_deps = [] ++ have_gtk_gl_windowing = false ++ ++ lib_sources += gtk_sources ++ ++ if build_gstgl + if gst_gl_have_window_x11 and gst_gl_have_platform_glx + # FIXME: automagic +- gtk_x11_dep = dependency('gtk+-x11-3.0', required : false) ++ gtk_x11_dep = dependency(x11_str, required : false) + if gtk_x11_dep.found() + optional_deps += gtk_x11_dep +- have_gtk3_gl_windowing = true ++ have_gtk_gl_windowing = true + endif + endif + + if gst_gl_have_window_wayland and gst_gl_have_platform_egl + # FIXME: automagic +- gtk_wayland_dep = dependency('gtk+-wayland-3.0', required : false) ++ gtk_wayland_dep = dependency(way_str, required : false) + if gtk_wayland_dep.found() + optional_deps += gtk_wayland_dep +- have_gtk3_gl_windowing = true ++ have_gtk_gl_windowing = true + endif + endif ++ endif + +- if have_gtk3_gl_windowing +- gtk_sources += [ +- 'gstgtkglsink.c', +- 'gtkgstglwidget.c', +- ] +- optional_deps += gstgl_dep +- gtk_defines += ['-DGST_USE_UNSTABLE_API', '-DHAVE_GTK3_GL'] +- endif ++ if have_gtk_gl_windowing ++ lib_sources += [ ++ 'gstgtkglsink.c', ++ 'gtkgstglwidget.c', ++ ] ++ optional_deps += gstgl_dep ++ gtk_defines += ['-DGST_USE_UNSTABLE_API', '-DHAVE_GTK_GL'] + endif + +- gstgtk = library('gstgtk', +- gtk_sources, ++ if gtk_ver == 3 ++ gtk_optional_deps = optional_deps ++ elif gtk_ver == 4 ++ gtk4_optional_deps = optional_deps ++ gtk_defines += '-DBUILD_FOR_GTK4' ++ endif ++ ++ lib_name = 'gstgtk' ++ if gtk_ver > 3 ++ lib_name += gtk_ver.to_string() ++ endif ++ ++ gstgtk = library(lib_name, ++ lib_sources, + c_args : gst_plugins_good_args + gtk_defines, + link_args : noseh_link_args, + include_directories : [configinc], +- dependencies : [gtk_dep, gstvideo_dep, gstbase_dep, libm] + optional_deps, ++ dependencies : [lib_dep, gstvideo_dep, gstbase_dep, libm] + optional_deps, + install : true, + install_dir : plugins_install_dir, + ) + pkgconfig.generate(gstgtk, install_dir : plugins_pkgconfig_install_dir) +-endif ++endforeach + +--- meson_options.txt.orig 2019-12-03 11:06:37 UTC ++++ meson_options.txt +@@ -53,6 +53,7 @@ option('dv1394', type : 'feature', value : 'auto', des + option('flac', type : 'feature', value : 'auto', description : 'FLAC audio codec plugin') + option('gdk-pixbuf', type : 'feature', value : 'auto', description : 'gdk-pixbuf image decoder, overlay, and sink plugin') + option('gtk3', type : 'feature', value : 'auto', description : 'GTK+ video sink plugin') ++option('gtk4', type : 'feature', value : 'disabled', description : 'GTK4 video sink plugin') + option('jack', type : 'feature', value : 'auto', description : 'JACK audio source/sink plugin') + option('jpeg', type : 'feature', value : 'auto', description : 'JPEG image codec plugin') + option('lame', type : 'feature', value : 'auto', description : 'LAME mp3 audio encoder plugin') +--- tests/examples/gtk/meson.build.orig 2019-12-03 11:06:37 UTC ++++ tests/examples/gtk/meson.build +@@ -1,5 +1,5 @@ + executable('gtksink', 'gtksink.c', +- dependencies: [gst_dep, gtk_dep, optional_deps], ++ dependencies: [gst_dep, gtk_dep, gtk_optional_deps], + c_args: gst_plugins_good_args, + include_directories: [configinc], + install: false) diff --git a/x11-toolkits/gstreamer1-plugins-gtk4/pkg-descr b/x11-toolkits/gstreamer1-plugins-gtk4/pkg-descr new file mode 100644 index 000000000000..3c967400de47 --- /dev/null +++ b/x11-toolkits/gstreamer1-plugins-gtk4/pkg-descr @@ -0,0 +1,6 @@ +GTK4 plugin features: + +- gtk4glsink: A video sink that renders to a GtkWidget using OpenGL +- gtk4sink: A video sink that renders to a GtkWidget + +WWW: https://gstreamer.freedesktop.org/documentation/gtk/gtksink.html