diff options
Diffstat (limited to 'gst-libs/gst')
-rw-r--r-- | gst-libs/gst/vaapi/Makefile.am | 41 | ||||
-rw-r--r-- | gst-libs/gst/vaapi/gstvaapibufferproxy.c | 25 | ||||
-rw-r--r-- | gst-libs/gst/vaapi/gstvaapibufferproxy_priv.h | 2 | ||||
-rw-r--r-- | gst-libs/gst/vaapi/gstvaapicodec_objects.c | 6 | ||||
-rw-r--r-- | gst-libs/gst/vaapi/gstvaapicompat.h | 55 | ||||
-rw-r--r-- | gst-libs/gst/vaapi/gstvaapicontext.c | 2 | ||||
-rw-r--r-- | gst-libs/gst/vaapi/gstvaapidisplay.c | 2 | ||||
-rw-r--r-- | gst-libs/gst/vaapi/gstvaapiencoder_objects.c | 2 | ||||
-rw-r--r-- | gst-libs/gst/vaapi/gstvaapifilter.c | 47 | ||||
-rw-r--r-- | gst-libs/gst/vaapi/gstvaapiprofile.c | 18 | ||||
-rw-r--r-- | gst-libs/gst/vaapi/gstvaapisurface.c | 10 | ||||
-rw-r--r-- | gst-libs/gst/vaapi/gstvaapiutils.c | 35 | ||||
-rw-r--r-- | gst-libs/gst/vaapi/gstvaapiutils_core.c | 2 | ||||
-rw-r--r-- | gst-libs/gst/vaapi/meson.build | 48 |
14 files changed, 21 insertions, 274 deletions
diff --git a/gst-libs/gst/vaapi/Makefile.am b/gst-libs/gst/vaapi/Makefile.am index 54c13885..976466e0 100644 --- a/gst-libs/gst/vaapi/Makefile.am +++ b/gst-libs/gst/vaapi/Makefile.am @@ -148,31 +148,23 @@ libgstvaapi_source_priv_h = \ libgstvaapi_jpegdec_source_c = gstvaapidecoder_jpeg.c libgstvaapi_jpegdec_source_h = gstvaapidecoder_jpeg.h -if USE_JPEG_DECODER libgstvaapi_source_c += $(libgstvaapi_jpegdec_source_c) libgstvaapi_source_h += $(libgstvaapi_jpegdec_source_h) -endif libgstvaapi_vp8dec_source_c = gstvaapidecoder_vp8.c libgstvaapi_vp8dec_source_h = gstvaapidecoder_vp8.h -if USE_VP8_DECODER libgstvaapi_source_c += $(libgstvaapi_vp8dec_source_c) libgstvaapi_source_h += $(libgstvaapi_vp8dec_source_h) -endif libgstvaapi_hevcdec_source_c = gstvaapidecoder_h265.c libgstvaapi_hevcdec_source_h = gstvaapidecoder_h265.h -if USE_H265_DECODER libgstvaapi_source_c += $(libgstvaapi_hevcdec_source_c) libgstvaapi_source_h += $(libgstvaapi_hevcdec_source_h) -endif libgstvaapi_vp9dec_source_c = gstvaapidecoder_vp9.c libgstvaapi_vp9dec_source_h = gstvaapidecoder_vp9.h -if USE_VP9_DECODER libgstvaapi_source_c += $(libgstvaapi_vp9dec_source_c) libgstvaapi_source_h += $(libgstvaapi_vp9dec_source_h) -endif libgstvaapi_enc_source_c = \ gstvaapicodedbuffer.c \ @@ -180,8 +172,11 @@ libgstvaapi_enc_source_c = \ gstvaapicodedbufferproxy.c \ gstvaapiencoder.c \ gstvaapiencoder_h264.c \ + gstvaapiencoder_h265.c \ + gstvaapiencoder_jpeg.c \ gstvaapiencoder_mpeg2.c \ gstvaapiencoder_objects.c \ + gstvaapiencoder_vp8.c \ $(NULL) libgstvaapi_enc_source_h = \ @@ -190,7 +185,10 @@ libgstvaapi_enc_source_h = \ gstvaapicodedbufferproxy.h \ gstvaapiencoder.h \ gstvaapiencoder_h264.h \ + gstvaapiencoder_h265.h \ + gstvaapiencoder_jpeg.h \ gstvaapiencoder_mpeg2.h \ + gstvaapiencoder_vp8.h \ $(NULL) libgstvaapi_enc_source_priv_h = \ @@ -207,27 +205,6 @@ libgstvaapi_source_h += $(libgstvaapi_enc_source_h) libgstvaapi_source_priv_h += $(libgstvaapi_enc_source_priv_h) endif -libgstvaapi_jpegenc_source_c = gstvaapiencoder_jpeg.c -libgstvaapi_jpegenc_source_h = gstvaapiencoder_jpeg.h -if USE_JPEG_ENCODER -libgstvaapi_source_c += $(libgstvaapi_jpegenc_source_c) -libgstvaapi_source_h += $(libgstvaapi_jpegenc_source_h) -endif - -libgstvaapi_vp8enc_source_c = gstvaapiencoder_vp8.c -libgstvaapi_vp8enc_source_h = gstvaapiencoder_vp8.h -if USE_VP8_ENCODER -libgstvaapi_source_c += $(libgstvaapi_vp8enc_source_c) -libgstvaapi_source_h += $(libgstvaapi_vp8enc_source_h) -endif - -libgstvaapi_h265enc_source_c = gstvaapiencoder_h265.c -libgstvaapi_h265enc_source_h = gstvaapiencoder_h265.h -if USE_H265_ENCODER -libgstvaapi_source_c += $(libgstvaapi_h265enc_source_c) -libgstvaapi_source_h += $(libgstvaapi_h265enc_source_h) -endif - libgstvaapi_vp9enc_source_c = gstvaapiencoder_vp9.c libgstvaapi_vp9enc_source_h = gstvaapiencoder_vp9.h if USE_VP9_ENCODER @@ -535,12 +512,6 @@ EXTRA_DIST = \ $(libgstvaapi_hevcdec_source_priv_h) \ $(libgstvaapi_vp9dec_source_c) \ $(libgstvaapi_vp9dec_source_h) \ - $(libgstvaapi_jpegenc_source_h) \ - $(libgstvaapi_jpegenc_source_c) \ - $(libgstvaapi_vp8enc_source_h) \ - $(libgstvaapi_vp8enc_source_c) \ - $(libgstvaapi_h265enc_source_h) \ - $(libgstvaapi_h265enc_source_c) \ $(libgstvaapi_vp9enc_source_h) \ $(libgstvaapi_vp9enc_source_c) \ $(libgstvaapi_egl_source_c) \ diff --git a/gst-libs/gst/vaapi/gstvaapibufferproxy.c b/gst-libs/gst/vaapi/gstvaapibufferproxy.c index b4fc0b7d..7ec1e294 100644 --- a/gst-libs/gst/vaapi/gstvaapibufferproxy.c +++ b/gst-libs/gst/vaapi/gstvaapibufferproxy.c @@ -36,14 +36,12 @@ from_GstVaapiBufferMemoryType (guint type) guint va_type; switch (type) { -#if VA_CHECK_VERSION(0,36,0) case GST_VAAPI_BUFFER_MEMORY_TYPE_DMA_BUF: va_type = VA_SURFACE_ATTRIB_MEM_TYPE_DRM_PRIME; break; case GST_VAAPI_BUFFER_MEMORY_TYPE_GEM_BUF: va_type = VA_SURFACE_ATTRIB_MEM_TYPE_KERNEL_DRM; break; -#endif default: va_type = 0; break; @@ -57,14 +55,12 @@ to_GstVaapiBufferMemoryType (guint va_type) guint type; switch (va_type) { -#if VA_CHECK_VERSION(0,36,0) case VA_SURFACE_ATTRIB_MEM_TYPE_DRM_PRIME: type = GST_VAAPI_BUFFER_MEMORY_TYPE_DMA_BUF; break; case VA_SURFACE_ATTRIB_MEM_TYPE_KERNEL_DRM: type = GST_VAAPI_BUFFER_MEMORY_TYPE_GEM_BUF; break; -#endif default: type = 0; break; @@ -72,7 +68,6 @@ to_GstVaapiBufferMemoryType (guint va_type) return type; } -#if VA_CHECK_VERSION (0,36,0) static gboolean gst_vaapi_buffer_proxy_acquire_handle (GstVaapiBufferProxy * proxy) { @@ -96,7 +91,6 @@ gst_vaapi_buffer_proxy_acquire_handle (GstVaapiBufferProxy * proxy) return TRUE; } -/* VA_CHECK_VERSION (0,36,0) */ static gboolean gst_vaapi_buffer_proxy_release_handle (GstVaapiBufferProxy * proxy) { @@ -117,7 +111,6 @@ gst_vaapi_buffer_proxy_release_handle (GstVaapiBufferProxy * proxy) return TRUE; } -/* VA_CHECK_VERSION (0,36,0) */ static void gst_vaapi_buffer_proxy_finalize (GstVaapiBufferProxy * proxy) { @@ -135,7 +128,6 @@ gst_vaapi_buffer_proxy_finalize (GstVaapiBufferProxy * proxy) gst_vaapi_object_replace (&proxy->parent, NULL); } -/* VA_CHECK_VERSION (0,36,0) */ static inline const GstVaapiMiniObjectClass * gst_vaapi_buffer_proxy_class (void) { @@ -145,13 +137,11 @@ gst_vaapi_buffer_proxy_class (void) }; return &GstVaapiBufferProxyClass; } -#endif GstVaapiBufferProxy * gst_vaapi_buffer_proxy_new (guintptr handle, guint type, gsize size, GDestroyNotify destroy_func, gpointer user_data) { -#if VA_CHECK_VERSION (0,36,0) GstVaapiBufferProxy *proxy; g_return_val_if_fail (handle != 0, NULL); @@ -183,16 +173,12 @@ error_unsupported_mem_type: gst_vaapi_buffer_proxy_unref (proxy); return NULL; } -#else - return NULL; -#endif } GstVaapiBufferProxy * gst_vaapi_buffer_proxy_new_from_object (GstVaapiObject * object, VABufferID buf_id, guint type, GDestroyNotify destroy_func, gpointer data) { -#if VA_CHECK_VERSION (0,36,0) GstVaapiBufferProxy *proxy; g_return_val_if_fail (object != NULL, NULL); @@ -229,9 +215,6 @@ error_acquire_handle: gst_vaapi_buffer_proxy_unref (proxy); return NULL; } -#else - return NULL; -#endif } /** @@ -314,11 +297,7 @@ gst_vaapi_buffer_proxy_get_handle (GstVaapiBufferProxy * proxy) { g_return_val_if_fail (proxy != NULL, 0); -#if VA_CHECK_VERSION (0,36,0) return GST_VAAPI_BUFFER_PROXY_HANDLE (proxy); -#else - return 0; -#endif } /** @@ -334,11 +313,7 @@ gst_vaapi_buffer_proxy_get_size (GstVaapiBufferProxy * proxy) { g_return_val_if_fail (proxy != NULL, 0); -#if VA_CHECK_VERSION (0,36,0) return GST_VAAPI_BUFFER_PROXY_SIZE (proxy); -#else - return 0; -#endif } /** diff --git a/gst-libs/gst/vaapi/gstvaapibufferproxy_priv.h b/gst-libs/gst/vaapi/gstvaapibufferproxy_priv.h index 39893e68..d0fb9a23 100644 --- a/gst-libs/gst/vaapi/gstvaapibufferproxy_priv.h +++ b/gst-libs/gst/vaapi/gstvaapibufferproxy_priv.h @@ -68,9 +68,7 @@ struct _GstVaapiBufferProxy { gpointer destroy_data; guint type; VABufferID va_buf; -#if VA_CHECK_VERSION (0,36,0) VABufferInfo va_info; -#endif GstMemory *mem; }; diff --git a/gst-libs/gst/vaapi/gstvaapicodec_objects.c b/gst-libs/gst/vaapi/gstvaapicodec_objects.c index 29f1b7a8..e66d2fe7 100644 --- a/gst-libs/gst/vaapi/gstvaapicodec_objects.c +++ b/gst-libs/gst/vaapi/gstvaapicodec_objects.c @@ -177,7 +177,6 @@ gst_vaapi_bitplane_new (GstVaapiDecoder * decoder, guint8 * data, /* --- JPEG Huffman Tables --- */ /* ------------------------------------------------------------------------- */ -#if USE_JPEG_DECODER GST_VAAPI_CODEC_DEFINE_TYPE (GstVaapiHuffmanTable, gst_vaapi_huffman_table); void @@ -209,8 +208,7 @@ gst_vaapi_huffman_table_new (GstVaapiDecoder * decoder, return NULL; return GST_VAAPI_HUFFMAN_TABLE_CAST (object); } -#endif -#if USE_VP8_DECODER + GST_VAAPI_CODEC_DEFINE_TYPE (GstVaapiProbabilityTable, gst_vaapi_probability_table); @@ -244,5 +242,3 @@ gst_vaapi_probability_table_new (GstVaapiDecoder * decoder, return NULL; return GST_VAAPI_PROBABILITY_TABLE_CAST (object); } - -#endif diff --git a/gst-libs/gst/vaapi/gstvaapicompat.h b/gst-libs/gst/vaapi/gstvaapicompat.h index b87df0eb..f75a9eae 100644 --- a/gst-libs/gst/vaapi/gstvaapicompat.h +++ b/gst-libs/gst/vaapi/gstvaapicompat.h @@ -27,16 +27,6 @@ #include <va/va.h> -/* Compatibility glue with VA-API < 0.31 */ -#if !VA_CHECK_VERSION(0,31,0) -#undef vaSyncSurface -#define vaSyncSurface(dpy, s) (vaSyncSurface)((dpy), VA_INVALID_ID, (s)) -#undef vaPutImage -#define vaPutImage vaPutImage2 -#undef vaAssociateSubpicture -#define vaAssociateSubpicture vaAssociateSubpicture2 -#endif - #if VA_CHECK_VERSION(1,0,0) #define VA_ROI_RC_QP_DELTA_SUPPORT(x) x->bits.roi_rc_qp_delta_support #define VA_ENC_PACKED_HEADER_H264_SEI VAEncPackedHeaderRawData @@ -45,50 +35,7 @@ #define VA_ENC_PACKED_HEADER_H264_SEI VAEncPackedHeaderH264_SEI #endif -/* Compatibility glue with VA-API 0.34 */ -#if VA_CHECK_VERSION(0,34,0) -# include <va/va_compat.h> -#endif - -#if VA_CHECK_VERSION(0,36,0) +#include <va/va_compat.h> #include <va/va_drmcommon.h> -#endif - -/* VA-API < 0.37 doesn't include sub core APIs in va.h */ -#if !VA_CHECK_VERSION(0,37,0) -#ifdef HAVE_VA_VA_DEC_HEVC_H -# include <va/va_dec_hevc.h> -#endif -#ifdef HAVE_VA_VA_DEC_JPEG_H -# include <va/va_dec_jpeg.h> -#endif -#ifdef HAVE_VA_VA_DEC_VP8_H -# include <va/va_dec_vp8.h> -#endif -#ifdef HAVE_VA_VA_DEC_VP9_H -# include <va/va_dec_vp9.h> -#endif -#ifdef HAVE_VA_VA_ENC_HEVC_H -# include <va/va_enc_hevc.h> -#endif -#ifdef HAVE_VA_VA_ENC_H264_H -# include <va/va_enc_h264.h> -#endif -#ifdef HAVE_VA_VA_ENC_JPEG_H -# include <va/va_enc_jpeg.h> -#endif -#ifdef HAVE_VA_VA_ENC_MPEG2_H -# include <va/va_enc_mpeg2.h> -#endif -#ifdef HAVE_VA_VA_ENC_VP8_H -# include <va/va_enc_vp8.h> -#endif -#ifdef HAVE_VA_VA_ENC_VP9_H -# include <va/va_enc_vp9.h> -#endif -#ifdef HAVE_VA_VA_VPP_H -# include <va/va_vpp.h> -#endif -#endif #endif /* GST_VAAPI_COMPAT_H */ diff --git a/gst-libs/gst/vaapi/gstvaapicontext.c b/gst-libs/gst/vaapi/gstvaapicontext.c index de9a7e80..006acb4b 100644 --- a/gst-libs/gst/vaapi/gstvaapicontext.c +++ b/gst-libs/gst/vaapi/gstvaapicontext.c @@ -302,7 +302,6 @@ config_create (GstVaapiContext * context) attrib = &attribs[++attrib_index]; g_assert (attrib_index < G_N_ELEMENTS (attribs)); } -#if VA_CHECK_VERSION(0,37,0) if (cip->profile == GST_VAAPI_PROFILE_JPEG_BASELINE) { attrib->type = VAConfigAttribEncJPEG; if (!context_get_attribute (context, attrib->type, &value)) @@ -311,7 +310,6 @@ config_create (GstVaapiContext * context) attrib = &attribs[++attrib_index]; g_assert (attrib_index < G_N_ELEMENTS (attribs)); } -#endif #if VA_CHECK_VERSION(0,39,1) if (config->roi_capability) { VAConfigAttribValEncROI *roi_config; diff --git a/gst-libs/gst/vaapi/gstvaapidisplay.c b/gst-libs/gst/vaapi/gstvaapidisplay.c index 5f2d4a27..3d8e39f5 100644 --- a/gst-libs/gst/vaapi/gstvaapidisplay.c +++ b/gst-libs/gst/vaapi/gstvaapidisplay.c @@ -532,7 +532,6 @@ ensure_profiles (GstVaapiDisplay * display) g_array_sort (priv->encoders, compare_profiles); /* Video processing API */ -#if USE_VA_VPP status = vaQueryConfigEntrypoints (priv->display, VAProfileNone, entrypoints, &num_entrypoints); if (vaapi_check_status (status, "vaQueryEntrypoints() [VAProfileNone]")) { @@ -541,7 +540,6 @@ ensure_profiles (GstVaapiDisplay * display) priv->has_vpp = TRUE; } } -#endif success = TRUE; cleanup: diff --git a/gst-libs/gst/vaapi/gstvaapiencoder_objects.c b/gst-libs/gst/vaapi/gstvaapiencoder_objects.c index ef72b590..f31181e7 100644 --- a/gst-libs/gst/vaapi/gstvaapiencoder_objects.c +++ b/gst-libs/gst/vaapi/gstvaapiencoder_objects.c @@ -289,7 +289,6 @@ gst_vaapi_enc_q_matrix_new (GstVaapiEncoder * encoder, /* --- JPEG Huffman Tables --- */ /* ------------------------------------------------------------------------- */ -#if USE_JPEG_ENCODER GST_VAAPI_CODEC_DEFINE_TYPE (GstVaapiEncHuffmanTable, gst_vaapi_enc_huffman_table); @@ -322,7 +321,6 @@ gst_vaapi_enc_huffman_table_new (GstVaapiEncoder * encoder, return NULL; return GST_VAAPI_ENC_HUFFMAN_TABLE_CAST (object); } -#endif /* ------------------------------------------------------------------------- */ /* --- Encoder Picture --- */ diff --git a/gst-libs/gst/vaapi/gstvaapifilter.c b/gst-libs/gst/vaapi/gstvaapifilter.c index 304272f8..5f25b373 100644 --- a/gst-libs/gst/vaapi/gstvaapifilter.c +++ b/gst-libs/gst/vaapi/gstvaapifilter.c @@ -125,14 +125,12 @@ gst_vaapi_deinterlace_method_get_type (void) "Disable deinterlacing", "none"}, {GST_VAAPI_DEINTERLACE_METHOD_BOB, "Bob deinterlacing", "bob"}, -#if USE_VA_VPP {GST_VAAPI_DEINTERLACE_METHOD_WEAVE, "Weave deinterlacing", "weave"}, {GST_VAAPI_DEINTERLACE_METHOD_MOTION_ADAPTIVE, "Motion adaptive deinterlacing", "motion-adaptive"}, {GST_VAAPI_DEINTERLACE_METHOD_MOTION_COMPENSATED, "Motion compensated deinterlacing", "motion-compensated"}, -#endif {0, NULL, NULL}, }; @@ -171,7 +169,6 @@ gst_vaapi_deinterlace_flags_get_type (void) /* --- VPP Helpers --- */ /* ------------------------------------------------------------------------- */ -#if USE_VA_VPP static VAProcFilterType * vpp_get_filters_unlocked (GstVaapiFilter * filter, guint * num_filters_ptr) { @@ -273,13 +270,11 @@ vpp_get_filter_caps (GstVaapiFilter * filter, VAProcFilterType type, GST_VAAPI_DISPLAY_UNLOCK (filter->display); return caps; } -#endif /* ------------------------------------------------------------------------- */ /* --- VPP Operations --- */ /* ------------------------------------------------------------------------- */ -#if USE_VA_VPP #define DEFAULT_FORMAT GST_VIDEO_FORMAT_UNKNOWN #define DEFAULT_SCALING GST_VAAPI_SCALE_METHOD_DEFAULT @@ -425,7 +420,6 @@ init_properties (void) GST_VAAPI_TYPE_SCALE_METHOD, DEFAULT_SCALING, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); -#if VA_CHECK_VERSION(0,36,0) /** * GstVaapiFilter:skin-tone-enhancement: * @@ -435,7 +429,6 @@ init_properties (void) "Skin tone enhancement", "Apply the skin tone enhancement algorithm", FALSE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); -#endif } static void @@ -484,12 +477,10 @@ op_data_new (GstVaapiFilterOp op, GParamSpec * pspec) op_data->va_cap_size = sizeof (VAProcFilterCap); op_data->va_buffer_size = sizeof (VAProcFilterParameterBuffer); break; -#if VA_CHECK_VERSION(0,36,0) case GST_VAAPI_FILTER_OP_SKINTONE: op_data->va_type = VAProcFilterSkinToneEnhancement; op_data->va_buffer_size = sizeof (VAProcFilterParameterBuffer); break; -#endif case GST_VAAPI_FILTER_OP_HUE: op_data->va_subtype = VAProcColorBalanceHue; goto op_colorbalance; @@ -715,14 +706,12 @@ error: return NULL; } } -#endif /* Determine the set of supported VPP operations by the specific filter, or known to this library if filter is NULL */ static GPtrArray * get_operations (GstVaapiFilter * filter) { -#if USE_VA_VPP GPtrArray *ops; if (filter && filter->operations) @@ -732,8 +721,6 @@ get_operations (GstVaapiFilter * filter) if (!ops) return NULL; return filter ? get_operations_ordered (filter, ops) : ops; -#endif - return NULL; } /* Ensure the set of supported VPP operations is cached into the @@ -776,7 +763,6 @@ find_operation (GstVaapiFilter * filter, GstVaapiFilterOp op) } /* Ensure the operation's VA buffer is allocated */ -#if USE_VA_VPP static inline gboolean op_ensure_buffer (GstVaapiFilter * filter, GstVaapiFilterOpData * op_data) { @@ -786,10 +772,8 @@ op_ensure_buffer (GstVaapiFilter * filter, GstVaapiFilterOpData * op_data) VAProcFilterParameterBufferType, op_data->va_buffer_size, NULL, &op_data->va_buffer, NULL); } -#endif /* Update a generic filter (float value) */ -#if USE_VA_VPP static gboolean op_set_generic_unlocked (GstVaapiFilter * filter, GstVaapiFilterOpData * op_data, gfloat value) @@ -819,7 +803,6 @@ op_set_generic_unlocked (GstVaapiFilter * filter, vaapi_unmap_buffer (filter->va_display, op_data->va_buffer, NULL); return TRUE; } -#endif static inline gboolean op_set_generic (GstVaapiFilter * filter, GstVaapiFilterOpData * op_data, @@ -827,16 +810,13 @@ op_set_generic (GstVaapiFilter * filter, GstVaapiFilterOpData * op_data, { gboolean success = FALSE; -#if USE_VA_VPP GST_VAAPI_DISPLAY_LOCK (filter->display); success = op_set_generic_unlocked (filter, op_data, value); GST_VAAPI_DISPLAY_UNLOCK (filter->display); -#endif return success; } /* Update the color balance filter */ -#if USE_VA_VPP static gboolean op_set_color_balance_unlocked (GstVaapiFilter * filter, GstVaapiFilterOpData * op_data, gfloat value) @@ -867,7 +847,6 @@ op_set_color_balance_unlocked (GstVaapiFilter * filter, vaapi_unmap_buffer (filter->va_display, op_data->va_buffer, NULL); return TRUE; } -#endif static inline gboolean op_set_color_balance (GstVaapiFilter * filter, GstVaapiFilterOpData * op_data, @@ -875,16 +854,13 @@ op_set_color_balance (GstVaapiFilter * filter, GstVaapiFilterOpData * op_data, { gboolean success = FALSE; -#if USE_VA_VPP GST_VAAPI_DISPLAY_LOCK (filter->display); success = op_set_color_balance_unlocked (filter, op_data, value); GST_VAAPI_DISPLAY_UNLOCK (filter->display); -#endif return success; } /* Update deinterlace filter */ -#if USE_VA_VPP static gboolean op_set_deinterlace_unlocked (GstVaapiFilter * filter, GstVaapiFilterOpData * op_data, GstVaapiDeinterlaceMethod method, @@ -920,7 +896,6 @@ op_set_deinterlace_unlocked (GstVaapiFilter * filter, vaapi_unmap_buffer (filter->va_display, op_data->va_buffer, NULL); return TRUE; } -#endif static inline gboolean op_set_deinterlace (GstVaapiFilter * filter, GstVaapiFilterOpData * op_data, @@ -928,16 +903,13 @@ op_set_deinterlace (GstVaapiFilter * filter, GstVaapiFilterOpData * op_data, { gboolean success = FALSE; -#if USE_VA_VPP GST_VAAPI_DISPLAY_LOCK (filter->display); success = op_set_deinterlace_unlocked (filter, op_data, method, flags); GST_VAAPI_DISPLAY_UNLOCK (filter->display); -#endif return success; } /* Update skin tone enhancement */ -#if USE_VA_VPP static gboolean op_set_skintone_unlocked (GstVaapiFilter * filter, GstVaapiFilterOpData * op_data, gboolean value) @@ -959,7 +931,6 @@ op_set_skintone_unlocked (GstVaapiFilter * filter, vaapi_unmap_buffer (filter->va_display, op_data->va_buffer, NULL); return TRUE; } -#endif static inline gboolean op_set_skintone (GstVaapiFilter * filter, GstVaapiFilterOpData * op_data, @@ -967,11 +938,9 @@ op_set_skintone (GstVaapiFilter * filter, GstVaapiFilterOpData * op_data, { gboolean success = FALSE; -#if USE_VA_VPP GST_VAAPI_DISPLAY_LOCK (filter->display); success = op_set_skintone_unlocked (filter, op_data, enhance); GST_VAAPI_DISPLAY_UNLOCK (filter->display); -#endif return success; } @@ -1044,7 +1013,6 @@ find_format (GstVaapiFilter * filter, GstVideoFormat format) /* --- Interface --- */ /* ------------------------------------------------------------------------- */ -#if USE_VA_VPP static void gst_vaapi_filter_init (GstVaapiFilter * filter) { @@ -1185,7 +1153,6 @@ gst_vaapi_filter_class_init (GstVaapiFilterClass * klass) "The VA-API display object to use", GST_TYPE_VAAPI_DISPLAY, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_NAME)); } -#endif /** * gst_vaapi_filter_new: @@ -1199,7 +1166,6 @@ gst_vaapi_filter_class_init (GstVaapiFilterClass * klass) GstVaapiFilter * gst_vaapi_filter_new (GstVaapiDisplay * display) { -#if USE_VA_VPP GstVaapiFilter *filter; filter = g_object_new (GST_TYPE_VAAPI_FILTER, "display", display, NULL); @@ -1213,11 +1179,6 @@ error: gst_object_unref (filter); return NULL; } -#else - GST_WARNING ("video processing is not supported, " - "please consider an upgrade to VA-API >= 0.34"); - return NULL; -#endif } /** @@ -1327,7 +1288,6 @@ gboolean gst_vaapi_filter_set_operation (GstVaapiFilter * filter, GstVaapiFilterOp op, const GValue * value) { -#if USE_VA_VPP GstVaapiFilterOpData *op_data; g_return_val_if_fail (filter != NULL, FALSE); @@ -1373,7 +1333,6 @@ gst_vaapi_filter_set_operation (GstVaapiFilter * filter, GstVaapiFilterOp op, default: break; } -#endif return FALSE; } @@ -1396,7 +1355,6 @@ static GstVaapiFilterStatus gst_vaapi_filter_process_unlocked (GstVaapiFilter * filter, GstVaapiSurface * src_surface, GstVaapiSurface * dst_surface, guint flags) { -#if USE_VA_VPP VAProcPipelineParameterBuffer *pipeline_param = NULL; VABufferID pipeline_param_buf_id = VA_INVALID_ID; VABufferID filters[N_PROPERTIES]; @@ -1536,8 +1494,6 @@ error: vaapi_destroy_buffer (filter->va_display, &pipeline_param_buf_id); return GST_VAAPI_FILTER_STATUS_ERROR_OPERATION_FAILED; } -#endif - return GST_VAAPI_FILTER_STATUS_ERROR_UNSUPPORTED_OPERATION; } GstVaapiFilterStatus @@ -1886,11 +1842,8 @@ static inline gfloat op_get_float_default_value (GstVaapiFilter * filter, GstVaapiFilterOpData * op_data) { -#if USE_VA_VPP GParamSpecFloat *const pspec = G_PARAM_SPEC_FLOAT (op_data->pspec); return pspec->default_value; -#endif - return 0.0; } gfloat diff --git a/gst-libs/gst/vaapi/gstvaapiprofile.c b/gst-libs/gst/vaapi/gstvaapiprofile.c index cc87096e..1e036c63 100644 --- a/gst-libs/gst/vaapi/gstvaapiprofile.c +++ b/gst-libs/gst/vaapi/gstvaapiprofile.c @@ -89,49 +89,37 @@ static const GstVaapiProfileMap gst_vaapi_profiles[] = { "video/x-divx, divxversion=5", "advanced-simple"}, {GST_VAAPI_PROFILE_MPEG4_ADVANCED_SIMPLE, VAProfileMPEG4AdvancedSimple, "video/x-xvid", "advanced-simple"}, -#if VA_CHECK_VERSION(0,30,0) {GST_VAAPI_PROFILE_H263_BASELINE, VAProfileH263Baseline, "video/x-h263, variant=itu, h263version=h263", "baseline"}, -#endif #if !VA_CHECK_VERSION(1,0,0) {GST_VAAPI_PROFILE_H264_BASELINE, VAProfileH264Baseline, "video/x-h264", "baseline"}, #endif -#if VA_CHECK_VERSION(0,31,1) {GST_VAAPI_PROFILE_H264_CONSTRAINED_BASELINE, VAProfileH264ConstrainedBaseline, "video/x-h264", "constrained-baseline"}, -#endif {GST_VAAPI_PROFILE_H264_MAIN, VAProfileH264Main, "video/x-h264", "main"}, {GST_VAAPI_PROFILE_H264_HIGH, VAProfileH264High, "video/x-h264", "high"}, -#if VA_CHECK_VERSION(0,35,2) {GST_VAAPI_PROFILE_H264_MULTIVIEW_HIGH, VAProfileH264MultiviewHigh, "video/x-h264", "multiview-high"}, {GST_VAAPI_PROFILE_H264_STEREO_HIGH, VAProfileH264StereoHigh, "video/x-h264", "stereo-high"}, -#endif {GST_VAAPI_PROFILE_VC1_SIMPLE, VAProfileVC1Simple, "video/x-wmv, wmvversion=3", "simple"}, {GST_VAAPI_PROFILE_VC1_MAIN, VAProfileVC1Main, "video/x-wmv, wmvversion=3", "main"}, {GST_VAAPI_PROFILE_VC1_ADVANCED, VAProfileVC1Advanced, "video/x-wmv, wmvversion=3, format=(string)WVC1", "advanced"}, -#if VA_CHECK_VERSION(0,32,0) {GST_VAAPI_PROFILE_JPEG_BASELINE, VAProfileJPEGBaseline, "image/jpeg", NULL}, -#endif -#if VA_CHECK_VERSION(0,35,0) {GST_VAAPI_PROFILE_VP8, VAProfileVP8Version0_3, "video/x-vp8", NULL}, -#endif -#if VA_CHECK_VERSION(0,37,0) {GST_VAAPI_PROFILE_H265_MAIN, VAProfileHEVCMain, "video/x-h265", "main"}, {GST_VAAPI_PROFILE_H265_MAIN10, VAProfileHEVCMain10, "video/x-h265", "main-10"}, -#endif #if VA_CHECK_VERSION(1,2,0) {GST_VAAPI_PROFILE_H265_MAIN_422_10, VAProfileHEVCMain422_10, "video/x-h265", "main-422-10"}, @@ -140,18 +128,14 @@ static const GstVaapiProfileMap gst_vaapi_profiles[] = { {GST_VAAPI_PROFILE_H265_MAIN_444_10, VAProfileHEVCMain444_10, "video/x-h265", "main-444-10"}, #endif -#if VA_CHECK_VERSION(0,38,0) {GST_VAAPI_PROFILE_VP9_0, VAProfileVP9Profile0, "video/x-vp9", "profile0"}, -#endif -#if VA_CHECK_VERSION(0,39,0) {GST_VAAPI_PROFILE_VP9_1, VAProfileVP9Profile1, "video/x-vp9", "profile1"}, {GST_VAAPI_PROFILE_VP9_2, VAProfileVP9Profile2, "video/x-vp9", "profile2"}, {GST_VAAPI_PROFILE_VP9_3, VAProfileVP9Profile3, "video/x-vp9", "profile3"}, -#endif {0,} }; @@ -160,10 +144,8 @@ static const GstVaapiEntrypointMap gst_vaapi_entrypoints[] = { {GST_VAAPI_ENTRYPOINT_VLD, VAEntrypointVLD}, {GST_VAAPI_ENTRYPOINT_IDCT, VAEntrypointIDCT}, {GST_VAAPI_ENTRYPOINT_MOCO, VAEntrypointMoComp}, -#if VA_CHECK_VERSION(0,30,0) {GST_VAAPI_ENTRYPOINT_SLICE_ENCODE, VAEntrypointEncSlice}, {GST_VAAPI_ENTRYPOINT_PICTURE_ENCODE, VAEntrypointEncPicture}, -#endif #if VA_CHECK_VERSION(0,39,1) {GST_VAAPI_ENTRYPOINT_SLICE_ENCODE_LP, VAEntrypointEncSliceLP}, #endif diff --git a/gst-libs/gst/vaapi/gstvaapisurface.c b/gst-libs/gst/vaapi/gstvaapisurface.c index 40d98745..482c9b63 100644 --- a/gst-libs/gst/vaapi/gstvaapisurface.c +++ b/gst-libs/gst/vaapi/gstvaapisurface.c @@ -132,7 +132,6 @@ static gboolean gst_vaapi_surface_create_full (GstVaapiSurface * surface, const GstVideoInfo * vip, guint flags) { -#if VA_CHECK_VERSION(0,34,0) GstVaapiDisplay *const display = GST_VAAPI_OBJECT_DISPLAY (surface); const GstVideoFormat format = GST_VIDEO_INFO_FORMAT (vip); VASurfaceID surface_id; @@ -219,16 +218,12 @@ error_unsupported_format: GST_ERROR ("unsupported format %s", gst_vaapi_video_format_to_string (format)); return FALSE; -#else - return FALSE; -#endif } static gboolean gst_vaapi_surface_create_from_buffer_proxy (GstVaapiSurface * surface, GstVaapiBufferProxy * proxy, const GstVideoInfo * vip) { -#if VA_CHECK_VERSION (0,36,0) GstVaapiDisplay *const display = GST_VAAPI_OBJECT_DISPLAY (surface); GstVideoFormat format; VASurfaceID surface_id; @@ -308,9 +303,6 @@ error_unsupported_format: GST_ERROR ("unsupported format %s", gst_vaapi_video_format_to_string (format)); return FALSE; -#else - return FALSE; -#endif } #define gst_vaapi_surface_finalize gst_vaapi_surface_destroy @@ -387,7 +379,6 @@ gst_vaapi_surface_new (GstVaapiDisplay * display, /* first try a recent version of vaCreateSurface, and later use as * fallback its old version */ -#if VA_CHECK_VERSION(0,34,0) { GstVideoInfo vi; GstVideoFormat surface_format; @@ -398,7 +389,6 @@ gst_vaapi_surface_new (GstVaapiDisplay * display, if (gst_vaapi_surface_create_full (surface, &vi, 0)) return surface; } -#endif if (!gst_vaapi_surface_create (surface, chroma_type, width, height)) goto error; return surface; diff --git a/gst-libs/gst/vaapi/gstvaapiutils.c b/gst-libs/gst/vaapi/gstvaapiutils.c index 414ae129..02a45350 100644 --- a/gst-libs/gst/vaapi/gstvaapiutils.c +++ b/gst-libs/gst/vaapi/gstvaapiutils.c @@ -214,42 +214,30 @@ string_of_VAProfile (VAProfile profile) MAP (MPEG4Simple); MAP (MPEG4AdvancedSimple); MAP (MPEG4Main); -#if VA_CHECK_VERSION(0,32,0) MAP (JPEGBaseline); MAP (H263Baseline); MAP (H264ConstrainedBaseline); -#endif #if !VA_CHECK_VERSION(1,0,0) MAP (H264Baseline); #endif MAP (H264Main); MAP (H264High); -#if VA_CHECK_VERSION(0,35,2) MAP (H264MultiviewHigh); MAP (H264StereoHigh); -#endif #if VA_CHECK_VERSION(1,2,0) MAP (HEVCMain422_10); MAP (HEVCMain444); #endif -#if VA_CHECK_VERSION(0,37,1) MAP (HEVCMain); MAP (HEVCMain10); -#endif MAP (VC1Simple); MAP (VC1Main); MAP (VC1Advanced); -#if VA_CHECK_VERSION(0,35,0) MAP (VP8Version0_3); -#endif -#if VA_CHECK_VERSION(0,37,0) MAP (VP9Profile0); -#endif -#if VA_CHECK_VERSION(0,39,0) MAP (VP9Profile1); MAP (VP9Profile2); MAP (VP9Profile3); -#endif #undef MAP default: break; @@ -288,17 +276,8 @@ string_of_VADisplayAttributeType (VADisplayAttribType attribute_type) MAP (Hue); MAP (Saturation); MAP (BackgroundColor); -#if !VA_CHECK_VERSION(0,34,0) - MAP (DirectSurface); -#endif MAP (Rotation); MAP (OutofLoopDeblock); -#if VA_CHECK_VERSION(0,31,1) && !VA_CHECK_VERSION(0,34,0) - MAP (BLEBlackMode); - MAP (BLEWhiteMode); - MAP (BlueStretch); - MAP (SkinColorCorrection); -#endif MAP (CSCMatrix); MAP (BlendColor); MAP (OverlayAutoPaintColorKey); @@ -323,15 +302,11 @@ string_of_va_chroma_format (guint chroma_format) MAP (YUV420); MAP (YUV422); MAP (YUV444); -#if VA_CHECK_VERSION(0,34,0) MAP (YUV400); MAP (RGB16); MAP (RGB32); MAP (RGBP); -#endif -#if VA_CHECK_VERSION(0,38,1) MAP (YUV420_10BPP); -#endif #if VA_CHECK_VERSION(1,2,0) MAP (YUV422_10); MAP (YUV444_10); @@ -397,7 +372,6 @@ to_GstVaapiChromaType (guint va_rt_format) case VA_RT_FORMAT_YUV444: chroma_type = GST_VAAPI_CHROMA_TYPE_YUV444; break; -#if VA_CHECK_VERSION(0,34,0) case VA_RT_FORMAT_YUV411: chroma_type = GST_VAAPI_CHROMA_TYPE_YUV411; break; @@ -413,12 +387,9 @@ to_GstVaapiChromaType (guint va_rt_format) case VA_RT_FORMAT_RGBP: chroma_type = GST_VAAPI_CHROMA_TYPE_RGBP; break; -#endif -#if VA_CHECK_VERSION(0,38,1) case VA_RT_FORMAT_YUV420_10BPP: chroma_type = GST_VAAPI_CHROMA_TYPE_YUV420_10BPP; break; -#endif #if VA_CHECK_VERSION(1,2,0) case VA_RT_FORMAT_YUV422_10: chroma_type = GST_VAAPI_CHROMA_TYPE_YUV422_10BPP; @@ -468,7 +439,6 @@ from_GstVaapiChromaType (guint chroma_type) case GST_VAAPI_CHROMA_TYPE_YUV444: format = VA_RT_FORMAT_YUV444; break; -#if VA_CHECK_VERSION(0,34,0) case GST_VAAPI_CHROMA_TYPE_YUV411: format = VA_RT_FORMAT_YUV411; break; @@ -484,12 +454,9 @@ from_GstVaapiChromaType (guint chroma_type) case GST_VAAPI_CHROMA_TYPE_RGBP: format = VA_RT_FORMAT_RGBP; break; -#endif -#if VA_CHECK_VERSION(0,38,1) case GST_VAAPI_CHROMA_TYPE_YUV420_10BPP: format = VA_RT_FORMAT_YUV420_10BPP; break; -#endif #if VA_CHECK_VERSION(1,2,0) case GST_VAAPI_CHROMA_TYPE_YUV422_10BPP: format = VA_RT_FORMAT_YUV422_10; @@ -683,10 +650,8 @@ to_GstVaapiSurfaceStatus (guint va_flags) } /* Check for encoder status */ -#if VA_CHECK_VERSION(0,30,0) if (va_flags & VASurfaceSkipped) flags |= GST_VAAPI_SURFACE_STATUS_SKIPPED; -#endif return flags; } diff --git a/gst-libs/gst/vaapi/gstvaapiutils_core.c b/gst-libs/gst/vaapi/gstvaapiutils_core.c index e1e76b81..20746667 100644 --- a/gst-libs/gst/vaapi/gstvaapiutils_core.c +++ b/gst-libs/gst/vaapi/gstvaapiutils_core.c @@ -92,7 +92,6 @@ gst_vaapi_get_config_attribute (GstVaapiDisplay * display, VAProfile profile, GArray * gst_vaapi_get_surface_formats (GstVaapiDisplay * display, VAConfigID config) { -#if VA_CHECK_VERSION(0,34,0) VASurfaceAttrib *surface_attribs = NULL; guint i, num_surface_attribs = 0; VAStatus va_status; @@ -152,6 +151,5 @@ error: { g_free (surface_attribs); } -#endif return NULL; } diff --git a/gst-libs/gst/vaapi/meson.build b/gst-libs/gst/vaapi/meson.build index 948937f2..4515d558 100644 --- a/gst-libs/gst/vaapi/meson.build +++ b/gst-libs/gst/vaapi/meson.build @@ -6,11 +6,15 @@ gstlibvaapi_sources = [ 'gstvaapidecoder.c', 'gstvaapidecoder_dpb.c', 'gstvaapidecoder_h264.c', + 'gstvaapidecoder_h265.c', + 'gstvaapidecoder_jpeg.c', 'gstvaapidecoder_mpeg2.c', 'gstvaapidecoder_mpeg4.c', 'gstvaapidecoder_objects.c', 'gstvaapidecoder_unit.c', 'gstvaapidecoder_vc1.c', + 'gstvaapidecoder_vp8.c', + 'gstvaapidecoder_vp9.c', 'gstvaapidisplay.c', 'gstvaapifilter.c', 'gstvaapiimage.c', @@ -44,9 +48,12 @@ gstlibvaapi_headers = [ 'gstvaapidecoder.h', 'gstvaapidecoder_h264.h', 'gstvaapidecoder_h265.h', + 'gstvaapidecoder_jpeg.h', 'gstvaapidecoder_mpeg2.h', 'gstvaapidecoder_mpeg4.h', 'gstvaapidecoder_vc1.h', + 'gstvaapidecoder_vp8.h', + 'gstvaapidecoder_vp9.h', 'gstvaapidisplay.h', 'gstvaapifilter.h', 'gstvaapiimage.h', @@ -71,26 +78,6 @@ gstlibvaapi_headers = [ 'video-format.h', ] -if USE_JPEG_DECODER - gstlibvaapi_sources += 'gstvaapidecoder_jpeg.c' - gstlibvaapi_headers += 'gstvaapidecoder_jpeg.h' -endif - -if USE_VP8_DECODER - gstlibvaapi_sources += 'gstvaapidecoder_vp8.c' - gstlibvaapi_headers += 'gstvaapidecoder_vp8.h' -endif - -if USE_H265_DECODER - gstlibvaapi_sources += 'gstvaapidecoder_h265.c' - gstlibvaapi_headers += 'gstvaapidecoder_h265.h' -endif - -if USE_VP9_DECODER - gstlibvaapi_sources += 'gstvaapidecoder_vp9.c' - gstlibvaapi_headers += 'gstvaapidecoder_vp9.h' -endif - if USE_ENCODERS gstlibvaapi_sources += [ 'gstvaapicodedbuffer.c', @@ -98,8 +85,11 @@ if USE_ENCODERS 'gstvaapicodedbufferproxy.c', 'gstvaapiencoder.c', 'gstvaapiencoder_h264.c', + 'gstvaapiencoder_h265.c', + 'gstvaapiencoder_jpeg.c', 'gstvaapiencoder_mpeg2.c', 'gstvaapiencoder_objects.c', + 'gstvaapiencoder_vp8.c', ] gstlibvaapi_headers += [ 'gstvaapicodedbuffer.h', @@ -107,25 +97,13 @@ if USE_ENCODERS 'gstvaapicodedbufferproxy.h', 'gstvaapiencoder.h', 'gstvaapiencoder_h264.h', + 'gstvaapiencoder_h265.h', + 'gstvaapiencoder_jpeg.h', 'gstvaapiencoder_mpeg2.h', + 'gstvaapiencoder_vp8.h', ] endif -if USE_JPEG_ENCODER - gstlibvaapi_sources += 'gstvaapiencoder_jpeg.c' - gstlibvaapi_headers += 'gstvaapiencoder_jpeg.h' -endif - -if USE_VP8_ENCODER - gstlibvaapi_sources += 'gstvaapiencoder_vp8.c' - gstlibvaapi_headers += 'gstvaapiencoder_vp8.h' -endif - -if USE_H265_ENCODER - gstlibvaapi_sources += 'gstvaapiencoder_h265.c' - gstlibvaapi_headers += 'gstvaapiencoder_h265.h' -endif - if USE_VP9_ENCODER gstlibvaapi_sources += 'gstvaapiencoder_vp9.c' gstlibvaapi_headers += 'gstvaapiencoder_vp9.h' |