History

Deprecate avcodec_pix_fmt_string() in favor of av_get_pix_fmt_string(), added to libavutil/pixdesc.h.

Originally committed as revision 25879 to svn://svn.ffmpeg.org/ffmpeg/trunk

Stefano Sabatini committed 15 years ago

Commit bb4afa11 parent 4da12e36 files · +37 −26Browse files

Unified · Split

6 files
  1. doc/APIchanges +4 −0
  2. libavcodec/avcodec.h +4 −10
  3. libavcodec/imgconvert.c +2 −15
  4. libavutil/avutil.h +1 −1
  5. libavutil/pixdesc.c +14 −0
  6. libavutil/pixdesc.h +12 −0
doc/APIchanges+4−0
@@ -12,6 +12,10 @@ libavutil: 2009-03-08 · 11 unmodified lines
1212
1313
1414 API changes, most recent first:
15+2010-12-04 - r25879 - lavu 50.34.0 - av_get_pix_fmt_string()
16+ Deprecate avcodec_pix_fmt_string() in favor of
17+ pixdesc.h/av_get_pix_fmt_string().
18+
1519 2010-12-04 - r25878 - lavcore 1.15.0 - av_image_alloc()
1620 Add av_image_alloc() to libavcore/imgutils.h.
1721
libavcodec/avcodec.h+4−10
@@ -33,7 +33,7 @@ · 32 unmodified lines
3333
3434 #define LIBAVCODEC_VERSION_MAJOR 52
3535 #define LIBAVCODEC_VERSION_MINOR 97
36−#define LIBAVCODEC_VERSION_MICRO 2
36+#define LIBAVCODEC_VERSION_MICRO 3
3737
3838 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
3939 LIBAVCODEC_VERSION_MINOR, \
@@ -3285,18 +3285,12 @@ int avcodec_get_pix_fmt_loss(enum PixelFormat dst_pix_fmt, enum PixelFormat src_ · 3245 unmodified lines
32853285 enum PixelFormat avcodec_find_best_pix_fmt(int64_t pix_fmt_mask, enum PixelFormat src_pix_fmt,
32863286 int has_alpha, int *loss_ptr);
32873287
3288−
3288+#if LIBAVCODEC_VERSION_MAJOR < 53
32893289 /**
3290− * Print in buf the string corresponding to the pixel format with
3291− * number pix_fmt, or an header if pix_fmt is negative.
3292− *
3293− * @param[in] buf the buffer where to write the string
3294− * @param[in] buf_size the size of buf
3295− * @param[in] pix_fmt the number of the pixel format to print the corresponding info string, or
3296− * a negative value to print the corresponding header.
3297− * Meaningful values for obtaining a pixel format info vary from 0 to PIX_FMT_NB -1.
3290+ * @deprecated Use av_get_pix_fmt_string() instead.
32983291 */
32993292 void avcodec_pix_fmt_string (char *buf, int buf_size, enum PixelFormat pix_fmt);
3293+#endif
33003294
33013295 #define FF_ALPHA_TRANSP 0x0001 /* image has some totally transparent pixels */
33023296 #define FF_ALPHA_SEMI_TRANSP 0x0002 /* image has some transparent pixels */
libavcodec/imgconvert.c+2−15
@@ -431,25 +431,12 @@ enum PixelFormat avcodec_get_pix_fmt(const char *name) · 430 unmodified lines
431431 {
432432 return av_get_pix_fmt(name);
433433 }
434−#endif
435434
436435 void avcodec_pix_fmt_string (char *buf, int buf_size, enum PixelFormat pix_fmt)
437436 {
438− /* print header */
439− if (pix_fmt < 0)
440− snprintf (buf, buf_size,
441− "name " " nb_components" " nb_bits"
442− );
443− else{
444− const AVPixFmtDescriptor *pixdesc = &av_pix_fmt_descriptors[pix_fmt];
445− snprintf (buf, buf_size,
446− "%-11s %7d %10d",
447− pixdesc->name,
448− pixdesc->nb_components,
449− av_get_bits_per_pixel(pixdesc)
450− );
451− }
437+ av_get_pix_fmt_string(buf, buf_size, pix_fmt);
452438 }
439+#endif
453440
454441 int ff_is_hwaccel_pix_fmt(enum PixelFormat pix_fmt)
455442 {
libavutil/avutil.h+1−1
@@ -40,7 +40,7 @@ · 39 unmodified lines
4040 #define AV_VERSION(a, b, c) AV_VERSION_DOT(a, b, c)
4141
4242 #define LIBAVUTIL_VERSION_MAJOR 50
43−#define LIBAVUTIL_VERSION_MINOR 33
43+#define LIBAVUTIL_VERSION_MINOR 34
4444 #define LIBAVUTIL_VERSION_MICRO 0
4545
4646 #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
libavutil/pixdesc.c+14−0
@@ -851,3 +851,17 @@ int av_get_bits_per_pixel(const AVPixFmtDescriptor *pixdesc) · 850 unmodified lines
851851
852852 return bits >> log2_pixels;
853853 }
854+
855+char *av_get_pix_fmt_string (char *buf, int buf_size, enum PixelFormat pix_fmt)
856+{
857+ /* print header */
858+ if (pix_fmt < 0) {
859+ snprintf (buf, buf_size, "name " " nb_components" " nb_bits");
860+ } else {
861+ const AVPixFmtDescriptor *pixdesc = &av_pix_fmt_descriptors[pix_fmt];
862+ snprintf(buf, buf_size, "%-11s %7d %10d",
863+ pixdesc->name, pixdesc->nb_components, av_get_bits_per_pixel(pixdesc));
864+ }
865+
866+ return buf;
867+}
libavutil/pixdesc.h+12−0
@@ -141,6 +141,18 @@ void av_write_image_line(const uint16_t *src, uint8_t *data[4], const int linesi · 140 unmodified lines
141141 */
142142 enum PixelFormat av_get_pix_fmt(const char *name);
143143
144+/**
145+ * Print in buf the string corresponding to the pixel format with
146+ * number pix_fmt, or an header if pix_fmt is negative.
147+ *
148+ * @param buf the buffer where to write the string
149+ * @param buf_size the size of buf
150+ * @param pix_fmt the number of the pixel format to print the
151+ * corresponding info string, or a negative value to print the
152+ * corresponding header.
153+ */
154+char *av_get_pix_fmt_string (char *buf, int buf_size, enum PixelFormat pix_fmt);
155+
144156 /**
145157 * Return the number of bits per pixel used by the pixel format
146158 * described by pixdesc.

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t