Search
SailfishOS Open Build Service
>
Projects
>
home:sledge
:
branches:nemo:devel:hw:ti:omap4:common
>
gst-plugins-base
> 0033-appsink-add-crop-signal.patch
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File 0033-appsink-add-crop-signal.patch of Package gst-plugins-base
From 9d3598f50427dcba3684da88c64513211b4d0cae Mon Sep 17 00:00:00 2001 From: Rob Clark <rob@ti.com> Date: Thu, 24 Nov 2011 16:08:40 -0600 Subject: [PATCH 33/38] appsink: add crop signal.. --- gst-libs/gst/app/gstappsink.c | 37 +++++++++++++++++++++++++++++++++++++ gst-libs/gst/app/gstappsink.h | 3 ++- 2 files changed, 39 insertions(+), 1 deletions(-) diff --git a/gst-libs/gst/app/gstappsink.c b/gst-libs/gst/app/gstappsink.c index 07a3989..7e685df 100644 --- a/gst-libs/gst/app/gstappsink.c +++ b/gst-libs/gst/app/gstappsink.c @@ -125,6 +125,7 @@ enum SIGNAL_NEW_PREROLL, SIGNAL_NEW_BUFFER, SIGNAL_NEW_BUFFER_LIST, + SIGNAL_CROP, /* actions */ SIGNAL_PULL_PREROLL, @@ -359,6 +360,35 @@ gst_app_sink_class_init (GstAppSinkClass * klass) g_signal_new ("new-buffer-list", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstAppSinkClass, new_buffer_list), NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0, G_TYPE_NONE); + /** + * GstAppSink::crop: + * @appsink: the appsink element that emited the signal + * @top: coordinate of top row of pixels + * @left: coordinate of left column of pixels + * @width: width of visible picture (starting from %left) + * @height: height of visible picture (starting from %top) + * + * Signal new picture cropping (applicable for YUV/RGB buffers). Note + * that for gst 0.11, this information should come from the buffer as + * meta-data, to make it easier to synchronize cropping coordinates + * with buffers. For now, you can probably ignore that because for + * decoders cropping won't be changing on a per-frame basis. In case + * you do need to care about synchronizing with buffers, you probably + * need to count the new-buffer signals and keep a queue of cropping + * coordinates to match up with buffers when you pop them. Or just + * wait for 0.11. + * + * This signal is emited from the steaming thread and only when the + * "emit-signals" property is %TRUE. + * + * Note that this signal is only emited when the "emit-signals" property is + * set to %TRUE, which it is not by default for performance reasons. + */ + gst_app_sink_signals[SIGNAL_CROP] = + g_signal_new ("crop", G_TYPE_FROM_CLASS (klass), + G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstAppSinkClass, crop), + NULL, NULL, g_cclosure_marshal_generic, G_TYPE_NONE, 4, + G_TYPE_INT, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT); /** * GstAppSink::pull-preroll: @@ -706,6 +736,13 @@ gst_app_sink_event (GstBaseSink * sink, GstEvent * event) gst_app_sink_flush_unlocked (appsink); g_mutex_unlock (priv->mutex); break; + case GST_EVENT_CROP:{ + gint top, left, width, height; + gst_event_parse_crop (event, &top, &left, &width, &height); + g_signal_emit (appsink, gst_app_sink_signals[SIGNAL_CROP], 0, top, left, + width, height); + break; + } default: break; } diff --git a/gst-libs/gst/app/gstappsink.h b/gst-libs/gst/app/gstappsink.h index 3e0bc41..660be7d 100644 --- a/gst-libs/gst/app/gstappsink.h +++ b/gst-libs/gst/app/gstappsink.h @@ -105,9 +105,10 @@ struct _GstAppSinkClass /* ABI added */ GstBufferList * (*new_buffer_list) (GstAppSink *sink); GstBufferList * (*pull_buffer_list) (GstAppSink *sink); + GstBufferList * (*crop) (GstAppSink *sink, gint top, gint left, gint width, gint height); /*< private >*/ - gpointer _gst_reserved[GST_PADDING - 2]; + gpointer _gst_reserved[GST_PADDING - 3]; }; GType gst_app_sink_get_type(void); -- 1.7.5.4