mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-03 14:08:56 +00:00
glvideoflip: fix setting of method property at construction time
A port of the same fix that https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4536 did for the non-GL videoflip element Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3245 Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5966>
This commit is contained in:
parent
9ee58825cc
commit
aadefa8aca
2 changed files with 23 additions and 3 deletions
|
@ -6772,7 +6772,7 @@
|
||||||
"method": {
|
"method": {
|
||||||
"blurb": "method (deprecated, use video-direction instead)",
|
"blurb": "method (deprecated, use video-direction instead)",
|
||||||
"conditionally-available": false,
|
"conditionally-available": false,
|
||||||
"construct": true,
|
"construct": false,
|
||||||
"construct-only": false,
|
"construct-only": false,
|
||||||
"controllable": true,
|
"controllable": true,
|
||||||
"default": "none (0)",
|
"default": "none (0)",
|
||||||
|
|
|
@ -106,6 +106,9 @@ static void gst_gl_video_flip_set_property (GObject * object, guint prop_id,
|
||||||
static void gst_gl_video_flip_get_property (GObject * object, guint prop_id,
|
static void gst_gl_video_flip_get_property (GObject * object, guint prop_id,
|
||||||
GValue * value, GParamSpec * pspec);
|
GValue * value, GParamSpec * pspec);
|
||||||
|
|
||||||
|
static void gst_gl_video_flip_set_method (GstGLVideoFlip * vf,
|
||||||
|
GstVideoOrientationMethod method, gboolean from_tag);
|
||||||
|
|
||||||
static GstPadProbeReturn _input_sink_probe (GstPad * pad,
|
static GstPadProbeReturn _input_sink_probe (GstPad * pad,
|
||||||
GstPadProbeInfo * info, gpointer user_data);
|
GstPadProbeInfo * info, gpointer user_data);
|
||||||
static GstPadProbeReturn _trans_src_probe (GstPad * pad, GstPadProbeInfo * info,
|
static GstPadProbeReturn _trans_src_probe (GstPad * pad, GstPadProbeInfo * info,
|
||||||
|
@ -131,6 +134,17 @@ gst_gl_video_flip_video_direction_interface_init (GstVideoDirectionInterface
|
||||||
/* We implement the video-direction property */
|
/* We implement the video-direction property */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
gst_gl_video_flip_constructed (GObject * object)
|
||||||
|
{
|
||||||
|
GstGLVideoFlip *self = GST_GL_VIDEO_FLIP (object);
|
||||||
|
|
||||||
|
if (self->method == (GstVideoOrientationMethod) DEFAULT_METHOD) {
|
||||||
|
gst_gl_video_flip_set_method (self,
|
||||||
|
(GstVideoOrientationMethod) DEFAULT_METHOD, FALSE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_gl_video_flip_class_init (GstGLVideoFlipClass * klass)
|
gst_gl_video_flip_class_init (GstGLVideoFlipClass * klass)
|
||||||
{
|
{
|
||||||
|
@ -143,13 +157,13 @@ gst_gl_video_flip_class_init (GstGLVideoFlipClass * klass)
|
||||||
gobject_class->finalize = gst_gl_video_flip_finalize;
|
gobject_class->finalize = gst_gl_video_flip_finalize;
|
||||||
gobject_class->set_property = gst_gl_video_flip_set_property;
|
gobject_class->set_property = gst_gl_video_flip_set_property;
|
||||||
gobject_class->get_property = gst_gl_video_flip_get_property;
|
gobject_class->get_property = gst_gl_video_flip_get_property;
|
||||||
|
gobject_class->constructed = gst_gl_video_flip_constructed;
|
||||||
|
|
||||||
g_object_class_install_property (gobject_class, PROP_METHOD,
|
g_object_class_install_property (gobject_class, PROP_METHOD,
|
||||||
g_param_spec_enum ("method", "method",
|
g_param_spec_enum ("method", "method",
|
||||||
"method (deprecated, use video-direction instead)",
|
"method (deprecated, use video-direction instead)",
|
||||||
GST_TYPE_GL_VIDEO_FLIP_METHOD, DEFAULT_METHOD,
|
GST_TYPE_GL_VIDEO_FLIP_METHOD, DEFAULT_METHOD,
|
||||||
GST_PARAM_CONTROLLABLE | G_PARAM_READWRITE | G_PARAM_CONSTRUCT |
|
GST_PARAM_CONTROLLABLE | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
||||||
G_PARAM_STATIC_STRINGS));
|
|
||||||
g_object_class_override_property (gobject_class, PROP_VIDEO_DIRECTION,
|
g_object_class_override_property (gobject_class, PROP_VIDEO_DIRECTION,
|
||||||
"video-direction");
|
"video-direction");
|
||||||
|
|
||||||
|
@ -169,6 +183,12 @@ gst_gl_video_flip_init (GstGLVideoFlip * flip)
|
||||||
gboolean res = TRUE;
|
gboolean res = TRUE;
|
||||||
GstPad *pad;
|
GstPad *pad;
|
||||||
|
|
||||||
|
/* We initialize to the default and call set_method() from constructed
|
||||||
|
* if the value hasn't changed, this ensures set_method() does get called
|
||||||
|
* even if the non-construct method / direction properties aren't set
|
||||||
|
*/
|
||||||
|
flip->method = (GstVideoOrientationMethod) DEFAULT_METHOD;
|
||||||
|
|
||||||
flip->aspect = 1.0;
|
flip->aspect = 1.0;
|
||||||
|
|
||||||
flip->input_capsfilter = gst_element_factory_make ("capsfilter", NULL);
|
flip->input_capsfilter = gst_element_factory_make ("capsfilter", NULL);
|
||||||
|
|
Loading…
Reference in a new issue