[Cogl] [PATCH] gst-video-sink: add pixel-aspect-ratio property
Robert Bragg
robert at sixbynine.org
Thu Mar 21 09:40:58 PDT 2013
This looks good to land to me:
Reviewed-by: Robert Bragg <robert at linux.intel.com>
Something this patch did make me realize is that we haven't added any
gtk-doc documentation for the new cogl-gst api. If you would be able
to at least add a gtk-doc comment for this one property when you land
the patch that would be a nice bonus, but anyway we need to keep in
mind that we should follow up soon and look at documenting all of
cogl-gst.
thanks,
- Robert
On Thu, Mar 14, 2013 at 2:54 PM, Lionel Landwerlin
<llandwerlin at gmail.com> wrote:
> ---
> cogl-gst/cogl-gst-video-sink.c | 23 ++++++++++++++++++++++-
> 1 file changed, 22 insertions(+), 1 deletion(-)
>
> diff --git a/cogl-gst/cogl-gst-video-sink.c b/cogl-gst/cogl-gst-video-sink.c
> index ccc3268..453caa6 100644
> --- a/cogl-gst/cogl-gst-video-sink.c
> +++ b/cogl-gst/cogl-gst-video-sink.c
> @@ -75,7 +75,8 @@ G_DEFINE_TYPE (CoglGstVideoSink, cogl_gst_video_sink, GST_TYPE_BASE_SINK);
> enum
> {
> PROP_0,
> - PROP_UPDATE_PRIORITY
> + PROP_UPDATE_PRIORITY,
> + PROP_PAR
> };
>
> enum
> @@ -803,12 +804,21 @@ cogl_gst_video_sink_parse_caps (GstCaps *caps,
> GST_INFO_OBJECT (sink, "found the %s renderer", renderer->name);
>
> if (save) {
> + gboolean notify_par = FALSE;
> +
> + if (priv->info.par_n != vinfo.par_n ||
> + priv->info.par_d != vinfo.par_d)
> + notify_par = TRUE;
> +
> priv->info = vinfo;
>
> priv->format = format;
> priv->bgr = bgr;
>
> priv->renderer = renderer;
> +
> + if (notify_par)
> + g_object_notify (G_OBJECT (sink), "pixel-aspect-ratio");
> }
>
> return TRUE;
> @@ -1081,6 +1091,9 @@ cogl_gst_video_sink_get_property (GObject *object,
> case PROP_UPDATE_PRIORITY:
> g_value_set_int (value, g_source_get_priority ((GSource*) priv->source));
> break;
> + case PROP_PAR:
> + gst_value_set_fraction (value, priv->info.par_n, priv->info.par_d);
> + break;
> default:
> G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
> break;
> @@ -1143,6 +1156,14 @@ cogl_gst_video_sink_class_init (CoglGstVideoSinkClass *klass)
>
> g_object_class_install_property (go_class, PROP_UPDATE_PRIORITY, pspec);
>
> + pspec = gst_param_spec_fraction ("pixel-aspect-ratio",
> + "Pixel Aspect Ratio",
> + "Pixel aspect ratio of incoming frames",
> + 1, 100, 100, 1, 1, 1,
> + COGL_GST_PARAM_READABLE);
> +
> + g_object_class_install_property (go_class, PROP_PAR, pspec);
> +
> video_sink_signals[PIPELINE_READY_SIGNAL] =
> g_signal_new ("pipeline-ready",
> COGL_GST_TYPE_VIDEO_SINK,
> --
> 1.8.2.rc3
>
> _______________________________________________
> Cogl mailing list
> Cogl at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/cogl
More information about the Cogl
mailing list