gstreamer-ti: add patch to make more sinks work
[vuplus_openembedded] / packages / dsplink / gstreamer-ti / gst-buffsize.diff
1  ChangeLog          |   10 ++++++++++
2  src/gsttividdec2.c |   25 +++++++++++++++++++++----
3  src/gsttividdec2.h |    2 ++
4  3 files changed, 33 insertions(+), 4 deletions(-)
5
6 diff -Nurd --exclude .svn trunk/gstreamer_ti/ti_build/ticodecplugin/ChangeLog branches/BRANCH_DDOMPE_BUFFERSIZES/gstreamer_ti/ti_build/ticodecplugin/ChangeLog
7 --- ticodecplugin/ChangeLog     2009-03-03 08:57:50.000000000 +0100
8 +++ ticodecplugin/ChangeLog     2009-03-03 08:59:20.000000000 +0100
9 @@ -1,3 +1,13 @@
10 +2009-03-01  Diego Dompe, RidgeRun
11 +       * src/gsttividdec2.{c.h}:
12 +       Create the output buffer tab using the recently added height and width
13 +       attributes passed by the capabilities. This solves integration problems
14 +       with other elements like ffmpegcolorspace and xvimagesink, where they 
15 +       will fail because the second buffer pushed over the src pad of the 
16 +       decoder has a size different from the first one. Using the input caps 
17 +       for the creation of the buffer tab we have a more educated guess on the
18 +       output buffer size, and the resizing won't be required.
19 +
20  2009-02-25  Brijesh Singh, Texas Instruments, Inc.
21         * src/{gsttividenc1.{c,h},gsttividenc.{c,h},gsttividdec1.{c,h},gsttividdec.
22         {c,h},gsttiauddec1.{c,h},gsttiauddec.{c,h},gsttiimgdec1.{c,h},gsttiimgenc1.
23 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
24 --- ticodecplugin/src/gsttividdec2.c    2009-03-03 08:57:50.000000000 +0100
25 +++ ticodecplugin/src/gsttividdec2.c    2009-03-03 08:59:20.000000000 +0100
26 @@ -21,7 +21,11 @@
27   * Original Author:
28   *     Don Darling, Texas Instruments, Inc.
29   *
30 + * Contributors:
31 + *     Diego Dompe, RidgeRun
32 + *
33   * Copyright (C) $year Texas Instruments Incorporated - http://www.ti.com/
34 + * Copyright (C) $year RidgeRun 
35   *
36   * This program is free software; you can redistribute it and/or modify 
37   * it under the terms of the GNU Lesser General Public License as
38 @@ -350,6 +354,8 @@
39  
40      viddec2->framerateNum       = 0;
41      viddec2->framerateDen       = 0;
42 +    viddec2->height            = 0;
43 +    viddec2->width             = 0;
44  
45      viddec2->numOutputBufs      = 0UL;
46      viddec2->hOutBufTab         = NULL;
47 @@ -484,6 +490,14 @@
48              viddec2->framerateNum = framerateNum;
49              viddec2->framerateDen = framerateDen;
50          }
51 +
52 +        if (!gst_structure_get_int(capStruct, "height", &viddec2->height)) {
53 +            viddec2->height = 0;
54 +        }
55 +
56 +        if (!gst_structure_get_int(capStruct, "width", &viddec2->width)) {
57 +            viddec2->width = 0;
58 +        }
59      }
60  
61      /* MPEG Decode */
62 @@ -1048,6 +1062,7 @@
63      Cpu_Device             device;
64      ColorSpace_Type        colorSpace;
65      Int                    defaultNumBufs;
66 +    Int                    outBufSize;
67  
68      /* Open the codec engine */
69      GST_LOG("opening codec engine \"%s\"\n", viddec2->engineName);
70 @@ -1116,8 +1131,8 @@
71      /* Create codec output buffers */
72      GST_LOG("creating output buffer table\n");
73      gfxAttrs.colorSpace     = colorSpace;
74 -    gfxAttrs.dim.width      = params.maxWidth;
75 -    gfxAttrs.dim.height     = params.maxHeight;
76 +    gfxAttrs.dim.width      = viddec2->width;
77 +    gfxAttrs.dim.height     = viddec2->height;
78      gfxAttrs.dim.lineLength = BufferGfx_calcLineLength(
79                                    gfxAttrs.dim.width, gfxAttrs.colorSpace);
80  
81 @@ -1125,8 +1140,10 @@
82      gfxAttrs.bAttrs.useMask = gst_tidmaibuffertransport_GST_FREE |
83                                gst_tividdec2_CODEC_FREE;
84  
85 +    outBufSize = gfxAttrs.dim.lineLength * viddec2->height;
86 +
87      viddec2->hOutBufTab =
88 -        BufTab_create(viddec2->numOutputBufs, Vdec2_getOutBufSize(viddec2->hVd),
89 +        BufTab_create(viddec2->numOutputBufs, outBufSize,
90              BufferGfx_getBufferAttrs(&gfxAttrs));
91  
92      if (viddec2->hOutBufTab == NULL) {
93 @@ -1295,7 +1312,7 @@
94               */
95              outBuf = gst_tidmaibuffertransport_new(hDstBuf);
96              gst_buffer_set_data(outBuf, GST_BUFFER_DATA(outBuf),
97 -                Buffer_getNumBytesUsed(hDstBuf));
98 +                Vdec2_getOutBufSize(viddec2->hVd));
99              gst_buffer_set_caps(outBuf, GST_PAD_CAPS(viddec2->srcpad));
100  
101              /* If we have a valid time stamp, set it on the buffer */
102 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
103 --- ticodecplugin/src/gsttividdec2.h    2009-03-03 08:57:50.000000000 +0100
104 +++ ticodecplugin/src/gsttividdec2.h    2009-03-03 08:59:20.000000000 +0100
105 @@ -96,6 +96,8 @@
106    /* Framerate (Num/Den) */
107    gint               framerateNum;
108    gint               framerateDen;
109 +  gint               height;
110 +  gint               width;
111  
112    /* Buffer management */
113    UInt32           numOutputBufs;