From: Thibault Saunier Date: Fri, 29 Apr 2016 13:29:00 +0000 (-0300) Subject: video-source: Expose deinterlace-[fields, mode, tff] child properties X-Git-Tag: 1.19.3~493^2~1016 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=57543cc894f3cfa54cbc1399de26239c26bab7da;p=platform%2Fupstream%2Fgstreamer.git video-source: Expose deinterlace-[fields, mode, tff] child properties Letting some control over the deinterlacing to the users --- diff --git a/ges/ges-video-source.c b/ges/ges-video-source.c index 10f7562..b787262 100644 --- a/ges/ges-video-source.c +++ b/ges/ges-video-source.c @@ -62,6 +62,21 @@ * height * The desired height for that source. Set to 0 if size is not mandatory, will be set to height of the current track. * + * + * GstDeinterlaceModes + * deinterlace-mode + * Deinterlace Mode + * + * + * GstDeinterlaceFields + * deinterlace-fields + * Fields to use for deinterlacing + * + * + * GstDeinterlaceFieldLayout + * deinterlace-tff + * Deinterlace top field first + * * * * @@ -122,7 +137,9 @@ ges_video_source_create_element (GESTrackElement * trksrc) GESVideoSource *self; GstElement *positioner, *videoscale, *videorate, *capsfilter, *videoconvert, *deinterlace; - const gchar *props[] = { "alpha", "posx", "posy", "width", "height", NULL }; + const gchar *positioner_props[] = + { "alpha", "posx", "posy", "width", "height", NULL }; + const gchar *deinterlace_props[] = { "mode", "fields", "tff", NULL }; if (!source_class->create_source) return NULL; @@ -149,7 +166,8 @@ ges_video_source_create_element (GESTrackElement * trksrc) ges_frame_positioner_set_source_and_filter (GST_FRAME_POSITIONNER (positioner), trksrc, capsfilter); - ges_track_element_add_children_props (trksrc, positioner, NULL, NULL, props); + ges_track_element_add_children_props (trksrc, positioner, NULL, NULL, + positioner_props); if (deinterlace == NULL) { post_missing_element_message (sub_element, "deinterlace"); @@ -161,6 +179,8 @@ ges_video_source_create_element (GESTrackElement * trksrc) ges_source_create_topbin ("videosrcbin", sub_element, queue, videoconvert, positioner, videoscale, videorate, capsfilter, NULL); } else { + ges_track_element_add_children_props (trksrc, deinterlace, NULL, NULL, + deinterlace_props); topbin = ges_source_create_topbin ("videosrcbin", sub_element, queue, videoconvert, deinterlace, positioner, videoscale, videorate, @@ -173,19 +193,51 @@ ges_video_source_create_element (GESTrackElement * trksrc) return topbin; } +static gboolean +_lookup_child (GESTimelineElement * object, + const gchar * prop_name, GObject ** element, GParamSpec ** pspec) +{ + gboolean res; + + gchar *clean_name; + + if (!g_strcmp0 (prop_name, "deinterlace-fields")) + clean_name = g_strdup ("GstDeinterlace::fields"); + else if (!g_strcmp0 (prop_name, "deinterlace-mode")) + clean_name = g_strdup ("GstDeinterlace::mode"); + else if (!g_strcmp0 (prop_name, "deinterlace-tff")) + clean_name = g_strdup ("GstDeinterlace::tff"); + else if (!g_strcmp0 (prop_name, "tff") || + !g_strcmp0 (prop_name, "fields") || !g_strcmp0 (prop_name, "mode")) { + GST_DEBUG_OBJECT (object, "Not allowed to use GstDeinterlace %s" + " property without prefixing its name", prop_name); + return FALSE; + } else + clean_name = g_strdup (prop_name); + + res = + GES_TIMELINE_ELEMENT_CLASS (ges_video_source_parent_class)->lookup_child + (object, clean_name, element, pspec); + + g_free (clean_name); + + return res; +} + static void ges_video_source_class_init (GESVideoSourceClass * klass) { - GESTrackElementClass *track_class = GES_TRACK_ELEMENT_CLASS (klass); + GESTrackElementClass *track_element_class = GES_TRACK_ELEMENT_CLASS (klass); GESTimelineElementClass *element_class = GES_TIMELINE_ELEMENT_CLASS (klass); GESVideoSourceClass *video_source_class = GES_VIDEO_SOURCE_CLASS (klass); g_type_class_add_private (klass, sizeof (GESVideoSourcePrivate)); element_class->set_priority = _set_priority; + element_class->lookup_child = _lookup_child; - track_class->nleobject_factorytype = "nlesource"; - track_class->create_element = ges_video_source_create_element; + track_element_class->nleobject_factorytype = "nlesource"; + track_element_class->create_element = ges_video_source_create_element; video_source_class->create_source = NULL; }