mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-19 16:21:17 +00:00
ges: Do not rescale videos if the track aspect ratio changes
Differential Revision: https://phabricator.freedesktop.org/D1242
This commit is contained in:
parent
1cef62ab79
commit
855488f58e
2 changed files with 7 additions and 6 deletions
|
@ -100,9 +100,11 @@ gst_frame_positioner_update_properties (GstFramePositioner * pos,
|
||||||
pos->fps_d, NULL);
|
pos->fps_d, NULL);
|
||||||
|
|
||||||
if (old_track_width && pos->width == old_track_width &&
|
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",
|
" || height, old_track %d -- pos: %d",
|
||||||
old_track_width, pos->width, old_track_height, pos->height);
|
old_track_width, pos->width, old_track_height, pos->height);
|
||||||
|
|
||||||
|
|
|
@ -1468,12 +1468,11 @@ GST_START_TEST (test_scaling)
|
||||||
_set_track_element_width_height (GES_CONTAINER_CHILDREN (clip)->data, 320,
|
_set_track_element_width_height (GES_CONTAINER_CHILDREN (clip)->data, 320,
|
||||||
240);
|
240);
|
||||||
|
|
||||||
/* As the video source as the same size as the track restriction caps, changing
|
/* The video source has the same size as the track restriction caps but we
|
||||||
* the track size through restriction caps should also change the video source
|
* are changing the aspect ratio, the video should thus not be rescaled. */
|
||||||
* size */
|
|
||||||
caps = gst_caps_from_string ("video/x-raw,height=1080,width=1920");
|
caps = gst_caps_from_string ("video/x-raw,height=1080,width=1920");
|
||||||
ges_track_set_restriction_caps (trackv, caps);
|
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);
|
gst_object_unref (timeline);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue