From 987170cb9dd036d3372c8feac6074d13d1b84dd2 Mon Sep 17 00:00:00 2001 From: Mans Rullgard Date: Wed, 8 Aug 2012 17:30:15 +0100 Subject: dict: add av_dict_count() This adds a function to retrieve the number of entries in a dictionary and updates the places directly accessing what should be an opaque struct to use this new function instead. Signed-off-by: Mans Rullgard --- doc/APIchanges | 3 +++ 1 file changed, 3 insertions(+) (limited to 'doc') diff --git a/doc/APIchanges b/doc/APIchanges index 436e994149..b723e1062d 100644 --- a/doc/APIchanges +++ b/doc/APIchanges @@ -13,6 +13,9 @@ libavutil: 2011-04-18 API changes, most recent first: +2012-08-08 - xxxxxxx - lavu 51.38 - dict.h + Add av_dict_count(). + 2012-08-xx - xxxxxxx - lavc 54.25 - avcodec.h Rename CodecID to AVCodecID and all CODEC_ID_* to AV_CODEC_ID_*. -- cgit v1.2.3 From 2ff67c909c95903240c30405b0b231ba68f5407a Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Wed, 8 Aug 2012 08:04:56 +0200 Subject: lavc: fix mixing CODEC_ID/AV_CODEC_ID in C++ code. C++ does not allow to mix different enums, so e.g. code comparing ACodecID with CodecID would fail to compile with gcc. This very evil hack should fix this problem. --- doc/APIchanges | 4 ++++ libavcodec/Makefile | 1 + libavcodec/avcodec.h | 11 ++++++++--- libavcodec/old_codec_ids.h | 6 +----- 4 files changed, 14 insertions(+), 8 deletions(-) (limited to 'doc') diff --git a/doc/APIchanges b/doc/APIchanges index b723e1062d..f94670cf16 100644 --- a/doc/APIchanges +++ b/doc/APIchanges @@ -18,6 +18,10 @@ API changes, most recent first: 2012-08-xx - xxxxxxx - lavc 54.25 - avcodec.h Rename CodecID to AVCodecID and all CODEC_ID_* to AV_CODEC_ID_*. + To provide backwards compatibility, CodecID is now #defined as AVCodecID. + Note that this can break user code that includes avcodec.h and uses the + 'CodecID' identifier. Such code should either #undef CodecID or stop using the + CodecID name. 2012-08-03 - xxxxxxx - lavu 51.37.1 - cpu.h lsws 2.1.1 - swscale.h diff --git a/libavcodec/Makefile b/libavcodec/Makefile index 655e828cbc..095d09a6eb 100644 --- a/libavcodec/Makefile +++ b/libavcodec/Makefile @@ -705,6 +705,7 @@ SKIPHEADERS += %_tablegen.h \ %_tables.h \ aac_tablegen_decl.h \ fft-internal.h \ + old_codec_ids.h \ tableprint.h \ $(ARCH)/vp56_arith.h \ diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index b807ae4bf3..8c28b6538a 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -76,9 +76,6 @@ * @{ */ -#if FF_API_CODEC_ID -#include "old_codec_ids.h" -#endif /** * Identify the syntax and semantics of the bitstream. @@ -428,8 +425,16 @@ enum AVCodecID { AV_CODEC_ID_MPEG4SYSTEMS = 0x20001, /**< _FAKE_ codec to indicate a MPEG-4 Systems * stream (only used by libavformat) */ AV_CODEC_ID_FFMETADATA = 0x21000, ///< Dummy codec for streams containing only metadata information. + +#if FF_API_CODEC_ID +#include "old_codec_ids.h" +#endif }; +#if FF_API_CODEC_ID +#define CodecID AVCodecID +#endif + #if FF_API_OLD_DECODE_AUDIO /* in bytes */ #define AVCODEC_MAX_AUDIO_FRAME_SIZE 192000 // 1 second of 48khz 32bit audio diff --git a/libavcodec/old_codec_ids.h b/libavcodec/old_codec_ids.h index 95b6b737b0..2b72e38d20 100644 --- a/libavcodec/old_codec_ids.h +++ b/libavcodec/old_codec_ids.h @@ -19,8 +19,6 @@ #ifndef AVCODEC_OLD_CODEC_IDS_H #define AVCODEC_OLD_CODEC_IDS_H -#include "libavutil/attributes.h" - /* * This header exists to prevent new codec IDs from being accidentally added to * the deprecated list. @@ -29,8 +27,7 @@ * Do not add new items to this list. Use the AVCodecID enum instead. */ -enum CodecID { - CODEC_ID_NONE, + CODEC_ID_NONE = AV_CODEC_ID_NONE, /* video codecs */ CODEC_ID_MPEG1VIDEO, @@ -365,6 +362,5 @@ enum CodecID { CODEC_ID_MPEG4SYSTEMS = 0x20001, /**< _FAKE_ codec to indicate a MPEG-4 Systems * stream (only used by libavformat) */ CODEC_ID_FFMETADATA = 0x21000, ///< Dummy codec for streams containing only metadata information. -} attribute_deprecated; #endif /* AVCODEC_OLD_CODEC_IDS_H */ -- cgit v1.2.3