Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] gst1-plugins-bad: hls: allow user to select crypto backend
@ 2016-08-03 12:19 Rahul Bedarkar
  2016-08-03 12:29 ` Thomas Petazzoni
  0 siblings, 1 reply; 5+ messages in thread
From: Rahul Bedarkar @ 2016-08-03 12:19 UTC (permalink / raw)
  To: buildroot

HLS plugin can be built with nettle or libgcrypt or openssl
cryptographic backend. But current dependency on gnutls is incorrect.
It has been working so far because gnutls depends on nettle.

gst-plugins-bad's build system for HLS allow user to choose which
cryptographic backend to use. So it makes sense to allow user to
select which cryptographic backend to use.

Reviewed-by: Marcin Nowakowski <marcin.nowakowski@imgtec.com>
Signed-off-by: Rahul Bedarkar <rahul.bedarkar@imgtec.com>
---
 package/gstreamer1/gst1-plugins-bad/Config.in      | 25 +++++++++++++++++++++-
 .../gst1-plugins-bad/gst1-plugins-bad.mk           | 18 +++++++++++++++-
 2 files changed, 41 insertions(+), 2 deletions(-)

diff --git a/package/gstreamer1/gst1-plugins-bad/Config.in b/package/gstreamer1/gst1-plugins-bad/Config.in
index 0f9fb15..51c1280 100644
--- a/package/gstreamer1/gst1-plugins-bad/Config.in
+++ b/package/gstreamer1/gst1-plugins-bad/Config.in
@@ -530,10 +530,33 @@ comment "gl needs the gst1-plugins-bad opengl library"
 
 config BR2_PACKAGE_GST1_PLUGINS_BAD_PLUGIN_HLS
 	bool "hls"
-	select BR2_PACKAGE_GNUTLS
 	help
 	  Fragmented streaming plugins
 
+if BR2_PACKAGE_GST1_PLUGINS_BAD_PLUGIN_HLS
+
+choice
+	prompt "choose HLS cryptographic backend"
+	default BR2_PACKAGE_GST1_PLUGINS_BAD_PLUGIN_HLS_BACKEND_NETTLE
+
+config BR2_PACKAGE_GST1_PLUGINS_BAD_PLUGIN_HLS_BACKEND_LIBGCRYPT
+	bool "libgcrypt"
+	depends on BR2_PACKAGE_LIBGPG_ERROR_ARCH_SUPPORTS # libgcrypt -> libgpg-error
+	select BR2_PACKAGE_LIBGCRYPT
+
+config BR2_PACKAGE_GST1_PLUGINS_BAD_PLUGIN_HLS_BACKEND_NETTLE
+	bool "nettle"
+	select BR2_PACKAGE_NETTLE
+
+config BR2_PACKAGE_GST1_PLUGINS_BAD_PLUGIN_HLS_BACKEND_OPENSSL
+	bool "openssl"
+	select BR2_PACKAGE_OPENSSL
+
+endchoice
+
+endif # BR2_PACKAGE_GST1_PLUGINS_BAD_PLUGIN_HLS
+
+
 config BR2_PACKAGE_GST1_PLUGINS_BAD_PLUGIN_LIBMMS
 	bool "libmms"
 	depends on BR2_USE_WCHAR # libmms -> libglib2
diff --git a/package/gstreamer1/gst1-plugins-bad/gst1-plugins-bad.mk b/package/gstreamer1/gst1-plugins-bad/gst1-plugins-bad.mk
index 8f739ec..e920939 100644
--- a/package/gstreamer1/gst1-plugins-bad/gst1-plugins-bad.mk
+++ b/package/gstreamer1/gst1-plugins-bad/gst1-plugins-bad.mk
@@ -650,7 +650,23 @@ endif
 
 ifeq ($(BR2_PACKAGE_GST1_PLUGINS_BAD_PLUGIN_HLS),y)
 GST1_PLUGINS_BAD_CONF_OPTS += --enable-hls
-GST1_PLUGINS_BAD_DEPENDENCIES += gnutls
+
+ifeq ($(BR2_PACKAGE_GST1_PLUGINS_BAD_PLUGIN_HLS_BACKEND_LIBGCRYPT),y)
+GST1_PLUGINS_BAD_DEPENDENCIES += libgcrypt
+GST1_PLUGINS_BAD_CONF_OPTS += --with-hls-crypto=libgcrypt \
+	--with-libgcrypt-prefix=$(STAGING_DIR)/usr
+endif
+
+ifeq ($(BR2_PACKAGE_GST1_PLUGINS_BAD_PLUGIN_HLS_BACKEND_NETTLE),y)
+GST1_PLUGINS_BAD_DEPENDENCIES += nettle
+GST1_PLUGINS_BAD_CONF_OPTS += --with-hls-crypto=nettle
+endif
+
+ifeq ($(BR2_PACKAGE_GST1_PLUGINS_BAD_PLUGIN_HLS_BACKEND_OPENSSL),y)
+GST1_PLUGINS_BAD_DEPENDENCIES += openssl
+GST1_PLUGINS_BAD_CONF_OPTS += --with-hls-crypto=openssl
+endif
+
 else
 GST1_PLUGINS_BAD_CONF_OPTS += --disable-hls
 endif
-- 
2.6.2

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH 1/1] gst1-plugins-bad: hls: allow user to select crypto backend
  2016-08-03 12:19 [Buildroot] [PATCH 1/1] gst1-plugins-bad: hls: allow user to select crypto backend Rahul Bedarkar
@ 2016-08-03 12:29 ` Thomas Petazzoni
  2016-08-03 13:47   ` Rahul Bedarkar
  0 siblings, 1 reply; 5+ messages in thread
From: Thomas Petazzoni @ 2016-08-03 12:29 UTC (permalink / raw)
  To: buildroot

Hello,

On Wed, 3 Aug 2016 17:49:27 +0530, Rahul Bedarkar wrote:

> +if BR2_PACKAGE_GST1_PLUGINS_BAD_PLUGIN_HLS
> +
> +choice
> +	prompt "choose HLS cryptographic backend"
> +	default BR2_PACKAGE_GST1_PLUGINS_BAD_PLUGIN_HLS_BACKEND_NETTLE
> +
> +config BR2_PACKAGE_GST1_PLUGINS_BAD_PLUGIN_HLS_BACKEND_LIBGCRYPT
> +	bool "libgcrypt"
> +	depends on BR2_PACKAGE_LIBGPG_ERROR_ARCH_SUPPORTS # libgcrypt -> libgpg-error
> +	select BR2_PACKAGE_LIBGCRYPT
> +
> +config BR2_PACKAGE_GST1_PLUGINS_BAD_PLUGIN_HLS_BACKEND_NETTLE
> +	bool "nettle"
> +	select BR2_PACKAGE_NETTLE
> +
> +config BR2_PACKAGE_GST1_PLUGINS_BAD_PLUGIN_HLS_BACKEND_OPENSSL
> +	bool "openssl"
> +	select BR2_PACKAGE_OPENSSL
> +
> +endchoice

I'm not sure I want to see a choice for this. Could we instead have
the .mk file automatically selected the backend according to which
crypto package(s) are available?

Thanks,

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH 1/1] gst1-plugins-bad: hls: allow user to select crypto backend
  2016-08-03 12:29 ` Thomas Petazzoni
