summaryrefslogtreecommitdiff
path: root/ext/hls/gsthlsdemux.c
diff options
context:
space:
mode:
authorSeungha Yang <seungha.yang@navercorp.com>2019-04-09 20:07:05 +0900
committerSeungha Yang <seungha.yang@navercorp.com>2019-08-21 22:55:50 +0900
commit98b303498ab352ef2efae47d76c2c41035c0005a (patch)
tree9678a5ada00807ae33270898ee302afdbeb179d4 /ext/hls/gsthlsdemux.c
parent807e311ae846e2c5b4ac26cabe5a9c672a5c7a4e (diff)
downloadgstreamer-plugins-bad-98b303498ab352ef2efae47d76c2c41035c0005a.tar.gz
hls: Make crypto dependency optional when hls-crypto is auto
crypto libraries are not required for hlssink and hlssink2. Also, hlsdemux with nonencrypted stream can work without crpyto. Make an error only when users set "hls-crpyto" with non-auto option explicitly, but no crpyto library was found.
Diffstat (limited to 'ext/hls/gsthlsdemux.c')
-rw-r--r--ext/hls/gsthlsdemux.c26
1 files changed, 25 insertions, 1 deletions
diff --git a/ext/hls/gsthlsdemux.c b/ext/hls/gsthlsdemux.c
index 1e4d0df90..968475746 100644
--- a/ext/hls/gsthlsdemux.c
+++ b/ext/hls/gsthlsdemux.c
@@ -1753,7 +1753,7 @@ gst_hls_demux_stream_decrypt_end (GstHLSDemuxStream * stream)
/* NOP */
}
-#else
+#elif defined(HAVE_LIBGCRYPT)
static gboolean
gst_hls_demux_stream_decrypt_start (GstHLSDemuxStream * stream,
const guint8 * key_data, const guint8 * iv_data)
@@ -1801,6 +1801,30 @@ gst_hls_demux_stream_decrypt_end (GstHLSDemuxStream * stream)
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 *