From 45571f4bd486c16d4933999b6578dffa6cb87157 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sebastian=20Dr=C3=B6ge?= Date: Mon, 19 Apr 2010 14:37:54 +0200 Subject: [PATCH] videoflip: Also flip the pixel-aspect-ratio if width/height are exchanged --- gst/videofilter/gstvideoflip.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/gst/videofilter/gstvideoflip.c b/gst/videofilter/gstvideoflip.c index 015a29f..9b52a3b 100644 --- a/gst/videofilter/gstvideoflip.c +++ b/gst/videofilter/gstvideoflip.c @@ -133,6 +133,7 @@ gst_video_flip_transform_caps (GstBaseTransform * trans, for (i = 0; i < gst_caps_get_size (ret); i++) { GstStructure *structure = gst_caps_get_structure (ret, i); + gint par_n, par_d; if (gst_structure_get_int (structure, "width", &width) && gst_structure_get_int (structure, "height", &height)) { @@ -144,6 +145,17 @@ gst_video_flip_transform_caps (GstBaseTransform * trans, case GST_VIDEO_FLIP_METHOD_OTHER: gst_structure_set (structure, "width", G_TYPE_INT, height, "height", G_TYPE_INT, width, NULL); + if (gst_structure_get_fraction (structure, "pixel-aspect-ratio", + &par_n, &par_d)) { + if (par_n != 1 || par_d != 1) { + GValue val = { 0, }; + + g_value_init (&val, GST_TYPE_FRACTION); + gst_value_set_fraction (&val, par_d, par_n); + gst_structure_set_value (structure, "pixel-aspect-ratio", &val); + g_value_unset (&val); + } + } break; case GST_VIDEO_FLIP_METHOD_IDENTITY: case GST_VIDEO_FLIP_METHOD_180: -- 2.7.4