[FFmpeg-cvslog] r25654 - in trunk: doc/APIchanges libavcodec/avcodec.h libavcodec/utils.c libavcore/avcore.h libavcore/samplefmt.c libavcore/samplefmt.h

stefano subversion
Tue Nov 2 23:20:49 CET 2010


Author: stefano
Date: Tue Nov  2 23:20:49 2010
New Revision: 25654

Log:
Add av_get_bits_per_sample_fmt() to libavcore/samplefmt.h and
deprecate av_get_bits_per_sample_format().

Modified:
   trunk/doc/APIchanges
   trunk/libavcodec/avcodec.h
   trunk/libavcodec/utils.c
   trunk/libavcore/avcore.h
   trunk/libavcore/samplefmt.c
   trunk/libavcore/samplefmt.h

Modified: trunk/doc/APIchanges
==============================================================================
--- trunk/doc/APIchanges	Tue Nov  2 23:08:02 2010	(r25653)
+++ trunk/doc/APIchanges	Tue Nov  2 23:20:49 2010	(r25654)
@@ -13,6 +13,10 @@ libavutil:   2009-03-08
 
 API changes, most recent first:
 
+2010-11-02 - r25654 - lavcore 0.12.0 - av_get_bits_per_sample_fmt()
+  Add av_get_bits_per_sample_fmt() to libavcore/samplefmt.h and
+  deprecate av_get_bits_per_sample_format().
+
 2010-11-02 - r25653 - lavcore 0.11.0 - samplefmt.h
   Add sample format functions in libavcore/samplefmt.h:
   av_get_sample_fmt_name(),

Modified: trunk/libavcodec/avcodec.h
==============================================================================
--- trunk/libavcodec/avcodec.h	Tue Nov  2 23:08:02 2010	(r25653)
+++ trunk/libavcodec/avcodec.h	Tue Nov  2 23:20:49 2010	(r25654)
@@ -33,7 +33,7 @@
 
 #define LIBAVCODEC_VERSION_MAJOR 52
 #define LIBAVCODEC_VERSION_MINOR 94
-#define LIBAVCODEC_VERSION_MICRO  2
+#define LIBAVCODEC_VERSION_MICRO  3
 
 #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
                                                LIBAVCODEC_VERSION_MINOR, \
@@ -3739,13 +3739,13 @@ char av_get_pict_type_char(int pict_type
  */
 int av_get_bits_per_sample(enum CodecID codec_id);
 
+#if FF_API_OLD_SAMPLE_FMT
 /**
- * Return sample format bits per sample.
- *
- * @param[in] sample_fmt the sample format
- * @return Number of bits per sample or zero if unknown for the given sample format.
+ * @deprecated Use av_get_bits_per_sample_fmt() instead.
  */
+attribute_deprecated
 int av_get_bits_per_sample_format(enum SampleFormat sample_fmt);
+#endif
 
 /* frame parsing */
 typedef struct AVCodecParserContext {

Modified: trunk/libavcodec/utils.c
==============================================================================
--- trunk/libavcodec/utils.c	Tue Nov  2 23:08:02 2010	(r25653)
+++ trunk/libavcodec/utils.c	Tue Nov  2 23:20:49 2010	(r25654)
@@ -1064,21 +1064,11 @@ int av_get_bits_per_sample(enum CodecID 
     }
 }
 
+#if FF_API_OLD_SAMPLE_FMT
 int av_get_bits_per_sample_format(enum SampleFormat sample_fmt) {
-    switch (sample_fmt) {
-    case SAMPLE_FMT_U8:
-        return 8;
-    case SAMPLE_FMT_S16:
-        return 16;
-    case SAMPLE_FMT_S32:
-    case SAMPLE_FMT_FLT:
-        return 32;
-    case SAMPLE_FMT_DBL:
-        return 64;
-    default:
-        return 0;
-    }
+    return av_get_bits_per_sample_fmt(sample_fmt);
 }
+#endif
 
 #if !HAVE_THREADS
 int avcodec_thread_init(AVCodecContext *s, int thread_count){

Modified: trunk/libavcore/avcore.h
==============================================================================
--- trunk/libavcore/avcore.h	Tue Nov  2 23:08:02 2010	(r25653)
+++ trunk/libavcore/avcore.h	Tue Nov  2 23:20:49 2010	(r25654)
@@ -27,7 +27,7 @@
 #include "libavutil/avutil.h"
 
 #define LIBAVCORE_VERSION_MAJOR  0
-#define LIBAVCORE_VERSION_MINOR 11
+#define LIBAVCORE_VERSION_MINOR 12
 #define LIBAVCORE_VERSION_MICRO  0
 
 #define LIBAVCORE_VERSION_INT   AV_VERSION_INT(LIBAVCORE_VERSION_MAJOR, \

Modified: trunk/libavcore/samplefmt.c
==============================================================================
--- trunk/libavcore/samplefmt.c	Tue Nov  2 23:08:02 2010	(r25653)
+++ trunk/libavcore/samplefmt.c	Tue Nov  2 23:20:49 2010	(r25654)
@@ -62,3 +62,9 @@ char *av_get_sample_fmt_string (char *bu
 
     return buf;
 }
+
+int av_get_bits_per_sample_fmt(enum AVSampleFormat sample_fmt)
+{
+    return sample_fmt < 0 || sample_fmt >= AV_SAMPLE_FMT_NB ?
+        0 : sample_fmt_info[sample_fmt].bits;
+}

Modified: trunk/libavcore/samplefmt.h
==============================================================================
--- trunk/libavcore/samplefmt.h	Tue Nov  2 23:08:02 2010	(r25653)
+++ trunk/libavcore/samplefmt.h	Tue Nov  2 23:20:49 2010	(r25654)
@@ -58,4 +58,13 @@ enum AVSampleFormat av_get_sample_fmt(co
  */
 char *av_get_sample_fmt_string(char *buf, int buf_size, enum AVSampleFormat sample_fmt);
 
+/**
+ * Return sample format bits per sample.
+ *
+ * @param sample_fmt the sample format
+ * @return number of bits per sample or zero if unknown for the given
+ * sample format
+ */
+int av_get_bits_per_sample_fmt(enum AVSampleFormat sample_fmt);
+
 #endif /* AVCORE_SAMPLEFMT_H */



More information about the ffmpeg-cvslog mailing list