diff mbox series

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

Message ID 20200909060217.25794-4-rcombs@rcombs.me
State New
Headers show
Series [FFmpeg-devel,01/15] lavc/codec_desc: add MIME type to AV_CODEC_ID_TEXT
Related show

Checks

Context Check Description
andriy/default pending
andriy/make success Make finished
andriy/make_fate success Make fate finished

Commit Message

Ridley Combs Sept. 9, 2020, 6:02 a.m. UTC
---
 libavcodec/codec_desc.c | 28 ++++++++++++++++++++++++++++
 libavcodec/codec_id.h   |  4 ++++
 2 files changed, 32 insertions(+)
diff mbox series

Patch

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