Skip to contentSkip to conversation

gst1-vaapi: new package.

PATCH New Adam Duskett 2 participants 7 messages Feb 1, 2017 – Mar 12, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 gst1-vaapi: new package.

gstreamer-vaapi consists in a collection of VA-API based plugins for GStreamer and helper libraries. These libraries are used for hardware decoding and encoding of several video formats.

decoding formats:
JPEG, MPEG-2, MPEG-4:2, H.264 AVC, H.264 MVC, VP8, VC-1, WMV3, and HEVC.

encoding formats:
MPEG-2, H.264 AVC, H.264 MVC, JPEG, VP8, HEVC

The package won't compile without at least one renderer enabled, so I chose to enable DRM by default, as X11, GLX, and wayland are heavy handed with the dependencies. As such, I have disabled every option defaulting to yes except for DRM for the first patch.

Also, these codecs are only for x86 and require a Intel CPU (See Hardware Requirements on line 82 of the README file.)

---
 package/gstreamer1/Config.in                  |  1 +
 package/gstreamer1/gst1-vaapi/Config.in       | 39 +++++++++++++++++++++++++++
 package/gstreamer1/gst1-vaapi/gst1-vaapi.hash |  2 ++
 package/gstreamer1/gst1-vaapi/gst1-vaapi.mk   | 28 +++++++++++++++++++
 4 files changed, 70 insertions(+)
 create mode 100644 package/gstreamer1/gst1-vaapi/Config.in
 create mode 100644 package/gstreamer1/gst1-vaapi/gst1-vaapi.hash
 create mode 100644 package/gstreamer1/gst1-vaapi/gst1-vaapi.mk
package/gstreamer1/Config.in +1 -0
index 23862bd..aef75b5 100644
@@ -10,5 +10,6 @@ source "package/gstreamer1/gst1-imx/Config.in"
 source "package/gstreamer1/gst1-libav/Config.in"
 source "package/gstreamer1/gst1-rtsp-server/Config.in"
 source "package/gstreamer1/gst1-validate/Config.in"
+source "package/gstreamer1/gst1-vaapi/Config.in"
 source "package/gstreamer1/gst-omx/Config.in"
 endif
package/gstreamer1/gst1-vaapi/Config.in new file +39 -0
new file mode 100644
index 0000000..44461e3
@@ -0,0 +1,39 @@
+config BR2_PACKAGE_GST1_VAAPI
+	bool "gst1-vaapi"
+	select BR2_PACKAGE_LIBVA
+	select BR2_PACKAGE_LIBDRM
+	select BR2_PACKAGE_GST1_PLUGINS_BASE
+	select BR2_PACKAGE_GST1_PLUGINS_BAD # gstreamer-codecparsers
+	depends on BR2_i386 || BR2_x86_64 # Only relevant for x86
+	depends on !BR2_STATIC_LIBS
+	help
+	  gstreamer-vaapi consists in a collection of VA-API based plugins for
+	  GStreamer and helper libraries.
+
+  	  vaapi<CODEC>dec is used to decode JPEG, MPEG-2, MPEG-4:2, H.264
+  	  AVC, H.264 MVC, VP8, VC-1, WMV3, HEVC videos to VA surfaces,
+  	  depending on the actual value of <CODEC> and the underlying
+  	  hardware capabilities.  This plugin is also able to implicitly
+  	  download the decoded surface to raw YUV buffers.
+  	  
+  	  vaapi<CODEC>enc is used to encode into MPEG-2, H.264 AVC, H.264
+  	  MVC, JPEG, VP8, HEVC videos, depending on the actual value of
+  	  <CODEC> (mpeg2, h264, etc.) and the hardware capabilities. By
+  	  default, raw format bitstreams are generated, so the result may be
+  	  piped to a muxer, e.g. qtmux for MP4 containers.
+  	  
+  	  vaapipostproc is used to filter VA surfaces, for e.g. scaling,
+  	  deinterlacing (bob, motion-adaptive, motion-compensated), noise
+  	  reduction or sharpening. This plugin is also used to upload raw
+  	  YUV pixels into VA surfaces.
+  	  
+  	  vaapisink is used to render VA surfaces to an X11 or Wayland
+  	  display. This plugin also features a "headless" mode (DRM) more
+  	  suited to remote transcode scenarios, with faster throughput.
+  	  
+	  https://cgit.freedesktop.org/gstreamer/gstreamer-vaapi
+
+comment "gst1-vaapi needs udev /dev management and a toolchain w/ threads, dynamic library"
+	depends on BR2_i386 || BR2_x86_64
+	depends on !BR2_TOOLCHAIN_HAS_THREADS || BR2_STATIC_LIBS || \
+	!BR2_PACKAGE_HAS_UDEV
package/gstreamer1/gst1-vaapi/gst1-vaapi.hash new file +2 -0
new file mode 100644
index 0000000..f3c6252
@@ -0,0 +1,2 @@
+# from https://gstreamer.freedesktop.org/src/gstreamer-vaapi/gstreamer-vaapi-1.10.3.tar.xz.sha256sum
+sha256 cea827066a152a6afa1d0c43544dfbda285238156d4c3b77f9d4037bbe79361e  gstreamer-vaapi-1.10.3.tar.xz
package/gstreamer1/gst1-vaapi/gst1-vaapi.mk new file +28 -0
new file mode 100644
index 0000000..470d95f
@@ -0,0 +1,28 @@
+################################################################################
+#
+# gst1-vaapi
+#
+################################################################################
+
+GST1_VAAPI_VERSION = 1.10.3
+GST1_VAAPI_SITE = https://gstreamer.freedesktop.org/src/gstreamer-vaapi
+GST1_VAAPI_SOURCE = gstreamer-vaapi-$(GST1_VAAPI_VERSION).tar.xz
+GST1_VAAPI_LICENSE = LGPLv2.1+
+GST1_VAAPI_LICENSE_FILES = COPYING.LIB
+
+GST1_VAAPI_DEPENDENCIES += \
+	gstreamer1 \
+	gst1-plugins-base \
+	gst1-plugins-bad \
+	libva \
+	libdrm
+	
+GST1_VAAPI_CONF_OPTS += \
+	--disable-encoders \
+	--disable-x11 \
+	--disable-glx \
+	--disable-wayland \
+	--disable-egl \
+	--disable-gtk-doc-html
+
+$(eval $(autotools-package))
Signature · 1 line
2.9.3
#1 lore raw

PATCH 2/2 gst1-vaapi: add optional encoder support.

---
 package/gstreamer1/gst1-vaapi/Config.in     | 7 +++++++
 package/gstreamer1/gst1-vaapi/gst1-vaapi.mk | 5 ++++-
 2 files changed, 11 insertions(+), 1 deletion(-)
package/gstreamer1/gst1-vaapi/Config.in +7 -0
index 44461e3..e33e612 100644
@@ -33,6 +33,13 @@ config BR2_PACKAGE_GST1_VAAPI
   	  
 	  https://cgit.freedesktop.org/gstreamer/gstreamer-vaapi
 
+if BR2_PACKAGE_GST1_VAAPI
+
+config BR2_PACKAGE_GST1_VAAPI_ENCODERS
+	bool "Build encoders"
+
+endif
+
 comment "gst1-vaapi needs udev /dev management and a toolchain w/ threads, dynamic library"
 	depends on BR2_i386 || BR2_x86_64
 	depends on !BR2_TOOLCHAIN_HAS_THREADS || BR2_STATIC_LIBS || \
package/gstreamer1/gst1-vaapi/gst1-vaapi.mk +4 -1
index 470d95f..966fe9b 100644
@@ -18,11 +18,14 @@ GST1_VAAPI_DEPENDENCIES += \
 	libdrm
 	
 GST1_VAAPI_CONF_OPTS += \
-	--disable-encoders \
 	--disable-x11 \
 	--disable-glx \
 	--disable-wayland \
 	--disable-egl \
 	--disable-gtk-doc-html
 
+ifneq ($(BR2_PACKAGE_GST1_VAAPI_ENCODERS),y)
+	GST1_VAAPI_CONF_OPTS += --disable-encoders
+endif
+
 $(eval $(autotools-package))
Signature · 1 line
2.9.3
#2 lore raw

PATCH 2/2 gst1-vaapi: add optional encoder support.

Hello,

package/gstreamer1/gst1-vaapi/Config.in config BR2_PACKAGE_GST1_VAAPI · line 39

Quoted 4 lines · Adam Duskett
package/gstreamer1/gst1-vaapi/Config.in +4 -0
+if BR2_PACKAGE_GST1_VAAPI
+
+config BR2_PACKAGE_GST1_VAAPI_ENCODERS
+	bool "Build encoders"

Changed to:

bool "enable encoders"

package/gstreamer1/gst1-vaapi/gst1-vaapi.mk GST1_VAAPI_DEPENDENCIES += \ · line 28

Quoted 2 lines
package/gstreamer1/gst1-vaapi/gst1-vaapi.mk +2 -0
+ifneq ($(BR2_PACKAGE_GST1_VAAPI_ENCODERS),y)
+	GST1_VAAPI_CONF_OPTS += --disable-encoders

This line should not be indented.

Quoted 1 line

+endif

Also, we normally explicitly enable and disable, so I've changed this to:

+ifeq ($(BR2_PACKAGE_GST1_VAAPI_ENCODERS),y)
+GST1_VAAPI_CONF_OPTS += --enable-encoders
+else
+GST1_VAAPI_CONF_OPTS += --disable-encoders
+endif

Best regards,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
#3 lore raw

PATCH 1/2 gst1-vaapi: new package.

In reply to Adam Duskett

Hello,

Quoted 15 lines · Adam Duskett

gstreamer-vaapi consists in a collection of VA-API based plugins for GStreamer and helper libraries. These libraries are used for hardware decoding and encoding of several video formats.

decoding formats:
JPEG, MPEG-2, MPEG-4:2, H.264 AVC, H.264 MVC, VP8, VC-1, WMV3, and HEVC.

encoding formats:
MPEG-2, H.264 AVC, H.264 MVC, JPEG, VP8, HEVC

The package won't compile without at least one renderer enabled, so I chose to enable DRM by default, as X11, GLX, and wayland are heavy handed with the dependencies. As such, I have disabled every option defaulting to yes except for DRM for the first patch.

Quoted 4 lines

Also, these codecs are only for x86 and require a Intel CPU (See Hardware Requirements on line 82 of the README file.)

We already had a patch pending in patchwork adding the same package, proposed by Jesper Baekdahl. Could you please sync with Jesper to propose a single patch?

Thanks,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
#4 lore raw

PATCH 1/2 gst1-vaapi: new package.

Quoted 18 lines · Thomas Petazzoni

Hello,

Quoted 15 lines · Adam Duskett

gstreamer-vaapi consists in a collection of VA-API based plugins for GStreamer and helper libraries. These libraries are used for hardware decoding and encoding of several video formats.

decoding formats:
JPEG, MPEG-2, MPEG-4:2, H.264 AVC, H.264 MVC, VP8, VC-1, WMV3, and HEVC.

encoding formats:
MPEG-2, H.264 AVC, H.264 MVC, JPEG, VP8, HEVC

The package won't compile without at least one renderer enabled, so I chose to enable DRM by default, as X11, GLX, and wayland are heavy handed with the dependencies. As such, I have disabled every option defaulting to yes except for DRM for the first patch.

Quoted 9 lines
Quoted 4 lines

Also, these codecs are only for x86 and require a Intel CPU (See Hardware Requirements on line 82 of the README file.)

We already had a patch pending in patchwork adding the same package, proposed by Jesper Baekdahl. Could you please sync with Jesper to propose a single patch?

Hey Thomas!

I sent an email out just a few minutes ago. Hopefully, he responds soon!

Question: What is the established procedure if somebody doesn't respond?

Quoted 9 lines

Thanks,

Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

Thanks!

Adam

#5 lore raw

PATCH 1/2 gst1-vaapi: new package.

Hello,

Quoted 46 lines · Adam Duskett
Quoted 18 lines · Thomas Petazzoni

Hello,

Quoted 15 lines · Adam Duskett

gstreamer-vaapi consists in a collection of VA-API based plugins for GStreamer and helper libraries. These libraries are used for hardware decoding and encoding of several video formats.

decoding formats:
JPEG, MPEG-2, MPEG-4:2, H.264 AVC, H.264 MVC, VP8, VC-1, WMV3, and HEVC.

encoding formats:
MPEG-2, H.264 AVC, H.264 MVC, JPEG, VP8, HEVC

The package won't compile without at least one renderer enabled, so I chose to enable DRM by default, as X11, GLX, and wayland are heavy handed with the dependencies. As such, I have disabled every option defaulting to yes except for DRM for the first patch.

Quoted 9 lines
Quoted 4 lines

Also, these codecs are only for x86 and require a Intel CPU (See Hardware Requirements on line 82 of the README file.)

