mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-22 17:51:16 +00:00
msdkenc: Add help functions to check and update property
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4865>
This commit is contained in:
parent
64b4257509
commit
1308b2f6e5
2 changed files with 54 additions and 0 deletions
|
@ -2006,6 +2006,39 @@ gst_msdkenc_init (GstMsdkEnc * thiz)
|
||||||
EC_PROPS_EXTBRC, G_TYPE_STRING, "off", NULL);
|
EC_PROPS_EXTBRC, G_TYPE_STRING, "off", NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* *INDENT-OFF* */
|
||||||
|
#define UPDATE_PROPERTY \
|
||||||
|
if (*old_val == new_val) { \
|
||||||
|
return FALSE; \
|
||||||
|
} \
|
||||||
|
*old_val = new_val; \
|
||||||
|
thiz->reconfig = TRUE; \
|
||||||
|
return TRUE; \
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
gst_msdkenc_check_update_property_uint (GstMsdkEnc * thiz, guint * old_val,
|
||||||
|
guint new_val)
|
||||||
|
{
|
||||||
|
UPDATE_PROPERTY
|
||||||
|
}
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
gst_msdkenc_check_update_property_int (GstMsdkEnc * thiz, gint * old_val,
|
||||||
|
gint new_val)
|
||||||
|
{
|
||||||
|
UPDATE_PROPERTY
|
||||||
|
}
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
gst_msdkenc_check_update_property_bool (GstMsdkEnc * thiz, gboolean * old_val,
|
||||||
|
gboolean new_val)
|
||||||
|
{
|
||||||
|
UPDATE_PROPERTY
|
||||||
|
}
|
||||||
|
|
||||||
|
#undef UPDATE_PROPERTY
|
||||||
|
/* *INDENT-ON* */
|
||||||
|
|
||||||
/* gst_msdkenc_set_common_property:
|
/* gst_msdkenc_set_common_property:
|
||||||
*
|
*
|
||||||
* This is a helper function to set the common property
|
* This is a helper function to set the common property
|
||||||
|
|
|
@ -56,6 +56,15 @@ G_BEGIN_DECLS
|
||||||
|
|
||||||
#define MAX_EXTRA_PARAMS 8
|
#define MAX_EXTRA_PARAMS 8
|
||||||
|
|
||||||
|
#define check_update_property(type, obj, old_val, new_val) \
|
||||||
|
gst_msdkenc_check_update_property_##type (obj, old_val, new_val)
|
||||||
|
#define check_update_property_uint(obj, old_val, new_val) \
|
||||||
|
check_update_property (uint, obj, old_val, new_val)
|
||||||
|
#define check_update_property_int(obj, old_val, new_val) \
|
||||||
|
check_update_property (int, obj, old_val, new_val)
|
||||||
|
#define check_update_property_bool(obj, old_val, new_val) \
|
||||||
|
check_update_property (bool, obj, old_val, new_val)
|
||||||
|
|
||||||
typedef struct _GstMsdkEnc GstMsdkEnc;
|
typedef struct _GstMsdkEnc GstMsdkEnc;
|
||||||
typedef struct _GstMsdkEncClass GstMsdkEncClass;
|
typedef struct _GstMsdkEncClass GstMsdkEncClass;
|
||||||
typedef struct _MsdkEncTask MsdkEncTask;
|
typedef struct _MsdkEncTask MsdkEncTask;
|
||||||
|
@ -209,6 +218,18 @@ void gst_msdkenc_add_extra_param (GstMsdkEnc * thiz, mfxExtBuffer * param);
|
||||||
void
|
void
|
||||||
gst_msdkenc_install_common_properties (GstMsdkEncClass *encoder_class);
|
gst_msdkenc_install_common_properties (GstMsdkEncClass *encoder_class);
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
gst_msdkenc_check_update_property_uint (GstMsdkEnc * thiz, guint * old_val,
|
||||||
|
guint new_val);
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
gst_msdkenc_check_update_property_int (GstMsdkEnc * thiz, gint * old_val,
|
||||||
|
gint new_val);
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
gst_msdkenc_check_update_property_bool (GstMsdkEnc * thiz, gboolean * old_val,
|
||||||
|
gboolean new_val);
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
gst_msdkenc_set_common_property (GObject * object, guint prop_id,
|
gst_msdkenc_set_common_property (GObject * object, guint prop_id,
|
||||||
const GValue * value, GParamSpec * pspec);
|
const GValue * value, GParamSpec * pspec);
|
||||||
|
|
Loading…
Reference in a new issue