Conversation
Signed-off-by: Dawid Kozinski <d.kozinski@samsung.com>
- Implement versioning functions with conditional compilation - Added oapv_version to generate version string using OAPV_VERSION_MAJOR, OAPV_VERSION_MINOR, and OAPV_VERSION_PATCH. - Added oapv_libversion function to return library version using OAPV_LIB_VERSION_MAJOR, OAPV_LIB_VERSION_MINOR, and OAPV_LIB_VERSION_PATCH. Signed-off-by: Dawid Kozinski <d.kozinski@samsung.com>
src/oapv.c
Outdated
| #else | ||
|
|
||
| static char *oapv_ver = "0.1.13.1"; | ||
| static char *oapv_libver = "0.1.13.1"; |
There was a problem hiding this comment.
Why major 0, and why making it match the project version?
There was a problem hiding this comment.
I guess that you're trying to change the major, minor, and patch meanings of version.
It should be discussed carefully because the version numbers are already used many O/S and applications.
We need to have strong reason and evidence to change the number dramatically, if we have to change it.
There was a problem hiding this comment.
It was decided in #91 (comment), and is already implemented. This PR at first reverted it by accident, but it was then rectified.
- Changed the version in library_version.txt to v1.0.0 - Updated the version definition in oapv.c. Signed-off-by: Dawid Kozinski <d.kozinski@samsung.com>
…c/oapv_version.h.in file Signed-off-by: Dawid Kozinski <d.kozinski@samsung.com>
pkgconfig/oapv.pc.in
Outdated
| Description: Advanced Professional Video Codec | ||
|
|
||
| Version: @PROJECT_VERSION_MAJOR@.@PROJECT_VERSION_MINOR@.@PROJECT_VERSION_PATCH@ | ||
| Version: @LIB_VERSION_MAJOR@.@LIB_VERSION_MINOR@.@LIB_VERSION_PATCH@ |
There was a problem hiding this comment.
No, this one is fine staying as project version. Pkg-config is usually about a package, and not necessarily a specific library within it.
There was a problem hiding this comment.
Not always. In the FFmpeg project, the version in the .pc files of individual libraries specifies the versions of the libraries, for example:
libavfilter.pc
...
Name: libavfilter
Description: FFmpeg audio/video filtering library
Version: 11.0.100
...
libavcodec.pc
...
Name: libavcodec
Description: FFmpeg codec library
Version: 62.3.101
...
libavcodec.so -> libavcodec.so.62.3.101
libavcodec.so.62 -> libavcodec.so.62.3.101
libavcodec.so.62.3.101
libavfilter.so -> libavfilter.so.11.0.100
libavfilter.so.11 -> libavfilter.so.11.0.100
libavfilter.so.11.0.100
inc/oapv_version.h.in
Outdated
| // Project version | ||
| #define OAPV_VERSION_MAJOR @VERSION_MAJOR@ | ||
| #define OAPV_VERSION_MINOR @VERSION_MINOR@ | ||
| #define OAPV_VERSION_PATCH @VERSION_PATCH@ |
There was a problem hiding this comment.
Wasn't it decided that the header would only have the library version defines?
There was a problem hiding this comment.
Wasn't it decided that the header would only have the library version defines?
At the moment, we still need this. The function oapv_version() returns the project version and requires the definitions OAPV_VERSION_MAJOR, OAPV_VERSION_MINOR, and OAPV_VERSION_PATCH.
Currently, we still need two versions of the function.
aopv_version() is used by the reference applications and returns the project version.
The other is oapv_libversion(), which returns the library version and could be used for integration with other projects like FFmpeg.
We will consider simplify it.
There was a problem hiding this comment.
Can't you add those defines in a different, also generated but not installed header?
Also, oapv_version() and oapv_libversion() should ideally return a const char*, or a strdup() output that the user needs to free otherwise.
Signed-off-by: Dawid Kozinski <d.kozinski@samsung.com>
src/oapv.c
Outdated
| static char *oapv_libver = "1.0.0"; | ||
|
|
||
| char * oapv_version() { return oapv_ver; } | ||
| char * oapv_libversion() { return oapv_libver; } |
There was a problem hiding this comment.
I think this would be better as
unsigned oapv_libversion(void) {
return (OAPV_LIB_VERSION_MAJOR << 16) |
(OAPV_LIB_VERSION_MINOR << 8) |
OAPV_LIB_VERSION_PATCH;
}
And then adding the following to oapv_version.h
#define OAPV_LIB_MAJOR(v) (((v) >> 16) & 0xFF)
#define OAPV_LIB_MINOR(v) (((v) >> 8) & 0xFF)
#define OAPV_LIB_PATCH(v) ( (v) & 0xFF)
This is a lot more library user friendly than a string for runtime version checks.
oapv_version() can remain a string just fine, but it should be const char*.
- Updated the oapv_version and oapv_libversion functions to return unsigned integers instead of strings Signed-off-by: Dawid Kozinski <d.kozinski@samsung.com>
inc/oapv_config.h
Outdated
| // #define OAPV_LIBVERSION_HEADER // defined if the file oapv_libversion.h exists | ||
| // #define OAPV_EXPORT_HEADER // defined if the file oapv_exports.h exists | ||
| #define OAPV_VERSION_HEADER // defined if the file oapv_libversion.h exists | ||
| #define OAPV_EXPORT_HEADER // defined if the file oapv_exports.h exists |
There was a problem hiding this comment.
What is the point of these defines? Why would those headers not exist if they are unconditionally installed?
Without this you'd be able to remove the ifdeffery in src/oapv.c and allow oapv_version() to safely return a const char*. And the reason a const char* is better for it than an int is because ideally you'd fetch the project version using git describe --tags first, and if not possible (Like in a tarball snapshot), then version.txt would be parsed.
inc/oapv.h
Outdated
| * openapv project version | ||
| *****************************************************************************/ | ||
| OAPV_EXPORT char *oapv_version(); | ||
| OAPV_EXPORT unsigned oapv_version(); |
There was a problem hiding this comment.
Suggest to use unsigned int instead of just unsigned here
inc/oapv.h
Outdated
| /***************************************************************************** | ||
| * openapv library version | ||
| *****************************************************************************/ | ||
| OAPV_EXPORT unsigned oapv_libversion(); |
There was a problem hiding this comment.
Suggest to use unsigned int instead of just unsigned here
src/oapv.c
Outdated
| unsigned oapv_version() { | ||
| return OAPV_GET_VERSION(0, 1, 13); | ||
| } | ||
|
|
||
| unsigned oapv_libversion() { | ||
| return OAPV_GET_VERSION(1, 0, 0); | ||
| } | ||
|
|
||
| #endif No newline at end of file |
There was a problem hiding this comment.
I don't think we need to have project version and library version separately.
It could lead confusing in communications.
I believe the project version and library version should be same.
Android platform and other 3rd-parties are already thinking like that. it is diffcult to change version numbering meaning at this moment.
There was a problem hiding this comment.
Android platform and other 3rd-parties are already thinking like that. it is diffcult to change version numbering meaning at this moment.
They are already linking to soversion 1. This PR is not changing that.
Project and library/API version need to be separate to properly signal new symbols and exported defines in public headers as they are introduced. Project version increases are arbitrary and don't signal actual changes to library users.
There was a problem hiding this comment.
@dkozinski @jamrial
Version numbering is the important. DO NOT try to decide it without maintainer's decision.
As I emphasized, it should be aligned to the market requirement.
And, I don't still fully understand any special reason why project and library version should be different in this project.
- Refactor versioning strategy based on feedback from maintainer Signed-off-by: Dawid Kozinski <d.kozinski@samsung.com>
Signed-off-by: Dawid Kozinski <d.kozinski@samsung.com>
Signed-off-by: Dawid Kozinski <d.kozinski@samsung.com>
- Changed CPACK_PACKAGE_VERSION to use VERSION_APISET, VERSION_MAJOR, VERSION_MINOR, and VERSION_PATCH for better version management. - Updated oapv.pc.in to reflect the new versioning format. Signed-off-by: Dawid Kozinski <d.kozinski@samsung.com>
Signed-off-by: Dawid Kozinski <d.kozinski@samsung.com>
…version code to application Signed-off-by: kp5.choi@samsung.com <kp5.choi@samsung.com>
Signed-off-by: kp5.choi@samsung.com <kp5.choi@samsung.com>
…ead of version.txt - Removed the function for retrieving version from git tags and version.txt. - Added checks to ensure the existence of oapv.h and extract version information using regex. - Updated project versioning to use values defined in oapv.h. Signed-off-by: Dawid Kozinski <d.kozinski@samsung.com>
src/oapv.c
Outdated
|
|
||
| static char *oapv_ver = "0.1.13.1"; | ||
| char * oapv_version() { return oapv_ver; } | ||
| char *oapv_version(void) |
There was a problem hiding this comment.
Can't this be made a const char* instead? With CMake it's trivial to generate the "0.1.13.1" string at configure time, but i assume the issue is with Android?
As is, this looks potentially racy. If it can't be const, then it should allocate a buffer and return it, and the user should then free it.
Also, an int version is still extremely useful for runtime checks, so please add it as a separate function, like unsigned int oapv_version_int()
There was a problem hiding this comment.
Is macro OAPV_VER_SET from inc/oapv.h is sufficient in this case?
There was a problem hiding this comment.
To generate the int to be returned? Yes
unsigned int oapv_version_int()
{
return OAPV_VER_SET(OAPV_VER_APISET, OAPV_VER_MAJOR, OAPV_VER_MINOR, OAPV_VER_PATCH);
}
Without a function like this, API users that want the version in integer form would need to parse the output of oapv_version()
There was a problem hiding this comment.
I recommend to use OAPV_VER_NUM constant defined in oapv.h, which is the integer type version number.
There was a problem hiding this comment.
That's for compile time checks. A function is needed for runtime checks.
I see it was added and then removed because of this comment. It would have been nice to wait a bit instead of being so hasty. Now it will need to be added as a separate PR.
There was a problem hiding this comment.
That's for compile time checks. A function is needed for runtime checks.
I see it was added and then removed because of this comment. It would have been nice to wait a bit instead of being so hasty. Now it will need to be added as a separate PR.
I hope that the PR #104 can be an answer of your considerations.
There was a problem hiding this comment.
The function may return not just the version number but also an error code, which is a negative value, despite the return type being unsigned, and as such can't be checked at all. For all the API user knows, it just returned a valid version number they can parse with OAPV_VER_GET_*.
There was a problem hiding this comment.
The function may return not just the version number but also an error code, which is a negative value, despite the return type being unsigned, and as such can't be checked at all. For all the API user knows, it just returned a valid version number they can parse with OAPV_VER_GET_*.
Again, oapv_version() has changed to support your comments.
Check the PR #105 .
- Removed the inclusion of oapv_version.h in oapv.h. - Changed the return type of oapv_version function from char* to const char*. - Deleted the oapv_version.h.in file as it is no longer needed. - Updated CMakeLists.txt to remove references to the version header file. Signed-off-by: Dawid Kozinski <d.kozinski@samsung.com>
|
It has been long discussion here. |
…ed int Signed-off-by: Dawid Kozinski <d.kozinski@samsung.com>
…gned int -The function was redundant because there is a macro OAPV_VER_SET that does this Signed-off-by: Dawid Kozinski <d.kozinski@samsung.com>
* Added reading library version from file in CMakeLists.txt Signed-off-by: Dawid Kozinski <d.kozinski@samsung.com> * Refactor version functions - Implement versioning functions with conditional compilation - Added oapv_version to generate version string using OAPV_VERSION_MAJOR, OAPV_VERSION_MINOR, and OAPV_VERSION_PATCH. - Added oapv_libversion function to return library version using OAPV_LIB_VERSION_MAJOR, OAPV_LIB_VERSION_MINOR, and OAPV_LIB_VERSION_PATCH. Signed-off-by: Dawid Kozinski <d.kozinski@samsung.com> * Updated library version to 1.0.0 - Changed the version in library_version.txt to v1.0.0 - Updated the version definition in oapv.c. Signed-off-by: Dawid Kozinski <d.kozinski@samsung.com> * Update CPack version settings to use LIB_VERSION and added missing inc/oapv_version.h.in file Signed-off-by: Dawid Kozinski <d.kozinski@samsung.com> * Exposed oapv_libversion() finction Signed-off-by: Dawid Kozinski <d.kozinski@samsung.com> * Refactor version handling to use unsigned integers - Updated the oapv_version and oapv_libversion functions to return unsigned integers instead of strings Signed-off-by: Dawid Kozinski <d.kozinski@samsung.com> * Update versioning for project and library - Refactor versioning strategy based on feedback from maintainer Signed-off-by: Dawid Kozinski <d.kozinski@samsung.com> * Removed obsolete library version checks from CMakeLists.txt Signed-off-by: Dawid Kozinski <d.kozinski@samsung.com> * Added comment to oapv_version function for Android versioning Signed-off-by: Dawid Kozinski <d.kozinski@samsung.com> * Update versioning scheme in CMakeLists.txt and pkgconfig file - Changed CPACK_PACKAGE_VERSION to use VERSION_APISET, VERSION_MAJOR, VERSION_MINOR, and VERSION_PATCH for better version management. - Updated oapv.pc.in to reflect the new versioning format. Signed-off-by: Dawid Kozinski <d.kozinski@samsung.com> * Refactor versioning messages and declarations Signed-off-by: Dawid Kozinski <d.kozinski@samsung.com> * refactoring code to avoid a symbol conflict. moved version string conversion code to application Signed-off-by: kp5.choi@samsung.com <kp5.choi@samsung.com> * the candidate of consensus Signed-off-by: kp5.choi@samsung.com <kp5.choi@samsung.com> * refactor CMakeLists.txt: Extract version information from oapv.h instead of version.txt - Removed the function for retrieving version from git tags and version.txt. - Added checks to ensure the existence of oapv.h and extract version information using regex. - Updated project versioning to use values defined in oapv.h. Signed-off-by: Dawid Kozinski <d.kozinski@samsung.com> * Further refactoring related to version handling - Removed the inclusion of oapv_version.h in oapv.h. - Changed the return type of oapv_version function from char* to const char*. - Deleted the oapv_version.h.in file as it is no longer needed. - Updated CMakeLists.txt to remove references to the version header file. Signed-off-by: Dawid Kozinski <d.kozinski@samsung.com> * Added oapv_version_int function that returns the version as an unsigned int Signed-off-by: Dawid Kozinski <d.kozinski@samsung.com> * Removed oapv_version_int function that returns the version as an unsigned int -The function was redundant because there is a macro OAPV_VER_SET that does this Signed-off-by: Dawid Kozinski <d.kozinski@samsung.com> --------- Signed-off-by: Dawid Kozinski <d.kozinski@samsung.com> Signed-off-by: kp5.choi@samsung.com <kp5.choi@samsung.com> Co-authored-by: kp5.choi@samsung.com <kp5.choi@samsung.com>
No description provided.