Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pbutils: add compile time and runtime version checks for gst-plugins-…
…base So people can check what version of the gst-plugins-base libs they're building against or linked against. API: GST_PLUGINS_BASE_VERSION_MAJOR API: GST_PLUGINS_BASE_VERSION_MINOR API: GST_PLUGINS_BASE_VERSION_MICRO API: GST_PLUGINS_BASE_VERSION_NANO API: GST_CHECK_PLUGINS_BASE_VERSION API: gst_plugins_base_version() API: gst_plugins_base_version_string()
- Loading branch information
Tim-Philipp Müller
committed
Jul 26, 2010
1 parent
93f9727
commit 5a0c251
Showing
9 changed files
with
210 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
/* GStreamer base plugins libraries version information | ||
* Copyright (C) 2010 Tim-Philipp Müller <tim centricular net> | ||
* | ||
* This library is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU Library General Public | ||
* License as published by the Free Software Foundation; either | ||
* version 2 of the License, or (at your option) any later version. | ||
* | ||
* This library is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* Library General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Library General Public | ||
* License along with this library; if not, write to the | ||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330, | ||
* Boston, MA 02111-1307, USA. | ||
*/ | ||
|
||
/** | ||
* SECTION:gstpluginsbaseversion | ||
* @short_description: GStreamer gst-plugins-base libraries version macros. | ||
* | ||
* Use the GST_PLUGINS_BASE_VERSION_* macros e.g. to check what version of | ||
* gst-plugins-base you are building against, and gst_plugins_base_version() | ||
* if you need to check at runtime what version of the gst-plugins-base | ||
* libraries are being used / you are currently linked against. | ||
* | ||
* The version macros get defined by including <gst/pbutils/pbutils.h>. | ||
*/ | ||
|
||
#include "gstpluginsbaseversion.h" | ||
|
||
/** | ||
* gst_plugins_base_version: | ||
* @major: (out): pointer to a guint to store the major version number, or %NULL | ||
* @minor: (out): pointer to a guint to store the minor version number, or %NULL | ||
* @micro: (out): pointer to a guint to store the micro version number, or %NULL | ||
* @nano: (out): pointer to a guint to store the nano version number, or %NULL | ||
* | ||
* Gets the version number of the GStreamer Plugins Base libraries. | ||
* | ||
* Since: 0.10.31 | ||
*/ | ||
void | ||
gst_plugins_base_version (guint * major, guint * minor, guint * micro, | ||
guint * nano) | ||
{ | ||
if (major) | ||
*major = GST_PLUGINS_BASE_VERSION_MAJOR; | ||
if (minor) | ||
*minor = GST_PLUGINS_BASE_VERSION_MINOR; | ||
if (micro) | ||
*micro = GST_PLUGINS_BASE_VERSION_MICRO; | ||
if (nano) | ||
*nano = GST_PLUGINS_BASE_VERSION_NANO; | ||
} | ||
|
||
/** | ||
* gst_plugins_base_version_string: | ||
* | ||
* This function returns a string that is useful for describing this version | ||
* of GStreamer's gst-plugins-base libraries to the outside world: user agent | ||
* strings, logging, about dialogs ... | ||
* | ||
* Returns: a newly allocated string describing this version of gst-plugins-base | ||
* | ||
* Since: 0.10.31 | ||
*/ | ||
gchar * | ||
gst_plugins_base_version_string (void) | ||
{ | ||
return g_strdup_printf ("GStreamer Base Plugins %d.%d.%d%s", | ||
GST_PLUGINS_BASE_VERSION_MAJOR, GST_PLUGINS_BASE_VERSION_MINOR, | ||
GST_PLUGINS_BASE_VERSION_MICRO, | ||
((GST_PLUGINS_BASE_VERSION_NANO == 0) ? "" : | ||
((GST_PLUGINS_BASE_VERSION_NANO == 1) ? " (GIT)" : " (prerelease)"))); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
/* GStreamer base plugins libraries version information | ||
* Copyright (C) 2010 Tim-Philipp Müller <tim centricular net> | ||
* | ||
* This library is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU Library General Public | ||
* License as published by the Free Software Foundation; either | ||
* version 2 of the License, or (at your option) any later version. | ||
* | ||
* This library is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* Library General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Library General Public | ||
* License along with this library; if not, write to the | ||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330, | ||
* Boston, MA 02111-1307, USA. | ||
*/ | ||
|
||
#ifndef __GST_PLUGINS_BASE_VERSION_H__ | ||
#define __GST_PLUGINS_BASE_VERSION_H__ | ||
|
||
#include <glib.h> | ||
|
||
G_BEGIN_DECLS | ||
|
||
/** | ||
* GST_PLUGINS_BASE_VERSION_MAJOR: | ||
* | ||
* The major version of GStreamer's gst-plugins-base libraries at compile time. | ||
* | ||
* Since: 0.10.31 | ||
*/ | ||
#define GST_PLUGINS_BASE_VERSION_MAJOR (@PACKAGE_VERSION_MAJOR@) | ||
/** | ||
* GST_PLUGINS_BASE_VERSION_MINOR: | ||
* | ||
* The minor version of GStreamer's gst-plugins-base libraries at compile time. | ||
* | ||
* Since: 0.10.31 | ||
*/ | ||
#define GST_PLUGINS_BASE_VERSION_MINOR (@PACKAGE_VERSION_MINOR@) | ||
/** | ||
* GST_PLUGINS_BASE_VERSION_MICRO: | ||
* | ||
* The micro version of GStreamer's gst-plugins-base libraries at compile time. | ||
* | ||
* Since: 0.10.31 | ||
*/ | ||
#define GST_PLUGINS_BASE_VERSION_MICRO (@PACKAGE_VERSION_MICRO@) | ||
/** | ||
* GST_PLUGINS_BASE_VERSION_NANO: | ||
* | ||
* The nano version of GStreamer's gst-plugins-base libraries at compile time. | ||
* Actual releases have 0, GIT versions have 1, prerelease versions have 2-... | ||
* | ||
* Since: 0.10.31 | ||
*/ | ||
#define GST_PLUGINS_BASE_VERSION_NANO (@PACKAGE_VERSION_NANO@) | ||
|
||
/** | ||
* GST_CHECK_PLUGIN_BASE_VERSION: | ||
* @major: a number indicating the major version | ||
* @minor: a number indicating the minor version | ||
* @micro: a number indicating the micro version | ||
* | ||
* Check whether a GStreamer's gst-plugins-base libraries' version equal to | ||
* or greater than major.minor.micro is present. | ||
* | ||
* Since: 0.10.31 | ||
*/ | ||
#define GST_CHECK_PLUGINS_BASE_VERSION(major,minor,micro) \ | ||
(GST_PLUGINS_BASE_VERSION_MAJOR > (major) || \ | ||
(GST_PLUGINS_BASE_VERSION_MAJOR == (major) && GST_PLUGINS_BASE_VERSION_MINOR > (minor)) || \ | ||
(GST_PLUGINS_BASE_VERSION_MAJOR == (major) && GST_PLUGINS_BASE_VERSION_MINOR == (minor) && \ | ||
GST_PLUGINS_BASE_VERSION_MICRO >= (micro))) | ||
|
||
void gst_plugins_base_version (guint *major, guint *minor, guint *micro, guint *nano); | ||
|
||
gchar * gst_plugins_base_version_string (void); | ||
|
||
G_END_DECLS | ||
|
||
#endif /* __GST_PLUGINS_BASE_VERSION_H__ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters