[FFmpeg-devel] [PATCH] Move error codes definitions from lavc to lavu
Michael Niedermayer
michaelni
Mon Mar 8 23:12:06 CET 2010
On Mon, Mar 08, 2010 at 10:57:59PM +0100, Stefano Sabatini wrote:
> On date Monday 2010-03-08 22:15:43 +0100, Michael Niedermayer encoded:
> > On Mon, Mar 08, 2010 at 09:46:15PM +0100, Stefano Sabatini wrote:
> > > On date Monday 2010-03-08 11:13:28 +0100, Michael Niedermayer encoded:
> > > > On Mon, Mar 08, 2010 at 12:09:49AM +0100, Stefano Sabatini wrote:
> > > [...]
> > > > > Subject: [PATCH] Move error code definitions from libavcodec/avcodec.h to
> > > > > libavutil/error.h, and mark the old definitions to be dropped at the
> > > > > next major bump.
> > > > >
> > > > > Error code definitions and handling code belongs to libavutil, where
> > > > > it can be shared by all the libav* libraries.
> > > > > ---
> > > > > libavcodec/avcodec.h | 3 ++-
> > > > > libavutil/Makefile | 1 +
> > > > > libavutil/avutil.h | 3 ++-
> > > > > libavutil/error.h | 37 +++++++++++++++++++++++++++++++++++++
> > > > > 4 files changed, 42 insertions(+), 2 deletions(-)
> > > > > create mode 100644 libavutil/error.h
> > > > >
> > > > > diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
> > > > > index 8983f05..64cfb26 100644
> > > > > --- a/libavcodec/avcodec.h
> > > > > +++ b/libavcodec/avcodec.h
> > > > > @@ -3810,6 +3810,7 @@ int av_parse_video_frame_size(int *width_ptr, int *height_ptr, const char *str);
> > > > > */
> > > > > int av_parse_video_frame_rate(AVRational *frame_rate, const char *str);
> > > > >
> > > > > +#if LIBAVCODEC_VERSION_MAJOR < 53
> > > > > /* error handling */
> > > > > #if EINVAL > 0
> > > > > #define AVERROR(e) (-(e)) /**< Returns a negative error code from a POSIX error code, to return from library functions. */
> > > > > @@ -3828,7 +3829,7 @@ int av_parse_video_frame_rate(AVRational *frame_rate, const char *str);
> > > > > #define AVERROR_NOTSUPP AVERROR(ENOSYS) /**< Operation not supported. */
> > > > > #define AVERROR_NOENT AVERROR(ENOENT) /**< No such file or directory. */
> > > >
> > > > > #define AVERROR_EOF AVERROR(EPIPE) /**< End of file. */
> > > >
> > > > iam not sure about droping this one
> > >
> > > Updates:
> > > * do not keep AVERROR(e) definition in avcodec.h, as it is now defined
> > > in libavutil/error.h
> > >
> > > * define the FFmpeg specific AVERROR_EOF error code in
> > > libavutil/error.h, this will be enabled when libavcodec version will
> > > be bumped and the old AVERROR_EOF definition will be dropped.
> > >
> > > Regards.
> > > --
> > > FFmpeg = Faithless and Faithless Monstrous Puritan Educated Game
> >
> > > libavcodec/avcodec.h | 5 ++---
> > > libavutil/Makefile | 1 +
> > > libavutil/avutil.h | 3 ++-
> > > libavutil/error.h | 42 ++++++++++++++++++++++++++++++++++++++++++
> > > 4 files changed, 47 insertions(+), 4 deletions(-)
> > > 1e22b7c63425d615de744772cc44b25495ac9ac0 0001-Move-error-code-definitions-from-libavcodec-avcodec..patch
> > > >From 987b6d489dad74009a555932dc80d7b3cdab60b9 Mon Sep 17 00:00:00 2001
> > > From: Stefano Sabatini <stefano.sabatini-lala at poste.it>
> > > Date: Sun, 7 Mar 2010 15:15:00 +0100
> > > Subject: [PATCH] Move error code definitions from libavcodec/avcodec.h to
> > > libavutil/error.h, and mark the old definitions to be dropped at the
> > > next major bump.
> > [...]
> > > @@ -3828,7 +3827,7 @@ int av_parse_video_frame_rate(AVRational *frame_rate, const char *str);
> > > #define AVERROR_NOTSUPP AVERROR(ENOSYS) /**< Operation not supported. */
> > > #define AVERROR_NOENT AVERROR(ENOENT) /**< No such file or directory. */
> > > #define AVERROR_EOF AVERROR(EPIPE) /**< End of file. */
> > > -#define AVERROR_PATCHWELCOME -MKTAG('P','A','W','E') /**< Not yet implemented in FFmpeg. Patches welcome. */
> > > +#endif
> > [...]
> > > +/* FFmpeg specific error codes */
> > > +#define AVERROR_PATCHWELCOME (-MKTAG('P','A','W','E')) ///< Not yet implemented in FFmpeg. Patches welcome.
> > > +#define AVERROR_BIKESHED (-MKTAG('B','I','S','H')) ///< Invalid argument or color or flavor. Mine is better.
> > > +#if 0 // enable by hand when LIBAVCODEC_VERSION_MAJOR == 53
> > > +#define AVERROR_EOF (-MKTAG('E','O','F','_')) ///< End of file.
> > > +#endif
> >
> > not just moving
> > unrelated changes
> > description doesnt match patch
>
> Patch edited and split.
>
> Regards.
> --
> FFmpeg = Friendly & Fascinating Mind-dumbing Peaceful Erotic Guru
> libavcodec/avcodec.h | 5 ++---
> libavutil/Makefile | 1 +
> libavutil/avutil.h | 3 ++-
> libavutil/error.h | 38 ++++++++++++++++++++++++++++++++++++++
> 4 files changed, 43 insertions(+), 4 deletions(-)
> 62ec56352b39a0cd62a65cc4053e630f3e6eac95 0001-Move-error-code-definitions-from-libavcodec-avcodec..patch
> >From cc3be6d0f3149aa549226d0e4bbec64817510fb2 Mon Sep 17 00:00:00 2001
> From: Stefano Sabatini <stefano.sabatini-lala at poste.it>
> Date: Sun, 7 Mar 2010 15:15:00 +0100
> Subject: [PATCH 1/3] Move error code definitions from libavcodec/avcodec.h to
> libavutil/error.h, and mark the old definitions to be dropped at the
> next major bump.
>
> Error code definitions and handling code belong to libavutil, where
> they can be shared by all the libav* libraries.
> ---
> libavcodec/avcodec.h | 5 ++---
> libavutil/Makefile | 1 +
> libavutil/avutil.h | 3 ++-
> libavutil/error.h | 38 ++++++++++++++++++++++++++++++++++++++
> 4 files changed, 43 insertions(+), 4 deletions(-)
> create mode 100644 libavutil/error.h
>
> diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
> index 3d162d7..465669b 100644
> --- a/libavcodec/avcodec.h
> +++ b/libavcodec/avcodec.h
> @@ -3810,13 +3810,12 @@ int av_parse_video_frame_size(int *width_ptr, int *height_ptr, const char *str);
> */
> int av_parse_video_frame_rate(AVRational *frame_rate, const char *str);
>
> +#if LIBAVCODEC_VERSION_MAJOR < 53
> /* error handling */
> #if EINVAL > 0
> -#define AVERROR(e) (-(e)) /**< Returns a negative error code from a POSIX error code, to return from library functions. */
> #define AVUNERROR(e) (-(e)) /**< Returns a POSIX error code from a library function error return value. */
> #else
> /* Some platforms have E* and errno already negated. */
> -#define AVERROR(e) (e)
> #define AVUNERROR(e) (e)
> #endif
> #define AVERROR_UNKNOWN AVERROR(EINVAL) /**< unknown error */
> @@ -3828,7 +3827,7 @@ int av_parse_video_frame_rate(AVRational *frame_rate, const char *str);
> #define AVERROR_NOTSUPP AVERROR(ENOSYS) /**< Operation not supported. */
> #define AVERROR_NOENT AVERROR(ENOENT) /**< No such file or directory. */
> #define AVERROR_EOF AVERROR(EPIPE) /**< End of file. */
> -#define AVERROR_PATCHWELCOME -MKTAG('P','A','W','E') /**< Not yet implemented in FFmpeg. Patches welcome. */
what i might approve is:
move all lines unchanged to a new header
move some lines unchanged to a new header
what i will not approve:
anything that adds new breakage with a major bump
any renamings or sneaked in redesign in a patch moving code
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Good people do not need laws to tell them to act responsibly, while bad
people will find a way around the laws. -- Plato
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100308/929bb721/attachment.pgp>
More information about the ffmpeg-devel
mailing list