aboutsummaryrefslogtreecommitdiffstats
path: root/packages/dsplink/gstreamer-ti/gst-buffsize.diff
blob: 2d712864986774b8f46e4af41e03ea9cf05ec185 (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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
 ChangeLog          |   10 ++++++++++
 src/gsttividdec2.c |   25 +++++++++++++++++++++----
 src/gsttividdec2.h |    2 ++
 3 files changed, 33 insertions(+), 4 deletions(-)

diff -Nurd --exclude .svn trunk/gstreamer_ti/ti_build/ticodecplugin/ChangeLog branches/BRANCH_DDOMPE_BUFFERSIZES/gstreamer_ti/ti_build/ticodecplugin/ChangeLog
--- ticodecplugin/ChangeLog	2009-03-03 08:57:50.000000000 +0100
+++ ticodecplugin/ChangeLog	2009-03-03 08:59:20.000000000 +0100
@@ -1,3 +1,13 @@
+2009-03-01  Diego Dompe, RidgeRun
+	* src/gsttividdec2.{c.h}:
+	Create the output buffer tab using the recently added height and width
+	attributes passed by the capabilities. This solves integration problems
+	with other elements like ffmpegcolorspace and xvimagesink, where they 
+	will fail because the second buffer pushed over the src pad of the 
+	decoder has a size different from the first one. Using the input caps 
+	for the creation of the buffer tab we have a more educated guess on the
+	output buffer size, and the resizing won't be required.
+
 2009-02-25  Brijesh Singh, Texas Instruments, Inc.
 	* src/{gsttividenc1.{c,h},gsttividenc.{c,h},gsttividdec1.{c,h},gsttividdec.
 	{c,h},gsttiauddec1.{c,h},gsttiauddec.{c,h},gsttiimgdec1.{c,h},gsttiimgenc1.
diff -Nurd --exclude .svn trunk/gstreamer_ti/ti_build/ticodecplugin/src/gsttividdec2.c branches/BRANCH_DDOMPE_BUFFERSIZES/gstreamer_ti/ti_build/ticodecplugin/src/gsttividdec2.c
--- ticodecplugin/src/gsttividdec2.c	2009-03-03 08:57:50.000000000 +0100
+++ ticodecplugin/src/gsttividdec2.c	2009-03-03 08:59:20.000000000 +0100
@@ -21,7 +21,11 @@
  * Original Author:
  *     Don Darling, Texas Instruments, Inc.
  *
+ * Contributors:
+ *     Diego Dompe, RidgeRun
+ *
  * Copyright (C) $year Texas Instruments Incorporated - http://www.ti.com/
+ * Copyright (C) $year RidgeRun 
  *
  * This program is free software; you can redistribute it and/or modify 
  * it under the terms of the GNU Lesser General Public License as
@@ -350,6 +354,8 @@
 
     viddec2->framerateNum       = 0;
     viddec2->framerateDen       = 0;
+    viddec2->height		= 0;
+    viddec2->width		= 0;
 
     viddec2->numOutputBufs      = 0UL;
     viddec2->hOutBufTab         = NULL;
@@ -484,6 +490,14 @@
             viddec2->framerateNum = framerateNum;
             viddec2->framerateDen = framerateDen;
         }
+
+        if (!gst_structure_get_int(capStruct, "height", &viddec2->height)) {
+            viddec2->height = 0;
+        }
+
+        if (!gst_structure_get_int(capStruct, "width", &viddec2->width)) {
+            viddec2->width = 0;
+        }
     }
 
     /* MPEG Decode */
@@ -1048,6 +1062,7 @@
     Cpu_Device             device;
     ColorSpace_Type        colorSpace;
     Int                    defaultNumBufs;
+    Int                    outBufSize;
 
     /* Open the codec engine */
     GST_LOG("opening codec engine \"%s\"\n", viddec2->engineName);
@@ -1116,8 +1131,8 @@
     /* Create codec output buffers */
     GST_LOG("creating output buffer table\n");
     gfxAttrs.colorSpace     = colorSpace;
-    gfxAttrs.dim.width      = params.maxWidth;
-    gfxAttrs.dim.height     = params.maxHeight;
+    gfxAttrs.dim.width      = viddec2->width;
+    gfxAttrs.dim.height     = viddec2->height;
     gfxAttrs.dim.lineLength = BufferGfx_calcLineLength(
                                   gfxAttrs.dim.width, gfxAttrs.colorSpace);
 
@@ -1125,8 +1140,10 @@
     gfxAttrs.bAttrs.useMask = gst_tidmaibuffertransport_GST_FREE |
                               gst_tividdec2_CODEC_FREE;
 
+    outBufSize = gfxAttrs.dim.lineLength * viddec2->height;
+
     viddec2->hOutBufTab =
-        BufTab_create(viddec2->numOutputBufs, Vdec2_getOutBufSize(viddec2->hVd),
+        BufTab_create(viddec2->numOutputBufs, outBufSize,
             BufferGfx_getBufferAttrs(&gfxAttrs));
 
     if (viddec2->hOutBufTab == NULL) {
@@ -1295,7 +1312,7 @@
              */
             outBuf = gst_tidmaibuffertransport_new(hDstBuf);
             gst_buffer_set_data(outBuf, GST_BUFFER_DATA(outBuf),
-                Buffer_getNumBytesUsed(hDstBuf));
+                Vdec2_getOutBufSize(viddec2->hVd));
             gst_buffer_set_caps(outBuf, GST_PAD_CAPS(viddec2->srcpad));
 
             /* If we have a valid time stamp, set it on the buffer */
diff -Nurd --exclude .svn trunk/gstreamer_ti/ti_build/ticodecplugin/src/gsttividdec2.h branches/BRANCH_DDOMPE_BUFFERSIZES/gstreamer_ti/ti_build/ticodecplugin/src/gsttividdec2.h
--- ticodecplugin/src/gsttividdec2.h	2009-03-03 08:57:50.000000000 +0100
+++ ticodecplugin/src/gsttividdec2.h	2009-03-03 08:59:20.000000000 +0100
@@ -96,6 +96,8 @@
   /* Framerate (Num/Den) */
   gint               framerateNum;
   gint               framerateDen;
+  gint               height;
+  gint               width;
 
   /* Buffer management */
   UInt32           numOutputBufs;