aboutsummaryrefslogtreecommitdiffstats
path: root/common/recipes-multimedia/gstreamer/gst-plugins-good/0020-videocrop-set-tile-boundary-offset-in-caps-for-T-L-a.patch
blob: 19703941b26e4fb67ada06701835dc7733e0eb7f (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
37
38
39
40
41
42
43
44
From efde8be8052d31a13629160c55f59e3be661a48c Mon Sep 17 00:00:00 2001
From: Kazunori Kobayashi <kkobayas@igel.co.jp>
Date: Fri, 12 Oct 2012 18:33:29 +0900
Subject: [PATCH 20/31] videocrop: set tile boundary offset in caps for T/L
 addressing

This change is necessary for cropping the image data that is stored
as tiles in memory. Thease capabilities notify downstream plugins of
the offset to the previous tile boundary.
---
 gst/videocrop/gstvideocrop.c |   12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/gst/videocrop/gstvideocrop.c b/gst/videocrop/gstvideocrop.c
index da30c1b..dbebcfa 100644
--- a/gst/videocrop/gstvideocrop.c
+++ b/gst/videocrop/gstvideocrop.c
@@ -677,11 +677,23 @@ gst_video_crop_transform_caps (GstBaseTransform * trans,
       delta_chroma_offs = 0;
     } else if (img_details.packing == VIDEO_CROP_PIXEL_FORMAT_SEMI_PLANAR) {
       guint ratio_y_c;
+      GstStructure *structure;
+      gint tile_height;
 
       rowstride = img_details.stride;
       /* Y plane / UV plane */
       ratio_y_c = img_details.uv_off / (img_details.size - img_details.uv_off);
       delta_chroma_offs = rowstride * vcrop->crop_top / ratio_y_c;
+
+      /* set tile boudary for T/L addressing */
+      structure = gst_caps_get_structure (caps, 0);
+      if (gst_structure_get_int (structure, "tile-height", &tile_height)) {
+        gst_structure_set (new_structure, "tile_boundary_y_offset",
+            G_TYPE_INT, vcrop->crop_top % tile_height, NULL);
+
+        gst_structure_set (new_structure, "tile_boundary_c_offset",
+            G_TYPE_INT, vcrop->crop_top / ratio_y_c % tile_height, NULL);
+      }
     } else {
       rowstride = 0;
       delta_chroma_offs = 0;
-- 
1.7.9.5