Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
9265364b
Commit
9265364b
authored
Nov 14, 2016
by
Diego Biurrun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
build: Separate avisynth and avxsynth support
This simplifies the code.
parent
3d6135ea
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
16 deletions
+18
-16
configure
configure
+8
-5
Makefile
libavformat/Makefile
+1
-1
avisynth.c
libavformat/avisynth.c
+9
-10
No files found.
configure
View file @
9265364b
...
...
@@ -188,6 +188,7 @@ External library support:
themselves, not all their features will necessarily be usable by Libav.
--enable-avisynth video frameserver
--enable-avxsynth Linux version of AviSynth
--enable-bzlib bzip2 compression [autodetect]
--enable-frei0r video filtering plugins
--enable-gnutls crypto
...
...
@@ -1268,6 +1269,7 @@ EXTERNAL_LIBRARY_LIST="
$EXTERNAL_LIBRARY_NONFREE_LIST
$EXTERNAL_LIBRARY_VERSION3_LIST
avisynth
avxsynth
bzlib
frei0r
gnutls
...
...
@@ -2243,6 +2245,10 @@ vc1_parser_select="vc1dsp"
mjpeg2jpeg_bsf_select
=
"jpegtables"
# external libraries
avisynth_deps
=
"LoadLibrary"
avxsynth_deps
=
"dlopen"
avisynth_demuxer_deps_any
=
"avisynth avxsynth"
avisynth_demuxer_select
=
"riffdec"
libdcadec_decoder_deps
=
"libdcadec"
libfaac_encoder_deps
=
"libfaac"
libfaac_encoder_select
=
"audio_frame_queue"
...
...
@@ -2302,8 +2308,6 @@ asf_muxer_select="riffenc"
asf_stream_muxer_select
=
"asf_muxer"
avi_demuxer_select
=
"iso_media riffdec"
avi_muxer_select
=
"riffenc"
avisynth_demuxer_deps
=
"avisynth"
avisynth_demuxer_select
=
"riffdec"
caf_demuxer_select
=
"iso_media riffdec"
dash_muxer_select
=
"mp4_muxer"
dirac_demuxer_select
=
"dirac_parser"
...
...
@@ -4610,9 +4614,8 @@ for func in $MATH_FUNCS; do
done
# these are off by default, so fail if requested and not available
enabled avisynth
&&
{
check_lib
"avisynth/avisynth_c.h windows.h"
LoadLibrary
||
check_lib
"avxsynth/avxsynth_c.h dlfcn.h"
dlopen
-ldl
||
die
"ERROR: LoadLibrary/dlopen not found, or avisynth header not found"
;
}
enabled avisynth
&&
{
check_header avisynth/avisynth_c.h
||
die
"ERROR: avisynth/avisynth_c.h header not found"
;
}
enabled avxsynth
&&
require avxsynth
"avxsynth/avxsynth_c.h dlfcn.h"
dlopen
-ldl
enabled cuda
&&
check_lib cuda.h cuInit
-lcuda
enabled frei0r
&&
{
check_header frei0r.h
||
die
"ERROR: frei0r.h header not found"
;
}
enabled gnutls
&&
require_pkg_config gnutls gnutls/gnutls.h gnutls_global_init
...
...
libavformat/Makefile
View file @
9265364b
...
...
@@ -85,7 +85,6 @@ OBJS-$(CONFIG_AU_DEMUXER) += au.o pcm.o
OBJS-$(CONFIG_AU_MUXER)
+=
au.o
rawenc.o
OBJS-$(CONFIG_AVI_DEMUXER)
+=
avidec.o
OBJS-$(CONFIG_AVI_MUXER)
+=
avienc.o
OBJS-$(CONFIG_AVISYNTH)
+=
avisynth.o
OBJS-$(CONFIG_AVM2_MUXER)
+=
swfenc.o
swf.o
OBJS-$(CONFIG_AVS_DEMUXER)
+=
avs.o
voc_packet.o
voc.o
OBJS-$(CONFIG_BETHSOFTVID_DEMUXER)
+=
bethsoftvid.o
...
...
@@ -379,6 +378,7 @@ OBJS-$(CONFIG_YUV4MPEGPIPE_DEMUXER) += yuv4mpegdec.o
OBJS-$(CONFIG_YUV4MPEGPIPE_MUXER)
+=
yuv4mpegenc.o
# external libraries
OBJS-$(CONFIG_AVISYNTH_DEMUXER)
+=
avisynth.o
OBJS-$(CONFIG_LIBRTMP)
+=
librtmp.o
# protocols I/O
...
...
libavformat/avisynth.c
View file @
9265364b
...
...
@@ -32,12 +32,11 @@
#define AVSC_NO_DECLSPEC
/* Platform-specific directives for AviSynth vs AvxSynth. */
#if
def _WIN32
#if
CONFIG_AVISYNTH
#include <windows.h>
#undef EXTERN_C
#include <avisynth/avisynth_c.h>
#define AVISYNTH_LIB "avisynth"
#define USING_AVISYNTH
#else
#include <dlfcn.h>
#include <avxsynth/avxsynth_c.h>
...
...
@@ -66,7 +65,7 @@ typedef struct AviSynthLibrary {
AVSC_DECLARE_FUNC
(
avs_release_value
);
AVSC_DECLARE_FUNC
(
avs_release_video_frame
);
AVSC_DECLARE_FUNC
(
avs_take_clip
);
#if
def USIN
G_AVISYNTH
#if
CONFI
G_AVISYNTH
AVSC_DECLARE_FUNC
(
avs_bits_per_pixel
);
AVSC_DECLARE_FUNC
(
avs_get_height_p
);
AVSC_DECLARE_FUNC
(
avs_get_pitch_p
);
...
...
@@ -146,7 +145,7 @@ static av_cold int avisynth_load_library(void)
LOAD_AVS_FUNC
(
avs_release_value
,
0
);
LOAD_AVS_FUNC
(
avs_release_video_frame
,
0
);
LOAD_AVS_FUNC
(
avs_take_clip
,
0
);
#if
def USIN
G_AVISYNTH
#if
CONFI
G_AVISYNTH
LOAD_AVS_FUNC
(
avs_bits_per_pixel
,
1
);
LOAD_AVS_FUNC
(
avs_get_height_p
,
1
);
LOAD_AVS_FUNC
(
avs_get_pitch_p
,
1
);
...
...
@@ -253,7 +252,7 @@ static int avisynth_create_stream_video(AVFormatContext *s, AVStream *st)
avpriv_set_pts_info
(
st
,
32
,
avs
->
vi
->
fps_denominator
,
avs
->
vi
->
fps_numerator
);
switch
(
avs
->
vi
->
pixel_type
)
{
#if
def USIN
G_AVISYNTH
#if
CONFI
G_AVISYNTH
/* 10~16-bit YUV pix_fmts (AviSynth+) */
case
AVS_CS_YUV444P10
:
st
->
codecpar
->
format
=
AV_PIX_FMT_YUV444P10
;
...
...
@@ -509,7 +508,7 @@ static int avisynth_open_file(AVFormatContext *s)
AviSynthContext
*
avs
=
s
->
priv_data
;
AVS_Value
arg
,
val
;
int
ret
;
#if
def USIN
G_AVISYNTH
#if
CONFI
G_AVISYNTH
char
filename_ansi
[
MAX_PATH
*
4
];
wchar_t
filename_wc
[
MAX_PATH
*
4
];
#endif
...
...
@@ -517,7 +516,7 @@ static int avisynth_open_file(AVFormatContext *s)
if
(
ret
=
avisynth_context_create
(
s
))
return
ret
;
#if
def USIN
G_AVISYNTH
#if
CONFI
G_AVISYNTH
/* Convert UTF-8 to ANSI code page */
MultiByteToWideChar
(
CP_UTF8
,
0
,
s
->
filename
,
-
1
,
filename_wc
,
MAX_PATH
*
4
);
WideCharToMultiByte
(
CP_THREAD_ACP
,
0
,
filename_wc
,
-
1
,
filename_ansi
,
...
...
@@ -541,7 +540,7 @@ static int avisynth_open_file(AVFormatContext *s)
avs
->
clip
=
avs_library
.
avs_take_clip
(
val
,
avs
->
env
);
avs
->
vi
=
avs_library
.
avs_get_video_info
(
avs
->
clip
);
#if
def USIN
G_AVISYNTH
#if
CONFI
G_AVISYNTH
/* On Windows, libav 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
...
...
@@ -605,7 +604,7 @@ static int avisynth_read_packet_video(AVFormatContext *s, AVPacket *pkt,
if
(
discard
)
return
0
;
#if
def USIN
G_AVISYNTH
#if
CONFI
G_AVISYNTH
/* Detect whether we're using AviSynth 2.6 or AviSynth+ by
* looking for whether avs_is_planar_rgb exists. */
if
(
GetProcAddress
(
avs_library
.
library
,
"avs_is_planar_rgb"
)
==
NULL
)
...
...
@@ -649,7 +648,7 @@ static int avisynth_read_packet_video(AVFormatContext *s, AVPacket *pkt,
dst_p
=
pkt
->
data
;
for
(
i
=
0
;
i
<
avs
->
n_planes
;
i
++
)
{
plane
=
avs
->
planes
[
i
];
#if
def USIN
G_AVISYNTH
#if
CONFI
G_AVISYNTH
src_p
=
avs_library
.
avs_get_read_ptr_p
(
frame
,
plane
);
pitch
=
avs_library
.
avs_get_pitch_p
(
frame
,
plane
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment