mirror of
https://github.com/mpv-player/mpv
synced 2024-12-24 15:52:25 +00:00
basic xvmc image support
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@10317 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
26df2d9797
commit
fd55a47f01
@ -158,6 +158,10 @@ static int add_to_format(char *s, char *alias,unsigned int *fourcc, unsigned int
|
|||||||
{"BGR1", IMGFMT_BGR|1},
|
{"BGR1", IMGFMT_BGR|1},
|
||||||
|
|
||||||
{"MPES", IMGFMT_MPEGPES},
|
{"MPES", IMGFMT_MPEGPES},
|
||||||
|
|
||||||
|
{"IDCT_MPEG2",IMGFMT_XVMC_IDCT_MPEG2},
|
||||||
|
{"MOCO_MPEG2",IMGFMT_XVMC_MOCO_MPEG2},
|
||||||
|
|
||||||
{NULL, 0}
|
{NULL, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
38
configure
vendored
38
configure
vendored
@ -215,6 +215,7 @@ Video output:
|
|||||||
--enable-xmga build with mga_vid X Window support
|
--enable-xmga build with mga_vid X Window support
|
||||||
(check for X & /dev/mga_vid) [autodetect]
|
(check for X & /dev/mga_vid) [autodetect]
|
||||||
--enable-xv build with Xv render support for X 4.x [autodetect]
|
--enable-xv build with Xv render support for X 4.x [autodetect]
|
||||||
|
--enable-xvmc build with XvMC acceleration for X 4.x [autodetect]
|
||||||
--enable-vm build with XF86VidMode support for X11 [autodetect]
|
--enable-vm build with XF86VidMode support for X11 [autodetect]
|
||||||
--enable-xinerama build with Xinerama support for X11 [autodetect]
|
--enable-xinerama build with Xinerama support for X11 [autodetect]
|
||||||
--enable-x11 build with X11 render support [autodetect]
|
--enable-x11 build with X11 render support [autodetect]
|
||||||
@ -288,6 +289,7 @@ Use these options if autodetection fails:
|
|||||||
--with-win32libdir=DIR W*ndows DLL files in DIR
|
--with-win32libdir=DIR W*ndows DLL files in DIR
|
||||||
--with-xanimlibdir=DIR XAnim DLL files in DIR
|
--with-xanimlibdir=DIR XAnim DLL files in DIR
|
||||||
--with-reallibdir=DIR RealPlayer DLL files in DIR
|
--with-reallibdir=DIR RealPlayer DLL files in DIR
|
||||||
|
--with-xvmclib=PATH path to adapter specific XvMCxxxxx.so (e.g. NVIDIA)
|
||||||
--with-xvidcore=PATH path to XviD libxvidcore.a
|
--with-xvidcore=PATH path to XviD libxvidcore.a
|
||||||
(e.g. /opt/lib/libxvidcore.a)
|
(e.g. /opt/lib/libxvidcore.a)
|
||||||
--with-sdl-config=PATH path to sdl*-config (e.g. /opt/bin/sdl-config)
|
--with-sdl-config=PATH path to sdl*-config (e.g. /opt/bin/sdl-config)
|
||||||
@ -991,6 +993,7 @@ fi
|
|||||||
|
|
||||||
|
|
||||||
_prefix="/usr/local"
|
_prefix="/usr/local"
|
||||||
|
_xvmclib="XvMCNVIDIA"
|
||||||
|
|
||||||
# GOTCHA: the variables below defines the default behavior for autodetection
|
# GOTCHA: the variables below defines the default behavior for autodetection
|
||||||
# and have - unless stated otherwise - at least 2 states : yes no
|
# and have - unless stated otherwise - at least 2 states : yes no
|
||||||
@ -1003,6 +1006,7 @@ _mencoder=yes
|
|||||||
_x11=auto
|
_x11=auto
|
||||||
_dga=auto # 1 2 no auto
|
_dga=auto # 1 2 no auto
|
||||||
_xv=auto
|
_xv=auto
|
||||||
|
_xvmc=no #auto when complete
|
||||||
_sdl=auto
|
_sdl=auto
|
||||||
_directx=auto
|
_directx=auto
|
||||||
_win32waveout=auto
|
_win32waveout=auto
|
||||||
@ -1129,6 +1133,8 @@ for ac_option do
|
|||||||
--disable-x11) _x11=no ;;
|
--disable-x11) _x11=no ;;
|
||||||
--enable-xv) _xv=yes ;;
|
--enable-xv) _xv=yes ;;
|
||||||
--disable-xv) _xv=no ;;
|
--disable-xv) _xv=no ;;
|
||||||
|
--enable-xvmc) _xvmc=yes ;;
|
||||||
|
--disable-xvmc) _xvmc=no ;;
|
||||||
--enable-sdl) _sdl=yes ;;
|
--enable-sdl) _sdl=yes ;;
|
||||||
--disable-sdl) _sdl=no ;;
|
--disable-sdl) _sdl=no ;;
|
||||||
--enable-directx) _directx=yes ;;
|
--enable-directx) _directx=yes ;;
|
||||||
@ -1417,6 +1423,9 @@ for ac_option do
|
|||||||
--with-dxr2incdir=*)
|
--with-dxr2incdir=*)
|
||||||
_inc_dxr2=-I`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -I,g'`
|
_inc_dxr2=-I`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -I,g'`
|
||||||
;;
|
;;
|
||||||
|
--with-xvmclib=*)
|
||||||
|
_xvmclib=`echo $ac_option | cut -d '=' -f 2`
|
||||||
|
;;
|
||||||
--with-xvidcore=*)
|
--with-xvidcore=*)
|
||||||
_xvidcore=`echo $ac_option | cut -d '=' -f 2`
|
_xvidcore=`echo $ac_option | cut -d '=' -f 2`
|
||||||
;;
|
;;
|
||||||
@ -2736,6 +2745,32 @@ fi
|
|||||||
echores "$_xv"
|
echores "$_xv"
|
||||||
|
|
||||||
|
|
||||||
|
echocheck "XvMC"
|
||||||
|
if test "$_x11" = yes && test "$_xv" && test "$_xvmc" != no ; then
|
||||||
|
_xvmc=no
|
||||||
|
cat > $TMPC <<EOF
|
||||||
|
#include <X11/Xlib.h>
|
||||||
|
#include <X11/extensions/Xvlib.h>
|
||||||
|
#include <X11/extensions/XvMClib.h>
|
||||||
|
int main(void) {
|
||||||
|
(void) XvMCQueryExtension(0,0,0);
|
||||||
|
(void) XvMCCreateContext(0,0,0,0,0,0,0);
|
||||||
|
return 0; }
|
||||||
|
EOF
|
||||||
|
cc_check $_inc_x11 $_ld_x11 $_ld_xv -lXvMC -l$_xvmclib && _xvmc=yes
|
||||||
|
fi
|
||||||
|
if test "$_xvmc" = yes ; then
|
||||||
|
_def_xvmc='#define HAVE_XVMC 1'
|
||||||
|
_ld_xvmc="-lXvMC -l$_xvmclib"
|
||||||
|
_vosrc="$_vosrc vo_xvmc.c"
|
||||||
|
_vomodules="xvmc $_vomodules"
|
||||||
|
else
|
||||||
|
_def_xvmc='#undef HAVE_XVMC'
|
||||||
|
_novomodules="xvmc $_novomodules"
|
||||||
|
fi
|
||||||
|
echores "$_xvmc"
|
||||||
|
|
||||||
|
|
||||||
echocheck "Xinerama"
|
echocheck "Xinerama"
|
||||||
if test "$_x11" = yes && test "$_xinerama" != no ; then
|
if test "$_x11" = yes && test "$_xinerama" != no ; then
|
||||||
cat > $TMPC <<EOF
|
cat > $TMPC <<EOF
|
||||||
@ -5310,7 +5345,7 @@ X11DIR = $_ld_x11
|
|||||||
SRC_PATH=.
|
SRC_PATH=.
|
||||||
|
|
||||||
# video output
|
# video output
|
||||||
X_LIB = $_ld_gl $_ld_dga $_ld_xv $_ld_vm $_ld_xinerama $_ld_x11 $_ld_mad $_ld_sock
|
X_LIB = $_ld_gl $_ld_dga $_ld_xv $_ld_xvmc $_ld_vm $_ld_xinerama $_ld_x11 $_ld_mad $_ld_sock
|
||||||
GGI_LIB = $_ld_ggi
|
GGI_LIB = $_ld_ggi
|
||||||
MLIB_LIB = $_ld_mlib
|
MLIB_LIB = $_ld_mlib
|
||||||
MLIB_INC = $_inc_mlib
|
MLIB_INC = $_inc_mlib
|
||||||
@ -5883,6 +5918,7 @@ $_def_mlib // Sun mediaLib, available only on solaris
|
|||||||
#define SCREEN_SIZE_Y 1
|
#define SCREEN_SIZE_Y 1
|
||||||
$_def_x11
|
$_def_x11
|
||||||
$_def_xv
|
$_def_xv
|
||||||
|
$_def_xvmc
|
||||||
$_def_vm
|
$_def_vm
|
||||||
$_def_xinerama
|
$_def_xinerama
|
||||||
$_def_gl
|
$_def_gl
|
||||||
|
@ -40,6 +40,7 @@ videocodec mpeg12
|
|||||||
; dll "libmpeg2"
|
; dll "libmpeg2"
|
||||||
out YV12,I420,IYUV
|
out YV12,I420,IYUV
|
||||||
|
|
||||||
|
|
||||||
videocodec ffmpeg12
|
videocodec ffmpeg12
|
||||||
info "FFmpeg MPEG 1/2"
|
info "FFmpeg MPEG 1/2"
|
||||||
status working
|
status working
|
||||||
@ -51,6 +52,18 @@ videocodec ffmpeg12
|
|||||||
dll "mpegvideo"
|
dll "mpegvideo"
|
||||||
out YV12,I420,IYUV
|
out YV12,I420,IYUV
|
||||||
|
|
||||||
|
videocodec ffmpeg12mc
|
||||||
|
info "FFmpeg MPEG 1/2"
|
||||||
|
status buggy
|
||||||
|
format 0x10000001 ; mpeg 1
|
||||||
|
format 0x10000002 ; mpeg 2
|
||||||
|
fourcc mpg1,mpg2
|
||||||
|
fourcc PIM1 ; Pinnacle hardware-mpeg1
|
||||||
|
driver ffmpeg
|
||||||
|
dll "mpegvideo_xvmc"
|
||||||
|
out IDCT_MPEG2
|
||||||
|
out MOCO_MPEG2
|
||||||
|
|
||||||
; we have only native opensource codecs for these:
|
; we have only native opensource codecs for these:
|
||||||
|
|
||||||
videocodec nuv
|
videocodec nuv
|
||||||
|
@ -54,6 +54,8 @@ char *vo_format_name(int format)
|
|||||||
case IMGFMT_YUVP: return("Packed YUVP");
|
case IMGFMT_YUVP: return("Packed YUVP");
|
||||||
case IMGFMT_UYVP: return("Packed UYVP");
|
case IMGFMT_UYVP: return("Packed UYVP");
|
||||||
case IMGFMT_MPEGPES: return("Mpeg PES");
|
case IMGFMT_MPEGPES: return("Mpeg PES");
|
||||||
|
case IMGFMT_XVMC_MOCO_MPEG2: return("MPEG1/2 Motion Compensation");
|
||||||
|
case IMGFMT_XVMC_IDCT_MPEG2: return("MPEG1/2 Motion Compensation and IDCT");
|
||||||
}
|
}
|
||||||
return("Unknown");
|
return("Unknown");
|
||||||
}
|
}
|
||||||
|
@ -77,6 +77,14 @@
|
|||||||
/* Compressed Formats */
|
/* Compressed Formats */
|
||||||
#define IMGFMT_MPEGPES (('M'<<24)|('P'<<16)|('E'<<8)|('S'))
|
#define IMGFMT_MPEGPES (('M'<<24)|('P'<<16)|('E'<<8)|('S'))
|
||||||
|
|
||||||
|
// I think that this code could not be used by any other codec/format
|
||||||
|
#define IMGFMT_XVMC 0x1DC70000
|
||||||
|
#define IMGFMT_XVMC_MASK 0xFFFF0000
|
||||||
|
#define IMGFMT_IS_XVMC(fmt) (((fmt)&IMGFMT_XVMC_MASK)==IMGFMT_XVMC)
|
||||||
|
//these are chroma420
|
||||||
|
#define IMGFMT_XVMC_MOCO_MPEG2 (IMGFMT_XVMC|0x02)
|
||||||
|
#define IMGFMT_XVMC_IDCT_MPEG2 (IMGFMT_XVMC|0x82)
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
void* data;
|
void* data;
|
||||||
int size;
|
int size;
|
||||||
|
@ -95,6 +95,10 @@ static inline void mp_image_setfmt(mp_image_t* mpi,unsigned int out_fmt){
|
|||||||
mpi->bpp=0;
|
mpi->bpp=0;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if(IMGFMT_IS_XVMC(out_fmt)){
|
||||||
|
mpi->bpp=0;
|
||||||
|
return;
|
||||||
|
}
|
||||||
mpi->num_planes=1;
|
mpi->num_planes=1;
|
||||||
if (IMGFMT_IS_RGB(out_fmt)) {
|
if (IMGFMT_IS_RGB(out_fmt)) {
|
||||||
if (IMGFMT_RGB_DEPTH(out_fmt) < 8 && !(out_fmt&128))
|
if (IMGFMT_RGB_DEPTH(out_fmt) < 8 && !(out_fmt&128))
|
||||||
|
@ -53,6 +53,7 @@ extern vo_functions_t video_out_mga;
|
|||||||
extern vo_functions_t video_out_xmga;
|
extern vo_functions_t video_out_xmga;
|
||||||
extern vo_functions_t video_out_x11;
|
extern vo_functions_t video_out_x11;
|
||||||
extern vo_functions_t video_out_xover;
|
extern vo_functions_t video_out_xover;
|
||||||
|
extern vo_functions_t video_out_xvmc;
|
||||||
extern vo_functions_t video_out_xv;
|
extern vo_functions_t video_out_xv;
|
||||||
extern vo_functions_t video_out_gl;
|
extern vo_functions_t video_out_gl;
|
||||||
extern vo_functions_t video_out_gl2;
|
extern vo_functions_t video_out_gl2;
|
||||||
@ -127,6 +128,9 @@ vo_functions_t* video_out_drivers[] =
|
|||||||
#ifdef HAVE_TDFXFB
|
#ifdef HAVE_TDFXFB
|
||||||
&video_out_tdfxfb,
|
&video_out_tdfxfb,
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef HAVE_XVMC
|
||||||
|
&video_out_xvmc,
|
||||||
|
#endif
|
||||||
#ifdef HAVE_XV
|
#ifdef HAVE_XV
|
||||||
&video_out_xv,
|
&video_out_xv,
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user