felipec gst-openmax: gst-openmax/omx/

[email protected]
Newsgroups gmane.comp.video.gstreamer.cvs
Message-ID <[email protected]>
CVS Root:       /cvs/gstreamer
Module:         gst-openmax
Changes by:     felipec
Date:           Thu Nov 20 2008  16:33:29 UTC

Log message:
Improve buffer sizes in jpegenc.
TI-specific stuff.

Modified files:
    omx             : gstomx_jpegenc.c

Links:
http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-openmax/omx/gstomx_jpegenc.c.diff?r1=1.2&r2=1.3

====Begin Diffs====
Index: gstomx_jpegenc.c
===================================================================
RCS file: /cvs/gstreamer/gst-openmax/omx/gstomx_jpegenc.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- gstomx_jpegenc.c	20 Nov 2008 16:32:22 -0000	1.2
+++ gstomx_jpegenc.c	20 Nov 2008 16:33:15 -0000	1.3
@@ -255,7 +255,6 @@
 
     {
         OMX_PARAM_PORTDEFINITIONTYPE *param;
-        OMX_COLOR_FORMATTYPE color_format;
         gint width, height;
         param = calloc (1, sizeof (OMX_PARAM_PORTDEFINITIONTYPE));
@@ -278,6 +277,8 @@
 #if 1
         /* the component should do this instead */
         {
+            OMX_COLOR_FORMATTYPE color_format;
+
             param->nPortIndex = 0;
             OMX_GetParameter (gomx->omx_handle, OMX_IndexParamPortDefinition, param);
@@ -291,9 +292,17 @@
                 case OMX_COLOR_FormatYCbYCr:
                 case OMX_COLOR_FormatCbYCrY:
                     param->nBufferSize = (GST_ROUND_UP_16 (width) * GST_ROUND_UP_16 (height)) * 2;
+#if 0
+                    if (param->nBufferSize >= 400)
+                        param->nBufferSize = 400;
+#endif
                     break;
                 case OMX_COLOR_FormatYUV420Planar:
                     param->nBufferSize = (GST_ROUND_UP_16 (width) * GST_ROUND_UP_16 (height)) * 3 / 2;
+                    if (param->nBufferSize >= 1600)
+                        param->nBufferSize = 1600;
                 default:
@@ -307,19 +316,14 @@
             param->nPortIndex = 1;
-            /* this is against the standard; nBufferSize is read-only. */
-            switch (color_format)
-            {
-                case OMX_COLOR_FormatYCbYCr:
-                case OMX_COLOR_FormatCbYCrY:
-                    param->nBufferSize = (GST_ROUND_UP_16 (width) * GST_ROUND_UP_16 (height)) * 2;
-                    break;
-                case OMX_COLOR_FormatYUV420Planar:
-                    param->nBufferSize = (GST_ROUND_UP_16 (width) * GST_ROUND_UP_16 (height)) * 3 / 2;
-                default:
-            }
+            param->nBufferSize = width * height;
+            if (qualityfactor < 10)
+                param->nBufferSize /= 10;
+            else if (qualityfactor < 100)
+                param->nBufferSize /= (100 / qualityfactor);
             param->format.image.nFrameWidth = width;
             param->format.image.nFrameHeight = height;

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.