[gst-devel] updated gstreamer for Forte patch

Brian Cameron Brian.Cameron at Sun.COM
Fri Dec 6 10:02:02 CET 2002


I sent this email to thomasvs, but I'm now forwarding to the mail list.

Brian

------------- Begin Forwarded Message -------------

Okay, I went and updated my patch to fix a lot more things.  This time
I just kept commenting out those things that I couldn't figure out so I
could resolve everything that I could figure out.  The attached updated
patch also includes the changes from my last patch.  The only thing in
the patch you might not like is the way I'm handling "__inline__" in
gst/gsttrace.c, so take a look at that.

The folloing things are still issues on Forte (in other words, these
are the things I commented out):

*  The inclusion of "-Wall" and "-Werror" in the toplevel configure.ac
   and the inclusion of "-Wall" in the 
   libs/ext/cothreads/cothreads/Makefile.am file do not work with
   Forte.
   
*  gst/gst.c - I currently must remove const from options_with and
               from options_without arrays.
               
*  gst/elements/gstmd5sink.c - "__alignof__ (guint32)" is not 
                               supported on Forte.  Not sure what
                               to replace it with yet.
                               
*  gst/cothreads.h and
   libs/ext/cothreads/cothreads/cothreads-pth-private.h - in both files
      __csf is not supported, used in "#define CURRENT_STACK_FRAME"

*  The various __asm__ references in gst/gstarch.h, gst/gstatomic.h, and
   gst/gsttrace.c (this last one does not cause the compiler to fail since
   it falls into the #else but I'm not sure that this is appropriate).
   I suspect these can be fixed by finding the right Forte "__asm"
   equilivants.

   The __asm__ references in gst/gstatomic.h and tests/bufspeed/gstmempool.c
   seem to have C workarounds, so I assume those aren't a problem.  I also
   assume it the __asm__ references in include/sse.h and include/mmx.h will
   not affect Solaris.

So, once we get all that sorted, I'll be able to look for runtime errors.
:)  At any rate, it was quite a lot of work to just get this far!  At least
we know that the compiler issues are narrowing down to just a few.

I've attached the output from making gstreamer with Forte on Solaris, so
you can see all the Warnings that Forte spits out.  Different compilers
are often better at finding different sorts of problems in the code, so
I suspect some of these messages might point you towards issues to look
into, etc.

Brian

------------- End Forwarded Message -------------
-------------- next part --------------
Index: gst/gstatomic.h
===================================================================
RCS file: /cvsroot/gstreamer/gstreamer/gst/gstatomic.h,v
retrieving revision 1.6
diff -u -p -r1.6 gstatomic.h
--- gst/gstatomic.h	29 Nov 2002 18:34:32 -0000	1.6
+++ gst/gstatomic.h	6 Dec 2002 16:15:55 -0000
@@ -226,7 +226,7 @@ G_STMT_START {						\
     tmp = (swap)->value;				\
     tmp2 = val;						\
     (swap)->value = (gpointer)*tmp2;			\
-    (*res) = (gpointer)*tmp2 = (gint*)tmp;		\
+    (*res) = (gpointer) (*tmp2 = (gint*)tmp);		\
     g_mutex_unlock ((swap)->lock);			\
   }							\
 } G_STMT_END
Index: gst/gstthread.c
===================================================================
RCS file: /cvsroot/gstreamer/gstreamer/gst/gstthread.c,v
retrieving revision 1.99
diff -u -p -r1.99 gstthread.c
--- gst/gstthread.c	28 Nov 2002 21:24:01 -0000	1.99
+++ gst/gstthread.c	6 Dec 2002 16:15:55 -0000
@@ -278,6 +278,50 @@ gst_thread_new (const gchar *name)
 
 /* these two macros are used for debug/info from the state_change function */
 
+#ifdef G_HAVE_ISO_VARARGS
+
+#define THR_INFO(...) \
+  { \
+  gchar *val = g_strdup_printf(__VA_ARGS__); \
+  GST_INFO_ELEMENT(GST_CAT_THREAD, thread, \
+    "sync(" GST_DEBUG_THREAD_FORMAT "): %s %s", \
+    GST_DEBUG_THREAD_ARGS(thread->pid), val); \
+  g_free(val); \
+  }
+  
+#define THR_DEBUG(...) \
+  { \
+  gchar *val = g_strdup_printf(__VA_ARGS__); \
+  GST_INFO_ELEMENT(GST_CAT_THREAD, thread, \
+    "sync(" GST_DEBUG_THREAD_FORMAT "): %s %s", \
+    GST_DEBUG_THREAD_ARGS(thread->pid), val); \
+  g_free(val); \
+  }
+
+/* these two macros are used for debug/info from the gst_thread_main_loop
+ * function
+ */
+
+#define THR_INFO_MAIN(...) \
+  { \
+  gchar *val = g_strdup_printf(__VA_ARGS__); \
+  GST_INFO_ELEMENT(GST_CAT_THREAD, thread, \
+    "sync-main(" GST_DEBUG_THREAD_FORMAT "): %s %s", \
+    GST_DEBUG_THREAD_ARGS(thread->pid), val); \
+  g_free(val); \
+  }
+
+#define THR_DEBUG_MAIN(...) \
+  { \
+  gchar *val = g_strdup_printf(__VA_ARGS__); \
+  GST_INFO_ELEMENT(GST_CAT_THREAD, thread, \
+    "sync-main(" GST_DEBUG_THREAD_FORMAT "): %s %s", \
+    GST_DEBUG_THREAD_ARGS(thread->pid), val); \
+  g_free(val); \
+  }
+
+#elif defined(G_HAVE_GNUC_VARARGS)
+
 #define THR_INFO(format,args...) \
   GST_INFO_ELEMENT(GST_CAT_THREAD, thread, "sync(" GST_DEBUG_THREAD_FORMAT "): " format , \
   GST_DEBUG_THREAD_ARGS(thread->pid) , ## args )
@@ -297,6 +341,8 @@ gst_thread_new (const gchar *name)
 #define THR_DEBUG_MAIN(format,args...) \
   GST_DEBUG_ELEMENT(GST_CAT_THREAD, thread, "sync-main(" GST_DEBUG_THREAD_FORMAT "): " format , \
   GST_DEBUG_THREAD_ARGS(thread->ppid) , ## args )
+
+#endif
 
 static GstElementStateReturn
 gst_thread_update_state (GstThread *thread)
Index: gst/gsttrace.c
===================================================================
RCS file: /cvsroot/gstreamer/gstreamer/gst/gsttrace.c,v
retrieving revision 1.8
diff -u -p -r1.8 gsttrace.c
--- gst/gsttrace.c	12 Aug 2002 16:59:39 -0000	1.8
+++ gst/gsttrace.c	6 Dec 2002 16:15:55 -0000
@@ -33,8 +33,12 @@
 #include "gstlog.h"
 #include "gsttrace.h"
 
-static __inline__ void
-read_tsc (guint64 * dst)
+static 
+#ifdef __inline__
+__inline__
+#endif
+void
+read_tsc (gint64 * dst)
 {
 #ifdef HAVE_RDTSC
   guint64 tsc;
@@ -47,7 +51,7 @@ read_tsc (guint64 * dst)
 }
 
 void
-gst_trace_read_tsc (guint64 * dst)
+gst_trace_read_tsc (gint64 * dst)
 {
   read_tsc (dst);
 }
Index: gst/gsttrace.h
===================================================================
RCS file: /cvsroot/gstreamer/gstreamer/gst/gsttrace.h,v
retrieving revision 1.10
diff -u -p -r1.10 gsttrace.h
--- gst/gsttrace.h	12 Aug 2002 16:59:39 -0000	1.10
+++ gst/gsttrace.h	6 Dec 2002 16:15:55 -0000
@@ -64,7 +64,7 @@ void 		gst_trace_set_default		(GstTrace 
 void 		_gst_trace_add_entry		(GstTrace *trace, guint32 seq, 
 						 guint32 data, gchar *msg);
 
-void 		gst_trace_read_tsc		(guint64 *dst);
+void 		gst_trace_read_tsc		(gint64 *dst);
 
 #define TRACE_ENABLE
 
Index: gst/elements/gstfilesrc.c
===================================================================
RCS file: /cvsroot/gstreamer/gstreamer/gst/elements/gstfilesrc.c,v
retrieving revision 1.47
diff -u -p -r1.47 gstfilesrc.c
--- gst/elements/gstfilesrc.c	27 Nov 2002 23:14:33 -0000	1.47
+++ gst/elements/gstfilesrc.c	6 Dec 2002 16:15:55 -0000
@@ -82,8 +82,17 @@ GstElementDetails gst_filesrc_details = 
 #define DEFAULT_BLOCKSIZE 	4*1024
 #define DEFAULT_MMAPSIZE 	4*1024*1024
 
+#ifdef G_HAVE_ISO_VARARGS
+
+/* #define fs_print(...) g_print(__VA_ARGS__)  */
+#define fs_print(...)
+
+#elif defined(G_HAVE_GNUC_VARARGS)
+
 /* #define fs_print(format,args...) g_print(format, ## args)  */
 #define fs_print(format,args...)
+
+#endif
 
 /* FileSrc signals and args */
 enum {
Index: libs/ext/cothreads/cothreads/cothreads-private.h
===================================================================
RCS file: /cvsroot/gstreamer/cothreads/cothreads/cothreads-private.h,v
retrieving revision 1.11
diff -u -p -r1.11 cothreads-private.h
--- libs/ext/cothreads/cothreads/cothreads-private.h	23 Jun 2002 04:31:45 -0000	1.11
+++ libs/ext/cothreads/cothreads/cothreads-private.h	6 Dec 2002 16:15:55 -0000
@@ -31,10 +31,26 @@
 #endif
 #define G_LOG_DOMAIN "Cothreads"
 
+#ifdef G_HAVE_ISO_VARARGS
+
+#ifdef COTHREADS_DEBUG_ENABLED
+#define COTHREADS_DEBUG(...) \
+  { \
+     fprintf(stderr, __VA_ARGS__); \
+     fprintf(stderr, "\n"); \
+  }
+#else
+#define COTHREADS_DEBUG(...)
+#endif
+
+#elif defined(G_HAVE_GNUC_VARARGS)
+
 #ifdef COTHREADS_DEBUG_ENABLED
 #define COTHREADS_DEBUG(text, args...) fprintf(stderr, text "\n", ##args)
 #else
 #define COTHREADS_DEBUG(text, args...)
+#endif
+
 #endif
 
 
Index: libs/ext/cothreads/cothreads/pth_p.h
===================================================================
RCS file: /cvsroot/gstreamer/cothreads/cothreads/pth_p.h,v
retrieving revision 1.1
diff -u -p -r1.1 pth_p.h
--- libs/ext/cothreads/cothreads/pth_p.h	9 Feb 2002 22:21:55 -0000	1.1
+++ libs/ext/cothreads/cothreads/pth_p.h	6 Dec 2002 16:15:55 -0000
@@ -52,12 +52,12 @@
 
 #else
 
-#define pth_debug1(a1)                     pth_debug(__FILE__, __LINE__, 1, a1)
-#define pth_debug2(a1, a2)                 pth_debug(__FILE__, __LINE__, 2, a1, a2)
-#define pth_debug3(a1, a2, a3)             pth_debug(__FILE__, __LINE__, 3, a1, a2, a3)
-#define pth_debug4(a1, a2, a3, a4)         pth_debug(__FILE__, __LINE__, 4, a1, a2, a3, a4)
-#define pth_debug5(a1, a2, a3, a4, a5)     pth_debug(__FILE__, __LINE__, 5, a1, a2, a3, a4, a5)
-#define pth_debug6(a1, a2, a3, a4, a5, a6) pth_debug(__FILE__, __LINE__, 6, a1, a2, a3, a4, a5, a6)
+#define pth_debug1(a1)                     pth_debug(__FILE__, 1, a1, __LINE__)
+#define pth_debug2(a1, a2)                 pth_debug(__FILE__, 2, a1, __LINE__, a2)
+#define pth_debug3(a1, a2, a3)             pth_debug(__FILE__, 3, a1, __LINE__, a2, a3)
+#define pth_debug4(a1, a2, a3, a4)         pth_debug(__FILE__, 4, a1, __LINE__, a2, a3, a4)
+#define pth_debug5(a1, a2, a3, a4, a5)     pth_debug(__FILE__, 5, a1, __LINE__, a2, a3, a4, a5)
+#define pth_debug6(a1, a2, a3, a4, a5, a6) pth_debug(__FILE__, 6, a1, __LINE__, a2, a3, a4, a5, a6)
 
 #endif /* PTH_DEBUG */
 
@@ -89,7 +89,15 @@
 #define pth_errno_storage __pth_errno_storage
 #define pth_errno_flag __pth_errno_flag
 
-#define pth_debug(file, line, num, str, args...) g_message ("%s:%d " str, file, line, ##args)
+#ifdef G_HAVE_ISO_VARARGS
+
+#define pth_debug(file, num, str, line, ...) g_message ("%s:%d " str, file, __VA_ARGS__)
+
+#elif defined(G_HAVE_GNUC_VARARGS)
+
+#define pth_debug(file, num, str, line, args...) g_message ("%s:%d " str, file, line, ##args)
+
+#endif
 
 /* prototypes for intern variables */
 extern int pth_errno_storage;
Index: libs/gst/bytestream/bytestream.c
===================================================================
RCS file: /cvsroot/gstreamer/gstreamer/libs/gst/bytestream/bytestream.c,v
retrieving revision 1.14
diff -u -p -r1.14 bytestream.c
--- libs/gst/bytestream/bytestream.c	8 Jul 2002 19:22:41 -0000	1.14
+++ libs/gst/bytestream/bytestream.c	6 Dec 2002 16:15:55 -0000
@@ -28,12 +28,26 @@
 
 /* #define BS_DEBUG */
 
+#ifdef G_HAVE_ISO_VARARGS
+
+#ifdef BS_DEBUG
+# define bs_print(...)	GST_DEBUG (GST_CAT_BUFFER, __VA_ARGS__)
+# define bs_status(bs)			gst_bytestream_print_status(bs)
+#else
+# define bs_print(...)
+# define bs_status(bs)
+#endif
+
+#elif defined(G_HAVE_GNUC_VARARGS)
+
 #ifdef BS_DEBUG
 # define bs_print(format,args...)	GST_DEBUG (GST_CAT_BUFFER,  format, ## args)
 # define bs_status(bs)			gst_bytestream_print_status(bs)
 #else
 # define bs_print(format,args...)
 # define bs_status(bs)
+#endif
+
 #endif
 
 guint8 *gst_bytestream_assemble (GstByteStream * bs, guint32 len);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/octet-stream
Size: 27873 bytes
Desc: make.out.gz
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20021206/cd1a9f9b/attachment.obj>


More information about the gstreamer-devel mailing list