add gst_version_string ()

Original commit message from CVS:
add gst_version_string ()
This commit is contained in:
Thomas Vander Stichele 2005-10-16 14:32:57 +00:00
parent 1233601cb4
commit 8543a54a49
6 changed files with 41 additions and 3 deletions

View file

@ -1,3 +1,12 @@
2005-10-16 Thomas Vander Stichele <thomas at apestaart dot org>
* 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 <thomas at apestaart dot org> 2005-10-16 Thomas Vander Stichele <thomas at apestaart dot org>
* configure.ac: * configure.ac:

View file

@ -23,6 +23,8 @@ gst_init
gst_init_check gst_init_check
gst_init_get_option_group gst_init_get_option_group
gst_deinit gst_deinit
gst_version
gst_version_string
<SUBSECTION Private> <SUBSECTION Private>
mutex mutex
start_cond start_cond
@ -2148,7 +2150,6 @@ gst_value_register_intersect_func
GST_VERSION_MAJOR GST_VERSION_MAJOR
GST_VERSION_MINOR GST_VERSION_MINOR
GST_VERSION_MICRO GST_VERSION_MICRO
gst_version
</SECTION> </SECTION>

View file

@ -870,3 +870,27 @@ gst_version (guint * major, guint * minor, guint * micro, guint * nano)
*micro = GST_VERSION_MICRO; *micro = GST_VERSION_MICRO;
*nano = GST_VERSION_NANO; *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, &micro, &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);
}

View file

@ -78,6 +78,10 @@ gboolean gst_init_check (int *argc, char **argv[],
GOptionGroup * gst_init_get_option_group (void); GOptionGroup * gst_init_get_option_group (void);
void gst_deinit (void); void gst_deinit (void);
void gst_version (guint *major, guint *minor,
guint *micro, guint *nano);
gchar * gst_version_string (void);
G_END_DECLS G_END_DECLS
#endif /* __GST_H__ */ #endif /* __GST_H__ */

View file

@ -66,8 +66,6 @@ G_BEGIN_DECLS
*/ */
#define GST_VERSION_NANO (@GST_VERSION_NANO@) #define GST_VERSION_NANO (@GST_VERSION_NANO@)
void gst_version (guint *major, guint *minor, guint *micro, guint *nano);
G_END_DECLS G_END_DECLS
#endif /* __GST_VERSION_H__ */ #endif /* __GST_VERSION_H__ */

View file

@ -338,3 +338,5 @@ EXPORTS
gst_message_parse_new_clock gst_message_parse_new_clock
gst_message_type_get_name gst_message_type_get_name
gst_flags_get_first_value gst_flags_get_first_value
gst_version
gst_version_string