tizen 2.0 init
[framework/multimedia/gst-plugins-base0.10.git] / gst-libs / gst / pbutils / gstpluginsbaseversion.c
1 /* GStreamer base plugins libraries version information
2  * Copyright (C) 2010 Tim-Philipp Müller <tim centricular net>
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Library General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Library General Public License for more details.
13  *
14  * You should have received a copy of the GNU Library General Public
15  * License along with this library; if not, write to the
16  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17  * Boston, MA 02111-1307, USA.
18  */
19
20 /**
21  * SECTION:gstpluginsbaseversion
22  * @short_description: GStreamer gst-plugins-base libraries version macros.
23  *
24  * Use the GST_PLUGINS_BASE_VERSION_* macros e.g. to check what version of
25  * gst-plugins-base you are building against, and gst_plugins_base_version()
26  * if you need to check at runtime what version of the gst-plugins-base
27  * libraries are being used / you are currently linked against.
28  *
29  * The version macros get defined by including &lt;gst/pbutils/pbutils.h&gt;.
30  */
31
32 #include "gstpluginsbaseversion.h"
33
34 /**
35  * gst_plugins_base_version:
36  * @major: (out): pointer to a guint to store the major version number, or %NULL
37  * @minor: (out): pointer to a guint to store the minor version number, or %NULL
38  * @micro: (out): pointer to a guint to store the micro version number, or %NULL
39  * @nano:  (out): pointer to a guint to store the nano version number, or %NULL
40  *
41  * Gets the version number of the GStreamer Plugins Base libraries.
42  *
43  * Since: 0.10.31
44  */
45 void
46 gst_plugins_base_version (guint * major, guint * minor, guint * micro,
47     guint * nano)
48 {
49   if (major)
50     *major = GST_PLUGINS_BASE_VERSION_MAJOR;
51   if (minor)
52     *minor = GST_PLUGINS_BASE_VERSION_MINOR;
53   if (micro)
54     *micro = GST_PLUGINS_BASE_VERSION_MICRO;
55   if (nano)
56     *nano = GST_PLUGINS_BASE_VERSION_NANO;
57 }
58
59 /**
60  * gst_plugins_base_version_string:
61  *
62  * This function returns a string that is useful for describing this version
63  * of GStreamer's gst-plugins-base libraries to the outside world: user agent
64  * strings, logging, about dialogs ...
65  *
66  * Returns: a newly allocated string describing this version of gst-plugins-base
67  *
68  * Since: 0.10.31
69  */
70 gchar *
71 gst_plugins_base_version_string (void)
72 {
73   return g_strdup_printf ("GStreamer Base Plugins %d.%d.%d%s",
74       GST_PLUGINS_BASE_VERSION_MAJOR, GST_PLUGINS_BASE_VERSION_MINOR,
75       GST_PLUGINS_BASE_VERSION_MICRO,
76       ((GST_PLUGINS_BASE_VERSION_NANO == 0) ? "" :
77           ((GST_PLUGINS_BASE_VERSION_NANO == 1) ? " (GIT)" : " (prerelease)")));
78 }