gst.h: Don't spew warnings if GST_USE_UNSTABLE_API is not defined
authorTim-Philipp Müller <tim@centricular.com>
Sat, 16 Jan 2016 14:51:37 +0000 (14:51 +0000)
committerTim-Philipp Müller <tim@centricular.com>
Sat, 16 Jan 2016 16:00:16 +0000 (16:00 +0000)
Only hide GstTracer and GstTracerRecord API behind GST_USE_UNSTABLE_API,
but don't spew any warnings, otherwise everyone has to define this
to avoid compiler warnings.

This reverts parts of commit 89ee5d948dff560204e6edd210c44ed2b8654b8e.

configure.ac
docs/gst/Makefile.am
gst/gst.h
gst/gsttracer.c
gst/gsttracer.h
gst/gsttracerrecord.c
gst/gsttracerrecord.h
gst/gsttracerutils.c
plugins/tracers/Makefile.am
tests/check/Makefile.am

index 0f1eae9..83d1c21 100644 (file)
@@ -922,8 +922,8 @@ dnl - src and build dirs need to be added because every piece that gets built
 dnl   will need the GStreamer source and generated headers
 dnl LIBS: XML doesn't need to be added because we don't explicitly use symbols
 dnl       from LibXML except for in the core library
-GST_ALL_CXXFLAGS="-I\$(top_srcdir)/libs -I\$(top_srcdir) -I\$(top_builddir)/libs -I\$(top_builddir) $GLIB_CFLAGS \$(GLIB_EXTRA_CFLAGS) $XML_CFLAGS \$(GST_OPTION_CXXFLAGS) \$(ERROR_CXXFLAGS) -DGST_USE_UNSTABLE_API"
-GST_ALL_CFLAGS="-I\$(top_srcdir)/libs -I\$(top_srcdir) -I\$(top_builddir)/libs -I\$(top_builddir) $GLIB_CFLAGS \$(GLIB_EXTRA_CFLAGS) $XML_CFLAGS \$(GST_OPTION_CFLAGS) \$(ERROR_CFLAGS) -DGST_USE_UNSTABLE_API"
+GST_ALL_CXXFLAGS="-I\$(top_srcdir)/libs -I\$(top_srcdir) -I\$(top_builddir)/libs -I\$(top_builddir) $GLIB_CFLAGS \$(GLIB_EXTRA_CFLAGS) $XML_CFLAGS \$(GST_OPTION_CXXFLAGS) \$(ERROR_CXXFLAGS)"
+GST_ALL_CFLAGS="-I\$(top_srcdir)/libs -I\$(top_srcdir) -I\$(top_builddir)/libs -I\$(top_builddir) $GLIB_CFLAGS \$(GLIB_EXTRA_CFLAGS) $XML_CFLAGS \$(GST_OPTION_CFLAGS) \$(ERROR_CFLAGS)"
 
 dnl FIXME: check if LTLIBINTL is needed everywhere
 dnl I presume it is given that it contains the symbols that _() stuff maps to
index 9e4f400..b97fa1e 100644 (file)
@@ -75,7 +75,7 @@ extra_files = gst-universe.dot
 
 # CFLAGS and LDFLAGS for compiling scan program. Only needed if your app/lib
 # contains GtkObjects/GObjects and you want to document signals and properties.
-GTKDOC_CFLAGS = $(GST_OBJ_CFLAGS)
+GTKDOC_CFLAGS = $(GST_OBJ_CFLAGS) -DGST_USE_UNSTABLE_API
 GTKDOC_LIBS = $(GST_OBJ_LIBS) \
        $(top_builddir)/gst/libgstreamer-@GST_API_VERSION@.la \
        $(top_builddir)/libs/gst/base/libgstbase-@GST_API_VERSION@.la \
index 4dcea22..5a5cde6 100644 (file)
--- a/gst/gst.h
+++ b/gst/gst.h
@@ -77,6 +77,7 @@
 #include <gst/gsttaskpool.h>
 #include <gst/gsttoc.h>
 #include <gst/gsttocsetter.h>
+#include <gst/gsttracer.h>
 #include <gst/gsttracerfactory.h>
 #include <gst/gsttracerrecord.h>
 #include <gst/gsttypefind.h>
index 567c37a..e5645dc 100644 (file)
@@ -31,6 +31,8 @@
  * Since: 1.8
  */
 
+#define GST_USE_UNSTABLE_API
+
 #include "gst_private.h"
 #include "gstenumtypes.h"
 #include "gsttracer.h"
