@@ -14,6 +14,9 @@ libavutil: 2021-04-27
API changes, most recent first:
+2022-05-XX - xxxxxxxxxxx - lavu 57.19.100 - avutil.h
+ Add av_media_type_get_string() which deprecates av_get_media_type_string().
+
2022-03-16 - xxxxxxxxxx - all libraries - version_major.h
Add lib<name>/version_major.h as new installed headers, which only
contain the major version number (and corresponding API deprecation
@@ -21,6 +21,8 @@
#ifndef AVUTIL_AVUTIL_H
#define AVUTIL_AVUTIL_H
+#include "attributes.h"
+
/**
* @file
* @ingroup lavu
@@ -209,9 +211,17 @@ enum AVMediaType {
/**
* Return a string describing the media_type enum, NULL if media_type
* is unknown.
+ *
+ * @deprecated Use av_media_type_get_string() instead.
*/
+attribute_deprecated
const char *av_get_media_type_string(enum AVMediaType media_type);
+/**
+ * Return a string describing the media_type enum, never NULL.
+ */
+const char *av_media_type_get_string(enum AVMediaType media_type);
+
/**
* @defgroup lavu_const Constants
* @{
@@ -37,6 +37,19 @@ const char *av_get_media_type_string(enum AVMediaType media_type)
}
}
+const char *av_media_type_get_string(enum AVMediaType media_type)
+{
+ switch (media_type) {
+ case AVMEDIA_TYPE_UNKNOWN: return "unknown";
+ case AVMEDIA_TYPE_VIDEO: return "video";
+ case AVMEDIA_TYPE_AUDIO: return "audio";
+ case AVMEDIA_TYPE_DATA: return "data";
+ case AVMEDIA_TYPE_SUBTITLE: return "subtitle";
+ case AVMEDIA_TYPE_ATTACHMENT: return "attachment";
+ default: return "invalid_media_type";
+ }
+}
+
char av_get_picture_type_char(enum AVPictureType pict_type)
{
switch (pict_type) {