@ 2016-08-03 13:47   ` Rahul Bedarkar
  2016-08-03 20:35     ` Peter Korsgaard
  0 siblings, 1 reply; 5+ messages in thread
From: Rahul Bedarkar @ 2016-08-03 13:47 UTC (permalink / raw)
  To: buildroot

Hi Thomas,

On Wednesday 03 August 2016 05:59 PM, Thomas Petazzoni wrote:
> Hello,
>
> On Wed, 3 Aug 2016 17:49:27 +0530, Rahul Bedarkar wrote:
>
>> +if BR2_PACKAGE_GST1_PLUGINS_BAD_PLUGIN_HLS
>> +
>> +choice
>> +	prompt "choose HLS cryptographic backend"
>> +	default BR2_PACKAGE_GST1_PLUGINS_BAD_PLUGIN_HLS_BACKEND_NETTLE
>> +
>> +config BR2_PACKAGE_GST1_PLUGINS_BAD_PLUGIN_HLS_BACKEND_LIBGCRYPT
>> +	bool "libgcrypt"
>> +	depends on BR2_PACKAGE_LIBGPG_ERROR_ARCH_SUPPORTS # libgcrypt -> libgpg-error
>> +	select BR2_PACKAGE_LIBGCRYPT
>> +
>> +config BR2_PACKAGE_GST1_PLUGINS_BAD_PLUGIN_HLS_BACKEND_NETTLE
>> +	bool "nettle"
>> +	select BR2_PACKAGE_NETTLE
>> +
>> +config BR2_PACKAGE_GST1_PLUGINS_BAD_PLUGIN_HLS_BACKEND_OPENSSL
>> +	bool "openssl"
>> +	select BR2_PACKAGE_OPENSSL
>> +
>> +endchoice
>
> I'm not sure I want to see a choice for this. Could we instead have
> the .mk file automatically selected the backend according to which
> crypto package(s) are available?

HLS plugin only supports above three crypto backends. If user hasn't 
specified which backend to use then build system tries find nettle or 
libgcrypt or openssl in order. If none of the backend is available then 
HLS plugin gets disabled internally.

Automatically selecting the backend based on which crypto packages are 
available, will work only if atleast one of supported crypto packages 
are selected already. If none of the supported packages are available, 
then we may need to add dependency on one of those crypto packages in 
.mk without selecting them in Config.in. That looks like broken dependency ?

Regards,

Rahul

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH 1/1] gst1-plugins-bad: hls: allow user to select crypto backend
  2016-08-03 13:47   ` Rahul Bedarkar
@ 2016-08-03 20:35     ` Peter Korsgaard
  2016-08-04 10:09       ` Rahul Bedarkar
  0 siblings, 1 reply; 5+ messages in thread
From: Peter Korsgaard @ 2016-08-03 20:35 UTC (permalink / raw)
  To: buildroot

>>>>> "Rahul" == Rahul Bedarkar <Rahul.Bedarkar@imgtec.com> writes:

Hi,

 >> I'm not sure I want to see a choice for this. Could we instead have
 >> the .mk file automatically selected the backend according to which
 >> crypto package(s) are available?

 > HLS plugin only supports above three crypto backends. If user hasn't
 > specified which backend to use then build system tries find nettle or
 > libgcrypt or openssl in order. If none of the backend is available
 > then HLS plugin gets disabled internally.

 > Automatically selecting the backend based on which crypto packages are
 > available, will work only if atleast one of supported crypto packages
 > are selected already. If none of the supported packages are available,
 > then we may need to add dependency on one of those crypto packages in
 > .mk without selecting them in Config.in. That looks like broken
 > dependency ?

Yes, but we can do something like (untested):

config BR2_PACKAGE_GST1_PLUGINS_BAD_PLUGIN_HLS
        bool "hls"
        select BR2_PACKAGE_NETTLE if !(BR2_PACKAGE_GNUTLS || BR2_PACKAGE_OPENSSL)
        help
          Fragmented streaming plugins

and then in the .mk:

ifeq ($(BR2_PACKAGE_NETTLE),y)
GST1_PLUGINS_BAD_DEPENDENCIES += nettle
GST1_PLUGINS_BAD_CONF_OPTS += --with-hls-crypto=nettle
else ifeq ($(BR2_PACKAGE_GNUTLS),y)
GST1_PLUGINS_BAD_DEPENDENCIES += libgcrypt
GST1_PLUGINS_BAD_CONF_OPTS += --with-hls-crypto=libgcrypt \
	--with-libgcrypt-prefix=$(STAGING_DIR)/usr
else
GST1_PLUGINS_BAD_DEPENDENCIES += openssl
GST1_PLUGINS_BAD_CONF_OPTS += --with-hls-crypto=openssl
endif

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH 1/1] gst1-plugins-bad: hls: allow user to select crypto backend
  2016-08-03 20:35     ` Peter Korsgaard
@ 2016-08-04 10:09       ` Rahul Bedarkar
  0 siblings, 0 replies; 5+ messages in thread
From: Rahul Bedarkar @ 2016-08-04 10:09 UTC (permalink / raw)
  To: buildroot

Hi Thomas, Peter,

On Thursday 04 August 2016 02:05 AM, Peter Korsgaard wrote:
>
> Yes, but we can do something like (untested):
>
> config BR2_PACKAGE_GST1_PLUGINS_BAD_PLUGIN_HLS
>          bool "hls"
>          select BR2_PACKAGE_NETTLE if !(BR2_PACKAGE_GNUTLS || BR2_PACKAGE_OPENSSL)
>          help
>            Fragmented streaming plugins
>
> and then in the .mk:
>
> ifeq ($(BR2_PACKAGE_NETTLE),y)
> GST1_PLUGINS_BAD_DEPENDENCIES += nettle
> GST1_PLUGINS_BAD_CONF_OPTS += --with-hls-crypto=nettle
> else ifeq ($(BR2_PACKAGE_GNUTLS),y)
> GST1_PLUGINS_BAD_DEPENDENCIES += libgcrypt
> GST1_PLUGINS_BAD_CONF_OPTS += --with-hls-crypto=libgcrypt \
> 	--with-libgcrypt-prefix=$(STAGING_DIR)/usr
> else
> GST1_PLUGINS_BAD_DEPENDENCIES += openssl
> GST1_PLUGINS_BAD_CONF_OPTS += --with-hls-crypto=openssl
> endif
>

Thanks for suggestion. I've sent new patch.

Regards,

Rahul

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-08-04 10:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-03 12:19 [Buildroot] [PATCH 1/1] gst1-plugins-bad: hls: allow user to select crypto backend Rahul Bedarkar
2016-08-03 12:29 ` Thomas Petazzoni
2016-08-03 13:47   ` Rahul Bedarkar
2016-08-03 20:35     ` Peter Korsgaard
2016-08-04 10:09       ` Rahul Bedarkar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox