build: don't compile HEVC if not supported
authorVíctor Manuel Jáquez Leal <vjaquez@igalia.com>
Tue, 14 Apr 2015 08:08:47 +0000 (10:08 +0200)
committerVíctor Manuel Jáquez Leal <vjaquez@igalia.com>
Tue, 14 Apr 2015 09:36:13 +0000 (11:36 +0200)
HEVC decoding was added recently libva-1.5.

This patch avoids HEVC decoding support in libgstvaapi if it is not available
in the installed libva.

https://bugzilla.gnome.org/show_bug.cgi?id=747831

configure.ac
gst-libs/gst/vaapi/Makefile.am

index 72afb8a..d86545f 100644 (file)
@@ -955,6 +955,10 @@ AC_DEFINE_UNQUOTED(USE_VP8_DECODER, $USE_VP8_DECODER,
     [Defined to 1 if VP8 decoder is used])
 AM_CONDITIONAL(USE_VP8_DECODER, test $USE_VP8_DECODER -eq 1)
 
+AC_DEFINE_UNQUOTED(USE_HEVC_DECODER, $USE_HEVC_DECODER,
+    [Defined to 1 if HEVC decoder is used])
+AM_CONDITIONAL(USE_HEVC_DECODER, test $USE_HEVC_DECODER -eq 1)
+
 AC_DEFINE_UNQUOTED(USE_DRM, $USE_DRM,
     [Defined to 1 if DRM is enabled])
 AM_CONDITIONAL(USE_DRM, test $USE_DRM -eq 1)
index 4c6a254..4c3551e 100644 (file)
@@ -55,7 +55,6 @@ libgstvaapi_source_c =                                \
        gstvaapidecoder.c                       \
        gstvaapidecoder_dpb.c                   \
        gstvaapidecoder_h264.c                  \
-       gstvaapidecoder_h265.c                  \
        gstvaapidecoder_mpeg2.c                 \
        gstvaapidecoder_mpeg4.c                 \
        gstvaapidecoder_objects.c               \
@@ -81,7 +80,6 @@ libgstvaapi_source_c =                                \
        gstvaapiutils_core.c                    \
        gstvaapiutils_h264.c                    \
        gstvaapiutils_mpeg2.c                   \
-       gstvaapiutils_h265.c                    \
        gstvaapivalue.c                         \
        gstvaapivideopool.c                     \
        gstvaapiwindow.c                        \
@@ -112,7 +110,6 @@ libgstvaapi_source_h =                              \
        gstvaapitypes.h                         \
        gstvaapiutils_h264.h                    \
        gstvaapiutils_mpeg2.h                   \
-       gstvaapiutils_h265.h                    \
        gstvaapivalue.h                         \
        gstvaapivideopool.h                     \
        gstvaapiwindow.h                        \
@@ -146,7 +143,6 @@ libgstvaapi_source_priv_h =                 \
        gstvaapiutils_core.h                    \
        gstvaapiutils_h264_priv.h               \
        gstvaapiutils_mpeg2_priv.h              \
-       gstvaapiutils_h265_priv.h               \
        gstvaapiversion.h                       \
        gstvaapivideopool_priv.h                \
        gstvaapiwindow_priv.h                   \
@@ -169,6 +165,17 @@ libgstvaapi_source_c += $(libgstvaapi_vp8dec_source_c)
 libgstvaapi_source_h += $(libgstvaapi_vp8dec_source_h)
 endif
 
+libgstvaapi_hevcdec_source_c =                         \
+       gstvaapidecoder_h265.c                  \
+       gstvaapiutils_h265.c
+libgstvaapi_hevcdec_source_h = gstvaapiutils_h265.h
+libgstvaapi_hevcdec_source_priv_h = gstvaapiutils_h265_priv.h
+if USE_HEVC_DECODER
+libgstvaapi_source_c += $(libgstvaapi_hevcdec_source_c)
+libgstvaapi_source_h += $(libgstvaapi_hevcdec_source_h)
+libgstvaapi_source_priv_h += $(libgstvaapi_hevcdec_source_priv_h)
+endif
+
 libgstvaapi_enc_source_c =                     \
        gstvaapicodedbuffer.c                   \
        gstvaapicodedbufferpool.c               \
@@ -576,6 +583,9 @@ EXTRA_DIST += \
        $(libgstvaapi_jpegdec_source_h)         \
        $(libgstvaapi_vp8dec_source_c)          \
        $(libgstvaapi_vp8dec_source_h)          \
+       $(libgstvaapi_hevcdec_source_c)         \
+       $(libgstvaapi_hevcdec_source_h)         \
+       $(libgstvaapi_hevcdec_source_priv_h)    \
        $(libgstvaapi_jpegenc_source_h)         \
        $(libgstvaapi_jpegenc_source_c)         \
        $(libgstvaapi_vp8enc_source_h)          \