ges: Do not rescale videos if the track aspect ratio changes

Differential Revision: https://phabricator.freedesktop.org/D1242
This commit is contained in:
Thibault Saunier 2016-08-03 11:40:30 -04:00
parent 1cef62ab79
commit 855488f58e
2 changed files with 7 additions and 6 deletions

View file

@ -100,9 +100,11 @@ gst_frame_positioner_update_properties (GstFramePositioner * pos,
pos->fps_d, NULL);
if (old_track_width && pos->width == old_track_width &&
old_track_width && pos->width == old_track_width) {
old_track_height && pos->height == old_track_height &&
((float) old_track_width / (float) old_track_height) ==
((float) pos->track_width / (float) pos->track_height)) {
GST_DEBUG_OBJECT (pos, "FOLLOWING track size width old_track: %d -- pos: %d"
GST_DEBUG_OBJECT (pos, "Following track size width old_track: %d -- pos: %d"
" || height, old_track %d -- pos: %d",
old_track_width, pos->width, old_track_height, pos->height);

View file

@ -1468,12 +1468,11 @@ GST_START_TEST (test_scaling)
_set_track_element_width_height (GES_CONTAINER_CHILDREN (clip)->data, 320,
240);
/* As the video source as the same size as the track restriction caps, changing
* the track size through restriction caps should also change the video source
* size */
/* The video source has the same size as the track restriction caps but we
* are changing the aspect ratio, the video should thus not be rescaled. */
caps = gst_caps_from_string ("video/x-raw,height=1080,width=1920");
ges_track_set_restriction_caps (trackv, caps);
fail_unless (check_frame_positioner_size (clip, 1920, 1080));
fail_unless (check_frame_positioner_size (clip, 320, 240));
gst_object_unref (timeline);
}