From adcb448276456115e36d2b4e3535266251397c42 Mon Sep 17 00:00:00 2001 From: He Junyan Date: Thu, 29 Aug 2019 18:17:42 +0800 Subject: [PATCH] libs: encoder: delete EncoderPropInfo related functions --- gst-libs/gst/vaapi/gstvaapiencoder.c | 78 ----------------------- gst-libs/gst/vaapi/gstvaapiencoder.h | 12 ---- gst-libs/gst/vaapi/gstvaapiencoder_priv.h | 17 ----- 3 files changed, 107 deletions(-) diff --git a/gst-libs/gst/vaapi/gstvaapiencoder.c b/gst-libs/gst/vaapi/gstvaapiencoder.c index 87060542fb..b6ef77c56b 100644 --- a/gst-libs/gst/vaapi/gstvaapiencoder.c +++ b/gst-libs/gst/vaapi/gstvaapiencoder.c @@ -34,84 +34,6 @@ #define DEBUG 1 #include "gstvaapidebug.h" -/* Helper function to create a new encoder property object */ -static GstVaapiEncoderPropData * -prop_new (gint id, GParamSpec * pspec) -{ - GstVaapiEncoderPropData *prop; - - if (!id || !pspec) - return NULL; - - prop = g_slice_new (GstVaapiEncoderPropData); - if (!prop) - return NULL; - - prop->prop = id; - prop->pspec = g_param_spec_ref_sink (pspec); - return prop; -} - -/* Helper function to release a property object and any memory held herein */ -static void -prop_free (GstVaapiEncoderPropData * prop) -{ - if (!prop) - return; - - if (prop->pspec) { - g_param_spec_unref (prop->pspec); - prop->pspec = NULL; - } - g_slice_free (GstVaapiEncoderPropData, prop); -} - -/* Helper function to lookup the supplied property specification */ -__attribute__ ((unused)) - static GParamSpec *prop_find_pspec (GstVaapiEncoder * encoder, - gint prop_id) -{ - GPtrArray *const props = encoder->properties; - guint i; - - if (props) { - for (i = 0; i < props->len; i++) { - GstVaapiEncoderPropInfo *const prop = g_ptr_array_index (props, i); - if (prop->prop == prop_id) - return prop->pspec; - } - } - return NULL; -} - -/* Create a new array of properties, or NULL on error */ -GPtrArray * -gst_vaapi_encoder_properties_append (GPtrArray * props, gint prop_id, - GParamSpec * pspec) -{ - GstVaapiEncoderPropData *prop; - - if (!props) { - props = g_ptr_array_new_with_free_func ((GDestroyNotify) prop_free); - if (!props) - return NULL; - } - - prop = prop_new (prop_id, pspec); - if (!prop) - goto error_allocation_failed; - g_ptr_array_add (props, prop); - return props; - - /* ERRORS */ -error_allocation_failed: - { - GST_ERROR ("failed to allocate encoder property info structure"); - g_ptr_array_unref (props); - return NULL; - } -} - gboolean gst_vaapi_encoder_ensure_param_quality_level (GstVaapiEncoder * encoder, GstVaapiEncPicture * picture) diff --git a/gst-libs/gst/vaapi/gstvaapiencoder.h b/gst-libs/gst/vaapi/gstvaapiencoder.h index 72254c3995..71502239b7 100644 --- a/gst-libs/gst/vaapi/gstvaapiencoder.h +++ b/gst-libs/gst/vaapi/gstvaapiencoder.h @@ -122,18 +122,6 @@ typedef enum { GST_VAAPI_ENCODER_MBBRC_OFF = 2, } GstVaapiEncoderMbbrc; -/** - * GstVaapiEncoderPropInfo: - * @prop: the #GstVaapiEncoderProp - * @pspec: the #GParamSpec describing the associated configurable value - * - * A #GstVaapiEncoderProp descriptor. - */ -typedef struct { - const gint prop; - GParamSpec *const pspec; -} GstVaapiEncoderPropInfo; - GType gst_vaapi_encoder_tune_get_type (void) G_GNUC_CONST; diff --git a/gst-libs/gst/vaapi/gstvaapiencoder_priv.h b/gst-libs/gst/vaapi/gstvaapiencoder_priv.h index 19a03192ff..5cda1cdea9 100644 --- a/gst-libs/gst/vaapi/gstvaapiencoder_priv.h +++ b/gst-libs/gst/vaapi/gstvaapiencoder_priv.h @@ -221,23 +221,6 @@ G_BEGIN_DECLS typedef struct _GstVaapiEncoderClass GstVaapiEncoderClass; typedef struct _GstVaapiEncoderClassData GstVaapiEncoderClassData; -/* Private GstVaapiEncoderPropInfo definition */ -typedef struct { - gint prop; - GParamSpec *pspec; -} GstVaapiEncoderPropData; - -#define GST_VAAPI_ENCODER_PROPERTIES_APPEND(props, id, pspec) do { \ - props = gst_vaapi_encoder_properties_append (props, id, pspec); \ - if (!props) \ - return NULL; \ - } while (0) - -G_GNUC_INTERNAL -GPtrArray * -gst_vaapi_encoder_properties_append (GPtrArray * props, gint prop_id, - GParamSpec *pspec); - struct _GstVaapiEncoder { /*< private >*/