0
0
mirror of https://github.com/mpv-player/mpv.git synced 2024-09-20 12:02:23 +02:00

Disable functionality requiring libswscale internals

The following are affected: vo_yuv4mpeg, vf_halfpack, vf_palette,
vf_rgb2bgr, vf_yuy2, vo_mga, vo_xmga. In vo_yuv4mpeg, only disable
RGB support (which is probably little used). Others are disabled
completely for now.

vo_mga and vo_xmga are disabled by preventing configure from enabling
them. The rest is placed under LIBSWSCALE_INTERNALS variable which
isn't currently enabled anywhere.
This commit is contained in:
Uoti Urpala 2009-07-22 04:20:11 +03:00
parent d6c410b54c
commit cd4e8dc1fa
4 changed files with 36 additions and 14 deletions

View File

@ -192,6 +192,10 @@ SRCS_COMMON-$(LIBNEMESI) += libmpdemux/demux_nemesi.c \
SRCS_COMMON-$(LIBNUT) += libmpdemux/demux_nut.c
SRCS_COMMON-$(LIBPOSTPROC) += libmpcodecs/vf_pp.c
SRCS_COMMON-$(LIBSMBCLIENT) += stream/stream_smb.c
SRCS_COMMON-$(LIBSWSCALE_INTERNALS) += libmpcodecs/vf_halfpack.c \
libmpcodecs/vf_palette.c \
libmpcodecs/vf_rgb2bgr.c \
libmpcodecs/vf_yuy2.c
SRCS_COMMON-$(LIBTHEORA) += libmpcodecs/vd_theora.c
SRCS_COMMON-$(LIVE555) += libmpdemux/demux_rtp.cpp \
libmpdemux/demux_rtp_codec.cpp \
@ -428,7 +432,6 @@ SRCS_COMMON = asxparser.c \
libmpcodecs/vf_format.c \
libmpcodecs/vf_framestep.c \
libmpcodecs/vf_gradfun.c \
libmpcodecs/vf_halfpack.c \
libmpcodecs/vf_harddup.c \
libmpcodecs/vf_hqdn3d.c \
libmpcodecs/vf_hue.c \
@ -440,14 +443,12 @@ SRCS_COMMON = asxparser.c \
libmpcodecs/vf_noformat.c \
libmpcodecs/vf_noise.c \
libmpcodecs/vf_ow.c \
libmpcodecs/vf_palette.c \
libmpcodecs/vf_perspective.c \
libmpcodecs/vf_phase.c \
libmpcodecs/vf_pp7.c \
libmpcodecs/vf_pullup.c \
libmpcodecs/vf_rectangle.c \
libmpcodecs/vf_remove_logo.c \
libmpcodecs/vf_rgb2bgr.c \
libmpcodecs/vf_rgbtest.c \
libmpcodecs/vf_rotate.c \
libmpcodecs/vf_sab.c \
@ -465,7 +466,6 @@ SRCS_COMMON = asxparser.c \
libmpcodecs/vf_vo.c \
libmpcodecs/vf_yadif.c \
libmpcodecs/vf_yuvcsp.c \
libmpcodecs/vf_yuy2.c \
libmpcodecs/vf_yvu9.c \
libmpdemux/aac_hdr.c \
libmpdemux/asfheader.c \

14
configure vendored
View File

@ -379,8 +379,8 @@ Video output:
--enable-v4l2 enable V4L2 Decoder audio/video output [autodetect]
--enable-dvb enable DVB video output [autodetect]
--enable-dvbhead enable DVB video output (HEAD version) [autodetect]
--enable-mga enable mga_vid video output [autodetect]
--enable-xmga enable mga_vid X11 video output [autodetect]
--enable-mga enable mga_vid video output [broken, disabled]
--enable-xmga enable mga_vid X11 video output [broken, disabled]
--enable-xv enable Xv video output [autodetect]
--enable-xvmc enable XvMC acceleration [disable]
--enable-vdpau enable VDPAU acceleration [autodetect]
@ -642,8 +642,8 @@ _live=auto
_nemesi=auto
_native_rtsp=yes
_xinerama=auto
_mga=auto
_xmga=auto
_mga=no
_xmga=no
_vm=auto
_xf86keysym=auto
_mlib=no #broken, thus disabled
@ -1061,9 +1061,9 @@ for ac_option do
--disable-nemesi) _nemesi=no ;;
--enable-xinerama) _xinerama=yes ;;
--disable-xinerama) _xinerama=no ;;
--enable-mga) _mga=yes ;;
--enable-mga) _mga=no ;;
--disable-mga) _mga=no ;;
--enable-xmga) _xmga=yes ;;
--enable-xmga) _xmga=no ;;
--disable-xmga) _xmga=no ;;
--enable-vm) _vm=yes ;;
--disable-vm) _vm=no ;;
@ -8268,6 +8268,7 @@ LIBPOSTPROC_SO = $_libpostproc_so
LIBSWSCALE = $_libswscale
LIBSWSCALE_A = $_libswscale_a
LIBSWSCALE_SO = $_libswscale_so
LIBSWSCALE_INTERNALS = no
BUILD_STATIC=yes
SRC_PATH=..
@ -8710,6 +8711,7 @@ $def_libpostproc_so
$def_libswscale
$def_libswscale_a
$def_libswscale_so
#undef CONFIG_LIBSWSCALE_INTERNALS
#define CONFIG_DECODERS 1
#define CONFIG_ENCODERS 1

