From: Thibault Saunier Date: Thu, 12 Jan 2023 14:07:45 +0000 (-0300) Subject: ges: Fix issues avoiding to use `operator` when unavailable on mixer X-Git-Tag: 1.22.0~35 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3065608730ec64137acd1697c1ed6a8d6377097d;p=platform%2Fupstream%2Fgstreamer.git ges: Fix issues avoiding to use `operator` when unavailable on mixer Part-of: --- diff --git a/subprojects/gst-editing-services/ges/ges-internal.h b/subprojects/gst-editing-services/ges/ges-internal.h index 66b2ba8..445ca82 100644 --- a/subprojects/gst-editing-services/ges/ges-internal.h +++ b/subprojects/gst-editing-services/ges/ges-internal.h @@ -500,7 +500,7 @@ G_GNUC_INTERNAL GstElement * ges_track_get_composition (GESTrack *track); /********************************************* - * GESTrackElement subclasses contructores * + * GESTrackElement subclasses constructors * ********************************************/ G_GNUC_INTERNAL GESAudioTestSource * ges_audio_test_source_new (void); G_GNUC_INTERNAL GESAudioUriSource * ges_audio_uri_source_new (gchar *uri); diff --git a/subprojects/gst-editing-services/ges/ges-smart-video-mixer.c b/subprojects/gst-editing-services/ges/ges-smart-video-mixer.c index a92f15a..f3af748 100644 --- a/subprojects/gst-editing-services/ges/ges-smart-video-mixer.c +++ b/subprojects/gst-editing-services/ges/ges-smart-video-mixer.c @@ -240,8 +240,10 @@ set_pad_properties_from_positioner_meta (GstPad * mixer_pad, GstSample * sample, } g_object_set (mixer_pad, "xpos", meta->posx, "ypos", - meta->posy, "width", meta->width, "height", meta->height, - "operator", meta->operator, NULL); + meta->posy, "width", meta->width, "height", meta->height, NULL); + + if (self->ABI.abi.has_operator) + g_object_set (mixer_pad, "operator", meta->operator, NULL); } /**************************************************** @@ -426,6 +428,8 @@ ges_smart_mixer_constructed (GObject * obj) self->mixer = gst_element_factory_create (ges_get_compositor_factory (), cname); + self->ABI.abi.has_operator = + gst_compositor_operator_get_type_and_default_value (NULL) != G_TYPE_NONE; g_free (cname); if (GST_IS_BIN (self->mixer)) { diff --git a/subprojects/gst-editing-services/ges/ges-smart-video-mixer.h b/subprojects/gst-editing-services/ges/ges-smart-video-mixer.h index ea4cd5d..73c3496 100644 --- a/subprojects/gst-editing-services/ges/ges-smart-video-mixer.h +++ b/subprojects/gst-editing-services/ges/ges-smart-video-mixer.h @@ -56,7 +56,14 @@ struct _GESSmartMixer GstCaps *caps; gboolean is_transition; - gpointer _ges_reserved[GES_PADDING]; + union { + gpointer _ges_reserved[GES_PADDING]; + + struct { + gboolean has_operator; + } abi; + + } ABI; }; G_GNUC_INTERNAL diff --git a/subprojects/gst-editing-services/ges/gstframepositioner.c b/subprojects/gst-editing-services/ges/gstframepositioner.c index c51a9a7..e2bb6bd 100644 --- a/subprojects/gst-editing-services/ges/gstframepositioner.c +++ b/subprojects/gst-editing-services/ges/gstframepositioner.c @@ -81,7 +81,7 @@ GST_STATIC_PAD_TEMPLATE ("sink", G_DEFINE_TYPE (GstFramePositioner, gst_frame_positioner, GST_TYPE_BASE_TRANSFORM); -static GType +GType gst_compositor_operator_get_type_and_default_value (int *default_operator_value) { static gsize _init = 0; @@ -112,7 +112,8 @@ gst_compositor_operator_get_type_and_default_value (int *default_operator_value) g_once_init_leave (&_init, 1); } - *default_operator_value = operator_value; + if (default_operator_value) + *default_operator_value = operator_value; return operator_gtype; } @@ -549,7 +550,7 @@ gst_frame_positioner_class_init (GstFramePositionerClass * klass) * * The blending operator for the source. */ - if (operator_gtype) { + if (operator_gtype != G_TYPE_NONE) { properties[PROP_OPERATOR] = g_param_spec_enum ("operator", "Operator", "Blending operator to use for blending this pad over the previous ones", diff --git a/subprojects/gst-editing-services/ges/gstframepositioner.h b/subprojects/gst-editing-services/ges/gstframepositioner.h index 0c1b28b..1be7037 100644 --- a/subprojects/gst-editing-services/ges/gstframepositioner.h +++ b/subprojects/gst-editing-services/ges/gstframepositioner.h @@ -85,6 +85,7 @@ struct _GstFramePositionerMeta { gint operator; }; +G_GNUC_INTERNAL GType gst_compositor_operator_get_type_and_default_value (int *default_operator_value); G_GNUC_INTERNAL void ges_frame_positioner_set_source_and_filter (GstFramePositioner *pos, GESTrackElement *trksrc, GstElement *capsfilter);