diff --git a/ChangeLog b/ChangeLog index f68077bdee..b68d5b390f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2005-10-16 Thomas Vander Stichele + + * docs/gst/gstreamer-sections.txt: + * gst/gst.c: (gst_version_string): + * gst/gst.h: + * gst/gstversion.h.in: + * win32/common/libgstreamer.def: + add gst_version_string () + 2005-10-16 Thomas Vander Stichele * configure.ac: diff --git a/docs/gst/gstreamer-sections.txt b/docs/gst/gstreamer-sections.txt index fc82ef93d2..b2478b7830 100644 --- a/docs/gst/gstreamer-sections.txt +++ b/docs/gst/gstreamer-sections.txt @@ -23,6 +23,8 @@ gst_init gst_init_check gst_init_get_option_group gst_deinit +gst_version +gst_version_string mutex start_cond @@ -2148,7 +2150,6 @@ gst_value_register_intersect_func GST_VERSION_MAJOR GST_VERSION_MINOR GST_VERSION_MICRO -gst_version diff --git a/gst/gst.c b/gst/gst.c index d6b6aa0913..740b788491 100644 --- a/gst/gst.c +++ b/gst/gst.c @@ -870,3 +870,27 @@ gst_version (guint * major, guint * minor, guint * micro, guint * nano) *micro = GST_VERSION_MICRO; *nano = GST_VERSION_NANO; } + +/** + * gst_version_string: + * + * This function returns a string that is useful for describing this version + * of GStreamer to the outside world: user agent strings, logging, ... + * + * Returns: a newly allocated string describing this version of GStreamer. + */ + +gchar * +gst_version_string () +{ + guint major, minor, micro, nano; + + gst_version (&major, &minor, µ, &nano); + if (nano == 0) + return g_strdup_printf ("GStreamer %d.%d.%d", major, minor, micro); + else if (nano == 1) + return g_strdup_printf ("GStreamer %d.%d.%d (CVS)", major, minor, micro); + else + return g_strdup_printf ("GStreamer %d.%d.%d (prerelease)", major, minor, + micro); +} diff --git a/gst/gst.h b/gst/gst.h index 5173b43a57..6f59a482f8 100644 --- a/gst/gst.h +++ b/gst/gst.h @@ -78,6 +78,10 @@ gboolean gst_init_check (int *argc, char **argv[], GOptionGroup * gst_init_get_option_group (void); void gst_deinit (void); +void gst_version (guint *major, guint *minor, + guint *micro, guint *nano); +gchar * gst_version_string (void); + G_END_DECLS #endif /* __GST_H__ */ diff --git a/gst/gstversion.h.in b/gst/gstversion.h.in index a7cd4fd266..c519659826 100644 --- a/gst/gstversion.h.in +++ b/gst/gstversion.h.in @@ -66,8 +66,6 @@ G_BEGIN_DECLS */ #define GST_VERSION_NANO (@GST_VERSION_NANO@) -void gst_version (guint *major, guint *minor, guint *micro, guint *nano); - G_END_DECLS #endif /* __GST_VERSION_H__ */ diff --git a/win32/common/libgstreamer.def b/win32/common/libgstreamer.def index f6d28c1304..35496c1d32 100644 --- a/win32/common/libgstreamer.def +++ b/win32/common/libgstreamer.def @@ -338,3 +338,5 @@ EXPORTS gst_message_parse_new_clock gst_message_type_get_name gst_flags_get_first_value + gst_version + gst_version_string