]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - glsdk/gst-plugin-ducati.git/blobdiff - src/gstducati.c
playbin2 uses ducatijpegdec to play mjpeg streams
[glsdk/gst-plugin-ducati.git] / src / gstducati.c
index e7f3422484e7fc9a74c6f6c09d0146289d487be5..d14472d037e61462c36492af502fa7a5cc6e45a2 100644 (file)
 #include "gstducatimpeg4dec.h"
 #include "gstducatimpeg2dec.h"
 #include "gstducativc1dec.h"
-#include "gstducativp6dec.h"
-#include "gstducativp7dec.h"
-#include "gstducatirvdec.h"
+#include "gstducatijpegdec.h"
+#include "gstducatih264enc.h"
+#include "gstducatimpeg4enc.h"
 
 GST_DEBUG_CATEGORY (gst_ducati_debug);
 
+void
+gst_ducati_set_generic_error_strings (const char *strings[])
+{
+#ifndef GST_DISABLE_GST_DEBUG
+  strings[XDM_PARAMSCHANGE] = "sequence parameters change";
+  strings[XDM_APPLIEDCONCEALMENT] = "applied concealment";
+  strings[XDM_INSUFFICIENTDATA] = "insufficient data";
+  strings[XDM_CORRUPTEDDATA] = "corrupted data";
+  strings[XDM_CORRUPTEDHEADER] = "corrupted header";
+  strings[XDM_UNSUPPORTEDINPUT] = "unsupported input";
+  strings[XDM_UNSUPPORTEDPARAM] = "unsupported param";
+  strings[XDM_FATALERROR] = "fatal";
+#endif
+}
+
 #ifndef GST_DISABLE_GST_DEBUG
 void
-gst_ducati_log_extended_error_info (int error)
+gst_ducati_log_extended_error_info (uint32_t error, const char *strings[])
 {
-  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);
+  int bit = 0;
+  while (error) {
+    if (error & 1) {
+      GST_ERROR ("Bit %d (%08x): %s", bit, 1 << bit,
+          strings[bit] ? strings[bit] : "unknown");
+    }
+    error >>= 1;
+    ++bit;
+  }
 }
 #endif
 
@@ -52,9 +68,6 @@ plugin_init (GstPlugin * plugin)
 {
   GST_DEBUG_CATEGORY_INIT (gst_ducati_debug, "ducati", 0, "ducati");
 
-  /* 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,
@@ -63,19 +76,12 @@ plugin_init (GstPlugin * plugin)
       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);
-#if 0
-      &&
+      gst_element_register (plugin, "ducatijpegdec", GST_RANK_PRIMARY + 1,
+      GST_TYPE_DUCATIJPEGDEC) &&
       gst_element_register (plugin, "ducatih264enc", GST_RANK_PRIMARY + 1,
       GST_TYPE_DUCATIH264ENC) &&
       gst_element_register (plugin, "ducatimpeg4enc", GST_RANK_PRIMARY + 1,
       GST_TYPE_DUCATIMPEG4ENC);
-#endif
 }
 
 /* PACKAGE: this is usually set by autotools depending on some _INIT macro
@@ -88,5 +94,5 @@ plugin_init (GstPlugin * plugin)
 #endif
 
 GST_PLUGIN_DEFINE (GST_VERSION_MAJOR, GST_VERSION_MINOR, "ducati",
-    "Hardware accellerated codecs for OMAP4",
+    "Hardware accelerated codecs for OMAP4",
     plugin_init, VERSION, "LGPL", "GStreamer", "http://gstreamer.net/")