Commit 754487c0 authored by Janne Grunau's avatar Janne Grunau Committed by Jean-Baptiste Kempf

let dav1d_version() return the project version

Increments the soname revision number for this behavior change.
Removes the DAV1D_VERSION and DAV1D_VERSION_INT defines and
dav1d_version_vcs() and dav1d_version_int().
Also cleans up the version usage in dav1d CLI.
Refs #241, #255.
parent d67e3476
...@@ -73,16 +73,6 @@ typedef struct Dav1dSettings { ...@@ -73,16 +73,6 @@ typedef struct Dav1dSettings {
*/ */
DAV1D_API const char *dav1d_version(void); DAV1D_API const char *dav1d_version(void);
/**
* Get library version based on version control system.
*/
DAV1D_API const char *dav1d_version_vcs(void);
/**
* Get library version as unsigned int.
*/
DAV1D_API unsigned int dav1d_version_int(void);
/** /**
* Initialize settings to default values. * Initialize settings to default values.
* *
......
...@@ -31,8 +31,4 @@ ...@@ -31,8 +31,4 @@
#define DAV1D_VERSION_MINOR @DAV1D_VERSION_MINOR@ #define DAV1D_VERSION_MINOR @DAV1D_VERSION_MINOR@
#define DAV1D_VERSION_PATCH @DAV1D_VERSION_PATCH@ #define DAV1D_VERSION_PATCH @DAV1D_VERSION_PATCH@
#define DAV1D_VERSION "@DAV1D_VERSION_MAJOR@.@DAV1D_VERSION_MINOR@.@DAV1D_VERSION_PATCH@"
#define DAV1D_VERSION_INT (@DAV1D_VERSION_MAJOR@ << 16 | @DAV1D_VERSION_MINOR@ << 8 | @DAV1D_VERSION_PATCH@)
#endif /* DAV1D_VERSION_H */ #endif /* DAV1D_VERSION_H */
/* auto-generated, do not edit */ /* auto-generated, do not edit */
#define DAV1D_VERSION_VCS "@VCS_TAG@" #define DAV1D_VERSION "@VCS_TAG@"
...@@ -30,7 +30,7 @@ project('dav1d', ['c'], ...@@ -30,7 +30,7 @@ project('dav1d', ['c'],
'b_ndebug=if-release'], 'b_ndebug=if-release'],
meson_version: '>= 0.47.0') meson_version: '>= 0.47.0')
dav1d_soname_version = '1.0.0' dav1d_soname_version = '1.0.1'
dav1d_version_array = dav1d_soname_version.split('.') dav1d_version_array = dav1d_soname_version.split('.')
dav1d_version_major = dav1d_version_array[0] dav1d_version_major = dav1d_version_array[0]
dav1d_version_minor = dav1d_version_array[1] dav1d_version_minor = dav1d_version_array[1]
......
...@@ -56,14 +56,6 @@ const char *dav1d_version(void) { ...@@ -56,14 +56,6 @@ const char *dav1d_version(void) {
return DAV1D_VERSION; return DAV1D_VERSION;
} }
const char *dav1d_version_vcs(void) {
return DAV1D_VERSION_VCS;
}
unsigned int dav1d_version_int(void) {
return DAV1D_VERSION_INT;
}
void dav1d_default_settings(Dav1dSettings *const s) { void dav1d_default_settings(Dav1dSettings *const s) {
s->n_frame_threads = 1; s->n_frame_threads = 1;
s->n_tile_threads = 1; s->n_tile_threads = 1;
......
...@@ -73,11 +73,11 @@ int main(const int argc, char *const *const argv) { ...@@ -73,11 +73,11 @@ int main(const int argc, char *const *const argv) {
Dav1dContext *c; Dav1dContext *c;
Dav1dData data; Dav1dData data;
unsigned n_out = 0, total, fps[2]; unsigned n_out = 0, total, fps[2];
const char *version = dav1d_version_vcs(); const char *version = dav1d_version();
if (strcmp(version, DAV1D_VERSION_VCS)) { if (strcmp(version, DAV1D_VERSION)) {
fprintf(stderr, "Version mismatch (library: %s, executable: %s)\n", fprintf(stderr, "Version mismatch (library: %s, executable: %s)\n",
version, DAV1D_VERSION_VCS); version, DAV1D_VERSION);
return -1; return -1;
} }
...@@ -100,7 +100,7 @@ int main(const int argc, char *const *const argv) { ...@@ -100,7 +100,7 @@ int main(const int argc, char *const *const argv) {
} }
if (!cli_settings.quiet) if (!cli_settings.quiet)
fprintf(stderr, "dav1d %s - by VideoLAN\n", dav1d_version_vcs()); fprintf(stderr, "dav1d %s - by VideoLAN\n", dav1d_version());
// skip frames until a sequence header is found // skip frames until a sequence header is found
if (cli_settings.skip) { if (cli_settings.skip) {
......
...@@ -263,7 +263,7 @@ void parse(const int argc, char *const *const argv, ...@@ -263,7 +263,7 @@ void parse(const int argc, char *const *const argv,
!!parse_unsigned(optarg, ARG_ALL_LAYERS, argv[0]); !!parse_unsigned(optarg, ARG_ALL_LAYERS, argv[0]);
break; break;
case 'v': case 'v':
fprintf(stderr, "%s\n", dav1d_version_vcs()); fprintf(stderr, "%s\n", dav1d_version());
exit(0); exit(0);
case ARG_CPU_MASK: case ARG_CPU_MASK:
dav1d_set_cpu_flags_mask(parse_enum(optarg, cpu_mask_tbl, dav1d_set_cpu_flags_mask(parse_enum(optarg, cpu_mask_tbl,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment