aboutsummaryrefslogtreecommitdiffstats
path: root/common/recipes-multimedia/gstreamer/gst-plugins-good/0011-videocrop-change-the-unit-of-rowstride-to-byte.patch
blob: 89c202571af71c797cae57e966d3a8d472024edf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
From 88b1d76187a840987ef548bd9c3023ebfd97ea5a Mon Sep 17 00:00:00 2001
From: Kazunori Kobayashi <kkobayas@igel.co.jp>
Date: Wed, 26 Sep 2012 10:34:31 +0900
Subject: [PATCH 11/31] videocrop: change the unit of rowstride to byte

Set rowstride units to bytes in order to align with other plugins.
---
 gst/videocrop/gstvideocrop.c |   12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/gst/videocrop/gstvideocrop.c b/gst/videocrop/gstvideocrop.c
index 80c6d3d..6af348a 100644
--- a/gst/videocrop/gstvideocrop.c
+++ b/gst/videocrop/gstvideocrop.c
@@ -633,8 +633,16 @@ gst_video_crop_transform_caps (GstBaseTransform * trans,
     gst_structure_set_value (new_structure, "height", &h_val);
 
     /* set rowstride when creating output caps */
-    if (vcrop->stride_supported && (direction == GST_PAD_SINK))
-      gst_structure_set_value (new_structure, "rowstride", in_width);
+    if (vcrop->stride_supported && (direction == GST_PAD_SINK)) {
+      GstVideoCropImageDetails img_details = { 0, };
+      GValue stride = { 0, };
+
+      gst_video_crop_get_image_details_from_structure (vcrop, &img_details,
+          structure);
+      g_value_init (&stride, G_TYPE_INT);
+      g_value_set_int (&stride, (gint) img_details.stride);
+      gst_structure_set_value (new_structure, "rowstride", &stride);
+    }
     g_value_unset (&w_val);
     g_value_unset (&h_val);
     GST_LOG_OBJECT (vcrop, "transformed structure %2d: %" GST_PTR_FORMAT
-- 
1.7.9.5