[FFmpeg-devel] [PATCH 04/15] lavc: add new font pseudo-codecs

rcombs rcombs at rcombs.me
Wed Sep 9 09:02:06 EEST 2020


---
 libavcodec/codec_desc.c | 28 ++++++++++++++++++++++++++++
 libavcodec/codec_id.h   |  4 ++++
 2 files changed, 32 insertions(+)

diff --git a/libavcodec/codec_desc.c b/libavcodec/codec_desc.c
index 72ecc1012b..ad044318c7 100644
--- a/libavcodec/codec_desc.c
+++ b/libavcodec/codec_desc.c
@@ -3410,6 +3410,34 @@ static const AVCodecDescriptor codec_descriptors[] = {
         .long_name = NULL_IF_CONFIG_SMALL("binary data"),
         .mime_types= MT("application/octet-stream"),
     },
+    {
+        .id        = AV_CODEC_ID_TTC,
+        .type      = AVMEDIA_TYPE_DATA,
+        .name      = "ttc",
+        .long_name = NULL_IF_CONFIG_SMALL("OpenType font collection"),
+        .mime_types= MT("font/collection"),
+    },
+    {
+        .id        = AV_CODEC_ID_SFNT,
+        .type      = AVMEDIA_TYPE_DATA,
+        .name      = "sfnt",
+        .long_name = NULL_IF_CONFIG_SMALL("SFNT font"),
+        .mime_types= MT("font/sfnt", "application/font-sfnt"),
+    },
+    {
+        .id        = AV_CODEC_ID_WOFF,
+        .type      = AVMEDIA_TYPE_DATA,
+        .name      = "woff",
+        .long_name = NULL_IF_CONFIG_SMALL("WOFF font"),
+        .mime_types= MT("font/woff", "application/font-woff"),
+    },
+    {
+        .id        = AV_CODEC_ID_WOFF2,
+        .type      = AVMEDIA_TYPE_DATA,
+        .name      = "woff2",
+        .long_name = NULL_IF_CONFIG_SMALL("WOFF version 2 font"),
+        .mime_types= MT("font/woff2"),
+    },
     {
         .id        = AV_CODEC_ID_WRAPPED_AVFRAME,
         .type      = AVMEDIA_TYPE_VIDEO,
diff --git a/libavcodec/codec_id.h b/libavcodec/codec_id.h
index e4eca5d580..06e5cdb4cd 100644
--- a/libavcodec/codec_id.h
+++ b/libavcodec/codec_id.h
@@ -552,6 +552,10 @@ enum AVCodecID {
     AV_CODEC_ID_DVD_NAV,
     AV_CODEC_ID_TIMED_ID3,
     AV_CODEC_ID_BIN_DATA,
+    AV_CODEC_ID_TTC,
+    AV_CODEC_ID_SFNT,
+    AV_CODEC_ID_WOFF,
+    AV_CODEC_ID_WOFF2,
 
 
     AV_CODEC_ID_PROBE = 0x19000, ///< codec_id is not known (like AV_CODEC_ID_NONE) but lavf should attempt to identify it
-- 
2.27.0



More information about the ffmpeg-devel mailing list