[FFmpeg-devel] [PATCH] Move sample format definitions from libavcodec to libavcore.

Michael Niedermayer michaelni
Mon Oct 25 14:53:59 CEST 2010


On Sun, Oct 24, 2010 at 11:38:20PM -0700, Stefano Sabatini wrote:
> ---
>  libavcodec/avcodec.h  |   27 +++++++++++++++------------
>  libavcore/Makefile    |    1 +
>  libavcore/samplefmt.h |   35 +++++++++++++++++++++++++++++++++++
>  3 files changed, 51 insertions(+), 12 deletions(-)
>  create mode 100644 libavcore/samplefmt.h
> 
> diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
> index 705259e..447493e 100644
> --- a/libavcodec/avcodec.h
> +++ b/libavcodec/avcodec.h
> @@ -27,6 +27,7 @@
>   */
>  
>  #include <errno.h>
> +#include "libavcore/samplefmt.h"
>  #include "libavutil/avutil.h"
>  #include "libavutil/cpu.h"
>  
> @@ -75,6 +76,9 @@
>  #ifndef FF_API_INOFFICIAL
>  #define FF_API_INOFFICIAL       (LIBAVCODEC_VERSION_MAJOR < 53)
>  #endif
> +#ifndef FF_API_OLD_SAMPLE_FMT
> +#define FF_API_OLD_SAMPLE_FMT   (LIBAVCODEC_VERSION_MAJOR < 53)
> +#endif
>  
>  #define AV_NOPTS_VALUE          INT64_C(0x8000000000000000)
>  #define AV_TIME_BASE            1000000
> @@ -409,18 +413,17 @@ enum CodecID {
>  #define CODEC_TYPE_NB         AVMEDIA_TYPE_NB
>  #endif
>  
> -/**
> - * all in native-endian format
> - */
> -enum SampleFormat {
> -    SAMPLE_FMT_NONE = -1,
> -    SAMPLE_FMT_U8,              ///< unsigned 8 bits
> -    SAMPLE_FMT_S16,             ///< signed 16 bits
> -    SAMPLE_FMT_S32,             ///< signed 32 bits
> -    SAMPLE_FMT_FLT,             ///< float
> -    SAMPLE_FMT_DBL,             ///< double
> -    SAMPLE_FMT_NB               ///< Number of sample formats. DO NOT USE if dynamically linking to libavcodec
> -};
> +
> +#if FF_API_OLD_SAMPLE_FMT
> +#define SAMPLE_FMT_NONE AV_SAMPLE_FMT_NONE
> +#define SAMPLE_FMT_U8   AV_SAMPLE_FMT_U8
> +#define SAMPLE_FMT_S16  AV_SAMPLE_FMT_S16
> +#define SAMPLE_FMT_S32  AV_SAMPLE_FMT_S32
> +#define SAMPLE_FMT_FLT  AV_SAMPLE_FMT_FLT
> +#define SAMPLE_FMT_DBL  AV_SAMPLE_FMT_DBL
> +#define SAMPLE_FMT_NB   AV_SAMPLE_FMT_NB
> +#endif
> +
>  
>  /* Audio channel masks */
>  #define CH_FRONT_LEFT             0x00000001
> diff --git a/libavcore/Makefile b/libavcore/Makefile
> index 5e16c34..97d973f 100644
> --- a/libavcore/Makefile
> +++ b/libavcore/Makefile
> @@ -6,6 +6,7 @@ FFLIBS = avutil
>  HEADERS = avcore.h                                                      \
>            imgutils.h                                                    \
>            parseutils.h                                                  \
> +          samplefmt.h                                                   \
>  
>  OBJS = imgutils.o                                                       \
>         parseutils.o                                                     \
> diff --git a/libavcore/samplefmt.h b/libavcore/samplefmt.h
> new file mode 100644
> index 0000000..0051c8d
> --- /dev/null
> +++ b/libavcore/samplefmt.h

do we really want a header per enum ?

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

If you really think that XML is the answer, then you definitly missunderstood
the question -- Attila Kinali
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20101025/8a16f5fb/attachment.pgp>



More information about the ffmpeg-devel mailing list