Skip to content

Commit

Permalink
gst1-plugins-base: build OpenGL library and plugin
Browse files Browse the repository at this point in the history
Requires packages video feed.

Signed-off-by: Daniel Golle <[email protected]>
  • Loading branch information
dangowrt committed Nov 13, 2024
1 parent 422c06e commit b854cb5
Showing 1 changed file with 26 additions and 7 deletions.
33 changes: 26 additions & 7 deletions multimedia/gst1-plugins-base/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ PKG_CONFIG_DEPENDS:= \
CONFIG_PACKAGE_gst1-mod-playback \
CONFIG_PACKAGE_gst1-mod-gio \
CONFIG_PACKAGE_gst1-mod-ogg \
CONFIG_PACKAGE_gst1-mod-opengl \
CONFIG_PACKAGE_gst1-mod-opus \
CONFIG_PACKAGE_gst1-mod-tcp \
CONFIG_PACKAGE_gst1-mod-theora \
Expand Down Expand Up @@ -95,16 +96,24 @@ define Package/gstreamer1-plugins-base/config
comment "Modules"

$(foreach mod,$(GST_BASE_MODULES), \
config PACKAGE_gst1-mod-$(mod)
prompt "GStreamer $(mod) module"
config PACKAGE_gst1-mod-$(firstword $(subst :, ,$(mod)))
prompt "GStreamer $(firstword $(subst :, ,$(mod))) module"
$(if $(wordlist 2,$(words $(subst :, ,$(mod))),$(subst :, ,$(mod))),\
$(foreach confdep,$(wordlist 2,$(words $(subst :, ,$(mod))),$(subst :, ,$(mod))),\
depends on $(confdep)
))
)

comment "Libraries"

$(foreach lib,$(GST_BASE_LIBS), \
config PACKAGE_libgst1$(lib)
prompt "GStreamer $(lib) library"
config PACKAGE_libgst1$(firstword $(subst :, ,$(lib)))
prompt "GStreamer $(firstword $(subst :, ,$(lib))) library"
$(if $(wordlist 2,$(words $(subst :, ,$(lib))),$(subst :, ,$(lib))),\
$(foreach confdep,$(wordlist 2,$(words $(subst :, ,$(lib))),$(subst :, ,$(lib))),\
depends on $(confdep)
))
)

Expand All @@ -118,7 +127,6 @@ GST_VERSION:=1.0

