Is av_log_level supposed to be exported?
Hi, av_log_level from libavutil/log.c is only used in that file. It is not declared in libavutil/log.h. It's meant to be used with the av_log_get_level() and av_log_set_level() functions. Should it be made static in log.c, or declared in libavutil/log.h so users can access it directly? Ramiro Polla
On Wed, Dec 02, 2009 at 10:42:36PM -0200, Ramiro Polla wrote:
Hi,
av_log_level from libavutil/log.c is only used in that file. It is not declared in libavutil/log.h. It's meant to be used with the av_log_get_level() and av_log_set_level() functions.
Should it be made static in log.c, or declared in libavutil/log.h so users can access it directly?
should be made static in the next maj ver bump [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB The real ebay dictionary, page 1 "Used only once" - "Some unspecified defect prevented a second use" "In good condition" - "Can be repaird by experienced expert" "As is" - "You wouldnt want it even if you were payed for it, if you knew ..."
On Thu, Dec 3, 2009 at 1:47 AM, Michael Niedermayer <michaelni at gmx.at> wrote:
On Wed, Dec 02, 2009 at 10:42:36PM -0200, Ramiro Polla wrote:
av_log_level from libavutil/log.c is only used in that file. It is not declared in libavutil/log.h. It's meant to be used with the av_log_get_level() and av_log_set_level() functions.
Should it be made static in log.c, or declared in libavutil/log.h so users can access it directly?
should be made static in the next maj ver bump
2 attempts attached, which one do you prefer?
On Thu, Dec 03, 2009 at 02:04:31AM -0200, Ramiro Polla wrote:
On Thu, Dec 3, 2009 at 1:47 AM, Michael Niedermayer <michaelni at gmx.at> wrote:
On Wed, Dec 02, 2009 at 10:42:36PM -0200, Ramiro Polla wrote:
av_log_level from libavutil/log.c is only used in that file. It is not declared in libavutil/log.h. It's meant to be used with the av_log_get_level() and av_log_set_level() functions.
Should it be made static in log.c, or declared in libavutil/log.h so users can access it directly?
should be made static in the next maj ver bump
2 attempts attached, which one do you prefer?
log.c | 3 +++ 1 file changed, 3 insertions(+) 0bda2f059aa904775edc4bb2c6d44d8dec0ba089 av_log_level_try1.diff Index: libavutil/log.c =================================================================== --- libavutil/log.c (revision 20713) +++ libavutil/log.c (working copy) @@ -27,6 +27,9 @@ #include "avutil.h" #include "log.h"
+#if LIBAVUTIL_VERSION_MAJOR > 50 +static +#endif int av_log_level = AV_LOG_INFO;
void av_log_default_callback(void* ptr, int level, const char* fmt, va_list vl)
ok [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB I do not agree with what you have to say, but I'll defend to the death your right to say it. -- Voltaire
On Thu, Dec 3, 2009 at 9:13 AM, Michael Niedermayer <michaelni at gmx.at> wrote:
On Thu, Dec 03, 2009 at 02:04:31AM -0200, Ramiro Polla wrote:
On Thu, Dec 3, 2009 at 1:47 AM, Michael Niedermayer <michaelni at gmx.at> wrote:
On Wed, Dec 02, 2009 at 10:42:36PM -0200, Ramiro Polla wrote:
av_log_level from libavutil/log.c is only used in that file. It is not declared in libavutil/log.h. It's meant to be used with the av_log_get_level() and av_log_set_level() functions.
Should it be made static in log.c, or declared in libavutil/log.h so users can access it directly?
should be made static in the next maj ver bump
2 attempts attached, which one do you prefer?
?log.c | ? ?3 +++ ?1 file changed, 3 insertions(+) 0bda2f059aa904775edc4bb2c6d44d8dec0ba089 ?av_log_level_try1.diff Index: libavutil/log.c =================================================================== --- libavutil/log.c ? (revision 20713) +++ libavutil/log.c ? (working copy) @@ -27,6 +27,9 @@ ?#include "avutil.h" ?#include "log.h"
+#if LIBAVUTIL_VERSION_MAJOR > 50 +static +#endif ?int av_log_level = AV_LOG_INFO;
?void av_log_default_callback(void* ptr, int level, const char* fmt, va_list vl)
ok
Applied.
On Thu, Dec 03, 2009 at 02:04:31AM -0200, Ramiro Polla wrote:
On Thu, Dec 3, 2009 at 1:47 AM, Michael Niedermayer <michaelni at gmx.at> wrote:
On Wed, Dec 02, 2009 at 10:42:36PM -0200, Ramiro Polla wrote:
av_log_level from libavutil/log.c is only used in that file. It is not declared in libavutil/log.h. It's meant to be used with the av_log_get_level() and av_log_set_level() functions.
Should it be made static in log.c, or declared in libavutil/log.h so users can access it directly?
should be made static in the next maj ver bump
2 attempts attached, which one do you prefer?
--- libavutil/log.c (revision 20713) +++ libavutil/log.c (working copy) @@ -27,6 +27,9 @@
+#if LIBAVUTIL_VERSION_MAJOR > 50 +static +#endif int av_log_level = AV_LOG_INFO;
--- libavutil/log.c (revision 20713) +++ libavutil/log.c (working copy) @@ -27,7 +27,11 @@
+#if LIBAVUTIL_VERSION_MAJOR > 50 +static int av_log_level = AV_LOG_INFO; +#else int av_log_level = AV_LOG_INFO; +#endif
Please use the second one, the first will inevitably lead to the 'static' keyword being left on a line of its own.. Diego
On Thu, Dec 03, 2009 at 04:47:28AM +0100, Michael Niedermayer wrote:
On Wed, Dec 02, 2009 at 10:42:36PM -0200, Ramiro Polla wrote:
av_log_level from libavutil/log.c is only used in that file. It is not declared in libavutil/log.h. It's meant to be used with the av_log_get_level() and av_log_set_level() functions.
Should it be made static in log.c, or declared in libavutil/log.h so users can access it directly?
should be made static in the next maj ver bump
Why care about API abuse? I'd just make it static right away... Diego
On Thu, Dec 03, 2009 at 09:52:44AM +0100, Diego Biurrun wrote:
On Thu, Dec 03, 2009 at 04:47:28AM +0100, Michael Niedermayer wrote:
On Wed, Dec 02, 2009 at 10:42:36PM -0200, Ramiro Polla wrote:
av_log_level from libavutil/log.c is only used in that file. It is not declared in libavutil/log.h. It's meant to be used with the av_log_get_level() and av_log_set_level() functions.
Should it be made static in log.c, or declared in libavutil/log.h so users can access it directly?
should be made static in the next maj ver bump
Why care about API abuse? I'd just make it static right away...
IIRC it was once the only way to set the field, so some appliations might still use it. [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Many that live deserve death. And some that die deserve life. Can you give it to them? Then do not be too eager to deal out death in judgement. For even the very wise cannot see all ends. -- Gandalf
On Thu, Dec 3, 2009 at 9:14 AM, Michael Niedermayer <michaelni at gmx.at> wrote:
On Thu, Dec 03, 2009 at 09:52:44AM +0100, Diego Biurrun wrote:
On Thu, Dec 03, 2009 at 04:47:28AM +0100, Michael Niedermayer wrote:
On Wed, Dec 02, 2009 at 10:42:36PM -0200, Ramiro Polla wrote:
av_log_level from libavutil/log.c is only used in that file. It is not declared in libavutil/log.h. It's meant to be used with the av_log_get_level() and av_log_set_level() functions.
Should it be made static in log.c, or declared in libavutil/log.h so users can access it directly?
should be made static in the next maj ver bump
Why care about API abuse? ?I'd just make it static right away...
IIRC it was once the only way to set the field, so some appliations might still use it.
I think it was already supposed to be gone by version 50. ------------- Author: lucabe Date: Thu Feb 8 19:55:36 2007 New Revision: 7882 Modified: trunk/ffmpeg.c trunk/ffplay.c trunk/libavcodec/utils.c Log: Directly access av_log_level instead of calling av_log_{set, get}_level() (which will be removed at the next avutil version increment) [...] ------------- Author: mru Date: Wed Dec 12 22:48:50 2007 New Revision: 11209 Log: use av_log_get/set_level() Modified: trunk/ffmpeg.c trunk/ffplay.c trunk/libavcodec/utils.c trunk/libavutil/log.c trunk/libavutil/log.h [...] Modified: trunk/libavutil/log.h ============================================================================== --- trunk/libavutil/log.h (original) +++ trunk/libavutil/log.h Wed Dec 12 22:48:50 2007 @@ -81,7 +81,10 @@ struct AVCLASS { */ #define AV_LOG_DEBUG 48 #endif + +#if LIBAVUTIL_VERSION_INT < (50<<16) extern int av_log_level; +#endif -------------------- It just wasn't made conditionally static in r11209, so I think Diego might be right... Ramiro Polla
On Thu, Dec 03, 2009 at 11:33:06AM -0200, Ramiro Polla wrote:
On Thu, Dec 3, 2009 at 9:14 AM, Michael Niedermayer <michaelni at gmx.at> wrote:
On Thu, Dec 03, 2009 at 09:52:44AM +0100, Diego Biurrun wrote:
On Thu, Dec 03, 2009 at 04:47:28AM +0100, Michael Niedermayer wrote:
On Wed, Dec 02, 2009 at 10:42:36PM -0200, Ramiro Polla wrote:
av_log_level from libavutil/log.c is only used in that file. It is not declared in libavutil/log.h. It's meant to be used with the av_log_get_level() and av_log_set_level() functions.
Should it be made static in log.c, or declared in libavutil/log.h so users can access it directly?
should be made static in the next maj ver bump
Why care about API abuse? ?I'd just make it static right away...
IIRC it was once the only way to set the field, so some appliations might still use it.
I think it was already supposed to be gone by version 50.
------------- Author: lucabe Date: Thu Feb 8 19:55:36 2007 New Revision: 7882
Modified: trunk/ffmpeg.c trunk/ffplay.c trunk/libavcodec/utils.c
Log: Directly access av_log_level instead of calling av_log_{set, get}_level() (which will be removed at the next avutil version increment) [...] ------------- Author: mru Date: Wed Dec 12 22:48:50 2007 New Revision: 11209
Log: use av_log_get/set_level()
Modified: trunk/ffmpeg.c trunk/ffplay.c trunk/libavcodec/utils.c trunk/libavutil/log.c trunk/libavutil/log.h
[...] --- trunk/libavutil/log.h (original) +++ trunk/libavutil/log.h Wed Dec 12 22:48:50 2007 @@ -81,7 +81,10 @@ struct AVCLASS { */ #define AV_LOG_DEBUG 48 #endif + +#if LIBAVUTIL_VERSION_INT < (50<<16) extern int av_log_level; +#endif --------------------
It just wasn't made conditionally static in r11209, so I think Diego might be right...
Diego says: Just make it static :)
On Thu, Dec 3, 2009 at 12:03 PM, Diego Biurrun <diego at biurrun.de> wrote:
On Thu, Dec 03, 2009 at 11:33:06AM -0200, Ramiro Polla wrote:
On Thu, Dec 3, 2009 at 9:14 AM, Michael Niedermayer <michaelni at gmx.at> wrote:
On Thu, Dec 03, 2009 at 09:52:44AM +0100, Diego Biurrun wrote:
On Thu, Dec 03, 2009 at 04:47:28AM +0100, Michael Niedermayer wrote:
On Wed, Dec 02, 2009 at 10:42:36PM -0200, Ramiro Polla wrote:
av_log_level from libavutil/log.c is only used in that file. It is not declared in libavutil/log.h. It's meant to be used with the av_log_get_level() and av_log_set_level() functions.
Should it be made static in log.c, or declared in libavutil/log.h so users can access it directly?
should be made static in the next maj ver bump
Why care about API abuse? ?I'd just make it static right away...
IIRC it was once the only way to set the field, so some appliations might still use it.
I think it was already supposed to be gone by version 50.
------------- Author: lucabe Date: Thu Feb ?8 19:55:36 2007 New Revision: 7882
Modified: ? ?trunk/ffmpeg.c ? ?trunk/ffplay.c ? ?trunk/libavcodec/utils.c
Log: Directly access av_log_level instead of calling av_log_{set, get}_level() (which will be removed at the next avutil version increment) [...] ------------- Author: mru Date: Wed Dec 12 22:48:50 2007 New Revision: 11209
Log: use av_log_get/set_level()
Modified: ? ?trunk/ffmpeg.c ? ?trunk/ffplay.c ? ?trunk/libavcodec/utils.c ? ?trunk/libavutil/log.c ? ?trunk/libavutil/log.h
[...] --- trunk/libavutil/log.h ? ? (original) +++ trunk/libavutil/log.h ? ? Wed Dec 12 22:48:50 2007 @@ -81,7 +81,10 @@ struct AVCLASS { ? */ ?#define AV_LOG_DEBUG ? ?48 ?#endif + +#if LIBAVUTIL_VERSION_INT < (50<<16) ?extern int av_log_level; +#endif --------------------
It just wasn't made conditionally static in r11209, so I think Diego might be right...
Diego says: Just make it static :)
And what does Simon says? =) If there are no more comments I'll just make it static...
On Thu, Dec 03, 2009 at 01:58:56PM -0200, Ramiro Polla wrote:
On Thu, Dec 3, 2009 at 12:03 PM, Diego Biurrun <diego at biurrun.de> wrote:
On Thu, Dec 03, 2009 at 11:33:06AM -0200, Ramiro Polla wrote:
On Thu, Dec 3, 2009 at 9:14 AM, Michael Niedermayer <michaelni at gmx.at> wrote:
On Thu, Dec 03, 2009 at 09:52:44AM +0100, Diego Biurrun wrote:
On Thu, Dec 03, 2009 at 04:47:28AM +0100, Michael Niedermayer wrote:
On Wed, Dec 02, 2009 at 10:42:36PM -0200, Ramiro Polla wrote: > > av_log_level from libavutil/log.c is only used in that file. It is not > declared in libavutil/log.h. It's meant to be used with the > av_log_get_level() and av_log_set_level() functions. > > Should it be made static in log.c, or declared in libavutil/log.h so > users can access it directly?
should be made static in the next maj ver bump
Why care about API abuse? ?I'd just make it static right away...
IIRC it was once the only way to set the field, so some appliations might still use it.
I think it was already supposed to be gone by version 50.
------------- Author: lucabe Date: Thu Feb ?8 19:55:36 2007 New Revision: 7882
Modified: ? ?trunk/ffmpeg.c ? ?trunk/ffplay.c ? ?trunk/libavcodec/utils.c
Log: Directly access av_log_level instead of calling av_log_{set, get}_level() (which will be removed at the next avutil version increment) [...] ------------- Author: mru Date: Wed Dec 12 22:48:50 2007 New Revision: 11209
Log: use av_log_get/set_level()
Modified: ? ?trunk/ffmpeg.c ? ?trunk/ffplay.c ? ?trunk/libavcodec/utils.c ? ?trunk/libavutil/log.c ? ?trunk/libavutil/log.h
[...] --- trunk/libavutil/log.h ? ? (original) +++ trunk/libavutil/log.h ? ? Wed Dec 12 22:48:50 2007 @@ -81,7 +81,10 @@ struct AVCLASS { ? */ ?#define AV_LOG_DEBUG ? ?48 ?#endif + +#if LIBAVUTIL_VERSION_INT < (50<<16) ?extern int av_log_level; +#endif --------------------
It just wasn't made conditionally static in r11209, so I think Diego might be right...
Diego says: Just make it static :)
And what does Simon says? =) If there are no more comments I'll just make it static...
I say make it static during the next major bump. yes, applications _should_not_ use it but there was no warning for them to update to the new ABI and the old is still working. Making it static has a high chance of breaking applications. Distro maintainers will lynch you if any application used it as it will break that app ... [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB If a bugfix only changes things apparently unrelated to the bug with no further explanation, that is a good sign that the bugfix is wrong.
participants (3)
-
diego@biurrun.de -
michaelni@gmx.at -
ramiro.polla@gmail.com