textoverlay: Switch to C++

Switch gsttextoverlay to C++ for consistency with other OpenCV elements,
and support of the new 2.4.11 API.

https://bugzilla.gnome.org/show_bug.cgi?id=754148
This commit is contained in:
Luis de Bethencourt 2015-10-11 23:44:25 +01:00
parent 466966ff6c
commit 3ffdb8a6e4
2 changed files with 19 additions and 11 deletions

View file

@ -16,7 +16,7 @@ libgstopencv_la_SOURCES = gstopencv.cpp \
gsthanddetect.cpp \ gsthanddetect.cpp \
gstpyramidsegment.cpp \ gstpyramidsegment.cpp \
gsttemplatematch.c \ gsttemplatematch.c \
gsttextoverlay.c \ gsttextoverlay.cpp \
gstmotioncells.c \ gstmotioncells.c \
gstskindetect.cpp \ gstskindetect.cpp \
gstretinex.cpp \ gstretinex.cpp \

View file

@ -160,47 +160,55 @@ gst_opencv_text_overlay_class_init (GstOpencvTextOverlayClass * klass)
g_object_class_install_property (gobject_class, PROP_TEXT, g_object_class_install_property (gobject_class, PROP_TEXT,
g_param_spec_string ("text", "text", g_param_spec_string ("text", "text",
"Text to be display.", DEFAULT_PROP_TEXT, "Text to be display.", DEFAULT_PROP_TEXT,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));
g_object_class_install_property (gobject_class, PROP_XPOS, g_object_class_install_property (gobject_class, PROP_XPOS,
g_param_spec_int ("xpos", "horizontal position", g_param_spec_int ("xpos", "horizontal position",
"Sets the Horizontal position", 0, G_MAXINT, "Sets the Horizontal position", 0, G_MAXINT,
DEFAULT_PROP_XPOS, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); DEFAULT_PROP_XPOS,
(GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));
g_object_class_install_property (gobject_class, PROP_YPOS, g_object_class_install_property (gobject_class, PROP_YPOS,
g_param_spec_int ("ypos", "vertical position", g_param_spec_int ("ypos", "vertical position",
"Sets the Vertical position", 0, G_MAXINT, "Sets the Vertical position", 0, G_MAXINT,
DEFAULT_PROP_YPOS, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); DEFAULT_PROP_YPOS,
(GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));
g_object_class_install_property (gobject_class, PROP_THICKNESS, g_object_class_install_property (gobject_class, PROP_THICKNESS,
g_param_spec_int ("thickness", "font thickness", g_param_spec_int ("thickness", "font thickness",
"Sets the Thickness of Font", 0, G_MAXINT, "Sets the Thickness of Font", 0, G_MAXINT,
DEFAULT_PROP_THICKNESS, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); DEFAULT_PROP_THICKNESS,
(GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));
g_object_class_install_property (gobject_class, PROP_COLOR_R, g_object_class_install_property (gobject_class, PROP_COLOR_R,
g_param_spec_int ("colorR", "color -Red ", g_param_spec_int ("colorR", "color -Red ",
"Sets the color -R", 0, 255, "Sets the color -R", 0, 255,
DEFAULT_PROP_COLOR, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); DEFAULT_PROP_COLOR,
(GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));
g_object_class_install_property (gobject_class, PROP_COLOR_G, g_object_class_install_property (gobject_class, PROP_COLOR_G,
g_param_spec_int ("colorG", "color -Green", g_param_spec_int ("colorG", "color -Green",
"Sets the color -G", 0, 255, "Sets the color -G", 0, 255,
DEFAULT_PROP_COLOR, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); DEFAULT_PROP_COLOR,
(GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));
g_object_class_install_property (gobject_class, PROP_COLOR_B, g_object_class_install_property (gobject_class, PROP_COLOR_B,
g_param_spec_int ("colorB", "color -Blue", g_param_spec_int ("colorB", "color -Blue",
"Sets the color -B", 0, 255, "Sets the color -B", 0, 255,
DEFAULT_PROP_COLOR, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); DEFAULT_PROP_COLOR,
(GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));
g_object_class_install_property (gobject_class, PROP_HEIGHT, g_object_class_install_property (gobject_class, PROP_HEIGHT,
g_param_spec_double ("height", "Height", g_param_spec_double ("height", "Height",
"Sets the height of fonts", 1.0, 5.0, "Sets the height of fonts", 1.0, 5.0,
DEFAULT_HEIGHT, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); DEFAULT_HEIGHT,
(GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));
g_object_class_install_property (gobject_class, PROP_WIDTH, g_object_class_install_property (gobject_class, PROP_WIDTH,
g_param_spec_double ("width", "Width", g_param_spec_double ("width", "Width",
"Sets the width of fonts", 1.0, 5.0, "Sets the width of fonts", 1.0, 5.0,
DEFAULT_WIDTH, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); DEFAULT_WIDTH,
(GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));
gst_element_class_set_static_metadata (element_class, gst_element_class_set_static_metadata (element_class,
"opencvtextoverlay", "opencvtextoverlay",