]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - glsdk/gst-plugin-ducati.git/blobdiff - src/gstducati.c
ducati: fix spelling mistake in plugin description
[glsdk/gst-plugin-ducati.git] / src / gstducati.c
index 2bdc90453cef737a552da85cbc2b1e7908aebaa0..e3d6ae24a5285b5261ea7abdddb1cdce4a0ed983 100644 (file)
 #include "gstducativp6dec.h"
 #include "gstducativp7dec.h"
 #include "gstducatirvdec.h"
+#include "gstducatih264enc.h"
+#include "gstducatimpeg4enc.h"
 
 GST_DEBUG_CATEGORY (gst_ducati_debug);
 
+#ifndef GST_DISABLE_GST_DEBUG
+void
+gst_ducati_log_extended_error_info (int error)
+{
+  GST_ERROR ("Error %s%s%s%s%s%s%s%x",
+      XDM_ISFATALERROR (error) ? "[fatal] " : "",
+      XDM_ISUNSUPPORTEDPARAM (error) ? "[unsupported param] " : "",
+      XDM_ISUNSUPPORTEDINPUT (error) ? "[unsupported input] " : "",
+      XDM_ISCORRUPTEDHEADER (error) ? "[corrupted header] " : "",
+      XDM_ISCORRUPTEDDATA (error) ? "[corrupted data] " : "",
+      XDM_ISINSUFFICIENTDATA (error) ? "[insufficient data] " : "",
+      XDM_ISAPPLIEDCONCEALMENT (error) ? "[applied concealment] " : "", error);
+}
+#endif
+
 static gboolean
 plugin_init (GstPlugin * plugin)
 {
@@ -40,65 +57,24 @@ plugin_init (GstPlugin * plugin)
   /* TODO .. find some way to reasonably detect if the corresponding
    * codecs are actually available..
    */
-  return gst_element_register (plugin, "ducatih264dec", GST_RANK_PRIMARY, GST_TYPE_DUCATIH264DEC) &&
-      gst_element_register (plugin, "ducatimpeg4dec", GST_RANK_PRIMARY, GST_TYPE_DUCATIMPEG4DEC) &&
-      gst_element_register (plugin, "ducatimpeg2dec", GST_RANK_PRIMARY, GST_TYPE_DUCATIMPEG2DEC) &&
-      gst_element_register (plugin, "ducativc1dec", GST_RANK_PRIMARY, GST_TYPE_DUCATIVC1DEC) &&
-      gst_element_register (plugin, "ducativp6dec", GST_RANK_PRIMARY, GST_TYPE_DUCATIVP6DEC) &&
-      gst_element_register (plugin, "ducativp7dec", GST_RANK_PRIMARY, GST_TYPE_DUCATIVP7DEC) &&
-      gst_element_register (plugin, "ducatirvdec", GST_RANK_PRIMARY, GST_TYPE_DUCATIRVDEC);
-}
-
-void *
-gst_ducati_alloc_1d (gint sz)
-{
-  MemAllocBlock block = {
-    .pixelFormat = PIXEL_FMT_PAGE,
-    .dim.len = sz,
-  };
-  return MemMgr_Alloc (&block, 1);
-}
-
-void *
-gst_ducati_alloc_2d (gint width, gint height, guint * sz)
-{
-  MemAllocBlock block[] = { {
-          .pixelFormat = PIXEL_FMT_8BIT,
-          .dim = {.area = {
-                      .width = width,
-                      .height = ALIGN2 (height, 1),
-                  }},
-          .stride = 4096
-      }, {
-        .pixelFormat = PIXEL_FMT_16BIT,
-        .dim = {.area = {
-                    .width = width,
-                    .height = ALIGN2 (height, 1) / 2,
-                }},
-        .stride = 4096
-      }
-  };
-  if (sz) {
-    *sz = (4096 * ALIGN2 (height, 1) * 3) / 2;
-  }
-  return MemMgr_Alloc (block, 2);
-}
-
-XDAS_Int16
-gst_ducati_get_mem_type (SSPtr paddr)
-{
-  XDAS_Int16 type = XDM_MEMTYPE_RAW;
-
-  if ((0x60000000 <= paddr) && (paddr < 0x68000000))
-      type = XDM_MEMTYPE_TILED8;
-  else if ((0x68000000 <= paddr) && (paddr < 0x70000000))
-      type = XDM_MEMTYPE_TILED16;
-  else if ((0x70000000 <= paddr) && (paddr < 0x78000000))
-      type = XDM_MEMTYPE_TILED32;
-  else if ((0x78000000 <= paddr) && (paddr < 0x80000000))
-      type = XDM_MEMTYPE_TILEDPAGE;
-
-  return type;
+  return gst_element_register (plugin, "ducatih264dec", GST_RANK_PRIMARY,
+      GST_TYPE_DUCATIH264DEC) &&
+      gst_element_register (plugin, "ducatimpeg4dec", GST_RANK_PRIMARY,
+      GST_TYPE_DUCATIMPEG4DEC) &&
+      gst_element_register (plugin, "ducatimpeg2dec", GST_RANK_PRIMARY,
+      GST_TYPE_DUCATIMPEG2DEC) &&
+      gst_element_register (plugin, "ducativc1dec", GST_RANK_PRIMARY,
+      GST_TYPE_DUCATIVC1DEC) &&
+      gst_element_register (plugin, "ducativp6dec", GST_RANK_PRIMARY,
+      GST_TYPE_DUCATIVP6DEC) &&
+      gst_element_register (plugin, "ducativp7dec", GST_RANK_PRIMARY,
+      GST_TYPE_DUCATIVP7DEC) &&
+      gst_element_register (plugin, "ducatirvdec", GST_RANK_PRIMARY,
+      GST_TYPE_DUCATIRVDEC) &&
+      gst_element_register (plugin, "ducatih264enc", GST_RANK_PRIMARY + 1,
+      GST_TYPE_DUCATIH264ENC) &&
+      gst_element_register (plugin, "ducatimpeg4enc", GST_RANK_PRIMARY + 1,
+      GST_TYPE_DUCATIMPEG4ENC);
 }
 
 /* PACKAGE: this is usually set by autotools depending on some _INIT macro
@@ -110,14 +86,6 @@ gst_ducati_get_mem_type (SSPtr paddr)
 #  define PACKAGE "ducati"
 #endif
 
-GST_PLUGIN_DEFINE (
-    GST_VERSION_MAJOR,
-    GST_VERSION_MINOR,
-    "ducati",
-    "Hardware accellerated codecs for OMAP4",
-    plugin_init,
-    VERSION,
-    "LGPL",
-    "GStreamer",
-    "http://gstreamer.net/"
-)
+GST_PLUGIN_DEFINE (GST_VERSION_MAJOR, GST_VERSION_MINOR, "ducati",
+    "Hardware accelerated codecs for OMAP4",
+    plugin_init, VERSION, "LGPL", "GStreamer", "http://gstreamer.net/")