We already had a patch pending in patchwork adding the same package, proposed by Jesper Baekdahl. Could you please sync with Jesper to propose a single patch?

Hey Thomas!

I sent an email out just a few minutes ago. Hopefully, he responds soon!

Question: What is the established procedure if somebody doesn't respond?

Quoted 9 lines

Thanks,

Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

Quoted 3 lines

Thanks!

Adam

I just got word from Jesper; he is fine with my patch.

"Hi Adam,

Sorry for the late answer. You can take over the patch.

Best Regards,

Jesper B?kdahl
Hardware/Software Developer
Gamblify"

So if you find this patch acceptable it looks like he is fine with it!

Adam

#6 lore raw

PATCH 1/2 gst1-vaapi: new package.

In reply to Adam Duskett

Hello,

Quoted 15 lines · Adam Duskett

gstreamer-vaapi consists in a collection of VA-API based plugins for GStreamer and helper libraries. These libraries are used for hardware decoding and encoding of several video formats.

decoding formats:
JPEG, MPEG-2, MPEG-4:2, H.264 AVC, H.264 MVC, VP8, VC-1, WMV3, and HEVC.

encoding formats:
MPEG-2, H.264 AVC, H.264 MVC, JPEG, VP8, HEVC

The package won't compile without at least one renderer enabled, so I chose to enable DRM by default, as X11, GLX, and wayland are heavy handed with the dependencies. As such, I have disabled every option defaulting to yes except for DRM for the first patch.

Quoted 4 lines

Also, these codecs are only for x86 and require a Intel CPU (See Hardware Requirements on line 82 of the README file.)

I've applied your patch, but after doing a number of fixes. The most important one is that your package was not building with the uClibc C library. uClibc is our default C library, so developers should *always* build test their packages with this C library before submitting patches.

So, next time, please the test-pkg script to build test your package properly. Submitting something that doesn't even build with Buildroot default configuration is not nice at all.

package/gstreamer1/gst1-vaapi/Config.in line 6

Quoted 12 lines
package/gstreamer1/gst1-vaapi/Config.in new file +6 -0
new file mode 100644
index 0000000..44461e3
@@ -0,0 +1,39 @@
+config BR2_PACKAGE_GST1_VAAPI
+	bool "gst1-vaapi"
+	select BR2_PACKAGE_LIBVA
+	select BR2_PACKAGE_LIBDRM
+	select BR2_PACKAGE_GST1_PLUGINS_BASE
+	select BR2_PACKAGE_GST1_PLUGINS_BAD # gstreamer-codecparsers

Your Config.in comment mentioned the udev and thread dependency, but I don't see them anywhere here... so I've added them.

package/gstreamer1/gst1-vaapi/Config.in line 7

Quoted 1 line
package/gstreamer1/gst1-vaapi/Config.in new file +1 -0
+	depends on BR2_i386 || BR2_x86_64 # Only relevant for x86

I don't really see why in fact. I've seen the README file, but I don't quite understand VA-API is a generic API, it can be used on other platforms than x86. And it builds fine on ARM, so for now, I've removed this.

package/gstreamer1/gst1-vaapi/Config.in line 37

Quoted 2 lines
package/gstreamer1/gst1-vaapi/Config.in new file +2 -0
+comment "gst1-vaapi needs udev /dev management and a toolchain w/ threads, dynamic library"
+	depends on BR2_i386 || BR2_x86_64

And removed this line.

package/gstreamer1/gst1-vaapi/Config.in line 39

Quoted 2 lines
package/gstreamer1/gst1-vaapi/Config.in new file +2 -0
+	depends on !BR2_TOOLCHAIN_HAS_THREADS || BR2_STATIC_LIBS || \
+	!BR2_PACKAGE_HAS_UDEV

This last line should have been intended with one more tab.

Also, you missed adding yourself to the DEVELOPERS file, so I've done that as well. Finally, there were some trailing tabs, and spaces instead of tabs in the Config.in file.

All in all, the list of changes:

[Thomas:
- Add entry to DEVELOPERS file.
- Add BR2_TOOLCHAIN_HAS_THREADS dependency to the main Config.in option.
- Add BR2_PACKAGE_HAS_UDEV dependency to the main Config.in option.
- Add comments about the BR2_STATIC_LIBS config option.
- Rewrap Config.in help text and removing trailing tabs/spaces.
- Remove restriction to i386/x86-64
- Add patch to fix build with uClibc.]

Thanks,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com