[Cogl] [PATCH] cogl-gst: expose aspect ratio apis
Neil Roberts
neil at linux.intel.com
Mon Apr 29 04:17:42 PDT 2013
Robert Bragg <robert at sixbynine.org> writes:
> +float
> +cogl_gst_video_sink_get_aspect (CoglGstVideoSink *vt)
> +{
> + GstVideoInfo *info = &vt->priv->info;
> + return (float)info->width * (float)info->par_n /
> + (float)info->height * (float)info->par_d;
> +}
It looks like this is missing some brackets. It is effectively doing
‘width / height * numerator * denominator’. If you try it with this
video which has a 8/9 pixel aspect ratio then it comes out totally
wrong.
http://upload.wikimedia.org/wikipedia/commons/e/e6/Typing_example.ogv
> +float
> +cogl_gst_video_sink_get_width_for_height (CoglGstVideoSink *vt,
> + float height)
I wonder if these functions are bit over the top. It seems like it'd be
totally trivial to just multiply or divide by the aspect ratio manually
in the application.
> + cogl_onscreen_add_resize_handler (onscreen, _resize_callback, &data);
This function has changed to cogl_onscreen_add_resize_callback so it
doesn't compile anymore.
Regards,
- Neil
---------------------------------------------------------------------
Intel Corporation (UK) Limited
Registered No. 1134945 (England)
Registered Office: Pipers Way, Swindon SN3 1RJ
VAT No: 860 2173 47
This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
More information about the Cogl
mailing list