mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-24 11:16:51 +00:00
new package:
- add mplayer for upcoming enna
This commit is contained in:
parent
c09e0a3a44
commit
0c5271baaf
3875
packages/multimedia/mplayer/720_dvdnav-colorspu.diff
Normal file
3875
packages/multimedia/mplayer/720_dvdnav-colorspu.diff
Normal file
File diff suppressed because it is too large
Load Diff
289
packages/multimedia/mplayer/build
Normal file
289
packages/multimedia/mplayer/build
Normal file
@ -0,0 +1,289 @@
|
||||
#!/bin/sh
|
||||
|
||||
. config/options
|
||||
|
||||
$SCRIPTS/build toolchain
|
||||
$SCRIPTS/build zlib
|
||||
$SCRIPTS/build alsa-lib
|
||||
$SCRIPTS/build freetype
|
||||
$SCRIPTS/build fribidi
|
||||
$SCRIPTS/build libiconv
|
||||
$SCRIPTS/build libcdio
|
||||
$SCRIPTS/build lame
|
||||
$SCRIPTS/build ffmpeg-mt
|
||||
$SCRIPTS/build libdvdread
|
||||
$SCRIPTS/build libdvdcss
|
||||
$SCRIPTS/build libdvdnav
|
||||
|
||||
if [ "$DISPLAYSERVER" = xorg-server ]; then
|
||||
$SCRIPTS/build libX11
|
||||
$SCRIPTS/build libXv
|
||||
$SCRIPTS/build libXvMC
|
||||
$SCRIPTS/build $MESA
|
||||
$SCRIPTS/build xorg-server
|
||||
$SCRIPTS/build xf86-video-intel
|
||||
|
||||
MPLAYER_CONFIGOPTS="--enable-xv \
|
||||
--enable-xvmc \
|
||||
--disable-vdpau \
|
||||
--disable-vm \
|
||||
--disable-xinerama \
|
||||
--enable-x11 \
|
||||
--enable-xf86keysym"
|
||||
else
|
||||
MPLAYER_CONFIGOPTS="--disable-xv \
|
||||
--disable-xvmc \
|
||||
--disable-vdpau \
|
||||
--disable-vm \
|
||||
--disable-xinerama \
|
||||
--disable-x11 \
|
||||
--disable-xf86keysym"
|
||||
fi
|
||||
|
||||
#$SCRIPTS/build vesautils
|
||||
|
||||
# setup_toolchain --optimize target
|
||||
|
||||
EXTRA_LIBDIR="-L$SYSROOT_PREFIX/usr/lib"
|
||||
EXTRA_INCDIR="-I$SYSROOT_PREFIX/usr/include"
|
||||
EXTRA_LIBS="-liconv"
|
||||
EXTRA_LIBS="$EXTRA_LIBS -lavcodec -lavformat -lavutil -lpostproc -lswscale"
|
||||
CFLAGS="$CFLAGS -ffast-math -DFIXED_POINT"
|
||||
|
||||
VIDIX_DRV="cyberblade,ivtv,mach64,mga,mga_crtc2,nvidia,pm2,pm3,radeon,rage128,s3,sis,unichrome"
|
||||
CODECS_DIR="/storage/.codecs"
|
||||
|
||||
if [ "$DEBUG" = yes ]; then
|
||||
DEBUG_CONFIG="--enable-debug=3 \
|
||||
--enable-sighandler \
|
||||
--enable-crash-debug"
|
||||
else
|
||||
DEBUG_CONFIG="--disable-debug \
|
||||
--disable-sighandler \
|
||||
--disable-crash-debug"
|
||||
fi
|
||||
|
||||
# --nm=$NM \
|
||||
# --ar=$AR \
|
||||
# --ranlib=$RANLIB \
|
||||
#\
|
||||
|
||||
cd $PKG_BUILD
|
||||
./configure --prefix=/usr \
|
||||
--confdir=/usr/etc/mplayer \
|
||||
--libdir=/usr/lib \
|
||||
--codecsdir=$CODECS_DIR \
|
||||
--win32codecsdir=$CODECS_DIR \
|
||||
--xanimcodecsdir=$CODECS_DIR \
|
||||
--realcodecsdir=$CODECS_DIR \
|
||||
\
|
||||
--enable-runtime-cpudetection \
|
||||
--enable-cross-compile \
|
||||
--cc=$TARGET_CC \
|
||||
--host-cc=$HOST_CC \
|
||||
--as=$TARGET_AS \
|
||||
--target="$TARGET_ARCH-linux" \
|
||||
--disable-static \
|
||||
--disable-dynamic-plugins \
|
||||
--disable-profile \
|
||||
--extra-ldflags="$EXTRA_LIBDIR" \
|
||||
--extra-cflags="$EXTRA_INCDIR" \
|
||||
--extra-libs="$EXTRA_LIBS" \
|
||||
\
|
||||
$DEBUG_CONFIG \
|
||||
$MPLAYER_CONFIG \
|
||||
\
|
||||
--disable-dynamic-plugins \
|
||||
--disable-shm \
|
||||
\
|
||||
--charset=utf8 \
|
||||
--language-msg=en \
|
||||
--language=all \
|
||||
\
|
||||
--disable-mencoder \
|
||||
--enable-mplayer \
|
||||
--disable-gui \
|
||||
--disable-gtk1 \
|
||||
--enable-largefiles \
|
||||
--disable-linux-devfs \
|
||||
--disable-termcap \
|
||||
--disable-termios \
|
||||
--enable-iconv \
|
||||
--disable-langinfo \
|
||||
\
|
||||
--disable-lirc \
|
||||
--disable-lircc \
|
||||
--disable-joystick \
|
||||
--disable-apple-remote \
|
||||
--disable-apple-ir \
|
||||
\
|
||||
--disable-radio \
|
||||
--disable-radio-capture \
|
||||
--disable-radio-v4l2 \
|
||||
--disable-radio-bsdbt848 \
|
||||
--enable-tv \
|
||||
--disable-tv-v4l1 \
|
||||
--enable-tv-v4l2 \
|
||||
--disable-tv-bsdbt848 \
|
||||
--enable-tv-teletext \
|
||||
--disable-pvr \
|
||||
--enable-rtc \
|
||||
--enable-network \
|
||||
--disable-winsock2_h \
|
||||
--disable-smb \
|
||||
--disable-live \
|
||||
--disable-nemesi \
|
||||
--enable-vcd \
|
||||
--enable-dvdnav \
|
||||
--with-dvdnav-config="$ROOT/$TOOLCHAIN/bin/dvdnav-config" \
|
||||
--enable-dvdread \
|
||||
--with-dvdread-config="$ROOT/$TOOLCHAIN/bin/dvdread-config" \
|
||||
--disable-dvdread-internal \
|
||||
--disable-libdvdcss-internal \
|
||||
--disable-cdparanoia \
|
||||
--disable-cddb \
|
||||
--enable-bitmap-font \
|
||||
--enable-freetype \
|
||||
--with-freetype-config="$ROOT/$TOOLCHAIN/bin/freetype-config" \
|
||||
--disable-fontconfig \
|
||||
--disable-unrarexec \
|
||||
--enable-menu \
|
||||
--disable-sortsub \
|
||||
--enable-fribidi \
|
||||
--with-fribidi-config="$ROOT/$TOOLCHAIN/bin/fribidi-config" \
|
||||
--disable-enca \
|
||||
--disable-maemo \
|
||||
--disable-macosx-finder \
|
||||
--disable-macosx-bundle \
|
||||
--enable-inet6 \
|
||||
--enable-gethostbyname2 \
|
||||
--enable-ftp \
|
||||
--disable-vstream \
|
||||
--enable-pthreads \
|
||||
--disable-w32threads \
|
||||
--enable-ass \
|
||||
--disable-rpath \
|
||||
\
|
||||
--disable-libnut \
|
||||
--disable-libavutil_a \
|
||||
--disable-libavcodec_a \
|
||||
--disable-libavformat_a \
|
||||
--disable-libpostproc_a \
|
||||
--disable-libswscale_a \
|
||||
--enable-libavutil_so \
|
||||
--enable-libavcodec_so \
|
||||
--enable-libavformat_so \
|
||||
--enable-libpostproc_so \
|
||||
--enable-libswscale_so \
|
||||
--enable-libavcodec_mpegaudio_hp \
|
||||
\
|
||||
--disable-gif \
|
||||
--enable-png \
|
||||
--disable-mng \
|
||||
--disable-jpeg \
|
||||
--disable-libcdio \
|
||||
--disable-liblzo \
|
||||
--enable-win32dll \
|
||||
--enable-qtx \
|
||||
--enable-xanim \
|
||||
--enable-real \
|
||||
--disable-xvid \
|
||||
--enable-xvid-lavc \
|
||||
--disable-x264 \
|
||||
--enable-x264-lavc \
|
||||
--disable-libdirac-lavc \
|
||||
--disable-libschroedinger-lavc \
|
||||
\
|
||||
--disable-tremor-internal \
|
||||
--disable-tremor-low \
|
||||
--disable-tremor \
|
||||
--disable-libvorbis \
|
||||
--disable-speex \
|
||||
--disable-theora \
|
||||
--disable-faad \
|
||||
--enable-faad-internal \
|
||||
--disable-faad-fixed \
|
||||
--disable-faac \
|
||||
--enable-faac-lavc \
|
||||
--disable-ladspa \
|
||||
--disable-libbs2b \
|
||||
--disable-libdv \
|
||||
--disable-mad \
|
||||
--disable-mp3lame \
|
||||
--enable-mp3lame-lavc \
|
||||
--disable-toolame \
|
||||
--disable-twolame \
|
||||
--disable-xmms \
|
||||
--disable-libdca \
|
||||
--enable-mp3lib \
|
||||
--disable-liba52 \
|
||||
--enable-liba52-internal \
|
||||
--enable-libmpeg2 \
|
||||
--disable-musepack \
|
||||
--disable-libopencore_amrnb \
|
||||
--disable-libopencore_amrwb \
|
||||
\
|
||||
--disable-vidix \
|
||||
--with-vidix-drivers="$VIDIX_DRV" \
|
||||
--disable-vidix-pcidb \
|
||||
--disable-dhahelper \
|
||||
--disable-svgalib_helper \
|
||||
--enable-gl \
|
||||
--disable-dga2 \
|
||||
--disable-dga1 \
|
||||
--disable-vesa \
|
||||
--disable-svga \
|
||||
--disable-sdl \
|
||||
--disable-kva \
|
||||
--disable-aa \
|
||||
--disable-caca \
|
||||
--disable-ggi \
|
||||
--disable-ggiwmh \
|
||||
--disable-direct3d \
|
||||
--disable-directx \
|
||||
--disable-dxr2 \
|
||||
--disable-dxr3 \
|
||||
--disable-ivtv \
|
||||
--disable-v4l2 \
|
||||
--disable-dvb \
|
||||
--disable-dvbhead \
|
||||
--disable-mga \
|
||||
--disable-xmga \
|
||||
--disable-xshape \
|
||||
--disable-xss \
|
||||
--disable-fbdev \
|
||||
--disable-mlib \
|
||||
--disable-3dfx \
|
||||
--disable-tdfxfb \
|
||||
--disable-s3fb \
|
||||
--disable-wii \
|
||||
--disable-directfb \
|
||||
--disable-zr \
|
||||
--disable-bl \
|
||||
--disable-tdfxvid \
|
||||
--disable-xvr100 \
|
||||
--disable-tga \
|
||||
--disable-pnm \
|
||||
--disable-md5sum \
|
||||
--disable-yuv4mpeg \
|
||||
--disable-corevideo \
|
||||
--disable-quartz \
|
||||
\
|
||||
--enable-alsa \
|
||||
--disable-ossaudio \
|
||||
--disable-arts \
|
||||
--disable-esd \
|
||||
--disable-pulse \
|
||||
--disable-jack \
|
||||
--disable-openal \
|
||||
--disable-nas \
|
||||
--disable-sgiaudio \
|
||||
--disable-sunaudio \
|
||||
--disable-dart \
|
||||
--disable-win32waveout \
|
||||
--disable-coreaudio \
|
||||
--disable-select \
|
||||
\
|
||||
--disable-demuxer=matroska \
|
||||
|
||||
make
|
129
packages/multimedia/mplayer/config/input.conf
Normal file
129
packages/multimedia/mplayer/config/input.conf
Normal file
@ -0,0 +1,129 @@
|
||||
##
|
||||
## GeeXboX MPlayer input control file
|
||||
##
|
||||
|
||||
## Playback
|
||||
p pause
|
||||
SPACE pause
|
||||
f pt_step -1
|
||||
g pt_step 1
|
||||
h tv_step_channel 1
|
||||
l tv_step_channel -1
|
||||
n tv_step_norm
|
||||
b tv_step_chanlist
|
||||
|
||||
## Seeking
|
||||
RIGHT seek +10
|
||||
LEFT seek -10
|
||||
DOWN seek -60
|
||||
UP seek +60
|
||||
PGUP seek 600
|
||||
PGDWN seek -600
|
||||
|
||||
## Audio properties
|
||||
- audio_delay 0.100
|
||||
+ audio_delay -0.100
|
||||
/ volume -1
|
||||
* volume 1
|
||||
c mute
|
||||
e switch_audio
|
||||
|
||||
## Subtitle properties
|
||||
z sub_delay -0.1
|
||||
x sub_delay +0.1
|
||||
r sub_pos -1
|
||||
t sub_pos +1
|
||||
w sub_select
|
||||
|
||||
## DVD Menu Navigation
|
||||
UP {dvdnav} dvdnav 1 # DVDNav UP
|
||||
DOWN {dvdnav} dvdnav 2 # DVDNav DOWN
|
||||
LEFT {dvdnav} dvdnav 3 # DVDNav LEFT
|
||||
RIGHT {dvdnav} dvdnav 4 # DVDNav RIGHT
|
||||
ESC {dvdnav} dvdnav 5 # DVDNav MENU
|
||||
ENTER {dvdnav} dvdnav 6 # DVDNav SELECT (ok)
|
||||
BS {dvdnav} dvdnav 7 # DVDNav PREVIOUS menu (in the order chapter->title->root)
|
||||
|
||||
AR_VUP {dvdnav} dvdnav 1 # DVDNav UP
|
||||
AR_VDOWN {dvdnav} dvdnav 2 # DVDNav DOWN
|
||||
AR_PREV {dvdnav} dvdnav 3 # DVDNav LEFT
|
||||
AR_NEXT {dvdnav} dvdnav 4 # DVDNav RIGHT
|
||||
AR_MENU {dvdnav} dvdnav 5 # DVDNav MENU
|
||||
AR_PLAY {dvdnav} dvdnav 6 # DVDNav SELECT (ok)
|
||||
|
||||
## Miscelaneous
|
||||
a quit
|
||||
q quit
|
||||
ESC quit
|
||||
k halt
|
||||
o osd
|
||||
m menu toggle
|
||||
; menu toggle
|
||||
s run /usr/bin/tvswitch
|
||||
y play_dvd
|
||||
i set_menu info
|
||||
|
||||
## Controls
|
||||
1 contrast -1
|
||||
3 contrast 1
|
||||
7 brightness -1
|
||||
9 brightness 1
|
||||
INS hue -1
|
||||
DEL hue 1
|
||||
HOME saturation -1
|
||||
END saturation 1
|
||||
|
||||
## Joystick
|
||||
JOY_RIGHT seek 10
|
||||
JOY_LEFT seek -10
|
||||
JOY_UP seek 60
|
||||
JOY_DOWN seek -60
|
||||
JOY_BTN1 menu hide
|
||||
JOY_BTN2 pause
|
||||
JOY_BTN3 osd
|
||||
JOY_BTN4 mute
|
||||
JOY_BTN5 volume -1
|
||||
JOY_BTN6 volume 1
|
||||
|
||||
## Apple Remote
|
||||
AR_PLAY pause
|
||||
AR_PLAY_HOLD quit
|
||||
AR_NEXT seek 30
|
||||
AR_NEXT_HOLD seek 120
|
||||
AR_PREV seek -10
|
||||
AR_PREV_HOLD seek -120
|
||||
AR_MENU menu up
|
||||
#AR_MENU menu cancel
|
||||
AR_MENU_HOLD mute
|
||||
AR_VUP volume 1
|
||||
AR_VDOWN volume -1
|
||||
|
||||
#Navigation between teletext pages
|
||||
RIGHT {teletext} step_property teletext_page 1
|
||||
LEFT {teletext} step_property teletext_page -1
|
||||
UP {teletext} step_property teletext_page 100
|
||||
DOWN {teletext} step_property teletext_page -100
|
||||
|
||||
H step_property teletext_mode 1
|
||||
C step_property teletext_format 1
|
||||
|
||||
#Nagigation though teletext subpages
|
||||
PGUP {teletext} step_property teletext_subpage -1
|
||||
PGDWN {teletext} step_property teletext_subpage 1
|
||||
|
||||
#Entering page number manually
|
||||
1 {teletext} teletext_add_dec 1
|
||||
2 {teletext} teletext_add_dec 2
|
||||
3 {teletext} teletext_add_dec 3
|
||||
4 {teletext} teletext_add_dec 4
|
||||
5 {teletext} teletext_add_dec 5
|
||||
6 {teletext} teletext_add_dec 6
|
||||
7 {teletext} teletext_add_dec 7
|
||||
8 {teletext} teletext_add_dec 8
|
||||
9 {teletext} teletext_add_dec 9
|
||||
0 {teletext} teletext_add_dec 0
|
||||
- {teletext} teletext_add_dec -
|
||||
|
||||
#Switch TV chanels by LEFT/RIGHT keys
|
||||
LEFT {tv} tv_step_channel -1
|
||||
RIGHT {tv} tv_step_channel 1
|
45
packages/multimedia/mplayer/config/mplayer.enna
Normal file
45
packages/multimedia/mplayer/config/mplayer.enna
Normal file
@ -0,0 +1,45 @@
|
||||
[deinterlace]
|
||||
profile-desc="Profile for picture de-interlacing"
|
||||
vf-add=pp=fd
|
||||
|
||||
[lang]
|
||||
profile-desc="Profile for language"
|
||||
alang=en
|
||||
|
||||
[protocol.cdda]
|
||||
profile-desc="Profile for cdda:// streams"
|
||||
cdda=speed=2
|
||||
|
||||
[extension.mkv]
|
||||
profile-desc="Profile for Matroska files"
|
||||
profile=lang
|
||||
|
||||
[default]
|
||||
vo=cvidix,vesa
|
||||
mixer-channel=Master
|
||||
framedrop=yes
|
||||
vsync=yes
|
||||
fs=yes
|
||||
zoom=yes
|
||||
double=yes
|
||||
fixed-vo=yes
|
||||
nocolorkey=yes
|
||||
cache=4096
|
||||
cache-min=2
|
||||
idx=yes
|
||||
sub-fuzziness=1
|
||||
spuaa=4
|
||||
|
||||
# Set Post Processing (h deblock, v deblock, dering, auto luminance)
|
||||
# Consumes CPU power, disabled for low configs, uncomment to enable it.
|
||||
#vf=pp=hb:a/vb:a/dr:a/al:a
|
||||
|
||||
# Forces RTSP client's port (usefull for FreeboxTV users in router mode)
|
||||
# Do _NOT_ uncomment the line without LIVE555 support
|
||||
#rtsp-port = 31337
|
||||
|
||||
# Subtitles properties
|
||||
ass=yes
|
||||
embeddedfonts=yes
|
||||
ass-use-margins=yes
|
||||
ass-color=FFFFFF00 # plain white (no alpha)
|
35
packages/multimedia/mplayer/install
Normal file
35
packages/multimedia/mplayer/install
Normal file
@ -0,0 +1,35 @@
|
||||
#!/bin/sh
|
||||
|
||||
. config/options
|
||||
|
||||
$SCRIPTS/install zlib
|
||||
$SCRIPTS/install alsa
|
||||
$SCRIPTS/install freetype
|
||||
$SCRIPTS/install libiconv
|
||||
$SCRIPTS/install libcdio
|
||||
#$SCRIPTS/install faad2
|
||||
$SCRIPTS/install ffmpeg-mt
|
||||
$SCRIPTS/install libdvdread
|
||||
$SCRIPTS/install libdvdcss
|
||||
$SCRIPTS/install libdvdnav
|
||||
|
||||
if [ "$DISPLAYSERVER" = xorg-server ]; then
|
||||
$SCRIPTS/install libX11
|
||||
$SCRIPTS/install libXv
|
||||
$SCRIPTS/install libXvMC
|
||||
$SCRIPTS/install $MESA
|
||||
$SCRIPTS/install xorg-server
|
||||
$SCRIPTS/install xf86-video-intel
|
||||
fi
|
||||
|
||||
PKG_DIR=`find $PACKAGES -type d -name $1`
|
||||
|
||||
mkdir -p $INSTALL/etc/mplayer
|
||||
cp $PKG_DIR/config/mplayer.enna $INSTALL/etc/mplayer/mplayer.conf
|
||||
cp $PKG_DIR/config/input.conf $INSTALL/etc/mplayer
|
||||
cp $PKG_BUILD/etc/codecs.conf $INSTALL/etc/mplayer
|
||||
|
||||
mkdir -p $INSTALL/usr/bin
|
||||
cp $PKG_BUILD/mplayer $INSTALL/usr/bin
|
||||
|
||||
mkdir -p $INSTALL/codecs
|
@ -0,0 +1,18 @@
|
||||
* Only "pop" subtree params if they had previously been "pushed", and
|
||||
afterwards reset the "pushed" value to 0 again. Similarly only set the
|
||||
PLAY_TREE_RND_PLAYED flag if the entry had been pushed before.
|
||||
OBSOLETE: remove this patch at next MPlayer upgrade.
|
||||
diff -Naur MPlayer-export-2009-06-13.orig/playtree.c MPlayer-export-2009-06-13/playtree.c
|
||||
--- MPlayer-export-2009-06-13.orig/playtree.c 2009-06-13 22:53:58.000000000 +0200
|
||||
+++ MPlayer-export-2009-06-13/playtree.c 2009-06-13 22:54:13.000000000 +0200
|
||||
@@ -712,8 +712,9 @@
|
||||
iter->tree = iter->tree->parent;
|
||||
|
||||
// Pop subtree params
|
||||
- if(iter->config) {
|
||||
+ if(iter->config && iter->entry_pushed > 0) {
|
||||
m_config_pop(iter->config);
|
||||
+ iter->entry_pushed = 0;
|
||||
if(iter->mode == PLAY_TREE_ITER_RND)
|
||||
iter->tree->flags |= PLAY_TREE_RND_PLAYED;
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
diff -Naur MPlayer-export-2009-06-13.orig/command.c MPlayer-export-2009-06-13/command.c
|
||||
--- MPlayer-export-2009-06-13.orig/command.c 2009-06-13 22:53:58.000000000 +0200
|
||||
+++ MPlayer-export-2009-06-13/command.c 2009-06-13 22:55:21.000000000 +0200
|
||||
@@ -2510,7 +2510,12 @@
|
||||
exit_player_with_rc(EXIT_QUIT,
|
||||
(cmd->nargs > 0) ? cmd->args[0].v.i : 0);
|
||||
|
||||
- case MP_CMD_PLAY_TREE_STEP:{
|
||||
+ case MP_CMD_SET_OPTION: {
|
||||
+ extern struct m_config* mconfig;
|
||||
+ m_config_set_option(mconfig, cmd->args[0].v.s, cmd->args[1].v.s);
|
||||
+ } break;
|
||||
+
|
||||
+ case MP_CMD_PLAY_TREE_STEP:{
|
||||
int n = cmd->args[0].v.i == 0 ? 1 : cmd->args[0].v.i;
|
||||
int force = cmd->args[1].v.i;
|
||||
|
||||
diff -Naur MPlayer-export-2009-06-13.orig/input/input.c MPlayer-export-2009-06-13/input/input.c
|
||||
--- MPlayer-export-2009-06-13.orig/input/input.c 2009-06-13 22:53:58.000000000 +0200
|
||||
+++ MPlayer-export-2009-06-13/input/input.c 2009-06-13 22:55:21.000000000 +0200
|
||||
@@ -140,6 +140,7 @@
|
||||
{ MP_CMD_SWITCH_AUDIO, "switch_audio", 0, { { MP_CMD_ARG_INT,{-1} }, {-1,{0}} } },
|
||||
{ MP_CMD_SWITCH_ANGLE, "switch_angle", 0, { { MP_CMD_ARG_INT,{-1} }, {-1,{0}} } },
|
||||
{ MP_CMD_SWITCH_TITLE, "switch_title", 0, { { MP_CMD_ARG_INT,{-1} }, {-1,{0}} } },
|
||||
+ { MP_CMD_SET_OPTION, "set_option", 2, { { MP_CMD_ARG_STRING, {0}}, { MP_CMD_ARG_STRING, {0}}, {-1,{0}} } },
|
||||
#ifdef CONFIG_TV
|
||||
{ MP_CMD_TV_START_SCAN, "tv_start_scan", 0, { {-1,{0}} }},
|
||||
{ MP_CMD_TV_STEP_CHANNEL, "tv_step_channel", 1, { { MP_CMD_ARG_INT ,{0}}, {-1,{0}} }},
|
||||
diff -Naur MPlayer-export-2009-06-13.orig/input/input.h MPlayer-export-2009-06-13/input/input.h
|
||||
--- MPlayer-export-2009-06-13.orig/input/input.h 2009-06-13 22:53:58.000000000 +0200
|
||||
+++ MPlayer-export-2009-06-13/input/input.h 2009-06-13 22:55:21.000000000 +0200
|
||||
@@ -129,6 +129,7 @@
|
||||
MP_CMD_ASS_USE_MARGINS,
|
||||
MP_CMD_SWITCH_TITLE,
|
||||
MP_CMD_STOP,
|
||||
+ MP_CMD_SET_OPTION,
|
||||
|
||||
/// DVDNAV commands
|
||||
MP_CMD_DVDNAV_UP = 1000,
|
153
packages/multimedia/mplayer/patches/250_bgvideo.diff
Normal file
153
packages/multimedia/mplayer/patches/250_bgvideo.diff
Normal file
@ -0,0 +1,153 @@
|
||||
diff -Naur MPlayer-export-2009-06-13.orig/cfg-mplayer.h MPlayer-export-2009-06-13/cfg-mplayer.h
|
||||
--- MPlayer-export-2009-06-13.orig/cfg-mplayer.h 2009-06-13 22:53:58.000000000 +0200
|
||||
+++ MPlayer-export-2009-06-13/cfg-mplayer.h 2009-06-13 22:56:04.000000000 +0200
|
||||
@@ -315,6 +315,8 @@
|
||||
{"guiwid", &guiWinID, CONF_TYPE_INT, 0, 0, 0, NULL},
|
||||
#endif
|
||||
|
||||
+ {"bgvideo", &bg_video, CONF_TYPE_STRING, 0, 0, 0, NULL},
|
||||
+
|
||||
{"noloop", &mpctx_s.loop_times, CONF_TYPE_FLAG, 0, 0, -1, NULL},
|
||||
{"loop", &mpctx_s.loop_times, CONF_TYPE_INT, CONF_RANGE, -1, 10000, NULL},
|
||||
{"playlist", NULL, CONF_TYPE_STRING, 0, 0, 0, NULL},
|
||||
diff -Naur MPlayer-export-2009-06-13.orig/mp_core.h MPlayer-export-2009-06-13/mp_core.h
|
||||
--- MPlayer-export-2009-06-13.orig/mp_core.h 2009-06-13 22:53:58.000000000 +0200
|
||||
+++ MPlayer-export-2009-06-13/mp_core.h 2009-06-13 22:56:04.000000000 +0200
|
||||
@@ -60,6 +60,7 @@
|
||||
|
||||
stream_t *stream;
|
||||
demuxer_t *demuxer;
|
||||
+ demuxer_t *bg_demuxer;
|
||||
sh_audio_t *sh_audio;
|
||||
sh_video_t *sh_video;
|
||||
demux_stream_t *d_audio;
|
||||
diff -Naur MPlayer-export-2009-06-13.orig/mplayer.c MPlayer-export-2009-06-13/mplayer.c
|
||||
--- MPlayer-export-2009-06-13.orig/mplayer.c 2009-06-13 22:53:58.000000000 +0200
|
||||
+++ MPlayer-export-2009-06-13/mplayer.c 2009-06-13 22:58:14.000000000 +0200
|
||||
@@ -271,6 +271,8 @@
|
||||
int forced_subs_only=0;
|
||||
int file_filter=1;
|
||||
|
||||
+static char* bg_video = NULL;
|
||||
+
|
||||
// cache2:
|
||||
int stream_cache_size=-1;
|
||||
#ifdef CONFIG_STREAM_CACHE
|
||||
@@ -608,6 +610,13 @@
|
||||
free_demuxer(mpctx->demuxer);
|
||||
}
|
||||
mpctx->demuxer=NULL;
|
||||
+ current_module="free_bg_demuxer";
|
||||
+ if(mpctx->bg_demuxer) {
|
||||
+ stream_t* bg_s = mpctx->bg_demuxer->stream;
|
||||
+ free_demuxer(mpctx->bg_demuxer);
|
||||
+ mpctx->bg_demuxer = NULL;
|
||||
+ free_stream(bg_s);
|
||||
+ }
|
||||
}
|
||||
|
||||
// kill the cache process:
|
||||
@@ -1528,6 +1537,8 @@
|
||||
int percentage = -1;
|
||||
char percentage_text[10];
|
||||
int pts = demuxer_get_current_time(mpctx->demuxer);
|
||||
+ if (mpctx->bg_demuxer)
|
||||
+ pts = playing_audio_pts(mpctx->sh_audio, mpctx->d_audio, mpctx->audio_out);
|
||||
|
||||
if (mpctx->osd_show_percentage)
|
||||
percentage = demuxer_get_percent_pos(mpctx->demuxer);
|
||||
@@ -1743,10 +1754,17 @@
|
||||
current_module = "video_read_frame";
|
||||
in_size = ds_get_packet_pts(d_video, &start, &pts);
|
||||
if (in_size < 0) {
|
||||
+ if(mpctx->bg_demuxer) {
|
||||
+ if(!demux_seek(mpctx->bg_demuxer,0,0,1))
|
||||
+ hit_eof = 1;
|
||||
+ else
|
||||
+ continue;
|
||||
+ } else {
|
||||
// try to extract last frames in case of decoder lag
|
||||
in_size = 0;
|
||||
pts = 1e300;
|
||||
hit_eof = 1;
|
||||
+ }
|
||||
}
|
||||
if (in_size > max_framesize)
|
||||
max_framesize = in_size;
|
||||
@@ -1939,6 +1957,13 @@
|
||||
current_module="av_sync";
|
||||
|
||||
if(mpctx->sh_audio){
|
||||
+ if(mpctx->bg_demuxer) {
|
||||
+ if(!quiet) mp_msg(MSGT_AVSYNC,MSGL_STATUS,"A:%6.1f %4.1f%% %d%% \r"
|
||||
+ ,mpctx->delay - mpctx->audio_out->get_delay()
|
||||
+ ,(mpctx->delay>0.5)?100.0*audio_time_usage/(double)mpctx->delay:0
|
||||
+ ,cache_fill_status
|
||||
+ );
|
||||
+ } else {
|
||||
double a_pts, v_pts;
|
||||
|
||||
if (autosync)
|
||||
@@ -1989,6 +2014,7 @@
|
||||
if(!quiet)
|
||||
print_status(a_pts - audio_delay, AV_delay, c_total);
|
||||
}
|
||||
+ }
|
||||
|
||||
} else {
|
||||
// No audio:
|
||||
@@ -3348,6 +3374,34 @@
|
||||
mpctx->sh_audio=mpctx->d_audio->sh;
|
||||
mpctx->sh_video=mpctx->d_video->sh;
|
||||
|
||||
+while(mpctx->sh_audio && !mpctx->sh_video && bg_video) {
|
||||
+ int bg_file_format = 0;
|
||||
+ stream_t* bg_s;
|
||||
+ mp_msg(MSGT_CPLAYER,MSGL_INFO, "Open bgvideo: %s\n",bg_video);
|
||||
+ bg_s = open_stream(bg_video,NULL,&bg_file_format);
|
||||
+ if(!bg_s) {
|
||||
+ mp_msg(MSGT_CPLAYER,MSGL_ERR, "Couldn't open the stream for back ground video: %s\n",bg_video);
|
||||
+ break;
|
||||
+ }
|
||||
+ mpctx->bg_demuxer = demux_open(bg_s,bg_file_format,-2,video_id,dvdsub_id,bg_video);
|
||||
+ if(!mpctx->bg_demuxer) {
|
||||
+ mp_msg(MSGT_DEMUXER,MSGL_ERR,"Failed to open background video\n");
|
||||
+ free_stream(bg_s);
|
||||
+ break;
|
||||
+ }
|
||||
+ if(!mpctx->bg_demuxer->video && !mpctx->bg_demuxer->video->sh) {
|
||||
+ mp_msg(MSGT_DEMUXER,MSGL_ERR,"The background video don't have a video stream\n");
|
||||
+ free_demuxer(mpctx->bg_demuxer);
|
||||
+ mpctx->bg_demuxer = NULL;
|
||||
+ free_stream(bg_s);
|
||||
+ break;
|
||||
+ }
|
||||
+ mpctx->d_video = mpctx->bg_demuxer->video;
|
||||
+ mpctx->sh_video = mpctx->d_video->sh;
|
||||
+ mp_msg(MSGT_DEMUXER,MSGL_INFO,"Background video should work ;)\n");
|
||||
+ break;
|
||||
+}
|
||||
+
|
||||
if(mpctx->sh_video){
|
||||
|
||||
current_module="video_read_properties";
|
||||
@@ -3665,6 +3719,7 @@
|
||||
if (!mpctx->sh_video)
|
||||
mpctx->eof = PT_NEXT_ENTRY;
|
||||
|
||||
+if(mpctx->bg_demuxer && mpctx->d_audio->eof) mpctx->eof=1;
|
||||
|
||||
if(!mpctx->sh_video) {
|
||||
// handle audio-only case:
|
||||
@@ -3696,6 +3751,11 @@
|
||||
mpctx->eof = 1; goto goto_next_file;
|
||||
}
|
||||
if (frame_time < 0)
|
||||
+ if(mpctx->bg_demuxer) {
|
||||
+ if(!demux_seek(mpctx->bg_demuxer,0,0,1))
|
||||
+ mpctx->eof = PT_NEXT_ENTRY;
|
||||
+ }
|
||||
+ else
|
||||
mpctx->eof = 1;
|
||||
else {
|
||||
// might return with !eof && !blit_frame if !correct_pts
|
163
packages/multimedia/mplayer/patches/575_streaminfo-dump.diff
Normal file
163
packages/multimedia/mplayer/patches/575_streaminfo-dump.diff
Normal file
@ -0,0 +1,163 @@
|
||||
diff -Naur MPlayer-export-2009-06-13.orig/cfg-mplayer.h MPlayer-export-2009-06-13/cfg-mplayer.h
|
||||
--- MPlayer-export-2009-06-13.orig/cfg-mplayer.h 2009-06-14 15:23:59.000000000 +0200
|
||||
+++ MPlayer-export-2009-06-13/cfg-mplayer.h 2009-06-14 19:43:05.000000000 +0200
|
||||
@@ -193,6 +193,8 @@
|
||||
{"novsync", &vo_vsync, CONF_TYPE_FLAG, 0, 1, 0, NULL},
|
||||
{"panscan", &vo_panscan, CONF_TYPE_FLOAT, CONF_RANGE, -1.0, 1.0, NULL},
|
||||
{"panscanrange", &vo_panscanrange, CONF_TYPE_FLOAT, CONF_RANGE, -19.0, 99.0, NULL},
|
||||
+ {"info-fifo", &info_fifo, CONF_TYPE_STRING, 0, 0, 0, NULL},
|
||||
+ {"bg-lcdbanner", &bg_lcdbanner, CONF_TYPE_STRING, 0, 0, 0, NULL},
|
||||
|
||||
{"grabpointer", &vo_grabpointer, CONF_TYPE_FLAG, 0, 0, 1, NULL},
|
||||
{"nograbpointer", &vo_grabpointer, CONF_TYPE_FLAG, 0, 1, 0, NULL},
|
||||
diff -Naur MPlayer-export-2009-06-13.orig/mplayer.c MPlayer-export-2009-06-13/mplayer.c
|
||||
--- MPlayer-export-2009-06-13.orig/mplayer.c 2009-06-14 15:23:59.000000000 +0200
|
||||
+++ MPlayer-export-2009-06-13/mplayer.c 2009-06-14 19:46:38.000000000 +0200
|
||||
@@ -276,6 +276,9 @@
|
||||
#ifdef CONFIG_STREAM_CACHE
|
||||
extern int cache_fill_status;
|
||||
|
||||
+char* info_fifo=NULL;
|
||||
+char* bg_lcdbanner=NULL;
|
||||
+
|
||||
float stream_cache_min_percent=20.0;
|
||||
float stream_cache_seek_min_percent=50.0;
|
||||
#else
|
||||
@@ -365,6 +368,128 @@
|
||||
|
||||
#define mp_basename2(s) (strrchr(s,'/')==NULL?(char*)s:(strrchr(s,'/')+1))
|
||||
|
||||
+#define mp_basename(s) (strrchr(s,'\\')==NULL?(mp_basename2(s)):(strrchr(s,'\\')+1))
|
||||
+
|
||||
+static void dump_stream_info(void)
|
||||
+{
|
||||
+ FILE *f;
|
||||
+ int fd;
|
||||
+
|
||||
+ if (!info_fifo)
|
||||
+ return;
|
||||
+
|
||||
+ mkfifo (info_fifo, 0644);
|
||||
+
|
||||
+ fd = open(info_fifo, O_RDWR | O_NONBLOCK);
|
||||
+ if (fd < 0)
|
||||
+ return;
|
||||
+
|
||||
+ f = fdopen (fd, "w");
|
||||
+ if (!f)
|
||||
+ return;
|
||||
+
|
||||
+ fprintf (f, "ID_FILENAME=%s\n",
|
||||
+ (bg_video && strcmp (filename, bg_video)) ?
|
||||
+ mp_basename (filename) : (bg_lcdbanner ? bg_lcdbanner : ""));
|
||||
+
|
||||
+ if (!mpctx)
|
||||
+ {
|
||||
+ fflush (f);
|
||||
+ fclose (f);
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ if (mpctx->demuxer)
|
||||
+ {
|
||||
+ int len, pts;
|
||||
+
|
||||
+ if (mpctx->demuxer->desc && mpctx->demuxer->desc->name)
|
||||
+ fprintf (f, "ID_DEMUXER=%s\n", mpctx->demuxer->desc->name);
|
||||
+
|
||||
+ len = (int) demuxer_get_time_length (mpctx->demuxer);
|
||||
+ fprintf (f, "ID_LENGTH=%02d:%02d:%02d\n",
|
||||
+ (len / 3600), (len / 60) % 60, len % 60);
|
||||
+ fprintf (f, "ID_VIDEO_PERCENT=%d\n",
|
||||
+ demuxer_get_percent_pos (mpctx->demuxer));
|
||||
+ pts = demuxer_get_current_time (mpctx->demuxer);
|
||||
+
|
||||
+ if (mpctx->bg_demuxer)
|
||||
+ pts = playing_audio_pts (mpctx->sh_audio,
|
||||
+ mpctx->d_audio, mpctx->audio_out);
|
||||
+ fprintf (f, "ID_TIME_ELAPSED=%02d:%02d:%02d\n",
|
||||
+ (pts / 3600), (pts / 60 ) % 60, pts % 60);
|
||||
+ }
|
||||
+
|
||||
+ if (mpctx->sh_video)
|
||||
+ {
|
||||
+ /* Assume FOURCC if all bytes >= 0x20 (' ') */
|
||||
+ if (mpctx->sh_video->format >= 0x20202020)
|
||||
+ fprintf (f, "ID_VIDEO_FORMAT=%.4s\n",
|
||||
+ (char *) &mpctx->sh_video->format);
|
||||
+ else
|
||||
+ fprintf (f, "ID_VIDEO_FORMAT=0x%08X\n", mpctx->sh_video->format);
|
||||
+
|
||||
+ fprintf (f, "ID_VIDEO_BITRATE=%d\n", mpctx->sh_video->i_bps*8);
|
||||
+ fprintf (f, "ID_VIDEO_WIDTH=%d\n", mpctx->sh_video->disp_w);
|
||||
+ fprintf (f, "ID_VIDEO_HEIGHT=%d\n", mpctx->sh_video->disp_h);
|
||||
+ fprintf (f, "ID_VIDEO_FPS=%5.3f\n", mpctx->sh_video->fps);
|
||||
+ fprintf (f, "ID_VIDEO_ASPECT=%1.4f\n", mpctx->sh_video->aspect);
|
||||
+ }
|
||||
+
|
||||
+ if (mpctx->demuxer)
|
||||
+ {
|
||||
+ char *info;
|
||||
+
|
||||
+ info = demux_info_get (mpctx->demuxer, "Title");
|
||||
+ if (info)
|
||||
+ fprintf (f, "ID_AUDIO_TITLE=%s\n", info);
|
||||
+
|
||||
+ info = demux_info_get (mpctx->demuxer, "Artist");
|
||||
+ if (info)
|
||||
+ fprintf (f, "ID_AUDIO_ARTIST=%s\n", info);
|
||||
+
|
||||
+ info = demux_info_get (mpctx->demuxer, "Album");
|
||||
+ if (info)
|
||||
+ fprintf (f, "ID_AUDIO_ALBUM=%s\n", info);
|
||||
+
|
||||
+ info = demux_info_get (mpctx->demuxer, "Year");
|
||||
+ if (info)
|
||||
+ fprintf (f, "ID_AUDIO_YEAR=%s\n", info);
|
||||
+
|
||||
+ info = demux_info_get (mpctx->demuxer, "Comment");
|
||||
+ if (info)
|
||||
+ fprintf (f, "ID_AUDIO_COMMENT=%s\n", info);
|
||||
+
|
||||
+ info = demux_info_get (mpctx->demuxer, "Track");
|
||||
+ if (info)
|
||||
+ fprintf (f, "ID_AUDIO_TRACK=%s\n", info);
|
||||
+
|
||||
+ info = demux_info_get (mpctx->demuxer, "Genre");
|
||||
+ if (info)
|
||||
+ fprintf (f, "ID_AUDIO_GENRE=%s\n", info);
|
||||
+ }
|
||||
+
|
||||
+ if (mpctx->sh_audio)
|
||||
+ {
|
||||
+ if (mpctx->sh_audio->codec && mpctx->sh_audio->codec->name)
|
||||
+ fprintf (f, "ID_AUDIO_CODEC=%s\n", mpctx->sh_audio->codec->name);
|
||||
+
|
||||
+ /* Assume FOURCC if all bytes >= 0x20 (' ') */
|
||||
+ if (mpctx->sh_audio->format >= 0x20202020)
|
||||
+ fprintf (f, "ID_AUDIO_FORMAT=%.4s\n",
|
||||
+ (char *) &mpctx->sh_audio->format);
|
||||
+ else
|
||||
+ fprintf (f, "ID_AUDIO_FORMAT=%d\n", mpctx->sh_audio->format);
|
||||
+
|
||||
+ fprintf (f, "ID_AUDIO_BITRATE=%d\n", mpctx->sh_audio->i_bps * 8);
|
||||
+ fprintf (f, "ID_AUDIO_RATE=%d\n", mpctx->sh_audio->samplerate);
|
||||
+ fprintf (f, "ID_AUDIO_NCH=%d\n", mpctx->sh_audio->channels);
|
||||
+ }
|
||||
+
|
||||
+ fflush (f);
|
||||
+ fclose (f);
|
||||
+}
|
||||
+
|
||||
const void *mpctx_get_video_out(MPContext *mpctx)
|
||||
{
|
||||
return mpctx->video_out;
|
||||
@@ -3843,6 +3968,8 @@
|
||||
loop_seek = 1;
|
||||
}
|
||||
|
||||
+ dump_stream_info();
|
||||
+
|
||||
if(rel_seek_secs || abs_seek_pos){
|
||||
if (seek(mpctx, rel_seek_secs, abs_seek_pos) >= 0) {
|
||||
// Set OSD:
|
22
packages/multimedia/mplayer/patches/600_dvb-includes.diff
Normal file
22
packages/multimedia/mplayer/patches/600_dvb-includes.diff
Normal file
@ -0,0 +1,22 @@
|
||||
diff -Naur MPlayer-r28852.orig/libao2/ao_mpegpes.c MPlayer-r28852/libao2/ao_mpegpes.c
|
||||
--- MPlayer-r28852.orig/libao2/ao_mpegpes.c 2009-03-06 20:57:55.000000000 +0100
|
||||
+++ MPlayer-r28852/libao2/ao_mpegpes.c 2009-06-01 22:29:16.000000000 +0200
|
||||
@@ -50,6 +50,7 @@
|
||||
#include <ost/audio.h>
|
||||
audioMixer_t dvb_mixer={255,255};
|
||||
#else
|
||||
+#include <linux/types.h>
|
||||
#include <linux/dvb/audio.h>
|
||||
audio_mixer_t dvb_mixer={255,255};
|
||||
#endif
|
||||
diff -Naur MPlayer-r28852.orig/libvo/vo_mpegpes.c MPlayer-r28852/libvo/vo_mpegpes.c
|
||||
--- MPlayer-r28852.orig/libvo/vo_mpegpes.c 2009-03-06 20:57:55.000000000 +0100
|
||||
+++ MPlayer-r28852/libvo/vo_mpegpes.c 2009-06-01 22:29:26.000000000 +0200
|
||||
@@ -60,6 +60,7 @@
|
||||
#include <stdio.h>
|
||||
#include <time.h>
|
||||
|
||||
+#include <linux/types.h>
|
||||
#include <linux/dvb/dmx.h>
|
||||
#include <linux/dvb/frontend.h>
|
||||
#include <linux/dvb/video.h>
|
11
packages/multimedia/mplayer/patches/655_tvkeepon.diff
Normal file
11
packages/multimedia/mplayer/patches/655_tvkeepon.diff
Normal file
@ -0,0 +1,11 @@
|
||||
diff -r 5f88e25ccf52 mplayer.c
|
||||
--- a/mplayer.c Sun Apr 30 16:54:44 2006 +0200
|
||||
+++ b/mplayer.c Sun Apr 30 16:54:44 2006 +0200
|
||||
@@ -2225,6 +2225,7 @@
|
||||
mp_msg(MSGT_CPLAYER,MSGL_FATAL,MSGTR_ErrorInitializingVODevice);
|
||||
goto err_out;
|
||||
}
|
||||
+ system("[ -x /usr/bin/tvkeepon ] && /usr/bin/tvkeepon");
|
||||
initialized_flags|=INITIALIZED_VO;
|
||||
}
|
||||
|
21
packages/multimedia/mplayer/patches/800_mt-vdec.diff
Normal file
21
packages/multimedia/mplayer/patches/800_mt-vdec.diff
Normal file
@ -0,0 +1,21 @@
|
||||
diff -Naur MPlayer-export-2009-06-13.orig/libmpcodecs/vd_ffmpeg.c MPlayer-export-2009-06-13/libmpcodecs/vd_ffmpeg.c
|
||||
--- MPlayer-export-2009-06-13.orig/libmpcodecs/vd_ffmpeg.c 2009-06-13 22:53:58.000000000 +0200
|
||||
+++ MPlayer-export-2009-06-13/libmpcodecs/vd_ffmpeg.c 2009-06-14 00:32:06.000000000 +0200
|
||||
@@ -145,7 +145,16 @@
|
||||
avcodec_flush_buffers(avctx);
|
||||
return CONTROL_TRUE;
|
||||
case VDCTRL_QUERY_UNSEEN_FRAMES:
|
||||
- return avctx->has_b_frames + 10;
|
||||
+#ifdef FF_THREAD_FRAME
|
||||
+ {
|
||||
+ int thread_delay = 0;
|
||||
+ if (avctx->active_thread_type & FF_THREAD_FRAME)
|
||||
+ thread_delay = avctx->thread_count - 1;
|
||||
+ return avctx->has_b_frames + thread_delay + 10;
|
||||
+ }
|
||||
+#else
|
||||
+ return avctx->has_b_frames + 10;
|
||||
+#endif
|
||||
}
|
||||
return CONTROL_UNKNOWN;
|
||||
}
|
@ -0,0 +1,72 @@
|
||||
diff -Nurp a/input/input.c b/input/input.c
|
||||
--- a/input/input.c 2009-05-28 22:11:18.000000000 +0800
|
||||
+++ b/input/input.c 2009-05-28 21:48:56.000000000 +0800
|
||||
@@ -317,6 +317,13 @@ static const mp_key_name_t key_names[] =
|
||||
{ JOY_BTN7, "JOY_BTN7" },
|
||||
{ JOY_BTN8, "JOY_BTN8" },
|
||||
{ JOY_BTN9, "JOY_BTN9" },
|
||||
+ { JOY_BTN10, "JOY_BTN10" },
|
||||
+ { JOY_BTN11, "JOY_BTN11" },
|
||||
+ { JOY_BTN12, "JOY_BTN12" },
|
||||
+ { JOY_BTN13, "JOY_BTN13" },
|
||||
+ { JOY_BTN14, "JOY_BTN14" },
|
||||
+ { JOY_BTN15, "JOY_BTN15" },
|
||||
+ { JOY_BTN16, "JOY_BTN16" },
|
||||
|
||||
{ AR_PLAY, "AR_PLAY" },
|
||||
{ AR_PLAY_HOLD, "AR_PLAY_HOLD" },
|
||||
diff -Nurp a/input/joystick.c b/input/joystick.c
|
||||
--- a/input/joystick.c 2008-12-14 02:28:00.000000000 +0800
|
||||
+++ b/input/joystick.c 2009-05-28 22:09:07.000000000 +0800
|
||||
@@ -45,6 +45,7 @@
|
||||
|
||||
int axis[256];
|
||||
int btns = 0;
|
||||
+char name[128];
|
||||
|
||||
int mp_input_joystick_init(char* dev) {
|
||||
int fd,l=0;
|
||||
@@ -68,6 +69,9 @@ int mp_input_joystick_init(char* dev) {
|
||||
continue;
|
||||
else if(errno == EAGAIN) {
|
||||
initialized = 1;
|
||||
+ if (ioctl(fd, JSIOCGNAME(sizeof(name)), name) < 0)
|
||||
+ strncpy(name, "Unknown", sizeof(name));
|
||||
+ mp_msg(MSGT_INPUT,MSGL_INFO,"Using joystick: %s\n",name);
|
||||
break;
|
||||
}
|
||||
mp_msg(MSGT_INPUT,MSGL_ERR,MSGTR_INPUT_JOYSTICK_ErrReading,strerror(errno));
|
||||
@@ -76,6 +79,7 @@ int mp_input_joystick_init(char* dev) {
|
||||
}
|
||||
l += r;
|
||||
}
|
||||
+
|
||||
if((unsigned int)l < sizeof(struct js_event)) {
|
||||
if(l > 0)
|
||||
mp_msg(MSGT_INPUT,MSGL_WARN,MSGTR_INPUT_JOYSTICK_LoosingBytes,l);
|
||||
@@ -141,6 +145,8 @@ int mp_input_joystick_read(int fd) {
|
||||
else
|
||||
return JOY_BTN0 + ev.number;
|
||||
} else if(ev.type & JS_EVENT_AXIS) {
|
||||
+ if (!strncmp(name, "Sony PLAYSTATION(R)3 Controller", 31))
|
||||
+ return MP_INPUT_NOTHING; // input doesn't handle axis events well, ignore them all
|
||||
if(ev.value < -JOY_AXIS_DELTA && axis[ev.number] != -1) {
|
||||
axis[ev.number] = -1;
|
||||
return (JOY_AXIS0_MINUS+(2*ev.number)) | MP_KEY_DOWN;
|
||||
diff -Nurp a/input/joystick.h b/input/joystick.h
|
||||
--- a/input/joystick.h 2008-12-14 02:28:00.000000000 +0800
|
||||
+++ b/input/joystick.h 2009-05-28 21:47:52.000000000 +0800
|
||||
@@ -52,6 +52,13 @@
|
||||
#define JOY_BTN7 (JOY_BTN_BASE+7)
|
||||
#define JOY_BTN8 (JOY_BTN_BASE+8)
|
||||
#define JOY_BTN9 (JOY_BTN_BASE+9)
|
||||
+#define JOY_BTN10 (JOY_BTN_BASE+10)
|
||||
+#define JOY_BTN11 (JOY_BTN_BASE+11)
|
||||
+#define JOY_BTN12 (JOY_BTN_BASE+12)
|
||||
+#define JOY_BTN13 (JOY_BTN_BASE+13)
|
||||
+#define JOY_BTN14 (JOY_BTN_BASE+14)
|
||||
+#define JOY_BTN15 (JOY_BTN_BASE+15)
|
||||
+#define JOY_BTN16 (JOY_BTN_BASE+16)
|
||||
|
||||
int mp_input_joystick_init(char* dev);
|
||||
|
855
packages/multimedia/mplayer/patches/900_vo_ps3.diff.ps3
Normal file
855
packages/multimedia/mplayer/patches/900_vo_ps3.diff.ps3
Normal file
@ -0,0 +1,855 @@
|
||||
Index: Makefile
|
||||
===================================================================
|
||||
--- a/Makefile (revision 29136)
|
||||
+++ b/Makefile (working copy)
|
||||
@@ -618,6 +618,7 @@
|
||||
SRCS_MPLAYER-$(OSS) += libao2/ao_oss.c
|
||||
SRCS_MPLAYER-$(PNG) += libvo/vo_png.c
|
||||
SRCS_MPLAYER-$(PNM) += libvo/vo_pnm.c
|
||||
+SRCS_MPLAYER-$(PS3) += libvo/vo_ps3.c
|
||||
SRCS_MPLAYER-$(PULSE) += libao2/ao_pulse.c
|
||||
SRCS_MPLAYER-$(QUARTZ) += libvo/vo_quartz.c
|
||||
SRCS_MPLAYER-$(S3FB) += libvo/vo_s3fb.c
|
||||
Index: libvo/video_out.c
|
||||
===================================================================
|
||||
--- a/libvo/video_out.c (revision 29136)
|
||||
+++ b/libvo/video_out.c (working copy)
|
||||
@@ -114,6 +114,7 @@
|
||||
extern vo_functions_t video_out_directx;
|
||||
extern vo_functions_t video_out_kva;
|
||||
extern vo_functions_t video_out_dxr2;
|
||||
+extern vo_functions_t video_out_ps3;
|
||||
extern vo_functions_t video_out_dxr3;
|
||||
extern vo_functions_t video_out_ivtv;
|
||||
extern vo_functions_t video_out_v4l2;
|
||||
@@ -201,6 +202,9 @@
|
||||
&video_out_fbdev,
|
||||
&video_out_fbdev2,
|
||||
#endif
|
||||
+#ifdef CONFIG_PS3
|
||||
+ &video_out_ps3,
|
||||
+#endif
|
||||
#ifdef CONFIG_SVGALIB
|
||||
&video_out_svga,
|
||||
#endif
|
||||
Index: libvo/vo_ps3.c
|
||||
===================================================================
|
||||
--- a/libvo/vo_ps3.c (revision 0)
|
||||
+++ b/libvo/vo_ps3.c (revision 0)
|
||||
@@ -0,0 +1,744 @@
|
||||
+/*
|
||||
+ * video driver for cell / BE Playstation3 framebuffer
|
||||
+ * Copyright 2007 by Bill Garrett <wgarrett@???>
|
||||
+ * Copyright 2009 by Kristian Jerpetjøn <kristian.jerpetjoen@???>
|
||||
+ *
|
||||
+ * This video out device uses the Cell Broadband Engine spes to accelerate
|
||||
+ * scaling and colorspace conversion
|
||||
+ *
|
||||
+ * This vo depends on spu-medialib which is a BSDv2 library
|
||||
+ *
|
||||
+ * This file is part of MPlayer.
|
||||
+ *
|
||||
+ * MPlayer is free software; you can redistribute it and/or modify
|
||||
+ * it under the terms of the GNU General Public License as published by
|
||||
+ * the Free Software Foundation; either version 2 of the License, or
|
||||
+ * (at your option) any later version.
|
||||
+ *
|
||||
+ * MPlayer 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 General Public License for more details.
|
||||
+ *
|
||||
+ * You should have received a copy of the GNU General Public License along
|
||||
+ * with MPlayer; if not, write to the Free Software Foundation, Inc.,
|
||||
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
+ */
|
||||
+
|
||||
+#include <stdio.h>
|
||||
+#include <stdlib.h>
|
||||
+#include <string.h>
|
||||
+#include <unistd.h>
|
||||
+#include <errno.h>
|
||||
+
|
||||
+#include <libspe2.h>
|
||||
+
|
||||
+#include "config.h"
|
||||
+#include "mplayer.h"
|
||||
+#include "aspect.h"
|
||||
+#include "mp_msg.h"
|
||||
+#include "help_mp.h"
|
||||
+#include "video_out.h"
|
||||
+#include "video_out_internal.h"
|
||||
+#include "subopt-helper.h"
|
||||
+#include "fastmemcpy.h"
|
||||
+#include "osd.h"
|
||||
+#include "sub.h"
|
||||
+
|
||||
+#if HAVE_MALLOC_H
|
||||
+#include <malloc.h>
|
||||
+#endif
|
||||
+
|
||||
+#include <spu-medialib/spu_control.h>
|
||||
+#include <spu-medialib/yuv2argb_scaler.h>
|
||||
+
|
||||
+#include <sys/mman.h>
|
||||
+#include <fcntl.h>
|
||||
+#include <sys/ioctl.h>
|
||||
+#include <linux/kd.h>
|
||||
+#include <linux/fb.h>
|
||||
+#include <asm/ps3fb.h>
|
||||
+
|
||||
+#define NUM_BUFFERS 2
|
||||
+#define FB_DEV "/dev/fb0"
|
||||
+#define CONSOLE "/dev/tty"
|
||||
+#define FALLBACK "/dev/console"
|
||||
+
|
||||
+static vo_info_t info =
|
||||
+{
|
||||
+ "PS3 framebuffer w/ spe offload courtesy of spu_medialib (https://sourceforge.net/projects/spu-medialib)",
|
||||
+ "ps3",
|
||||
+ "Bill Garrett <wgarrett@xxx>",
|
||||
+ "Kristian Jerpetjøn <kristian.jerpetjoen@xxx>"
|
||||
+};
|
||||
+
|
||||
+LIBVO_EXTERN(ps3)
|
||||
+
|
||||
+static int maxW=1920, maxH=1200;
|
||||
+
|
||||
+static int page, parking_lot_page, offset;
|
||||
+
|
||||
+static uint8_t *inbuf_y[NUM_BUFFERS], *inbuf_u[NUM_BUFFERS], *inbuf_v[NUM_BUFFERS];
|
||||
+
|
||||
+static uint8_t *parking_lot_y[NUM_BUFFERS],*parking_lot_u[NUM_BUFFERS], *parking_lot_v[NUM_BUFFERS];
|
||||
+static uint32_t srcW, srcH, src_buf_siz, src_stride[3], src_p_siz[3], src_fmt, src_bpp;
|
||||
+static uint32_t dstW, dstH;
|
||||
+static uint32_t suggestedW, suggestedH;
|
||||
+static uint8_t *buf_plane_ptr[3];
|
||||
+
|
||||
+static char *src_title;
|
||||
+
|
||||
+static struct ps3fb_ioctl_res ps3_fb;
|
||||
+static void *fb_buf0;
|
||||
+static int fb, console, fb_length;
|
||||
+
|
||||
+
|
||||
+static int debug, snap;
|
||||
+
|
||||
+static yuvscaler2argb_t *yuvcsc;
|
||||
+static unsigned int yuvcsc_msg;
|
||||
+static int wait_yuvcsc, yuvcsc_not_ready;
|
||||
+
|
||||
+static int draw_slice_count, draw_image_count, get_image_count , flip_count;
|
||||
+
|
||||
+/**
|
||||
+ * Makes a copy of inbufs to .yuv files in current directory
|
||||
+ *
|
||||
+ * handy for testing - try with single stepping! '.'
|
||||
+ */
|
||||
+static void snapshot(void)
|
||||
+{
|
||||
+
|
||||
+ int i;
|
||||
+ FILE * snapshot;
|
||||
+ char *inbuf_file[]={"inbuf0.yuv", "inbuf1.yuv"};
|
||||
+
|
||||
+ for (i = 0; i < 2; i++) {
|
||||
+
|
||||
+ snapshot = fopen(inbuf_file[i], "wb");
|
||||
+ fwrite ( inbuf_y[i], 1, src_p_siz[0], snapshot );
|
||||
+ fwrite ( inbuf_u[i], 1, src_p_siz[1], snapshot );
|
||||
+ fwrite ( inbuf_v[i], 1, src_p_siz[2], snapshot );
|
||||
+ fclose ( snapshot );
|
||||
+ }
|
||||
+ mp_msg(MSGT_VO, MSGL_INFO,
|
||||
+ "[vo_ps3] snapshot: wrote current inbuf_*[]"
|
||||
+ "to inbuf0.yuv & inbuf1.yuv\n");
|
||||
+}
|
||||
+
|
||||
+/**
|
||||
+ * yuvcsc_check - check spu_yuv2argb_scaler process
|
||||
+ * make sure it's ready to run, and if not wait for it to finish
|
||||
+ */
|
||||
+static void yuvcsc_check(void)
|
||||
+{
|
||||
+
|
||||
+ if (!wait_yuvcsc)
|
||||
+ return;
|
||||
+
|
||||
+ yuvcsc_msg = yuvscsc_receive_message(yuvcsc);
|
||||
+
|
||||
+ while (yuvcsc_msg != RDY) {
|
||||
+
|
||||
+ yuvcsc_not_ready++;
|
||||
+ mp_msg(MSGT_VO, MSGL_WARN,
|
||||
+ "[vo_ps3] yuvcsc_check: ***yuvcsc not ready to run! :(\n" );
|
||||
+
|
||||
+ yuvcsc_msg = yuvscsc_receive_message(yuvcsc);
|
||||
+ }
|
||||
+
|
||||
+ wait_yuvcsc = 0;
|
||||
+}
|
||||
+
|
||||
+/**
|
||||
+ * yuvcsc_run - put the image on the framebuffer
|
||||
+ *
|
||||
+ */
|
||||
+static void yuvcsc_run(void)
|
||||
+{
|
||||
+ //confirm last run finished
|
||||
+ yuvcsc_check();
|
||||
+
|
||||
+ wait_yuvcsc = 1;
|
||||
+
|
||||
+ yuvscsc_send_message(yuvcsc, RUN);
|
||||
+}
|
||||
+
|
||||
+
|
||||
+static void draw_alpha(int x0, int y0, int w, int h, int dp, unsigned char* src,
|
||||
+ unsigned char *srca, int stride)
|
||||
+{
|
||||
+ switch(src_fmt)
|
||||
+ {
|
||||
+ case IMGFMT_I420: //Planar I420 0x30323449
|
||||
+ case IMGFMT_YV12: //Planar YV12 0x32315659
|
||||
+ case IMGFMT_IYUV: //Planar IYUV 0x56555949
|
||||
+ vo_draw_alpha_yv12(w, h, dp, src, srca, stride,
|
||||
+ buf_plane_ptr[0] + ( y0 * src_stride[0] + x0 ),
|
||||
+ src_stride[0] );
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+
|
||||
+
|
||||
+/**
|
||||
+ * Initiates the spu medialib spe vo accellerator
|
||||
+ * TODO change spu-medialib api to handle a struct
|
||||
+ */
|
||||
+static void init_spu_medialib(void)
|
||||
+{
|
||||
+ //init spu-medialib's scaler & colorspace converter on an spe
|
||||
+ yuvcsc = yuvscsc_init_yuv2argb_scaler(srcW, srcH, dstW, dstH, offset, maxW,
|
||||
+ ( ea_t * ) inbuf_y[0], ( ea_t * ) inbuf_y[1],
|
||||
+ ( ea_t * ) inbuf_u[0], ( ea_t * ) inbuf_u[1],
|
||||
+ ( ea_t * ) inbuf_v[0], ( ea_t * ) inbuf_v[1],
|
||||
+ fb_buf0, fb_buf0 );
|
||||
+
|
||||
+ mp_msg(MSGT_VO, MSGL_INFO,
|
||||
+ "[vo_ps3] init_spu_medialib:"
|
||||
+ " Initialized spu-medialib's spu_yuv2argb_scaler with:\n"
|
||||
+ " %ix%i=>%ix%i, offset:%i, maxW:%i\n",
|
||||
+ srcW, srcH, dstW, dstH, offset, maxW);
|
||||
+}
|
||||
+
|
||||
+/**
|
||||
+ * Updates the spu-medialib accellerator
|
||||
+ * TODO change spu-medialib api to handle a struct
|
||||
+ */
|
||||
+static void update_spu_medialib(void)
|
||||
+{
|
||||
+ yuvscsc_set_srcW(yuvcsc, srcW);
|
||||
+ yuvscsc_set_srcH(yuvcsc, srcH);
|
||||
+ yuvscsc_set_dstW(yuvcsc, dstW);
|
||||
+ yuvscsc_set_dstH(yuvcsc, dstH);
|
||||
+ yuvscsc_set_offset(yuvcsc, offset);
|
||||
+ yuvscsc_set_maxwidth(yuvcsc, maxW);
|
||||
+ yuvscsc_send_message(yuvcsc, UPDATE);
|
||||
+}
|
||||
+
|
||||
+
|
||||
+/**
|
||||
+ * Waits for any running spu-medialib operations and closes spu-medialib
|
||||
+ */
|
||||
+static void cleanup_spu_medialib(void)
|
||||
+{
|
||||
+
|
||||
+ yuvcsc_check();
|
||||
+
|
||||
+ yuvscsc_destroy(yuvcsc);
|
||||
+
|
||||
+ mp_msg(MSGT_VO, MSGL_INFO,
|
||||
+ "[vo_ps3] cleanup_spu_medialib:"
|
||||
+ " Destroyed spu-medialib's scaler/converter\n" );
|
||||
+}
|
||||
+
|
||||
+/**
|
||||
+ * Clears the ps3 framebuffer
|
||||
+ */
|
||||
+static void clear_framebuffer(void)
|
||||
+{
|
||||
+ //make sure spu medialib is not currently drawing to the surface
|
||||
+ yuvcsc_check();
|
||||
+
|
||||
+ mp_msg(MSGT_VO, MSGL_INFO,
|
||||
+ "[vo_ps3] clear: Clearing buffers\n");
|
||||
+
|
||||
+ //clear target framebuffer
|
||||
+ memset(fb_buf0, 0, fb_length);
|
||||
+}
|
||||
+
|
||||
+static void setup_screen(void)
|
||||
+{
|
||||
+
|
||||
+ vo_dx = vo_dy = 0;
|
||||
+ vo_screenwidth=ps3_fb.xres - (ps3_fb.xoff * 2);
|
||||
+ vo_screenheight=ps3_fb.yres- (ps3_fb.yoff * 2);
|
||||
+
|
||||
+ dstW = suggestedW;
|
||||
+ dstH = suggestedH;
|
||||
+
|
||||
+ if (vo_fs || dstW > vo_screenwidth || dstH > vo_screenheight)
|
||||
+ /* DISABLED BY GEEXBOX PORTER */ // aspect_fit(&dstW, &dstH, vo_screenwidth, vo_screenheight);
|
||||
+
|
||||
+ mp_msg(MSGT_VO, MSGL_INFO,
|
||||
+ "[vo_ps3] setup_scale: Using dest WxH:%ix%i\n", dstW, dstH);
|
||||
+
|
||||
+ //set aspect stuff
|
||||
+ aspect_save_orig(srcW, srcH);
|
||||
+ aspect_save_screenres(vo_screenwidth, vo_screenheight);
|
||||
+ aspect_save_prescale(dstW, dstH);
|
||||
+
|
||||
+ geometry(&vo_dx, &vo_dy, &dstW, &dstH, vo_screenwidth, vo_screenheight);
|
||||
+ aspect(&dstW, &dstH, A_NOZOOM);
|
||||
+
|
||||
+ //take care of scaling and scaler requirements/restrictions
|
||||
+ aspect_fit(&dstW, &dstH, (dstW&(~0xF)), (dstH&(~0x3)));
|
||||
+
|
||||
+ //center image -because
|
||||
+ //spu-medialib handles this and we don't have to draw the extra black bars
|
||||
+ vo_dx = (((vo_screenwidth - dstW)/2)&(~0x3));
|
||||
+ vo_dy = (vo_screenheight - dstH)/2;
|
||||
+ offset = vo_dx + (ps3_fb.xres * vo_dy);
|
||||
+
|
||||
+ mp_msg(MSGT_VO, MSGL_INFO,
|
||||
+ "[vo_ps3] setup_screen: After mplayer aspectchanges:\n"
|
||||
+ " vo_dx/dy=%ix%i, vo_screenwidth/height=%ix%i, offset=%i\n"
|
||||
+ " desired image size=%ix%i\n",
|
||||
+ vo_dx, vo_dy, vo_screenwidth, vo_screenheight, offset, dstW, dstH);
|
||||
+
|
||||
+ clear_framebuffer();
|
||||
+}
|
||||
+
|
||||
+static int query_format(uint32_t format)
|
||||
+{
|
||||
+
|
||||
+ mp_msg(MSGT_VO, MSGL_INFO,
|
||||
+ "[vo_ps3] query_format: Called for %s (0x%x)\n",
|
||||
+ vo_format_name(format), format);
|
||||
+
|
||||
+ switch(format)
|
||||
+ {
|
||||
+ case IMGFMT_I420: //Planar I420 0x30323449
|
||||
+ case IMGFMT_YV12: //Planar YV12 0x32315659
|
||||
+ case IMGFMT_IYUV: //Planar IYUV 0x56555949
|
||||
+ return VFCAP_CSP_SUPPORTED | VFCAP_CSP_SUPPORTED_BY_HW | VFCAP_HWSCALE_UP | \
|
||||
+ VFCAP_ACCEPT_STRIDE;
|
||||
+ default:
|
||||
+ return VO_FALSE; //not supporting anything else yet
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+static int config(uint32_t width, uint32_t height, uint32_t d_width,
|
||||
+ uint32_t d_height, uint32_t flags, char *title, uint32_t format)
|
||||
+{
|
||||
+
|
||||
+ int i;
|
||||
+
|
||||
+ srcW = dstW = width;
|
||||
+ srcH = dstH = height;
|
||||
+
|
||||
+ src_fmt = format;
|
||||
+ src_title = title;
|
||||
+
|
||||
+ suggestedW = d_width;
|
||||
+ suggestedH = d_height;
|
||||
+
|
||||
+ maxW=ps3_fb.xres;
|
||||
+ maxH=ps3_fb.yres;
|
||||
+
|
||||
+ if (flags && VOFLAG_FULLSCREEN)
|
||||
+ vo_fs = 1;
|
||||
+
|
||||
+ switch(format)
|
||||
+ {
|
||||
+ case IMGFMT_I420: //Planar I420 0x30323449
|
||||
+ case IMGFMT_YV12: //Planar YV12 0x32315659
|
||||
+ case IMGFMT_IYUV: //Planar IYUV 0x56555949
|
||||
+ src_buf_siz = srcW*srcH + srcW*srcH/2;
|
||||
+ src_stride[0] = srcW; //buffer plane strides 0=y, 1=u, 2=v
|
||||
+ src_stride[1] = src_stride[2] = src_stride[0]/2;
|
||||
+ src_p_siz[0] = srcW * srcH; //buffer plane sizes 0=y, 1=u, 2=v
|
||||
+ src_p_siz[1] = src_p_siz[2] = srcW/2 * srcH/2;
|
||||
+ src_bpp = 12;
|
||||
+ break;
|
||||
+ default:
|
||||
+ mp_msg(MSGT_VO, MSGL_FATAL,
|
||||
+ "[vo_ps3] config: Unsupported format: %i\n", format );
|
||||
+ return 1;
|
||||
+ }
|
||||
+
|
||||
+ for (i=0; i < NUM_BUFFERS; i++) {
|
||||
+
|
||||
+ inbuf_y[i]= memalign ( 128, src_p_siz[0]*2 );
|
||||
+ inbuf_u[i]= memalign ( 128, src_p_siz[1]*2 );
|
||||
+ inbuf_v[i]= memalign ( 128, src_p_siz[2]*2 );
|
||||
+ parking_lot_y[i]= memalign ( 128, src_p_siz[0]*2 );
|
||||
+ parking_lot_u[i]= memalign ( 128, src_p_siz[1]*2 );
|
||||
+ parking_lot_v[i]= memalign ( 128, src_p_siz[2]*2 );
|
||||
+ }
|
||||
+
|
||||
+ clear_framebuffer();
|
||||
+
|
||||
+ setup_screen();
|
||||
+
|
||||
+ init_spu_medialib();
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static uint32_t get_image(mp_image_t * mpi)
|
||||
+{
|
||||
+ //TODO fix this whole mess somehow
|
||||
+ get_image_count++;
|
||||
+
|
||||
+ if ( ( mpi->flags & MP_IMGFLAG_READABLE ) && ( mpi->type == MP_IMGTYPE_IPB
|
||||
+ || mpi->type == MP_IMGTYPE_IP ) ) {
|
||||
+
|
||||
+ buf_plane_ptr[0] = parking_lot_y[parking_lot_page];
|
||||
+ buf_plane_ptr[1] = parking_lot_u[parking_lot_page];
|
||||
+ buf_plane_ptr[2] = parking_lot_v[parking_lot_page];
|
||||
+ //mpi->flags |=MP_IMGFLAG_DIRECT;
|
||||
+ //FIXME crash without understand what Bill was thinking here
|
||||
+ mpi->flags |= MP_IMGFLAG_ALLOCATED;
|
||||
+ parking_lot_page^=1;
|
||||
+ }
|
||||
+ else {
|
||||
+
|
||||
+ buf_plane_ptr[0] = inbuf_y[page];
|
||||
+ buf_plane_ptr[1] = inbuf_u[page];
|
||||
+ buf_plane_ptr[2] = inbuf_v[page];
|
||||
+ mpi->flags |= MP_IMGFLAG_DIRECT;
|
||||
+ }
|
||||
+
|
||||
+ mpi->planes[0] = buf_plane_ptr[0];
|
||||
+ mpi->planes[1] = buf_plane_ptr[1];
|
||||
+ mpi->planes[2] = buf_plane_ptr[2];
|
||||
+
|
||||
+ mpi->stride[0] = src_stride[0];
|
||||
+ mpi->stride[1] = src_stride[1];
|
||||
+ mpi->stride[2] = src_stride[2];
|
||||
+
|
||||
+ mpi->priv = buf_plane_ptr[0];
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static int draw_slice(uint8_t *src[], int stride[], int w, int h, int x, int y)
|
||||
+{
|
||||
+
|
||||
+ int i;
|
||||
+ int slice_siz[3], slice_p_w[3], slice_p_h[3], offset[3];
|
||||
+
|
||||
+ draw_slice_count++;
|
||||
+
|
||||
+ //todo: should we care about MP_IMGFLAG_PRESERVE for a slice?
|
||||
+
|
||||
+ buf_plane_ptr[0] = inbuf_y[page];
|
||||
+ buf_plane_ptr[1] = inbuf_u[page];
|
||||
+ buf_plane_ptr[2] = inbuf_v[page];
|
||||
+
|
||||
+ // setup for YV12 - should add switch statement to 'check' format
|
||||
+ slice_siz[0] = stride[0] * h;
|
||||
+ slice_siz[1] = stride[1] * h/2;
|
||||
+ slice_siz[2] = stride[2] * h/2;
|
||||
+
|
||||
+ slice_p_w[0] = w;
|
||||
+ slice_p_w[1] = slice_p_w[2] = w/2;
|
||||
+
|
||||
+ slice_p_h[0] = h;
|
||||
+ slice_p_h[1] = slice_p_h[2] = h/2;
|
||||
+
|
||||
+ offset[0] = y * src_stride[0] + x;
|
||||
+ offset[1] = y/2 * src_stride[1] + x/2;
|
||||
+ offset[2] = y/2 * src_stride[2] + x/2;
|
||||
+
|
||||
+ for ( i=0; i<3; i++ ) {
|
||||
+
|
||||
+ memcpy_pic(buf_plane_ptr[i]+offset[i], src[i], slice_p_w[i],
|
||||
+ slice_p_h[i], src_stride[i], stride[i] );
|
||||
+ }
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+
|
||||
+static uint32_t draw_image(mp_image_t *mpi)
|
||||
+{
|
||||
+
|
||||
+ int i;
|
||||
+
|
||||
+ int mpi_p_siz[3], mpi_p_w[3], mpi_p_h[3];
|
||||
+
|
||||
+ draw_image_count++;
|
||||
+
|
||||
+ if (mpi->flags & MP_IMGFLAG_DIRECT)
|
||||
+ return 0;
|
||||
+
|
||||
+
|
||||
+ //TODO Understand what bill was trying to do here
|
||||
+ //not (mpi->flags & MP_IMGFLAG_DIRECT) (no -dr flag for direct rendering),
|
||||
+ // may need to handle MP_IMGFLAG_READABLE IPB (B) frames differently
|
||||
+ // When direct rendering is enabled (-dr), I moved the B frames to a
|
||||
+ // non-direct
|
||||
+ // buffer and then when drawn with draw_image, they (seem) to work fine
|
||||
+ // BUT, without direct rendering, don't know how to handle them :(
|
||||
+ // Just drawing them as called makes a mess of the video.
|
||||
+
|
||||
+ // if ( ( mpi->flags & MP_IMGFLAG_READABLE ) &&
|
||||
+ // ( mpi->type == MP_IMGTYPE_IPB || mpi->type == MP_IMGTYPE_IP ) )
|
||||
+ // {
|
||||
+ // buf_plane_ptr[0] = inbuf_y[page];
|
||||
+ // buf_plane_ptr[1] = inbuf_u[page];
|
||||
+ // buf_plane_ptr[2] = inbuf_v[page];
|
||||
+ // }
|
||||
+ // else
|
||||
+ // {
|
||||
+ buf_plane_ptr[0] = inbuf_y[page];
|
||||
+ buf_plane_ptr[1] = inbuf_u[page];
|
||||
+ buf_plane_ptr[2] = inbuf_v[page];
|
||||
+ // }
|
||||
+
|
||||
+
|
||||
+ // draw_slice(mpi->planes, buf_plane_ptr,mpi->w, mpi->h, 0, 0);
|
||||
+
|
||||
+ //messing with strides
|
||||
+ mpi_p_siz[0] = mpi->stride[0] * mpi->height;
|
||||
+ mpi_p_siz[1] = mpi->stride[1] * mpi->chroma_height;
|
||||
+ mpi_p_siz[2] = mpi->stride[2] * mpi->chroma_height;
|
||||
+
|
||||
+ mpi_p_w[0] = mpi->w;
|
||||
+ mpi_p_w[1] = mpi_p_w[2] = mpi->chroma_width;
|
||||
+
|
||||
+ mpi_p_h[0] = mpi->h;
|
||||
+ mpi_p_h[1] = mpi_p_h[2] = mpi->chroma_height;
|
||||
+
|
||||
+ for (i = 0; i < 3; i++){
|
||||
+
|
||||
+ memcpy_pic(buf_plane_ptr[i], mpi->planes[i], mpi_p_w[i],
|
||||
+ mpi_p_h[i], src_stride[i], mpi->stride[i]);
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+//FIXME Cannot remove compile issues sort this
|
||||
+static int draw_frame(uint8_t *src[])
|
||||
+{
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static void draw_osd(void)
|
||||
+{
|
||||
+
|
||||
+ vo_draw_text (srcW, srcH, draw_alpha);
|
||||
+}
|
||||
+
|
||||
+static void flip_page(void)
|
||||
+{
|
||||
+ int frame = 0;
|
||||
+
|
||||
+ int crt = 0;
|
||||
+
|
||||
+ flip_count++;
|
||||
+
|
||||
+ //make sure last frame is done
|
||||
+ yuvcsc_check();
|
||||
+
|
||||
+ //flip output to monitor
|
||||
+ ioctl(fb, PS3FB_IOCTL_FSEL, (unsigned long)&frame);
|
||||
+
|
||||
+ //make sure flip is complete
|
||||
+ ioctl(fb, FBIO_WAITFORVSYNC, (unsigned long)&crt);
|
||||
+
|
||||
+ //run process next frame
|
||||
+ yuvcsc_run();
|
||||
+
|
||||
+ //flip input buffer
|
||||
+ page = page^1;
|
||||
+}
|
||||
+
|
||||
+
|
||||
+/**
|
||||
+ * Toggles fullscreen off and on
|
||||
+ */
|
||||
+static void toggle_fullscreen(void)
|
||||
+{
|
||||
+
|
||||
+ vo_fs = !vo_fs;
|
||||
+
|
||||
+ setup_screen();
|
||||
+
|
||||
+ update_spu_medialib();
|
||||
+}
|
||||
+
|
||||
+static int control (uint32_t request, void *data, ...)
|
||||
+{
|
||||
+
|
||||
+ switch(request)
|
||||
+ {
|
||||
+ case VOCTRL_QUERY_FORMAT:
|
||||
+ return query_format (*(uint32_t*)data);
|
||||
+
|
||||
+ case VOCTRL_FULLSCREEN:
|
||||
+ toggle_fullscreen();
|
||||
+ return 0;
|
||||
+
|
||||
+ case VOCTRL_PAUSE:
|
||||
+ if (snap)
|
||||
+ snapshot();
|
||||
+ return 0;
|
||||
+
|
||||
+ case VOCTRL_RESUME:
|
||||
+ return 0;
|
||||
+
|
||||
+ case VOCTRL_GET_IMAGE:
|
||||
+ return get_image(data);
|
||||
+
|
||||
+ case VOCTRL_DRAW_IMAGE:
|
||||
+ return draw_image(data);
|
||||
+
|
||||
+ //TODO Handle upate screeninfo
|
||||
+ case VOCTRL_UPDATE_SCREENINFO:
|
||||
+ return VO_NOTIMPL;
|
||||
+
|
||||
+ default:
|
||||
+ return VO_NOTIMPL;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+static void check_events(void)
|
||||
+{
|
||||
+ //no events to check or is there ?
|
||||
+}
|
||||
+
|
||||
+static void uninit(void)
|
||||
+{
|
||||
+
|
||||
+ int i;
|
||||
+
|
||||
+ cleanup_spu_medialib();
|
||||
+
|
||||
+ /* Cleanup FrameBuffer and re-enable console */
|
||||
+ ioctl(fb, PS3FB_IOCTL_OFF);
|
||||
+
|
||||
+ ioctl(console, KDSETMODE, KD_TEXT);
|
||||
+
|
||||
+ if (console >= 0)
|
||||
+ close(console);
|
||||
+
|
||||
+ if (console >= 0)
|
||||
+ close(fb);
|
||||
+
|
||||
+ mp_msg(MSGT_VO, MSGL_INFO,
|
||||
+ "[vo_ps3] uninit: Cleaned up FB and re-enabled console.\n" );
|
||||
+
|
||||
+ for ( i=0; i<NUM_BUFFERS; i++ ) {
|
||||
+
|
||||
+ free(inbuf_y[i]);
|
||||
+ free(inbuf_u[i]);
|
||||
+ free(inbuf_v[i]);
|
||||
+ free(parking_lot_y[i]);
|
||||
+ free(parking_lot_u[i]);
|
||||
+ free(parking_lot_v[i]);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+/**
|
||||
+ * Initiates the ps3 framebuffer and disables the console
|
||||
+ * @return -1 if unsuccessful
|
||||
+ */
|
||||
+static int init_framebuffer(void)
|
||||
+{
|
||||
+ int arg;
|
||||
+ int res = 0;
|
||||
+
|
||||
+ console = open(CONSOLE, O_NONBLOCK);
|
||||
+
|
||||
+
|
||||
+ if (console >= 0)
|
||||
+ res = ioctl(console, KDGETMODE, &arg);
|
||||
+
|
||||
+ //ok the previous failed lets attempt to open as root
|
||||
+ if (console < 0 || res < 0) {
|
||||
+
|
||||
+ if (console >= 0)
|
||||
+ close(console);
|
||||
+ //This will only work if you are root
|
||||
+ console = open(FALLBACK, O_NONBLOCK);
|
||||
+ res = ioctl(console, KDGETMODE, &arg);
|
||||
+ }
|
||||
+
|
||||
+ //all options to open the FB has failed but we continue in good fait
|
||||
+ //it will only annoy you slightly
|
||||
+ if (console >= 0) {
|
||||
+
|
||||
+ if (arg !=KD_GRAPHICS && ioctl(console, KDSETMODE, KD_GRAPHICS) < 0)
|
||||
+ mp_msg(MSGT_VO,MSGL_INFO,"[vo_ps3] failed to disable console\n");
|
||||
+ }
|
||||
+ //we got this far now even if the console failed we continue
|
||||
+ res = 0;
|
||||
+
|
||||
+ fb = open(FB_DEV, O_RDWR);
|
||||
+
|
||||
+ if (fb < 0) {
|
||||
+
|
||||
+ mp_msg(MSGT_VO, MSGL_INFO,
|
||||
+ "[vo_ps3] init_framebuffer: failed to open fb\n" );
|
||||
+ goto fail;
|
||||
+ }
|
||||
+
|
||||
+ if (ioctl(fb, PS3FB_IOCTL_SCREENINFO, (unsigned long)&ps3_fb) < 0) {
|
||||
+
|
||||
+ mp_msg(MSGT_VO, MSGL_INFO,
|
||||
+ "[vo_ps3] init_framebuffer: failed to get fb info\n" );
|
||||
+ goto fail;
|
||||
+ }
|
||||
+
|
||||
+ if (ioctl(fb, PS3FB_IOCTL_ON ) < 0) {
|
||||
+
|
||||
+ mp_msg(MSGT_VO, MSGL_INFO,
|
||||
+ "[vo_ps3] init_framebuffer: failed to set manual swap control\n"
|
||||
+ );
|
||||
+ goto fail;
|
||||
+ }
|
||||
+
|
||||
+ fb_length = ps3_fb.xres*ps3_fb.yres*4;
|
||||
+
|
||||
+ //get the FB mmap
|
||||
+ fb_buf0 = mmap(NULL, fb_length, PROT_WRITE, MAP_SHARED, fb, 0);
|
||||
+
|
||||
+ mp_msg(MSGT_VO, MSGL_INFO, "[vo_ps3] init_framebuffer:"
|
||||
+ " Initialized framebuffer & disabled console\n"
|
||||
+ "FB is %ix%i at offset %ix%i\n",
|
||||
+ ps3_fb.xres, ps3_fb.yres, ps3_fb.xoff, ps3_fb.yoff);
|
||||
+
|
||||
+
|
||||
+ return 0;
|
||||
+
|
||||
+fail:
|
||||
+ if (fb >= 0) {
|
||||
+ ioctl(fb,PS3FB_IOCTL_OFF);
|
||||
+ close(fb);
|
||||
+ }
|
||||
+
|
||||
+ if (console >= 0) {
|
||||
+
|
||||
+ ioctl (console, KDSETMODE, KD_TEXT);
|
||||
+ close(console);
|
||||
+ }
|
||||
+
|
||||
+ return -1;
|
||||
+}
|
||||
+
|
||||
+static int preinit (const char *arg)
|
||||
+{
|
||||
+
|
||||
+ const opt_t subopts[] =
|
||||
+ {
|
||||
+ /* name arg type arg var test */
|
||||
+ { "debug", OPT_ARG_BOOL, &debug, NULL },
|
||||
+ { "snapshot", OPT_ARG_BOOL, &snap, NULL },
|
||||
+ { NULL, 0, NULL, NULL }
|
||||
+ };
|
||||
+
|
||||
+ if (subopt_parse(arg, subopts)) {
|
||||
+
|
||||
+ mp_msg(MSGT_VO, MSGL_WARN,
|
||||
+ "Suboptions for -vo ps3:\n"
|
||||
+ " debug - turn on debugging output specific to vo_ps3\n"
|
||||
+ " snapshot - take a raw yuv snapshot of input buffers on pause"
|
||||
+ "\n\n" );
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ mp_msg(MSGT_VO, MSGL_INFO,
|
||||
+ "ps3 suboptions:\n"
|
||||
+ " debug:%i\n"
|
||||
+ " snapshot:%i\n",
|
||||
+ debug, snap);
|
||||
+
|
||||
+ /* init PS3 FrameBuffer */
|
||||
+ if (init_framebuffer() < 0)
|
||||
+ return -1;
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
Index: configure
|
||||
===================================================================
|
||||
--- a/configure (revision 29136)
|
||||
+++ b/configure (working copy)
|
||||
@@ -391,6 +391,7 @@
|
||||
--enable-xshape enable XShape support [autodetect]
|
||||
--disable-xss disable screensaver support via xss [autodetect]
|
||||
--enable-fbdev enable FBDev video output [autodetect]
|
||||
+ --enable-ps3 enable FBDev video output SPU optimized for PS3 [autodetect]
|
||||
--enable-mlib enable mediaLib video output (Solaris) [disable]
|
||||
--enable-3dfx enable obsolete /dev/3dfx video output [disable]
|
||||
--enable-tdfxfb enable tdfxfb video output [disable]
|
||||
@@ -577,6 +578,7 @@
|
||||
_svga=auto
|
||||
_vesa=auto
|
||||
_fbdev=auto
|
||||
+_ps3=auto
|
||||
_dvb=auto
|
||||
_dvbhead=auto
|
||||
_dxr2=auto
|
||||
@@ -931,6 +933,8 @@
|
||||
--disable-vesa) _vesa=no ;;
|
||||
--enable-fbdev) _fbdev=yes ;;
|
||||
--disable-fbdev) _fbdev=no ;;
|
||||
+ --enable-ps3) _ps3=yes ;;
|
||||
+ --disable-ps3) _ps3=no ;;
|
||||
--enable-dvb) _dvb=yes ;;
|
||||
--disable-dvb) _dvb=no ;;
|
||||
--enable-dvbhead) _dvbhead=yes ;;
|
||||
@@ -4758,6 +4762,26 @@
|
||||
echores "$_fbdev"
|
||||
|
||||
|
||||
+echocheck "PS3"
|
||||
+if test "$_ps3" = auto ; then
|
||||
+ cat > $TMPC << EOF
|
||||
+#include <libspe2.h>
|
||||
+#include <spu-medialib/spu_control.h>
|
||||
+#include <spu-medialib/yuv2argb_scaler.h>
|
||||
+int main(void) { return 0; }
|
||||
+EOF
|
||||
+ _ps3=no
|
||||
+ cc_check -lspu-medialib -lspe2 && _ps3=yes
|
||||
+fi
|
||||
+if test "$_ps3" = yes; then
|
||||
+ def_ps3='#define CONFIG_PS3 1'
|
||||
+ _libs_mplayer="$_libs_mplayer -lspu-medialib -lspe2"
|
||||
+ _vomodules="ps3 $_vomodules"
|
||||
+else
|
||||
+ def_ps3='#undef CONFIG_PS3'
|
||||
+ _novomodules="ps3 $_novomodules"
|
||||
+fi
|
||||
+echores "$_ps3"
|
||||
|
||||
echocheck "DVB"
|
||||
if test "$_dvb" = auto ; then
|
||||
@@ -8257,6 +8281,7 @@
|
||||
PNG = $_png
|
||||
PNM = $_pnm
|
||||
PRIORITY = $_priority
|
||||
+PS3 = $_ps3
|
||||
PULSE = $_pulse
|
||||
PVR = $_pvr
|
||||
QTX_CODECS = $_qtx
|
||||
@@ -8730,6 +8755,7 @@
|
||||
$def_mng
|
||||
$def_png
|
||||
$def_pnm
|
||||
+$def_ps3
|
||||
$def_quartz
|
||||
$def_s3fb
|
||||
$def_sdl
|
7
packages/multimedia/mplayer/unpack.1
Normal file
7
packages/multimedia/mplayer/unpack.1
Normal file
@ -0,0 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
. config/options
|
||||
|
||||
$SCRIPTS/build toolchain
|
||||
|
||||
sed -i 's/\(cc_check -lpthread\) && $TMPO/\1/' $BUILD/$1*/configure
|
1
packages/multimedia/mplayer/url
Normal file
1
packages/multimedia/mplayer/url
Normal file
@ -0,0 +1 @@
|
||||
http://sources.openelec.tv/svn/mplayer-29746.tar.bz2
|
Loading…
x
Reference in New Issue
Block a user