]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - glsdk/gst-plugin-ducati.git/blob - src/gstducati.c
mpeg4dec: add MPEG-4 support
[glsdk/gst-plugin-ducati.git] / src / gstducati.c
1 /*
2  * GStreamer
3  * Copyright (c) 2010, Texas Instruments Incorporated
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation
8  * version 2.1 of the License.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
18  */
20 #ifdef HAVE_CONFIG_H
21 #  include <config.h>
22 #endif
24 #include <gst/gst.h>
26 #include "gstducatih264dec.h"
27 #include "gstducatimpeg4dec.h"
29 GST_DEBUG_CATEGORY (gst_ducati_debug);
31 static gboolean
32 plugin_init (GstPlugin * plugin)
33 {
34   GST_DEBUG_CATEGORY_INIT (gst_ducati_debug, "ducati", 0, "ducati");
36   return gst_element_register (plugin, "ducatih264dec", GST_RANK_PRIMARY, GST_TYPE_DUCATIH264DEC) &&
37       gst_element_register (plugin, "ducatimpeg4dec", GST_RANK_PRIMARY, GST_TYPE_DUCATIMPEG4DEC);
38 }
40 void *
41 gst_ducati_alloc_1d (gint sz)
42 {
43   MemAllocBlock block = {
44     .pixelFormat = PIXEL_FMT_PAGE,
45     .dim.len = sz,
46   };
47   return MemMgr_Alloc (&block, 1);
48 }
50 void *
51 gst_ducati_alloc_2d (gint width, gint height)
52 {
53   MemAllocBlock block[] = { {
54           .pixelFormat = PIXEL_FMT_8BIT,
55           .dim = {.area = {
56                       .width = width,
57                       .height = height,
58                   }}
59       }, {
60         .pixelFormat = PIXEL_FMT_16BIT,
61         .dim = {.area = {
62                     .width = width,
63                     .height = height / 2,
64                 }}
65       }
66   };
67   return MemMgr_Alloc (block, 2);
68 }
70 XDAS_Int16
71 gst_ducati_get_mem_type (SSPtr paddr)
72 {
73   if ((0x60000000 <= paddr) && (paddr < 0x68000000))
74     return XDM_MEMTYPE_TILED8;
75   if ((0x68000000 <= paddr) && (paddr < 0x70000000))
76     return XDM_MEMTYPE_TILED16;
77   if ((0x70000000 <= paddr) && (paddr < 0x78000000))
78     return XDM_MEMTYPE_TILED32;
79   if ((0x78000000 <= paddr) && (paddr < 0x80000000))
80     return XDM_MEMTYPE_RAW;
81   return -1;
82 }
84 /* PACKAGE: this is usually set by autotools depending on some _INIT macro
85  * in configure.ac and then written into and defined in config.h, but we can
86  * just set it ourselves here in case someone doesn't use autotools to
87  * compile this code. GST_PLUGIN_DEFINE needs PACKAGE to be defined.
88  */
89 #ifndef PACKAGE
90 #  define PACKAGE "ducati"
91 #endif
93 GST_PLUGIN_DEFINE (
94     GST_VERSION_MAJOR,
95     GST_VERSION_MINOR,
96     "ducati",
97     "Hardware accellerated codecs for OMAP4",
98     plugin_init,
99     VERSION,
100     "LGPL",
101     "GStreamer",
102     "http://gstreamer.net/"