Revert "msdkh265enc: let MSDK select the encoding mode by default"

This reverts commit 9e977832c1.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1426>
This commit is contained in:
Haihao Xiang 2020-07-09 09:01:23 +08:00
parent 395ecb3d2f
commit 3ecb2a82be
2 changed files with 7 additions and 10 deletions

View file

@ -48,7 +48,7 @@ enum
PROP_MAX_SLICE_SIZE, PROP_MAX_SLICE_SIZE,
}; };
#define PROP_LOWPOWER_DEFAULT -1 #define PROP_LOWPOWER_DEFAULT FALSE
#define PROP_TILE_ROW_DEFAULT 1 #define PROP_TILE_ROW_DEFAULT 1
#define PROP_TILE_COL_DEFAULT 1 #define PROP_TILE_COL_DEFAULT 1
#define PROP_MAX_SLICE_SIZE_DEFAULT 0 #define PROP_MAX_SLICE_SIZE_DEFAULT 0
@ -266,8 +266,7 @@ gst_msdkh265enc_configure (GstMsdkEnc * encoder)
} }
encoder->param.mfx.LowPower = encoder->param.mfx.LowPower =
(h265enc->lowpower == 1 ? MFX_CODINGOPTION_ON : (h265enc->lowpower == (h265enc->lowpower ? MFX_CODINGOPTION_ON : MFX_CODINGOPTION_OFF);
0 ? MFX_CODINGOPTION_OFF : MFX_CODINGOPTION_UNKNOWN));
return TRUE; return TRUE;
} }
@ -389,7 +388,7 @@ gst_msdkh265enc_set_property (GObject * object, guint prop_id,
switch (prop_id) { switch (prop_id) {
case PROP_LOW_POWER: case PROP_LOW_POWER:
thiz->lowpower = g_value_get_int (value); thiz->lowpower = g_value_get_boolean (value);
break; break;
case PROP_TILE_ROW: case PROP_TILE_ROW:
@ -423,7 +422,7 @@ gst_msdkh265enc_get_property (GObject * object, guint prop_id, GValue * value,
GST_OBJECT_LOCK (thiz); GST_OBJECT_LOCK (thiz);
switch (prop_id) { switch (prop_id) {
case PROP_LOW_POWER: case PROP_LOW_POWER:
g_value_set_int (value, thiz->lowpower); g_value_set_boolean (value, thiz->lowpower);
break; break;
case PROP_TILE_ROW: case PROP_TILE_ROW:
@ -525,10 +524,8 @@ gst_msdkh265enc_class_init (GstMsdkH265EncClass * klass)
gst_msdkenc_install_common_properties (encoder_class); gst_msdkenc_install_common_properties (encoder_class);
g_object_class_install_property (gobject_class, PROP_LOW_POWER, g_object_class_install_property (gobject_class, PROP_LOW_POWER,
g_param_spec_int ("low-power", "Low power", g_param_spec_boolean ("low-power", "Low power", "Enable low power mode",
"Enable low power mode(-1: default, 0: disable, 1: enable)", PROP_LOWPOWER_DEFAULT, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
-1, 1, PROP_LOWPOWER_DEFAULT,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property (gobject_class, PROP_TILE_ROW, g_object_class_install_property (gobject_class, PROP_TILE_ROW,
g_param_spec_uint ("num-tile-rows", "number of rows for tiled encoding", g_param_spec_uint ("num-tile-rows", "number of rows for tiled encoding",

View file

@ -55,7 +55,7 @@ struct _GstMsdkH265Enc
{ {
GstMsdkEnc base; GstMsdkEnc base;
gint lowpower; gboolean lowpower;
gushort num_tile_rows; gushort num_tile_rows;
gushort num_tile_cols; gushort num_tile_cols;
guint max_slice_size; guint max_slice_size;