plugins: use G_PARAM_STATIC_STRINGS.

This avoids a few string copies during initialization.
This commit is contained in:
Gwenole Beauchesne 2013-11-28 14:15:44 +01:00
parent 3324cdfb61
commit 9ab6037847
6 changed files with 37 additions and 28 deletions

View file

@ -271,7 +271,7 @@ init_properties(void)
"The forced output pixel format",
GST_TYPE_VIDEO_FORMAT,
DEFAULT_FORMAT,
G_PARAM_READWRITE);
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
/**
* GstVaapiFilter:crop-rect:
@ -283,7 +283,7 @@ init_properties(void)
"Cropping Rectangle",
"The cropping rectangle",
GST_VAAPI_TYPE_RECTANGLE,
G_PARAM_READWRITE);
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
/**
* GstVaapiFilter:denoise:
@ -295,7 +295,7 @@ init_properties(void)
"Denoising Level",
"The level of denoising to apply",
0.0, 1.0, 0.0,
G_PARAM_READWRITE);
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
/**
* GstVaapiFilter:sharpen:
@ -308,7 +308,7 @@ init_properties(void)
"Sharpening Level",
"The level of sharpening/blurring to apply",
-1.0, 1.0, 0.0,
G_PARAM_READWRITE);
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
/**
* GstVaapiFilter:hue:
@ -321,7 +321,7 @@ init_properties(void)
"Hue",
"The color hue value",
-180.0, 180.0, 0.0,
G_PARAM_READWRITE);
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
/**
* GstVaapiFilter:saturation:
@ -334,7 +334,7 @@ init_properties(void)
"Saturation",
"The color saturation value",
0.0, 2.0, 1.0,
G_PARAM_READWRITE);
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
/**
* GstVaapiFilter:brightness:
@ -347,7 +347,7 @@ init_properties(void)
"Brightness",
"The color brightness value",
-1.0, 1.0, 0.0,
G_PARAM_READWRITE);
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
/**
* GstVaapiFilter:contrast:
@ -360,7 +360,7 @@ init_properties(void)
"Contrast",
"The color contrast value",
0.0, 2.0, 1.0,
G_PARAM_READWRITE);
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
/**
* GstVaapiFilter:deinterlace-method:
@ -374,7 +374,7 @@ init_properties(void)
"Deinterlacing method to apply",
GST_VAAPI_TYPE_DEINTERLACE_METHOD,
GST_VAAPI_DEINTERLACE_METHOD_NONE,
G_PARAM_READWRITE);
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
}
static void

View file

@ -336,32 +336,38 @@ gst_vaapiencode_h264_class_init (GstVaapiEncodeH264Class * klass)
g_param_spec_uint ("key-period",
"Key Period",
"Maximal distance between two key-frames",
1,
300, GST_VAAPI_ENCODER_H264_DEFAULT_INTRA_PERIOD, G_PARAM_READWRITE));
1, 300, GST_VAAPI_ENCODER_H264_DEFAULT_INTRA_PERIOD,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property (object_class,
PROP_MAX_BFRAMES,
g_param_spec_uint ("max-bframes",
"Max B-Frames",
"Number of B-frames between I and P", 0, 10, 0, G_PARAM_READWRITE));
"Number of B-frames between I and P",
0, 10, 0,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property (object_class,
PROP_INIT_QP,
g_param_spec_uint ("init-qp",
"Initial QP",
"Initial quantizer value",
1, 51, GST_VAAPI_ENCODER_H264_DEFAULT_INIT_QP, G_PARAM_READWRITE));
1, 51, GST_VAAPI_ENCODER_H264_DEFAULT_INIT_QP,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property (object_class,
PROP_MIN_QP,
g_param_spec_uint ("min-qp",
"Minimum QP",
"Minimum quantizer value",
1, 51, GST_VAAPI_ENCODER_H264_DEFAULT_MIN_QP, G_PARAM_READWRITE));
1, 51, GST_VAAPI_ENCODER_H264_DEFAULT_MIN_QP,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property (object_class,
PROP_NUM_SLICES,
g_param_spec_uint ("num-slices",
"Number of Slices", "Number of slices per frame", 1, 200,
1, G_PARAM_READWRITE));
"Number of Slices",
"Number of slices per frame",
1, 200, 1,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
}

View file

@ -214,7 +214,8 @@ gst_vaapiencode_mpeg2_class_init (GstVaapiEncodeMpeg2Class * klass)
"Constant quantizer (if rate-control mode is CQP)",
GST_VAAPI_ENCODER_MPEG2_MIN_CQP,
GST_VAAPI_ENCODER_MPEG2_MAX_CQP,
GST_VAAPI_ENCODER_MPEG2_DEFAULT_CQP, G_PARAM_READWRITE));
GST_VAAPI_ENCODER_MPEG2_DEFAULT_CQP,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property (object_class,
PROP_KEY_PERIOD,
@ -223,7 +224,8 @@ gst_vaapiencode_mpeg2_class_init (GstVaapiEncodeMpeg2Class * klass)
"Maximal distance between two key-frames",
1,
GST_VAAPI_ENCODER_MPEG2_MAX_GOP_SIZE,
GST_VAAPI_ENCODER_MPEG2_DEFAULT_GOP_SIZE, G_PARAM_READWRITE));
GST_VAAPI_ENCODER_MPEG2_DEFAULT_GOP_SIZE,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property (object_class,
PROP_MAX_BFRAMES,
@ -232,5 +234,6 @@ gst_vaapiencode_mpeg2_class_init (GstVaapiEncodeMpeg2Class * klass)
"Number of B-frames between I and P",
0,
GST_VAAPI_ENCODER_MPEG2_MAX_MAX_BFRAMES,
GST_VAAPI_ENCODER_MPEG2_DEFAULT_MAX_BFRAMES, G_PARAM_READWRITE));
GST_VAAPI_ENCODER_MPEG2_DEFAULT_MAX_BFRAMES,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
}

View file

@ -1716,7 +1716,7 @@ gst_vaapipostproc_class_init(GstVaapiPostprocClass *klass)
"Width",
"Forced output width",
0, G_MAXINT, 0,
G_PARAM_READWRITE));
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
/**
* GstVaapiPostproc:height:
@ -1732,7 +1732,7 @@ gst_vaapipostproc_class_init(GstVaapiPostprocClass *klass)
"Height",
"Forced output height",
0, G_MAXINT, 0,
G_PARAM_READWRITE));
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
/**
* GstVaapiPostproc:force-aspect-ratio:
@ -1748,7 +1748,7 @@ gst_vaapipostproc_class_init(GstVaapiPostprocClass *klass)
"Force aspect ratio",
"When enabled, scaling will respect original aspect ratio",
TRUE,
G_PARAM_READWRITE));
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
/**
* GstVaapiPostproc:denoise:

View file

@ -1514,7 +1514,7 @@ gst_vaapisink_class_init(GstVaapiSinkClass *klass)
"OpenGL rendering",
"Enables OpenGL rendering",
FALSE,
G_PARAM_READWRITE));
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property
(object_class,
@ -1523,7 +1523,7 @@ gst_vaapisink_class_init(GstVaapiSinkClass *klass)
"Reflection effect",
"Enables OpenGL reflection effect",
FALSE,
G_PARAM_READWRITE));
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
#endif
g_object_class_install_property
@ -1533,7 +1533,7 @@ gst_vaapisink_class_init(GstVaapiSinkClass *klass)
"Fullscreen",
"Requests window in fullscreen state",
FALSE,
G_PARAM_READWRITE));
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
/**
* GstVaapiSink:synchronous:
@ -1548,7 +1548,7 @@ gst_vaapisink_class_init(GstVaapiSinkClass *klass)
"Synchronous mode",
"Toggles X display synchronous mode",
FALSE,
G_PARAM_READWRITE));
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
/**
* GstVaapiSink:rotation:
@ -1578,7 +1578,7 @@ gst_vaapisink_class_init(GstVaapiSinkClass *klass)
"Force aspect ratio",
"When enabled, scaling will respect original aspect ratio",
TRUE,
G_PARAM_READWRITE));
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
}
static void

View file

@ -307,7 +307,7 @@ gst_vaapi_uploader_class_init(GstVaapiUploaderClass *klass)
"display",
"Display",
"The GstVaapiDisplay this object is bound to",
G_PARAM_READWRITE));
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
}
static void