View File

@ -117,12 +117,18 @@ static const vf_info_t* const filter_list[]={
&vf_info_vo,
&vf_info_format,
&vf_info_noformat,
#ifdef CONFIG_LIBSWSCALE_INTERNALS
&vf_info_yuy2,
#endif
&vf_info_flip,
#ifdef CONFIG_LIBSWSCALE_INTERNALS
&vf_info_rgb2bgr,
#endif
&vf_info_rotate,
&vf_info_mirror,
#ifdef CONFIG_LIBSWSCALE_INTERNALS
&vf_info_palette,
#endif
&vf_info_pp7,
#ifdef CONFIG_LIBAVCODEC
&vf_info_lavc,
@ -140,7 +146,9 @@ static const vf_info_t* const filter_list[]={
&vf_info_eq,
&vf_info_eq2,
&vf_info_gradfun,
#ifdef CONFIG_LIBSWSCALE_INTERNALS
&vf_info_halfpack,
#endif
&vf_info_dint,
&vf_info_1bpp,
&vf_info_2xsai,

View File

@ -56,7 +56,9 @@
#include "fastmemcpy.h"
#include "libswscale/swscale.h"
#ifdef CONFIG_LIBSWSCALE_INTERNALS
#include "libswscale/rgb2rgb.h"
#endif
#include "libmpcodecs/vf_scale.h"
#include "libavutil/rational.h"
@ -147,6 +149,7 @@ static int config(uint32_t width, uint32_t height, uint32_t d_width,
return -1;
}
#ifdef CONFIG_LIBSWSCALE_INTERNALS
if(using_format != IMGFMT_YV12)
{
sws_rgb2rgb_init(get_sws_cpuflags());
@ -158,6 +161,7 @@ static int config(uint32_t width, uint32_t height, uint32_t d_width,
return -1;
}
}
#endif
write_bytes = image_width * image_height * 3 / 2;
image = malloc(write_bytes);
@ -228,6 +232,7 @@ static void draw_osd(void)
vo_draw_text(image_width, image_height, draw_alpha);
}
#ifdef CONFIG_LIBSWSCALE_INTERNALS
static void deinterleave_fields(uint8_t *ptr, const int stride,
const int img_height)
{
@ -258,6 +263,7 @@ static void deinterleave_fields(uint8_t *ptr, const int stride,
}
free(line_state);
}
#endif
static void vo_y4m_write(const void *ptr, const size_t num_bytes)
{
@ -318,14 +324,15 @@ static int write_last_frame(void)
static void flip_page (void)
{
uint8_t *upper_y, *upper_u, *upper_v, *rgb_buffer_lower;
int rgb_stride, uv_stride, field_height;
unsigned int i, low_ofs;
fprintf(yuv_out, "FRAME\n");
#ifdef CONFIG_LIBSWSCALE_INTERNALS
if (using_format != IMGFMT_YV12)
{
uint8_t *upper_y, *upper_u, *upper_v, *rgb_buffer_lower;
int rgb_stride, uv_stride, field_height;
unsigned int i, low_ofs;
rgb_stride = image_width * 3;
uv_stride = image_width / 2;
@ -374,6 +381,7 @@ static void flip_page (void)
image_width, image_height,
image_width, uv_stride, rgb_stride);
}
#endif
/* Write progressive frame */
vo_y4m_write(image, write_bytes);
@ -458,9 +466,11 @@ static int query_format(uint32_t format)
{
case IMGFMT_YV12:
return VFCAP_CSP_SUPPORTED|VFCAP_OSD|VFCAP_ACCEPT_STRIDE;
#ifdef CONFIG_LIBSWSCALE_INTERNALS
case IMGFMT_BGR|24:
case IMGFMT_RGB|24:
return VFCAP_CSP_SUPPORTED|VFCAP_CSP_SUPPORTED_BY_HW|VFCAP_OSD|VFCAP_ACCEPT_STRIDE;
#endif
}
}
else
@ -470,9 +480,11 @@ static int query_format(uint32_t format)
{
case IMGFMT_YV12:
return VFCAP_CSP_SUPPORTED|VFCAP_CSP_SUPPORTED_BY_HW|VFCAP_OSD|VFCAP_ACCEPT_STRIDE;
#ifdef CONFIG_LIBSWSCALE_INTERNALS
case IMGFMT_BGR|24:
case IMGFMT_RGB|24:
return VFCAP_CSP_SUPPORTED|VFCAP_OSD|VFCAP_ACCEPT_STRIDE;
#endif
}
}
return 0;