ges: Sync 'par' to track restriction caps in the frame positionner

Allowing GES users to have control over how compositing is done
This commit is contained in:
Thibault Saunier 2017-10-31 12:05:08 -03:00
parent 6c7c4e0257
commit 62891c3f03
2 changed files with 14 additions and 0 deletions

View file

@ -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

View file

@ -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 */
};