diff options
author | Clément Bœsch <u@pkh.me> | 2017-04-01 12:12:42 +0200 |
---|---|---|
committer | Clément Bœsch <u@pkh.me> | 2017-04-01 12:16:45 +0200 |
commit | f047da4ebe418f95a46b00d38b45e1daf858ec52 (patch) | |
tree | 4bc6a49c600e0aaf171d25f6bbabe0cdd4154946 /libavformat/avisynth.c | |
parent | 2738b4cee01c4dcccce3b79be9b6461830580258 (diff) | |
parent | 3cc3463f306f425f76bd962755df1132eeac6dfa (diff) | |
download | ffmpeg-f047da4ebe418f95a46b00d38b45e1daf858ec52.tar.gz |
Merge commit '3cc3463f306f425f76bd962755df1132eeac6dfa'
* commit '3cc3463f306f425f76bd962755df1132eeac6dfa':
avisynth: Support pix_fmts added to AviSynth+
This commit is mostly a noop, see
92916e8542e425ca20daddb490261a5818643206.
Cosmetics and a small fix are merged.
Merged-by: Clément Bœsch <u@pkh.me>
Diffstat (limited to 'libavformat/avisynth.c')
-rw-r--r-- | libavformat/avisynth.c | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/libavformat/avisynth.c b/libavformat/avisynth.c index 6d47571ad6..56700288f7 100644 --- a/libavformat/avisynth.c +++ b/libavformat/avisynth.c @@ -3,6 +3,7 @@ * Copyright (c) 2012 AvxSynth Team * * This file is part of FFmpeg + * * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either @@ -18,8 +19,11 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include "libavutil/attributes.h" #include "libavutil/internal.h" + #include "libavcodec/internal.h" + #include "avformat.h" #include "internal.h" #include "config.h" @@ -245,7 +249,7 @@ static int avisynth_create_stream_video(AVFormatContext *s, AVStream *st) switch (avs->vi->pixel_type) { #ifdef USING_AVISYNTH -/* 10~16-bit YUV pix_fmts (AviSynth+) */ + /* 10~16-bit YUV pix_fmts (AviSynth+) */ case AVS_CS_YUV444P10: st->codecpar->format = AV_PIX_FMT_YUV444P10; planar = 1; @@ -294,7 +298,7 @@ static int avisynth_create_stream_video(AVFormatContext *s, AVStream *st) st->codecpar->format = AV_PIX_FMT_YUV420P16; planar = 1; break; -/* 8~16-bit YUV pix_fmts with Alpha (AviSynth+) */ + /* 8~16-bit YUV pix_fmts with Alpha (AviSynth+) */ case AVS_CS_YUVA444: st->codecpar->format = AV_PIX_FMT_YUVA444P; planar = 4; @@ -331,7 +335,7 @@ static int avisynth_create_stream_video(AVFormatContext *s, AVStream *st) st->codecpar->format = AV_PIX_FMT_YUVA420P16; planar = 4; break; -/* Planar RGB pix_fmts (AviSynth+) */ + /* Planar RGB pix_fmts (AviSynth+) */ case AVS_CS_RGBP: st->codecpar->format = AV_PIX_FMT_GBRP; planar = 3; @@ -352,7 +356,7 @@ static int avisynth_create_stream_video(AVFormatContext *s, AVStream *st) st->codecpar->format = AV_PIX_FMT_GBRP16; planar = 3; break; -/* Planar RGB pix_fmts with Alpha (AviSynth+) */ + /* Planar RGB pix_fmts with Alpha (AviSynth+) */ case AVS_CS_RGBAP: st->codecpar->format = AV_PIX_FMT_GBRAP; planar = 5; @@ -369,12 +373,12 @@ static int avisynth_create_stream_video(AVFormatContext *s, AVStream *st) st->codecpar->format = AV_PIX_FMT_GBRAP16; planar = 5; break; -/* GRAY16 (AviSynth+) */ + /* GRAY16 (AviSynth+) */ case AVS_CS_Y16: st->codecpar->format = AV_PIX_FMT_GRAY16; planar = 2; break; -/* pix_fmts added in AviSynth 2.6 */ + /* pix_fmts added in AviSynth 2.6 */ case AVS_CS_YV24: st->codecpar->format = AV_PIX_FMT_YUV444P; planar = 1; @@ -391,7 +395,7 @@ static int avisynth_create_stream_video(AVFormatContext *s, AVStream *st) st->codecpar->format = AV_PIX_FMT_GRAY8; planar = 2; break; -/* 16-bit packed RGB pix_fmts (AviSynth+) */ + /* 16-bit packed RGB pix_fmts (AviSynth+) */ case AVS_CS_BGR48: st->codecpar->format = AV_PIX_FMT_BGR48; break; @@ -399,7 +403,7 @@ static int avisynth_create_stream_video(AVFormatContext *s, AVStream *st) st->codecpar->format = AV_PIX_FMT_BGRA64; break; #endif -/* AviSynth 2.5 and AvxSynth pix_fmts */ + /* AviSynth 2.5 and AvxSynth pix_fmts */ case AVS_CS_BGR24: st->codecpar->format = AV_PIX_FMT_BGR24; break; @@ -606,6 +610,7 @@ static int avisynth_read_packet_video(AVFormatContext *s, AVPacket *pkt, const unsigned char *src_p; int n, i, plane, rowsize, planeheight, pitch, bits; const char *error; + int avsplus av_unused; if (avs->curr_frame >= avs->vi->num_frames) return AVERROR_EOF; @@ -618,9 +623,6 @@ static int avisynth_read_packet_video(AVFormatContext *s, AVPacket *pkt, #ifdef USING_AVISYNTH /* Detect whether we're using AviSynth 2.6 or AviSynth+ by * looking for whether avs_is_planar_rgb exists. */ - - int avsplus; - if (GetProcAddress(avs_library.library, "avs_is_planar_rgb") == NULL) avsplus = 0; else @@ -683,7 +685,7 @@ static int avisynth_read_packet_video(AVFormatContext *s, AVPacket *pkt, } #ifdef USING_AVISYNTH - /* Flip Planar RGB video. */ + /* Flip Planar RGB video */ if (avsplus && (avs_library.avs_is_planar_rgb(avs->vi) || avs_library.avs_is_planar_rgba(avs->vi))) { src_p = src_p + (planeheight - 1) * pitch; |