summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Crête <olivier.crete@collabora.co.uk>2010-09-09 14:08:16 (GMT)
committerOlivier Crête <olivier.crete@collabora.co.uk>2010-09-09 14:08:16 (GMT)
commitf75cdaccc556f95acc5e773d72befe7482b1342b (patch)
tree90357bfcbf9a9149dfe2416a5c8cda294e089798
parentb37db82922e35133104d9237b0bf9590c41cf51a (diff)
downloadstream-engine-master.tar.gz
stream-engine-master.tar.xz
Take pixel-aspect-ratio in account for the output-sizeHEADmaster
-rw-r--r--src/videosink.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/videosink.c b/src/videosink.c
index e1beb61..ff3a123 100644
--- a/src/videosink.c
+++ b/src/videosink.c
@@ -162,12 +162,28 @@ size_change_idle_cb (gpointer data)
{
TpStreamEngineVideoSink *self = data;
gint width, height;
+ gboolean have_size = FALSE;
g_static_mutex_lock (&self->priv->mutex);
self->priv->size_change_idle_id = 0;
g_static_mutex_unlock (&self->priv->mutex);
+ GST_OBJECT_LOCK (self->priv->sinkpad);
if (gst_video_get_size (self->priv->sinkpad, &width, &height))
+ {
+ gint par_n, par_d;
+
+ if (gst_video_parse_caps_pixel_aspect_ratio (
+ GST_PAD_CAPS (self->priv->sinkpad), &par_n, &par_d))
+ {
+ width *= par_n;
+ width /= par_d;
+ }
+ have_size = TRUE;
+ }
+ GST_OBJECT_UNLOCK (self->priv->sinkpad);
+
+ if (have_size)
g_signal_emit (self, signals[SIZE_CHANGED], 0, width, height);
return FALSE;