From 62891c3f03e3ec87c1fd54e4c04b30e38445db20 Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Tue, 31 Oct 2017 12:05:08 -0300 Subject: [PATCH] ges: Sync 'par' to track restriction caps in the frame positionner Allowing GES users to have control over how compositing is done --- ges/gstframepositioner.c | 11 +++++++++++ ges/gstframepositioner.h | 3 +++ 2 files changed, 14 insertions(+) diff --git a/ges/gstframepositioner.c b/ges/gstframepositioner.c index e29476814a..dc1a06e06f 100644 --- a/ges/gstframepositioner.c +++ b/ges/gstframepositioner.c @@ -99,6 +99,10 @@ gst_frame_positioner_update_properties (GstFramePositioner * pos, gst_caps_set_simple (caps, "framerate", GST_TYPE_FRACTION, pos->fps_n, pos->fps_d, NULL); + if (pos->par_n != -1) + gst_caps_set_simple (caps, "pixel-aspect-ratio", GST_TYPE_FRACTION, + pos->par_n, pos->par_d, NULL); + if (old_track_width && pos->width == old_track_width && old_track_height && pos->height == old_track_height && pos->track_height && pos->track_width && @@ -142,6 +146,10 @@ sync_properties_from_track (GstFramePositioner * pos, GESTrack * track) if (!gst_structure_get_fraction (structure, "framerate", &(pos->fps_n), &(pos->fps_d))) pos->fps_n = -1; + + if (!gst_structure_get_fraction (structure, "pixel-aspect-ratio", + &(pos->par_n), &(pos->par_d))) + pos->par_n = -1; } old_track_width = pos->track_width; @@ -341,6 +349,9 @@ gst_frame_positioner_init (GstFramePositioner * framepositioner) framepositioner->track_source = NULL; framepositioner->current_track = NULL; framepositioner->scale_in_compositor = TRUE; + + framepositioner->par_n = -1; + framepositioner->par_d = 1; } void diff --git a/ges/gstframepositioner.h b/ges/gstframepositioner.h index f08f73094f..9b1884f73b 100644 --- a/ges/gstframepositioner.h +++ b/ges/gstframepositioner.h @@ -57,6 +57,9 @@ struct _GstFramePositioner gint fps_n; gint fps_d; + gint par_n; + gint par_d; + /* This should never be made public, no padding needed */ };