diff options
author | Rostislav Pehlivanov | 2017-05-08 05:00:41 +0100 |
---|---|---|
committer | Rostislav Pehlivanov | 2017-05-16 11:27:00 +0100 |
commit | f68ea92833474d7f0e493c6009eb533cb9c8bc90 (patch) | |
tree | b71aafdbc8938cedeec7739e57da1a3b39671e1f /libavformat/img2dec.c | |
parent | a13eac5a9959cb14b780b0938f56b627237f3d19 (diff) |
img2dec: add support for piped SVG demuxing
Only checks the extension and MIME type, since determining whether
a file is SVG is difficult since they're just XML files.
Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
Diffstat (limited to 'libavformat/img2dec.c')
-rw-r--r-- | libavformat/img2dec.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/libavformat/img2dec.c b/libavformat/img2dec.c index b454071168..1d532e9343 100644 --- a/libavformat/img2dec.c +++ b/libavformat/img2dec.c @@ -971,6 +971,26 @@ AVInputFormat ff_image_ ## imgname ## _pipe_demuxer = {\ .raw_codec_id = codecid,\ }; +static const AVClass svg_class = { + .class_name = "svg demuxer", + .item_name = av_default_item_name, + .option = ff_img_options, + .version = LIBAVUTIL_VERSION_INT, +}; + +AVInputFormat ff_image_svg_pipe_demuxer = { + .name = "svg_pipe", + .long_name = NULL_IF_CONFIG_SMALL("piped svg sequence"), + .priv_data_size = sizeof(VideoDemuxData), + .read_header = ff_img_read_header, + .read_packet = ff_img_read_packet, + .priv_class = &svg_class, + .mime_type = "image/svg+xml", + .extensions = "svg,svgz", + .flags = AVFMT_GENERIC_INDEX, + .raw_codec_id = AV_CODEC_ID_SVG, +}; + IMAGEAUTO_DEMUXER(bmp, AV_CODEC_ID_BMP) IMAGEAUTO_DEMUXER(dds, AV_CODEC_ID_DDS) IMAGEAUTO_DEMUXER(dpx, AV_CODEC_ID_DPX) |