/* NOP */
}
-#else
+#elif defined(HAVE_LIBGCRYPT)
static gboolean
gst_hls_demux_stream_decrypt_start (GstHLSDemuxStream * stream,
const guint8 * key_data, const guint8 * iv_data)
stream->aes_ctx = NULL;
}
}
+
+#else
+/* NO crypto available */
+static gboolean
+gst_hls_demux_stream_decrypt_start (GstHLSDemuxStream * stream,
+ const guint8 * key_data, const guint8 * iv_data)
+{
+ GST_ERROR ("No crypto available");
+ return FALSE;
+}
+
+static gboolean
+decrypt_fragment (GstHLSDemuxStream * stream, gsize length,
+ const guint8 * encrypted_data, guint8 * decrypted_data)
+{
+ GST_ERROR ("Cannot decrypt fragment, no crypto available");
+ return FALSE;
+}
+
+static void
+gst_hls_demux_stream_decrypt_end (GstHLSDemuxStream * stream)
+{
+ return;
+}
#endif
static GstBuffer *
hls_crypto = get_option('hls-crypto')
hls_option = get_option('hls')
-have_hls_crypto = false
-if not hls_option.disabled()
- if ['auto', 'nettle'].contains(hls_crypto)
- hls_crypto_dep = dependency('nettle', required : false)
- if hls_crypto_dep.found()
- have_hls_crypto = true
- hls_cargs += ['-DHAVE_NETTLE']
- endif
- endif
+hls_crypto_dep = dependency('', required : false)
+
+if hls_option.disabled()
+ subdir_done()
+endif
- if not have_hls_crypto and ['auto', 'libgcrypt'].contains(hls_crypto)
- hls_crypto_dep = cc.find_library('gcrypt', required : false)
- if hls_crypto_dep.found()
- have_hls_crypto = true
- hls_cargs += ['-DHAVE_LIBGCRYPT']
- endif
+if ['auto', 'nettle'].contains(hls_crypto)
+ hls_crypto_dep = dependency('nettle', required : false)
+ if hls_crypto_dep.found()
+ hls_cargs += ['-DHAVE_NETTLE']
endif
+endif
- if not have_hls_crypto and ['auto', 'openssl'].contains(hls_crypto)
- hls_crypto_dep = dependency('openssl', required : false)
- if hls_crypto_dep.found()
- have_hls_crypto = true
- hls_cargs += ['-DHAVE_OPENSSL']
- endif
+if not hls_crypto_dep.found() and ['auto', 'libgcrypt'].contains(hls_crypto)
+ hls_crypto_dep = cc.find_library('gcrypt', required : false)
+ if hls_crypto_dep.found()
+ hls_cargs += ['-DHAVE_LIBGCRYPT']
endif
+endif
- if not have_hls_crypto and hls_option.enabled()
- if hls_crypto == 'auto'
- error('HLS plugin enabled, but found none of nettle, libgcrypt, or openssl')
- else
- error('HLS plugin enabled, but crypto library "@0@" not found'.format(hls_crypto))
- endif
+if not hls_crypto_dep.found() and ['auto', 'openssl'].contains(hls_crypto)
+ hls_crypto_dep = dependency('openssl', required : false)
+ if hls_crypto_dep.found()
+ hls_cargs += ['-DHAVE_OPENSSL']
endif
endif
-if have_hls_crypto
- gsthls = library('gsthls',
- hls_sources,
- c_args : gst_plugins_bad_args + hls_cargs,
- link_args : noseh_link_args,
- include_directories : [configinc],
- dependencies : [gstpbutils_dep, gsttag_dep, gstvideo_dep,
- gstadaptivedemux_dep, gsturidownloader_dep,
- hls_crypto_dep, libm],
- install : true,
- install_dir : plugins_install_dir,
- )
- pkgconfig.generate(gsthls, install_dir : plugins_pkgconfig_install_dir)
+if not hls_crypto_dep.found()
+ if hls_crypto == 'auto'
+ message('Enable HLS plugin enable without crypto')
+ elif hls_option.enabled()
+ error('HLS plugin enabled with crypto, but crypto library "@0@" not found'.format(hls_crypto))
+ else
+ subdir_done()
+ endif
endif
+
+gsthls = library('gsthls',
+ hls_sources,
+ c_args : gst_plugins_bad_args + hls_cargs,
+ link_args : noseh_link_args,
+ include_directories : [configinc],
+ dependencies : [gstpbutils_dep, gsttag_dep, gstvideo_dep,
+ gstadaptivedemux_dep, gsturidownloader_dep,
+ hls_crypto_dep, libm],
+ install : true,
+ install_dir : plugins_install_dir,
+)
+pkgconfig.generate(gsthls, install_dir : plugins_pkgconfig_install_dir)