[FFmpeg-devel] [PATCH] Move error codes definitions from lavc to lavu
Michael Niedermayer
michaelni
Mon Mar 8 11:13:28 CET 2010
On Mon, Mar 08, 2010 at 12:09:49AM +0100, Stefano Sabatini wrote:
> On date Sunday 2010-03-07 16:48:55 +0100, Michael Niedermayer encoded:
> > On Sun, Mar 07, 2010 at 03:32:00PM +0100, Stefano Sabatini wrote:
> [...]
> > > #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
> > > diff --git a/libavutil/common.h b/libavutil/common.h
> > > index 4b757d1..547b7d0 100644
> > > --- a/libavutil/common.h
> > > +++ b/libavutil/common.h
> > > @@ -35,6 +35,16 @@
> > > #include <stdlib.h>
> > > #include <string.h>
> > >
> > > +/** Returns a negative error code from a POSIX error code, to return from library functions. */
> > > +#if EINVAL > 0
> > > +#define AVERROR(e) (-(e))
> > > +#else
> > > +/* Some platforms have E* and errno already negated. */
> > > +#define AVERROR(e) (e)
> > > +#endif
> > > +
> >
> > > +#define AVERROR_PATCHWELCOME -MKTAG('P','A','W','E') ///< Not yet implemented in FFmpeg. Patches welcome.
> >
> > missig ()
>
> Fixed.
>
> Also do you prefer to put error codes in libavutil/common.h or in a
> separate file libavutil/error.h? (I have a slightly preference for the
> second.)
>
> Regards.
> --
> FFmpeg = Fierce and Fiendish Mournful Programmable Ecumenical Guru
> libavcodec/avcodec.h | 3 ++-
> libavutil/Makefile | 1 +
> libavutil/avutil.h | 3 ++-
> libavutil/error.h | 37 +++++++++++++++++++++++++++++++++++++
> 4 files changed, 42 insertions(+), 2 deletions(-)
> 46a3dc33ca0855b11706bb4209d7cfe819b34a1f 0001-Move-error-code-definitions-from-libavcodec-avcodec..patch
> >From 83b8cfe5d36d2fdb5a9358ae457f702a785a6675 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.
>
> 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
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
I am the wisest man alive, for I know one thing, and that is that I know
nothing. -- Socrates
-------------- 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/c4b07b38/attachment.pgp>
More information about the ffmpeg-devel
mailing list