mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-11-26 19:01:44 +02:00
avisynth: Fix compilation against current 2.6 header(s).
AviSynth 2.6 (and by extension, AviSynth+) moves these functions into AVSC_API. This requires both adjusting their normal use, and for AvxSynth, adjusting the position/use of the USING_AVISYNTH ifdefs. Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
This commit is contained in:
parent
1ddd3e23a4
commit
a8c99205ca
@ -74,6 +74,17 @@ typedef struct AviSynthLibrary {
|
|||||||
AVSC_DECLARE_FUNC(avs_release_value);
|
AVSC_DECLARE_FUNC(avs_release_value);
|
||||||
AVSC_DECLARE_FUNC(avs_release_video_frame);
|
AVSC_DECLARE_FUNC(avs_release_video_frame);
|
||||||
AVSC_DECLARE_FUNC(avs_take_clip);
|
AVSC_DECLARE_FUNC(avs_take_clip);
|
||||||
|
#ifdef USING_AVISYNTH
|
||||||
|
AVSC_DECLARE_FUNC(avs_bits_per_pixel);
|
||||||
|
AVSC_DECLARE_FUNC(avs_get_height_p);
|
||||||
|
AVSC_DECLARE_FUNC(avs_get_pitch_p);
|
||||||
|
AVSC_DECLARE_FUNC(avs_get_read_ptr_p);
|
||||||
|
AVSC_DECLARE_FUNC(avs_get_row_size_p);
|
||||||
|
AVSC_DECLARE_FUNC(avs_is_yv24);
|
||||||
|
AVSC_DECLARE_FUNC(avs_is_yv16);
|
||||||
|
AVSC_DECLARE_FUNC(avs_is_yv411);
|
||||||
|
AVSC_DECLARE_FUNC(avs_is_y8);
|
||||||
|
#endif
|
||||||
#undef AVSC_DECLARE_FUNC
|
#undef AVSC_DECLARE_FUNC
|
||||||
} AviSynthLibrary;
|
} AviSynthLibrary;
|
||||||
|
|
||||||
@ -137,6 +148,17 @@ static av_cold int avisynth_load_library(void)
|
|||||||
LOAD_AVS_FUNC(avs_release_value, 0);
|
LOAD_AVS_FUNC(avs_release_value, 0);
|
||||||
LOAD_AVS_FUNC(avs_release_video_frame, 0);
|
LOAD_AVS_FUNC(avs_release_video_frame, 0);
|
||||||
LOAD_AVS_FUNC(avs_take_clip, 0);
|
LOAD_AVS_FUNC(avs_take_clip, 0);
|
||||||
|
#ifdef USING_AVISYNTH
|
||||||
|
LOAD_AVS_FUNC(avs_bits_per_pixel, 0);
|
||||||
|
LOAD_AVS_FUNC(avs_get_height_p, 0);
|
||||||
|
LOAD_AVS_FUNC(avs_get_pitch_p, 0);
|
||||||
|
LOAD_AVS_FUNC(avs_get_read_ptr_p, 0);
|
||||||
|
LOAD_AVS_FUNC(avs_get_row_size_p, 0);
|
||||||
|
LOAD_AVS_FUNC(avs_is_yv24, 0);
|
||||||
|
LOAD_AVS_FUNC(avs_is_yv16, 0);
|
||||||
|
LOAD_AVS_FUNC(avs_is_yv411, 0);
|
||||||
|
LOAD_AVS_FUNC(avs_is_y8, 0);
|
||||||
|
#endif
|
||||||
#undef LOAD_AVS_FUNC
|
#undef LOAD_AVS_FUNC
|
||||||
|
|
||||||
atexit(avisynth_atexit_handler);
|
atexit(avisynth_atexit_handler);
|
||||||
@ -460,17 +482,19 @@ static int avisynth_read_packet_video(AVFormatContext *s, AVPacket *pkt,
|
|||||||
* Since AvxSynth doesn't have these functions, special-case
|
* Since AvxSynth doesn't have these functions, special-case
|
||||||
* it in order to avoid implicit declaration errors. */
|
* it in order to avoid implicit declaration errors. */
|
||||||
|
|
||||||
if (avs_is_yv24(avs->vi))
|
if (avs_library.avs_is_yv24(avs->vi))
|
||||||
bits = 24;
|
bits = 24;
|
||||||
else if (avs_is_yv16(avs->vi))
|
else if (avs_library.avs_is_yv16(avs->vi))
|
||||||
bits = 16;
|
bits = 16;
|
||||||
else if (avs_is_yv411(avs->vi))
|
else if (avs_library.avs_is_yv411(avs->vi))
|
||||||
bits = 12;
|
bits = 12;
|
||||||
else if (avs_is_y8(avs->vi))
|
else if (avs_library.avs_is_y8(avs->vi))
|
||||||
bits = 8;
|
bits = 8;
|
||||||
else
|
else
|
||||||
#endif
|
bits = avs_library.avs_bits_per_pixel(avs->vi);
|
||||||
|
#else
|
||||||
bits = avs_bits_per_pixel(avs->vi);
|
bits = avs_bits_per_pixel(avs->vi);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Without the cast to int64_t, calculation overflows at about 9k x 9k
|
/* Without the cast to int64_t, calculation overflows at about 9k x 9k
|
||||||
* resolution. */
|
* resolution. */
|
||||||
@ -499,11 +523,19 @@ static int avisynth_read_packet_video(AVFormatContext *s, AVPacket *pkt,
|
|||||||
dst_p = pkt->data;
|
dst_p = pkt->data;
|
||||||
for (i = 0; i < avs->n_planes; i++) {
|
for (i = 0; i < avs->n_planes; i++) {
|
||||||
plane = avs->planes[i];
|
plane = avs->planes[i];
|
||||||
|
#ifdef USING_AVISYNTH
|
||||||
|
src_p = avs_library.avs_get_read_ptr_p(frame, plane);
|
||||||
|
pitch = avs_library.avs_get_pitch_p(frame, plane);
|
||||||
|
|
||||||
|
rowsize = avs_library.avs_get_row_size_p(frame, plane);
|
||||||
|
planeheight = avs_library.avs_get_height_p(frame, plane);
|
||||||
|
#else
|
||||||
src_p = avs_get_read_ptr_p(frame, plane);
|
src_p = avs_get_read_ptr_p(frame, plane);
|
||||||
pitch = avs_get_pitch_p(frame, plane);
|
pitch = avs_get_pitch_p(frame, plane);
|
||||||
|
|
||||||
rowsize = avs_get_row_size_p(frame, plane);
|
rowsize = avs_get_row_size_p(frame, plane);
|
||||||
planeheight = avs_get_height_p(frame, plane);
|
planeheight = avs_get_height_p(frame, plane);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Flip RGB video. */
|
/* Flip RGB video. */
|
||||||
if (avs_is_rgb24(avs->vi) || avs_is_rgb(avs->vi)) {
|
if (avs_is_rgb24(avs->vi) || avs_is_rgb(avs->vi)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user