summaryrefslogtreecommitdiff
path: root/recipes/ti/gstreamer-ti/0002-add-omapl138-support.patch
blob: 7ddbe648c3cb9037ae2901d29ef582c48bd660ee (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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
From f19ff5f127764d42d497d47bcefeeca1e0af5f28 Mon Sep 17 00:00:00 2001
From: Brijesh Singh <bksingh@ti.com>
Date: Sun, 9 May 2010 05:23:59 -0500
Subject: [PATCH] add omapl138 support

---
 src/gstticodecplugin_omapl138.cfg |   41 +++++++++++++++++++
 src/gstticodecs_omapl138.c        |   81 +++++++++++++++++++++++++++++++++++++
 src/gsttidmaivideosink.c          |   73 ++++++++++++++++++++++++++-------
 src/gsttividenc1.c                |    3 +
 4 files changed, 183 insertions(+), 15 deletions(-)
 create mode 100644 src/gstticodecplugin_omapl138.cfg
 create mode 100644 src/gstticodecs_omapl138.c

diff --git a/src/gstticodecplugin_omapl138.cfg b/src/gstticodecplugin_omapl138.cfg
new file mode 100644
index 0000000..af1ad41
--- /dev/null
+++ b/src/gstticodecplugin_omapl138.cfg
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) $year Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation version 2.1 of the License.
+ *
+ * This program is distributed #as is# WITHOUT ANY WARRANTY of any kind,
+ * whether express or implied; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ */
+
+/* Load the Codec Engine 'Operating System Abstraction Layer' */
+var osalGlobal = xdc.useModule('ti.sdo.ce.osal.Global');
+
+var os = xdc.useModule('ti.sdo.ce.osal.linux.Settings');
+osalGlobal.os = os;
+
+/* Configure CE to use it's DSP Link Linux version */
+var ipc = xdc.useModule('ti.sdo.ce.ipc.Settings');
+ipc.commType = ipc.COMM_DSPLINK;
+
+/*
+*  ======== Engine Configuration ========
+ */
+var Engine = xdc.useModule('ti.sdo.ce.Engine');
+var demoEngine = Engine.createFromServer(
+    "codecServer",
+    "./bin/cs.x64P",
+    "ti.sdo.server.cs"
+    );
+
+var combopath = "" + java.lang.System.getenv("CODEC_SERVER");
+if (combopath != "" && combopath != "null") {
+	demoEngine.server = java.lang.System.getenv("CODEC_SERVER");
+}
+
+/* Load support for the DMAI module */
+var DMAI = xdc.loadPackage('ti.sdo.dmai');
diff --git a/src/gstticodecs_omapl138.c b/src/gstticodecs_omapl138.c
new file mode 100644
index 0000000..edab54f
--- /dev/null
+++ b/src/gstticodecs_omapl138.c
@@ -0,0 +1,81 @@
+/*
+ * gstticodecs_omapl138.c
+ *
+ * This file provides information for available codecs on the OMAP3530 platform.
+ *
+ * Original Author:
+ *     Don Darling, Texas Instruments, Inc.
+ *
+ * Copyright (C) $year Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation version 2.1 of the License.
+ *
+ * This program is distributed #as is# WITHOUT ANY WARRANTY of any kind,
+ * whether express or implied; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ */
+
+#include "gstticodecs.h"
+
+/* Declaration of the production engine and decoders shipped with the DVSDK */
+static Char codecServer[] = "codecServer";
+
+/* NULL terminated list of speech decoders in the engine to use in the demo */
+GstTICodec gst_ticodec_codecs[] = {
+
+    /* Audio Decoders */
+    {
+        "AAC Audio Decoder",     /* String name of codec used by plugin      */
+        "aachedec",              /* String name of codec used by CE          */
+        codecServer              /* Engine that contains this codec          */
+    },
+
+    /* Video Decoders */
+    {
+        "H.264 Video Decoder",   /* String name of codec used by plugin      */
+        "h264dec",               /* String name of codec used by CE          */
+        codecServer              /* Engine that contains this codec          */
+    }, {
+        "MPEG4 Video Decoder",   /* String name of codec used by plugin      */
+        "mpeg4dec",              /* String name of codec used by CE          */
+        codecServer              /* Engine that contains this codec          */
+    },
+
+    /* Image Decoders */
+    {
+        "JPEG Image Decoder",    /* String name of codec used by plugin      */
+        "jpegdec",               /* String name of codec used by CE          */
+        codecServer              /* Engine that contains this codec          */
+    },
+
+    /* Video Encoders */
+    {
+        "H.264 Video Encoder",   /* String name of codec used by plugin      */
+        "h264enc",               /* String name of codec used by CE          */
+        codecServer              /* Engine that contains this codec          */
+    },
+
+    /* Image Encoders */
+    {
+        "JPEG Image Encoder",    /* String name of codec used by plugin      */
+        "jpegenc",               /* String name of codec used by CE          */
+        codecServer              /* Engine that contains this codec          */
+    },
+
+    { NULL }
+};
+
+
+/******************************************************************************
+ * Custom ViM Settings for editing this file
+ ******************************************************************************/
+#if 0
+ Tabs (use 4 spaces for indentation)
+ vim:set tabstop=4:      /* Use 4 spaces for tabs          */
+ vim:set shiftwidth=4:   /* Use 4 spaces for >> operations */
+ vim:set expandtab:      /* Expand tabs into white spaces  */
+#endif
diff --git a/src/gsttidmaivideosink.c b/src/gsttidmaivideosink.c
index 81bdac7..65e0406 100644
--- a/src/gsttidmaivideosink.c
+++ b/src/gsttidmaivideosink.c
@@ -52,6 +52,19 @@ static GstStaticPadTemplate sink_factory = GST_STATIC_PAD_TEMPLATE (
     GST_PAD_SINK,
     GST_PAD_ALWAYS,
     GST_STATIC_CAPS
+#if defined(Platform_omapl138)
+    ("video/x-raw-rgb, "
+        "bpp=(int)16, "
+        "depth=(int)16, "
+        "endianness=(int)1234, "
+        "red_mask=(int)63488, "
+        "green_mask=(int)2016, "
+        "blue_mask=(int)31, "
+        "framerate=(fraction)[ 0, MAX ], "
+        "width=(int)[ 1, MAX ], "
+        "height=(int)[1, MAX ] "
+    )
+#else
     ("video/x-raw-yuv, "
          "format=(fourcc)UYVY, "
          "framerate=(fraction)[ 0, MAX ], "
@@ -73,6 +86,7 @@ static GstStaticPadTemplate sink_factory = GST_STATIC_PAD_TEMPLATE (
          "width=(int)[ 1, MAX ], "
          "height=(int)[ 1, MAX ]"
     )
+#endif
 );
 
 GST_DEBUG_CATEGORY_STATIC (gst_tidmaivideosink_debug);
@@ -673,6 +687,12 @@ static int gst_tidmaivideosink_videostd_get_attrs(VideoStd_Type videoStd,
             vattrs->framerate = 60;
             break;
 
+        #if defined(Platform_omapl138)
+        case VideoStd_QVGA:
+            vattrs->framerate = 30;
+            break;
+        #endif
+
         #if defined(Platform_omap3530)
         case VideoStd_VGA:
             vattrs->framerate = 60;
@@ -1051,6 +1071,12 @@ static gboolean gst_tidmaivideosink_set_display_attrs(GstTIDmaiVideoSink *sink,
             sink->dAttrs.colorSpace = colorSpace;
             break;
         #endif
+        #if defined(Platform_omapl138)
+        case Cpu_Device_OMAPL138:
+            sink->dAttrs = Display_Attrs_OMAPL138_OSD_DEFAULT;
+            sink->dAttrs.colorSpace = colorSpace;
+            break;
+        #endif
         default:
             sink->dAttrs = Display_Attrs_DM6446_DM355_VID_DEFAULT;
             break;
@@ -1307,8 +1333,10 @@ static gboolean gst_tidmaivideosink_process_caps(GstBaseSink * bsink,
     ColorSpace_Type     inBufColorSpace;
     gint                framerateDen;
     gint                framerateNum;
+    const gchar         *mime;
 
     structure = gst_caps_get_structure(caps, 0);
+    mime      = gst_structure_get_name(structure);
 
     /* The width and height of the input buffer are collected here so that it
      * can be checked against the width and height of the display buffer.
@@ -1316,23 +1344,38 @@ static gboolean gst_tidmaivideosink_process_caps(GstBaseSink * bsink,
     gst_structure_get_int(structure, "width", &width);
     gst_structure_get_int(structure, "height", &height);
 
-    /* Map input buffer fourcc to dmai color space  */
-    gst_structure_get_fourcc(structure, "format", &fourcc);
+    if (!strcmp(mime, "video/x-raw-rgb")) {
+        gint rm,gm,bm;
 
-    switch (fourcc) {
-        case GST_MAKE_FOURCC('U', 'Y', 'V', 'Y'):
-            inBufColorSpace = ColorSpace_UYVY;
-            break;
-        case GST_MAKE_FOURCC('N', 'V', '1', '6'):
-        case GST_MAKE_FOURCC('Y', '8', 'C', '8'):
-            inBufColorSpace = ColorSpace_YUV422PSEMI;
-            break;
-        case GST_MAKE_FOURCC('N', 'V', '1', '2'):
-            inBufColorSpace = ColorSpace_YUV420PSEMI;
-            break;
-        default:
-            GST_ERROR("unsupported fourcc\n");
+        gst_structure_get_int(structure,"red_mask",&rm);
+        gst_structure_get_int(structure,"green_mask",&gm);
+        gst_structure_get_int(structure,"blue_mask",&bm);
+        if ((rm == 63488) && (gm == 2016) && (bm == 31)){
+            inBufColorSpace = ColorSpace_RGB565;
+        } else {
+            GST_ERROR("unsupported color space\n");
             return FALSE;
+        }
+    } else {
+
+        /* Map input buffer fourcc to dmai color space  */
+        gst_structure_get_fourcc(structure, "format", &fourcc);
+
+        switch (fourcc) {
+            case GST_MAKE_FOURCC('U', 'Y', 'V', 'Y'):
+                inBufColorSpace = ColorSpace_UYVY;
+                break;
+            case GST_MAKE_FOURCC('N', 'V', '1', '6'):
+            case GST_MAKE_FOURCC('Y', '8', 'C', '8'):
+                inBufColorSpace = ColorSpace_YUV422PSEMI;
+                break;
+            case GST_MAKE_FOURCC('N', 'V', '1', '2'):
+                inBufColorSpace = ColorSpace_YUV420PSEMI;
+                break;
+            default:
+                GST_ERROR("unsupported fourcc\n");
+                return FALSE;
+        }
     }
 
     /* Read the frame rate */
diff --git a/src/gsttividenc1.c b/src/gsttividenc1.c
index 2e1fb31..60bf9e4 100644
--- a/src/gsttividenc1.c
+++ b/src/gsttividenc1.c
@@ -1488,6 +1488,9 @@ static gboolean gst_tividenc1_codec_start (GstTIVidenc1 *videnc1)
         #if defined(Platform_omap3530)
         case Cpu_Device_OMAP3530:
         #endif
+        #if defined(Platform_omapl138)
+        case Cpu_Device_OMAPL138:
+        #endif
         case Cpu_Device_DM6446:
             params.inputChromaFormat = XDM_YUV_422ILE;
             break;
-- 
1.5.4.3