MESON_ARGS += \
-Daudioresample_format=int \
-Dgl=disabled \
\
$(call GST_COND_SELECT,adder) \
$(call GST_COND_SELECT,app) \
Expand All @@ -130,6 +138,7 @@ MESON_ARGS += \
$(call GST_COND_SELECT,compositor) \
$(call GST_COND_SELECT,encoding) \
$(call GST_COND_SELECT,gio) \
-Dgl=$(if $(CONFIG_PACKAGE_libgst1gl),en,dis)abled \
$(call GST_COND_SELECT,overlaycomposition) \
$(call GST_COND_SELECT,pbtypes) \
$(call GST_COND_SELECT,playback) \
Expand Down Expand Up @@ -186,6 +195,14 @@ define Build/InstallDev
--target-directory=$(1)/usr/lib/gstreamer-$(GST_VERSION)/ \
) \
fi
if [ -d $(PKG_INSTALL_DIR)/usr/lib/gstreamer-$(GST_VERSION)/include/gst/gl ]; then \
$(INSTALL_DIR) $(1)/usr/lib/gstreamer-$(GST_VERSION)/include/gst/gl; \
( cd $(PKG_INSTALL_DIR); $(FIND) \
./usr/lib/gstreamer-$(GST_VERSION)/include/gst/gl -name *.h -print0 | \
xargs --null --no-run-if-empty $(CP) \
--target-directory=$(1)/usr/lib/gstreamer-$(GST_VERSION)/include/gst/gl \
) \
fi
$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
( cd $(PKG_INSTALL_DIR); $(CP) \
./usr/lib/pkgconfig/gstreamer*-$(GST_VERSION).pc \
Expand All @@ -210,7 +227,7 @@ define GstBuildLibrary

GST_DEPENDS += +libgst1$(1)

GST_BASE_LIBS+= $(1)
GST_BASE_LIBS+= $(1)$(if $(5),:$(subst $(space),:,$(5)))

define Package/libgst1$(1)
$(call Package/gstreamer1-base/Default)
Expand Down Expand Up @@ -240,6 +257,7 @@ $(eval $(call GstBuildLibrary,allocators,allocators,,+libdrm))
$(eval $(call GstBuildLibrary,app,app,,))
$(eval $(call GstBuildLibrary,audio,audio,tag,))
$(eval $(call GstBuildLibrary,fft,FFT,,))
$(eval $(call GstBuildLibrary,gl,gl,allocators video,+libmesa +libwayland +libgudev,HAVE_MESA))
$(eval $(call GstBuildLibrary,pbutils,utils,audio tag video,))
$(eval $(call GstBuildLibrary,riff,RIFF media,audio tag,,))
$(eval $(call GstBuildLibrary,rtp,RTP,,))
Expand All @@ -257,7 +275,7 @@ define GstBuildPlugin

GST_DEPENDS += +gst1-mod-$(1)

GST_BASE_MODULES+= $(1)
GST_BASE_MODULES+= $(1)$(if $(6),:$(subst $(space),:,$(6)))

define Package/gst1-mod-$(1)
$(call Package/gstreamer1-base/Default)
Expand Down Expand Up @@ -293,6 +311,7 @@ $(eval $(call GstBuildPlugin,audiotestsrc,audio test,audio tag controller,,))
$(eval $(call GstBuildPlugin,compositor,video compositor,video,,))
$(eval $(call GstBuildPlugin,encoding,encoding plugin,pbutils video,,))
$(eval $(call GstBuildPlugin,gio,GIO,,,))
$(eval $(call GstBuildPlugin,opengl,GL,gl controller,,+libgraphene +libjpeg +libpng,HAVE_MESA))
$(eval $(call GstBuildPlugin,overlaycomposition,overlay composition,video,,))
$(eval $(call GstBuildPlugin,pbtypes,pbtypes,video,,))
$(eval $(call GstBuildPlugin,playback,playback,pbutils,,))
Expand Down

7 comments on commit b854cb5

@zxlhhyccc
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WARNING: Makefile 'package/feeds/packages/gst1-plugins-base/Makefile' has a dependency on 'libmesa', which does not exist
WARNING: Makefile 'package/feeds/packages/gst1-plugins-base/Makefile' has a dependency on 'libwayland', which does not exist
WARNING: Makefile 'package/feeds/packages/gst1-plugins-base/Makefile' has a dependency on 'libgraphene', which does not exist
Installing all packages from feed packages.
Installing all packages from feed luci.
Installing all packages from feed routing.
Installing all packages from feed telephony.

@ptpt52
Copy link
Contributor

@ptpt52 ptpt52 commented on b854cb5 Nov 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WARNING: Makefile 'package/feeds/packages/gst1-plugins-base/Makefile' has a dependency on 'libmesa', which does not exist
WARNING: Makefile 'package/feeds/packages/gst1-plugins-base/Makefile' has a dependency on 'libwayland', which does not exist
WARNING: Makefile 'package/feeds/packages/gst1-plugins-base/Makefile' has a dependency on 'libgraphene', which does not exist

@dangowrt how to resolv the issue?

@dangowrt
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Enable the video feed. It's a non-issue, the GL library and module will simply be skipped if mesa, wayland and graphene packages are not present.

@vortexilation
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dangowrt

Where is the libgraphene, cannot found it on video feed.

@zxlhhyccc
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dangowrt Why not add these packages?

@dangowrt
Copy link
Member Author

@dangowrt dangowrt commented on b854cb5 Nov 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See
openwrt/video#35

The idea of the video feed and having those packages there is to not have them built by the buildbots. Mesa is huge, WebKit alone are more source files than all the rest of OpenWrt together, it takes hours to build. We may decide to occasionally also generate binaries, but having all that in the packages feed is just overkill with our current CI/buildbot concept.

@zxlhhyccc
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dangowrt If that's the case, is it necessary to include it?

Please sign in to comment.