index cdf1461..0692c34 100644 (file)
 #ifndef __GST_TRACER_H__
 #define __GST_TRACER_H__
 
-#ifndef GST_USE_UNSTABLE_API
-#warning "The tracer subsystem is unstable API and may change in future."
-#warning "You can define GST_USE_UNSTABLE_API to avoid this warning."
-#endif
-
 #include <glib.h>
 #include <glib-object.h>
 #include <gst/gstconfig.h>
@@ -62,12 +57,16 @@ struct _GstTracerClass {
 
 GType gst_tracer_get_type          (void);
 
+#ifdef GST_USE_UNSTABLE_API
+
 void gst_tracing_register_hook (GstTracer *tracer, const gchar *detail,
   GCallback func);
 
 /* tracing modules */
 gboolean gst_tracer_register (GstPlugin * plugin, const gchar * name, GType type);
 
+#endif
+
 #ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
 G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstTracer, gst_object_unref)
 #endif
index 284b91a..060aead 100644 (file)
@@ -29,6 +29,8 @@
  * Since: 1.8
  */
 
+#define GST_USE_UNSTABLE_API
+
 #include "gst_private.h"
 #include "gstinfo.h"
 #include "gststructure.h"
index fa56145..2ce3382 100644 (file)
 #ifndef __GST_TRACER_RECORD_H__
 #define __GST_TRACER_RECORD_H__
 
-#ifndef GST_USE_UNSTABLE_API
-#warning "The tracer subsystem is unstable API and may change in future."
-#warning "You can define GST_USE_UNSTABLE_API to avoid this warning."
-#endif
-
 #include <gst/gstobject.h>
 
 G_BEGIN_DECLS
@@ -45,9 +40,6 @@ typedef struct _GstTracerRecordClass GstTracerRecordClass;
 
 GType gst_tracer_record_get_type          (void);
 
-GstTracerRecord * gst_tracer_record_new (GstStructure *spec);
-void gst_tracer_record_log (GstTracerRecord *self, ...);
-
 #ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
 G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstTracerRecord, gst_object_unref)
 #endif
@@ -64,6 +56,8 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstTracerRecord, gst_object_unref)
  * taken. This enumerating declares to which scope such a meta data field
  * relates to. If it is e.g. %GST_TRACER_VALUE_SCOPE_PAD, then each of the log
  * events may contain values for different #GstPads.
+ *
+ * Since: 1.8
  */
 typedef enum
 {
@@ -73,6 +67,14 @@ typedef enum
   GST_TRACER_VALUE_SCOPE_PAD
 } GstTracerValueScope;
 
+#ifdef GST_USE_UNSTABLE_API
+
+GstTracerRecord * gst_tracer_record_new (GstStructure *spec);
+
+void              gst_tracer_record_log (GstTracerRecord *self, ...);
+
+#endif
+
 G_END_DECLS
 
 #endif /* __GST_TRACER_RECORD_H__ */
index d30c71a..1b70d39 100644 (file)
@@ -30,6 +30,8 @@
  * to a ';' separated list of tracers.
  */
 
+#define GST_USE_UNSTABLE_API
+
 #include "gst_private.h"
 #include "gsttracer.h"
 #include "gsttracerfactory.h"
index 8f67e87..f6efee6 100644 (file)
@@ -23,7 +23,8 @@ libgstcoretracers_la_SOURCES = \
   gststats.c \
        gsttracers.c
 
-libgstcoretracers_la_CFLAGS = $(GST_OBJ_CFLAGS)
+libgstcoretracers_la_CFLAGS = $(GST_OBJ_CFLAGS) \
+  -DGST_USE_UNSTABLE_API
 libgstcoretracers_la_LIBADD = \
        $(GST_PRINTF_LA) \
        $(GST_OBJ_LIBS)
index d58e98c..560b5b1 100644 (file)
@@ -207,7 +207,7 @@ gst_gstcpp_SOURCES = gst/gstcpp.cc
 
 libs_gstlibscpp_SOURCES = libs/gstlibscpp.cc
 
-gst_gsttracerrecord_CFLAGS = $(GST_OBJ_CFLAGS) $(AM_CFLAGS)
+gst_gsttracerrecord_CFLAGS = $(GST_OBJ_CFLAGS) $(AM_CFLAGS) -DGST_USE_UNSTABLE_API
 
 gst_gstutils_LDADD = $(LDADD) $(GSL_LIBS) $(GMP_LIBS)