diff options
Diffstat (limited to 'libavformat/avisynth.c')
-rw-r--r-- | libavformat/avisynth.c | 48 |
1 files changed, 32 insertions, 16 deletions
diff --git a/libavformat/avisynth.c b/libavformat/avisynth.c index fd5f323e13..56700288f7 100644 --- a/libavformat/avisynth.c +++ b/libavformat/avisynth.c @@ -2,20 +2,20 @@ * AviSynth/AvxSynth support * Copyright (c) 2012 AvxSynth Team * - * This file is part of Libav. + * This file is part of FFmpeg * - * Libav is free software; you can redistribute it and/or + * 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 * version 2.1 of the License, or (at your option) any later version. * - * Libav is distributed in the hope that it will be useful, + * FFmpeg is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with Libav; if not, write to the Free Software + * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ @@ -33,20 +33,16 @@ /* Platform-specific directives for AviSynth vs AvxSynth. */ #ifdef _WIN32 - #include <windows.h> + #include "compat/w32dlfcn.h" #undef EXTERN_C - #include <avisynth/avisynth_c.h> + #include "compat/avisynth/avisynth_c.h" #define AVISYNTH_LIB "avisynth" #define USING_AVISYNTH #else #include <dlfcn.h> - #include <avxsynth/avxsynth_c.h> + #include "compat/avisynth/avxsynth_c.h" #define AVISYNTH_NAME "libavxsynth" #define AVISYNTH_LIB AVISYNTH_NAME SLIBSUF - - #define LoadLibrary(x) dlopen(x, RTLD_NOW | RTLD_LOCAL) - #define GetProcAddress dlsym - #define FreeLibrary dlclose #endif typedef struct AviSynthLibrary { @@ -122,12 +118,12 @@ static av_cold void avisynth_atexit_handler(void); static av_cold int avisynth_load_library(void) { - avs_library.library = LoadLibrary(AVISYNTH_LIB); + avs_library.library = dlopen(AVISYNTH_LIB, RTLD_NOW | RTLD_LOCAL); if (!avs_library.library) return AVERROR_UNKNOWN; #define LOAD_AVS_FUNC(name, continue_on_fail) \ - avs_library.name = GetProcAddress(avs_library.library, #name); \ + avs_library.name = dlsym(avs_library.library, #name); \ if (!continue_on_fail && !avs_library.name) \ goto fail; @@ -160,7 +156,7 @@ static av_cold int avisynth_load_library(void) return 0; fail: - FreeLibrary(avs_library.library); + dlclose(avs_library.library); return AVERROR_UNKNOWN; } @@ -228,7 +224,7 @@ static av_cold void avisynth_atexit_handler(void) avisynth_context_destroy(avs); avs = next; } - FreeLibrary(avs_library.library); + dlclose(avs_library.library); avs_atexit_called = 1; } @@ -278,6 +274,18 @@ static int avisynth_create_stream_video(AVFormatContext *s, AVStream *st) st->codecpar->format = AV_PIX_FMT_YUV420P12; planar = 1; break; + case AVS_CS_YUV444P14: + st->codecpar->format = AV_PIX_FMT_YUV444P14; + planar = 1; + break; + case AVS_CS_YUV422P14: + st->codecpar->format = AV_PIX_FMT_YUV422P14; + planar = 1; + break; + case AVS_CS_YUV420P14: + st->codecpar->format = AV_PIX_FMT_YUV420P14; + planar = 1; + break; case AVS_CS_YUV444P16: st->codecpar->format = AV_PIX_FMT_YUV444P16; planar = 1; @@ -340,6 +348,10 @@ static int avisynth_create_stream_video(AVFormatContext *s, AVStream *st) st->codecpar->format = AV_PIX_FMT_GBRP12; planar = 3; break; + case AVS_CS_RGBP14: + st->codecpar->format = AV_PIX_FMT_GBRP14; + planar = 3; + break; case AVS_CS_RGBP16: st->codecpar->format = AV_PIX_FMT_GBRP16; planar = 3; @@ -349,6 +361,10 @@ static int avisynth_create_stream_video(AVFormatContext *s, AVStream *st) st->codecpar->format = AV_PIX_FMT_GBRAP; planar = 5; break; + case AVS_CS_RGBAP10: + st->codecpar->format = AV_PIX_FMT_GBRAP10; + planar = 5; + break; case AVS_CS_RGBAP12: st->codecpar->format = AV_PIX_FMT_GBRAP12; planar = 5; @@ -541,7 +557,7 @@ static int avisynth_open_file(AVFormatContext *s) avs->vi = avs_library.avs_get_video_info(avs->clip); #ifdef USING_AVISYNTH - /* On Windows, libav supports AviSynth interface version 6 or higher. + /* On Windows, FFmpeg supports AviSynth interface version 6 or higher. * This includes AviSynth 2.6 RC1 or higher, and AviSynth+ r1718 or higher, * and excludes 2.5 and the 2.6 alphas. Since AvxSynth identifies itself * as interface version 3 like 2.5.8, this needs to be special-cased. */ |