1
mirror of https://github.com/mpv-player/mpv synced 2024-11-03 03:19:24 +01:00

Remove dvdnav support (DVD menus)

When the internal mplayer MPEG demuxer was removed (commit 1fde09db),
the default demuxer when using dvdnav was set to libavformat. Now it
turns out that this doesn't work with libavformat. It will terminate
playback right after the audio runs out (instead of looping it like the
video, or whatever it's supposed to do). I'm not sure what exactly the
problem is, but since 1. even mplayer-svn can't handle DVD menus
directly (missing highlights), 2. DVD menus are essentially worthless,
and 3. I don't directly watch DVDs, don't bother with it and remove it.

For basic playback, there's still libdvdread support.

Also, use pkg-config for libdvdread, and drop support for in-tree
libdvdread. Remove support for in-tree libdvdcss as well.
This commit is contained in:
wm4 2012-08-12 18:40:21 +02:00
parent aebfbbf2bd
commit 41fbcee1f5
17 changed files with 17 additions and 1706 deletions

View File

@ -9,7 +9,7 @@ Synopsis
| **mplayer** [options] files | **mplayer** [options] files
| **mplayer** [options] {group of files and options} | **mplayer** [options] {group of files and options}
| **mplayer** [br]://[title][/device] [options] | **mplayer** [br]://[title][/device] [options]
| **mplayer** [dvd|dvdnav]://[title|[start\_title]-end\_title][/device] [options] | **mplayer** dvd://[title|[start\_title]-end\_title][/device] [options]
| **mplayer** \vcd://track[/device] | **mplayer** \vcd://track[/device]
| **mplayer** \tv://[channel][/input_id] [options] | **mplayer** \tv://[channel][/input_id] [options]
| **mplayer** radio://[channel|frequency][/capture] [options] | **mplayer** radio://[channel|frequency][/capture] [options]
@ -239,30 +239,6 @@ n
u u
Change channel list. Change channel list.
(The following keys are only valid if you compiled with dvdnav support: They
are used to navigate the menus.)
keypad 8
Select button up.
keypad 2
Select button down.
keypad 4
Select button left.
keypad 6
Select button right.
keypad 5
Return to main menu.
keypad 7
Return to nearest menu (the order of preference is: chapter->title->root).
keypad ENTER
Confirm choice.
mouse control mouse control
------------- -------------
@ -410,12 +386,6 @@ option. To end the profile, start another one or use the profile name
| vf=pp=hb/vb/dr/al/fd | vf=pp=hb/vb/dr/al/fd
| alang=en | alang=en
| |
| [protocol.dvdnav]
| profile-desc="profile for dvdnav:// streams"
| profile=protocol.dvd
| mouse-movements=yes
| nocache=yes
|
| [extension.flv] | [extension.flv]
| profile-desc="profile for .flv files" | profile-desc="profile for .flv files"
| flip=yes | flip=yes
@ -680,9 +650,6 @@ Play DVD video from a directory with VOB files:
Copy a DVD title to hard disk, saving to file title1.vob : Copy a DVD title to hard disk, saving to file title1.vob :
``mplayer dvd://1 --dumpstream --dumpfile=title1.vob`` ``mplayer dvd://1 --dumpstream --dumpfile=title1.vob``
Play a DVD with dvdnav from path /dev/sr1:
``mplayer dvdnav:////dev/sr1``
Stream from HTTP: Stream from HTTP:
``mplayer http://mplayer.hq/example.avi`` ``mplayer http://mplayer.hq/example.avi``

View File

@ -31,29 +31,8 @@ SRCS_COMMON-$(CDDA) += stream/stream_cdda.c \
SRCS_COMMON-$(CDDB) += stream/stream_cddb.c SRCS_COMMON-$(CDDB) += stream/stream_cddb.c
SRCS_COMMON-$(DVBIN) += stream/dvb_tune.c \ SRCS_COMMON-$(DVBIN) += stream/dvb_tune.c \
stream/stream_dvb.c stream/stream_dvb.c
SRCS_COMMON-$(DVDNAV) += stream/stream_dvdnav.c
SRCS_COMMON-$(DVDNAV_INTERNAL) += libdvdnav/dvdnav.c \
libdvdnav/highlight.c \
libdvdnav/navigation.c \
libdvdnav/read_cache.c \
libdvdnav/remap.c \
libdvdnav/searching.c \
libdvdnav/settings.c \
libdvdnav/vm/decoder.c \
libdvdnav/vm/vm.c \
libdvdnav/vm/vmcmd.c \
SRCS_COMMON-$(DVDREAD) += stream/stream_dvd.c \ SRCS_COMMON-$(DVDREAD) += stream/stream_dvd.c \
stream/stream_dvd_common.c stream/stream_dvd_common.c
SRCS_COMMON-$(DVDREAD_INTERNAL) += libdvdread4/bitreader.c \
libdvdread4/dvd_input.c \
libdvdread4/dvd_reader.c \
libdvdread4/dvd_udf.c \
libdvdread4/ifo_print.c \
libdvdread4/ifo_read.c \
libdvdread4/md5.c \
libdvdread4/nav_print.c \
libdvdread4/nav_read.c \
SRCS_COMMON-$(FAAD) += libmpcodecs/ad_faad.c SRCS_COMMON-$(FAAD) += libmpcodecs/ad_faad.c
@ -78,11 +57,6 @@ SRCS_COMMON-$(LIBDCA) += libmpcodecs/ad_libdca.c
SRCS_COMMON-$(LIBDV) += libmpcodecs/ad_libdv.c \ SRCS_COMMON-$(LIBDV) += libmpcodecs/ad_libdv.c \
libmpcodecs/vd_libdv.c \ libmpcodecs/vd_libdv.c \
libmpdemux/demux_rawdv.c libmpdemux/demux_rawdv.c
SRCS_COMMON-$(LIBDVDCSS_INTERNAL) += libdvdcss/css.c \
libdvdcss/device.c \
libdvdcss/error.c \
libdvdcss/ioctl.c \
libdvdcss/libdvdcss.c \
SRCS_COMMON-$(LIBMAD) += libmpcodecs/ad_libmad.c SRCS_COMMON-$(LIBMAD) += libmpcodecs/ad_libmad.c
@ -518,13 +492,6 @@ libmpcodecs/vf_fspp.o libmpcodecs/vf_mcdeint.o libmpcodecs/vf_spp.o: CFLAGS := -
osdep/mplayer-rc.o: osdep/mplayer.exe.manifest osdep/mplayer-rc.o: osdep/mplayer.exe.manifest
libdvdcss/%: CFLAGS := -Ilibdvdcss -D_GNU_SOURCE -DVERSION=\"1.2.10\" $(CFLAGS_LIBDVDCSS) $(CFLAGS)
libdvdnav/%: CFLAGS := -Ilibdvdnav -D_GNU_SOURCE -DHAVE_CONFIG_H -DVERSION=\"MPlayer-custom\" $(CFLAGS)
libdvdread4/%: CFLAGS := -Ilibdvdread4 -D_GNU_SOURCE $(CFLAGS_LIBDVDCSS_DVDREAD) $(CFLAGS)
stream/stream_dvdnav%: CFLAGS := $(CFLAGS_LIBDVDNAV) $(CFLAGS)
###### installation / clean / generic rules ####### ###### installation / clean / generic rules #######

View File

@ -65,7 +65,6 @@
#ifdef CONFIG_DVDREAD #ifdef CONFIG_DVDREAD
#include "stream/stream_dvd.h" #include "stream/stream_dvd.h"
#endif #endif
#include "stream/stream_dvdnav.h"
#include "m_struct.h" #include "m_struct.h"
#include "screenshot.h" #include "screenshot.h"
@ -1690,10 +1689,9 @@ static int mp_property_sub(m_option_t *prop, int action, void *arg,
} }
} }
#ifdef CONFIG_DVDREAD #ifdef CONFIG_DVDREAD
if (vo_spudec if (vo_spudec && (mpctx->stream->type == STREAMTYPE_DVD)
&& (mpctx->stream->type == STREAMTYPE_DVD && opts->sub_id < 0 && reset_spu)
|| mpctx->stream->type == STREAMTYPE_DVDNAV) {
&& opts->sub_id < 0 && reset_spu) {
d_sub->id = -2; d_sub->id = -2;
d_sub->sh = NULL; d_sub->sh = NULL;
} }
@ -2513,36 +2511,6 @@ static bool set_property_command(MPContext *mpctx, mp_cmd_t *cmd)
return 1; return 1;
} }
#ifdef CONFIG_DVDNAV
static const struct {
const char *name;
const enum mp_command_type cmd;
} mp_dvdnav_bindings[] = {
{ "up", MP_CMD_DVDNAV_UP },
{ "down", MP_CMD_DVDNAV_DOWN },
{ "left", MP_CMD_DVDNAV_LEFT },
{ "right", MP_CMD_DVDNAV_RIGHT },
{ "menu", MP_CMD_DVDNAV_MENU },
{ "select", MP_CMD_DVDNAV_SELECT },
{ "prev", MP_CMD_DVDNAV_PREVMENU },
{ "mouse", MP_CMD_DVDNAV_MOUSECLICK },
/*
* keep old dvdnav sub-command options for a while in order not to
* break slave-mode API too suddenly.
*/
{ "1", MP_CMD_DVDNAV_UP },
{ "2", MP_CMD_DVDNAV_DOWN },
{ "3", MP_CMD_DVDNAV_LEFT },
{ "4", MP_CMD_DVDNAV_RIGHT },
{ "5", MP_CMD_DVDNAV_MENU },
{ "6", MP_CMD_DVDNAV_SELECT },
{ "7", MP_CMD_DVDNAV_PREVMENU },
{ "8", MP_CMD_DVDNAV_MOUSECLICK },
{ NULL, 0 }
};
#endif
static const char *property_error_string(int error_value) static const char *property_error_string(int error_value)
{ {
switch (error_value) { switch (error_value) {
@ -3392,50 +3360,9 @@ void run_command(MPContext *mpctx, mp_cmd_t *cmd)
pointer_x = cmd->args[0].v.i; pointer_x = cmd->args[0].v.i;
pointer_y = cmd->args[1].v.i; pointer_y = cmd->args[1].v.i;
rescale_input_coordinates(mpctx, pointer_x, pointer_y, &dx, &dy); rescale_input_coordinates(mpctx, pointer_x, pointer_y, &dx, &dy);
#ifdef CONFIG_DVDNAV
if (mpctx->stream->type == STREAMTYPE_DVDNAV
&& dx > 0.0 && dy > 0.0) {
int button = -1;
pointer_x = (int) (dx * (double) sh_video->disp_w);
pointer_y = (int) (dy * (double) sh_video->disp_h);
mp_dvdnav_update_mouse_pos(mpctx->stream,
pointer_x, pointer_y, &button);
if (opts->osd_level > 1 && button > 0)
set_osd_msg(mpctx, OSD_MSG_TEXT, 1, osd_duration,
"Selected button number %d", button);
}
#endif
break; break;
} }
#ifdef CONFIG_DVDNAV
case MP_CMD_DVDNAV: {
int button = -1;
int i;
enum mp_command_type command = 0;
if (mpctx->stream->type != STREAMTYPE_DVDNAV)
break;
for (i = 0; mp_dvdnav_bindings[i].name; i++)
if (cmd->args[0].v.s &&
!strcasecmp(cmd->args[0].v.s,
mp_dvdnav_bindings[i].name))
command = mp_dvdnav_bindings[i].cmd;
mp_dvdnav_handle_input(mpctx->stream, command, &button);
if (opts->osd_level > 1 && button > 0)
set_osd_msg(mpctx, OSD_MSG_TEXT, 1, osd_duration,
"Selected button number %d", button);
break;
}
case MP_CMD_SWITCH_TITLE:
if (mpctx->stream->type == STREAMTYPE_DVDNAV)
mp_dvdnav_switch_title(mpctx->stream, cmd->args[0].v.i);
break;
#endif
case MP_CMD_VO_CMDLINE: case MP_CMD_VO_CMDLINE:
if (mpctx->video_out) { if (mpctx->video_out) {
char *s = cmd->args[0].v.s; char *s = cmd->args[0].v.s;

137
configure vendored
View File

@ -325,10 +325,7 @@ Optional features:
--enable-lcms2 enable LCMS2 support [autodetect] --enable-lcms2 enable LCMS2 support [autodetect]
--disable-vcd disable VCD support [autodetect] --disable-vcd disable VCD support [autodetect]
--disable-bluray disable Blu-ray support [autodetect] --disable-bluray disable Blu-ray support [autodetect]
--disable-dvdnav disable libdvdnav [autodetect]
--disable-dvdread disable libdvdread [autodetect] --disable-dvdread disable libdvdread [autodetect]
--disable-dvdread-internal disable internal libdvdread [autodetect]
--disable-libdvdcss-internal disable internal libdvdcss [autodetect]
--disable-cddb disable cddb [autodetect] --disable-cddb disable cddb [autodetect]
--disable-sortsub disable subtitle sorting [enabled] --disable-sortsub disable subtitle sorting [enabled]
--disable-enca disable ENCA charset oracle library [autodetect] --disable-enca disable ENCA charset oracle library [autodetect]
@ -425,7 +422,6 @@ Use these options if autodetection fails:
--extra-libs=FLAGS extra linker flags --extra-libs=FLAGS extra linker flags
--extra-libs-mplayer=FLAGS extra linker flags for MPlayer --extra-libs-mplayer=FLAGS extra linker flags for MPlayer
--with-dvdnav-config=PATH path to dvdnav-config
--with-dvdread-config=PATH path to dvdread-config --with-dvdread-config=PATH path to dvdread-config
This configure script is NOT autoconf-based, even though its output is similar. This configure script is NOT autoconf-based, even though its output is similar.
@ -482,12 +478,8 @@ _ladspa=auto
_libbs2b=auto _libbs2b=auto
_vcd=auto _vcd=auto
_bluray=auto _bluray=auto
_dvdnav=auto
_dvdnavconfig=dvdnav-config
_dvdreadconfig=dvdread-config _dvdreadconfig=dvdread-config
_dvdread=auto _dvdread=auto
_dvdread_internal=auto
_libdvdcss_internal=auto
_live=no _live=no
_nemesi=auto _nemesi=auto
_lcms2=auto _lcms2=auto
@ -579,10 +571,6 @@ for ac_option do
--with-install=*) --with-install=*)
_install=$(echo $ac_option | cut -d '=' -f 2 ) _install=$(echo $ac_option | cut -d '=' -f 2 )
;; ;;
--with-dvdnav-config=*)
_dvdnavconfig=$(echo $ac_option | cut -d '=' -f 2)
;;
--with-dvdread-config=*) --with-dvdread-config=*)
_dvdreadconfig=$(echo $ac_option | cut -d '=' -f 2) _dvdreadconfig=$(echo $ac_option | cut -d '=' -f 2)
;; ;;
@ -718,12 +706,6 @@ for ac_option do
--disable-bluray) _bluray=no ;; --disable-bluray) _bluray=no ;;
--enable-dvdread) _dvdread=yes ;; --enable-dvdread) _dvdread=yes ;;
--disable-dvdread) _dvdread=no ;; --disable-dvdread) _dvdread=no ;;
--enable-dvdread-internal) _dvdread_internal=yes ;;
--disable-dvdread-internal) _dvdread_internal=no ;;
--enable-libdvdcss-internal) _libdvdcss_internal=yes ;;
--disable-libdvdcss-internal) _libdvdcss_internal=no ;;
--enable-dvdnav) _dvdnav=yes ;;
--disable-dvdnav) _dvdnav=no ;;
--enable-live) _live=yes ;; --enable-live) _live=yes ;;
--disable-live) _live=no ;; --disable-live) _live=no ;;
--enable-nemesi) _nemesi=yes ;; --enable-nemesi) _nemesi=yes ;;
@ -2852,44 +2834,15 @@ else
fi fi
echores "$_bluray" echores "$_bluray"
echocheck "dvdread"
if test "$_dvdread_internal" = auto && test ! -f "libdvdread4/dvd_reader.c" ; then
_dvdread_internal=no
fi
if test "$_dvdread_internal" = auto ; then
_dvdread_internal=no
_dvdread=no
if (linux || freebsd || netbsd || openbsd || dragonfly) &&
(test "$_dvd" = yes || test "$_cdrom" = yes || test "$_cdio" = yes ||
test "$_dvdio" = yes || test "$_bsdi_dvd" = yes) ||
darwin || win32; then
_dvdread_internal=yes
_dvdread=yes
extra_cflags="-Ilibdvdread4 $extra_cflags"
fi
elif test "$_dvdread" = auto ; then
_dvdread=no
if test "$_dl" = yes; then
_dvdreadcflags=$($_dvdreadconfig --cflags 2> /dev/null)
_dvdreadlibs=$($_dvdreadconfig --libs 2> /dev/null)
if header_check dvdread/dvd_reader.h $_dvdreadcflags $_dvdreadlibs $_ld_dl ; then
_dvdread=yes
extra_cflags="$extra_cflags $_dvdreadcflags"
extra_ldflags="$extra_ldflags $_dvdreadlibs"
res_comment="external"
fi
fi
fi
if test "$_dvdread_internal" = yes; then echocheck "dvdread"
if test "$_dvdread" = auto ; then
_dvdread=no
pkg_config_add 'dvdread >= 4.2.0' && _dvdread=yes
fi
if test "$_dvdread" = yes ; then
def_dvdread='#define CONFIG_DVDREAD 1' def_dvdread='#define CONFIG_DVDREAD 1'
inputmodules="dvdread(internal) $inputmodules" inputmodules="dvdread $inputmodules"
res_comment="internal"
elif test "$_dvdread" = yes; then
def_dvdread='#define CONFIG_DVDREAD 1'
extra_ldflags="$extra_ldflags -ldvdread"
inputmodules="dvdread(external) $inputmodules"
res_comment="external"
else else
def_dvdread='#undef CONFIG_DVDREAD' def_dvdread='#undef CONFIG_DVDREAD'
noinputmodules="dvdread $noinputmodules" noinputmodules="dvdread $noinputmodules"
@ -2897,32 +2850,6 @@ fi
echores "$_dvdread" echores "$_dvdread"
echocheck "internal libdvdcss"
if test "$_libdvdcss_internal" = auto ; then
_libdvdcss_internal=no
test "$_dvdread_internal" = yes && test -d libdvdcss && _libdvdcss_internal=yes
fi
if test "$_libdvdcss_internal" = yes ; then
if linux || netbsd || openbsd ; then
def_dvd_linux='#define HAVE_LINUX_DVD_STRUCT 1'
openbsd && def_dvd_openbsd='#define HAVE_OPENBSD_DVD_STRUCT 1'
elif freebsd || dragonfly ; then
def_dvd_bsd='#define HAVE_BSD_DVD_STRUCT 1'
elif darwin ; then
def_dvd_darwin='#define DARWIN_DVD_IOCTL'
extra_ldflags="$extra_ldflags -framework IOKit -framework Carbon"
elif cygwin ; then
cflags_libdvdcss="-DSYS_CYGWIN -DWIN32"
fi
cflags_libdvdcss_dvdread="-Ilibdvdcss"
def_dvdcss="#define HAVE_DVDCSS_DVDCSS_H 1"
inputmodules="libdvdcss(internal) $inputmodules"
else
noinputmodules="libdvdcss(internal) $noinputmodules"
fi
echores "$_libdvdcss_internal"
echocheck "libcdio" echocheck "libcdio"
if test "$_libcdio" = auto ; then if test "$_libcdio" = auto ; then
_libcdio=no _libcdio=no
@ -3575,49 +3502,7 @@ CFLAGS="$CFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE
CXXFLAGS=" $CFLAGS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS" CXXFLAGS=" $CFLAGS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS"
# This must be the last test to be performed. Any other tests following it
# could fail due to linker errors. libdvdnavmini is intentionally not linked
# against libdvdread (to permit MPlayer to use its own copy of the library).
# So any compilation using the flags added here but not linking against
# libdvdread can fail.
echocheck "DVD support (libdvdnav)"
if test "$_dvdread_internal" = yes && test ! -f "libdvdnav/dvdnav.c" ; then
_dvdnav=no
fi
dvdnav_internal=no
if test "$_dvdnav" = auto ; then
if test "$_dvdread_internal" = yes ; then
_dvdnav=yes
dvdnav_internal=yes
res_comment="internal"
else
$_dvdnavconfig --version --minilibs >> $TMPLOG 2>&1 || _dvdnav=no
fi
fi
if test "$_dvdnav" = auto ; then
_dvdnav=no
_dvdnavdir=$($_dvdnavconfig --cflags)
_dvdnavlibs=$($_dvdnavconfig --libs)
statement_check_broken stdint.h dvdnav/dvdnav.h 'dvdnav_t *dvd = 0' $_dvdnavdir $_dvdnavlibs $_ld_dl $_ld_pthread && _dvdnav=yes
fi
if test "$_dvdnav" = yes ; then
def_dvdnav='#define CONFIG_DVDNAV 1'
if test "$dvdnav_internal" = yes ; then
cflags_libdvdnav="-Ilibdvdnav"
inputmodules="dvdnav(internal) $inputmodules"
else
extra_cflags="$extra_cflags $($_dvdnavconfig --cflags)"
extra_ldflags="$extra_ldflags $($_dvdnavconfig --minilibs)"
inputmodules="dvdnav $inputmodules"
fi
else
def_dvdnav='#undef CONFIG_DVDNAV'
noinputmodules="dvdnav $noinputmodules"
fi
echores "$_dvdnav"
# DO NOT ADD ANY TESTS THAT USE LINKER FLAGS HERE (like cc_check). # DO NOT ADD ANY TESTS THAT USE LINKER FLAGS HERE (like cc_check).
# Read dvdnav comment above.
mak_enable () { mak_enable () {
list=$(echo $1 | tr '[a-z]' '[A-Z]') list=$(echo $1 | tr '[a-z]' '[A-Z]')
@ -3667,7 +3552,6 @@ DEPFLAGS = $DEPFLAGS
CFLAGS_LIBDVDCSS = $cflags_libdvdcss CFLAGS_LIBDVDCSS = $cflags_libdvdcss
CFLAGS_LIBDVDCSS_DVDREAD = $cflags_libdvdcss_dvdread CFLAGS_LIBDVDCSS_DVDREAD = $cflags_libdvdcss_dvdread
CFLAGS_LIBDVDNAV = $cflags_libdvdnav
EXTRALIBS = $extra_ldflags $_ld_static $_ld_lm $extra_libs EXTRALIBS = $extra_ldflags $_ld_static $_ld_lm $extra_libs
EXTRALIBS_MPLAYER = $libs_mplayer EXTRALIBS_MPLAYER = $libs_mplayer
@ -3705,10 +3589,7 @@ DIRECT3D = $_direct3d
DIRECTFB = $_directfb DIRECTFB = $_directfb
DIRECTX = $_directx DIRECTX = $_directx
DVBIN = $_dvbin DVBIN = $_dvbin
DVDNAV = $_dvdnav
DVDNAV_INTERNAL = $dvdnav_internal
DVDREAD = $_dvdread DVDREAD = $_dvdread
DVDREAD_INTERNAL = $_dvdread_internal
DXR3 = $_dxr3 DXR3 = $_dxr3
FAAD = $_faad FAAD = $_faad
FTP = $_ftp FTP = $_ftp
@ -3731,7 +3612,6 @@ LIBBLURAY = $_bluray
LIBBS2B = $_libbs2b LIBBS2B = $_libbs2b
LIBDCA = $_libdca LIBDCA = $_libdca
LIBDV = $_libdv LIBDV = $_libdv
LIBDVDCSS_INTERNAL = $_libdvdcss_internal
LIBMAD = $_mad LIBMAD = $_mad
LIBNEMESI = $_nemesi LIBNEMESI = $_nemesi
LCMS2 = $_lcms2 LCMS2 = $_lcms2
@ -3835,8 +3715,6 @@ $def_translation
/* libdvdread */ /* libdvdread */
#define STDC_HEADERS 1 #define STDC_HEADERS 1
#define HAVE_MEMCPY 1 #define HAVE_MEMCPY 1
/* libdvdnav */
#define READ_CACHE_TRACE 0
/* libdvdread */ /* libdvdread */
#define HAVE_DLFCN_H 1 #define HAVE_DLFCN_H 1
$def_dvdcss $def_dvdcss
@ -3916,7 +3794,6 @@ $def_dvd_darwin
$def_dvd_linux $def_dvd_linux
$def_dvd_openbsd $def_dvd_openbsd
$def_dvdio $def_dvdio
$def_dvdnav
$def_dvdread $def_dvdread
$def_vcd $def_vcd

View File

@ -134,20 +134,6 @@ k tv_step_channel -1
n tv_step_norm n tv_step_norm
u tv_step_chanlist u tv_step_chanlist
#
# DVDNAV
# Requires dvdnav://
#
KP8 {dvdnav} dvdnav up
KP2 {dvdnav} dvdnav down
KP4 {dvdnav} dvdnav left
KP6 {dvdnav} dvdnav right
KP5 {dvdnav} dvdnav menu
KP_ENTER {dvdnav} dvdnav select
MOUSE_BTN0 {dvdnav} dvdnav mouse
KP7 {dvdnav} dvdnav prev
# #
# Apple Remote section # Apple Remote section
# #

View File

@ -197,10 +197,6 @@ static const mp_cmd_t mp_cmds[] = {
{ MP_CMD_RUN, "run", { ARG_STRING } }, { MP_CMD_RUN, "run", { ARG_STRING } },
{ MP_CMD_VF_CHANGE_RECTANGLE, "change_rectangle", { ARG_INT, ARG_INT } }, { MP_CMD_VF_CHANGE_RECTANGLE, "change_rectangle", { ARG_INT, ARG_INT } },
#ifdef CONFIG_DVDNAV
{ MP_CMD_DVDNAV, "dvdnav", { ARG_STRING } },
#endif
{ MP_CMD_GET_VO_FULLSCREEN, "get_vo_fullscreen", }, { MP_CMD_GET_VO_FULLSCREEN, "get_vo_fullscreen", },
{ MP_CMD_GET_SUB_VISIBILITY, "get_sub_visibility", }, { MP_CMD_GET_SUB_VISIBILITY, "get_sub_visibility", },
{ MP_CMD_KEYDOWN_EVENTS, "key_down_event", { ARG_INT } }, { MP_CMD_KEYDOWN_EVENTS, "key_down_event", { ARG_INT } },

View File

@ -44,7 +44,6 @@ enum mp_command_type {
MP_CMD_TV_STEP_CHANNEL_LIST, MP_CMD_TV_STEP_CHANNEL_LIST,
MP_CMD_VO_FULLSCREEN, MP_CMD_VO_FULLSCREEN,
MP_CMD_SUB_POS, MP_CMD_SUB_POS,
MP_CMD_DVDNAV,
MP_CMD_SCREENSHOT, MP_CMD_SCREENSHOT,
MP_CMD_PANSCAN, MP_CMD_PANSCAN,
MP_CMD_MUTE, MP_CMD_MUTE,
@ -130,16 +129,6 @@ enum mp_command_type {
MP_CMD_SWITCH_TITLE, MP_CMD_SWITCH_TITLE,
MP_CMD_STOP, MP_CMD_STOP,
/// DVDNAV commands
MP_CMD_DVDNAV_UP = 1000,
MP_CMD_DVDNAV_DOWN,
MP_CMD_DVDNAV_LEFT,
MP_CMD_DVDNAV_RIGHT,
MP_CMD_DVDNAV_MENU,
MP_CMD_DVDNAV_SELECT,
MP_CMD_DVDNAV_PREVMENU,
MP_CMD_DVDNAV_MOUSECLICK,
/// DVB commands /// DVB commands
MP_CMD_DVB_SET_CHANNEL = 5101, MP_CMD_DVB_SET_CHANNEL = 5101,

View File

@ -1145,7 +1145,7 @@ int demux_seek(demuxer_t *demuxer, float rel_seek_secs, float audio_delay,
* (nothing actually implements DEMUXER_CTRL_RESYNC now). * (nothing actually implements DEMUXER_CTRL_RESYNC now).
*/ */
struct stream *stream = demuxer->stream; struct stream *stream = demuxer->stream;
if (stream->type == STREAMTYPE_DVD || stream->type == STREAMTYPE_DVDNAV) { if (stream->type == STREAMTYPE_DVD) {
double pts; double pts;
if (flags & SEEK_ABSOLUTE) if (flags & SEEK_ABSOLUTE)

View File

@ -214,12 +214,6 @@ typedef struct MPContext {
struct screenshot_ctx *screenshot_ctx; struct screenshot_ctx *screenshot_ctx;
#ifdef CONFIG_DVDNAV
struct mp_image *nav_smpi; ///< last decoded dvdnav video image
unsigned char *nav_buffer; ///< last read dvdnav video frame
unsigned char *nav_start; ///< pointer to last read video buffer
int nav_in_size; ///< last read size
#endif
} MPContext; } MPContext;

241
mplayer.c
View File

@ -146,7 +146,6 @@ static int max_framesize = 0;
#ifdef CONFIG_DVDREAD #ifdef CONFIG_DVDREAD
#include "stream/stream_dvd.h" #include "stream/stream_dvd.h"
#endif #endif
#include "stream/stream_dvdnav.h"
#include "libmpcodecs/dec_audio.h" #include "libmpcodecs/dec_audio.h"
#include "libmpcodecs/dec_video.h" #include "libmpcodecs/dec_video.h"
@ -526,19 +525,6 @@ static void print_file_properties(struct MPContext *mpctx, const char *filename)
/// step size of mixer changes /// step size of mixer changes
int volstep = 3; int volstep = 3;
#ifdef CONFIG_DVDNAV
static void mp_dvdnav_context_free(MPContext *ctx)
{
if (ctx->nav_smpi)
free_mp_image(ctx->nav_smpi);
ctx->nav_smpi = NULL;
free(ctx->nav_buffer);
ctx->nav_buffer = NULL;
ctx->nav_start = NULL;
ctx->nav_in_size = 0;
}
#endif
static void uninit_subs(struct demuxer *demuxer) static void uninit_subs(struct demuxer *demuxer)
{ {
for (int i = 0; i < MAX_S_STREAMS; i++) { for (int i = 0; i < MAX_S_STREAMS; i++) {
@ -615,9 +601,6 @@ void uninit_player(struct MPContext *mpctx, unsigned int mask)
mpctx->initialized_flags &= ~INITIALIZED_VO; mpctx->initialized_flags &= ~INITIALIZED_VO;
vo_destroy(mpctx->video_out); vo_destroy(mpctx->video_out);
mpctx->video_out = NULL; mpctx->video_out = NULL;
#ifdef CONFIG_DVDNAV
mp_dvdnav_context_free(mpctx);
#endif
} }
// Must be after libvo uninit, as few vo drivers (svgalib) have tty code. // Must be after libvo uninit, as few vo drivers (svgalib) have tty code.
@ -953,13 +936,6 @@ void init_vo_spudec(struct MPContext *mpctx)
} }
#endif #endif
#ifdef CONFIG_DVDNAV
if (vo_spudec == NULL && mpctx->stream->type == STREAMTYPE_DVDNAV) {
unsigned int *palette = mp_dvdnav_get_spu_clut(mpctx->stream);
vo_spudec = spudec_new_scaled(palette, width, height, NULL, 0);
}
#endif
if (vo_spudec == NULL) { if (vo_spudec == NULL) {
sh_sub_t *sh = mpctx->d_sub->sh; sh_sub_t *sh = mpctx->d_sub->sh;
vo_spudec = spudec_new_scaled(NULL, width, height, sh->extradata, vo_spudec = spudec_new_scaled(NULL, width, height, sh->extradata,
@ -1854,149 +1830,6 @@ static int select_subtitle(MPContext *mpctx)
return found; return found;
} }
#ifdef CONFIG_DVDNAV
#ifndef FF_B_TYPE
#define FF_B_TYPE 3
#endif
/// store decoded video image
static mp_image_t *mp_dvdnav_copy_mpi(mp_image_t *to_mpi,
mp_image_t *from_mpi)
{
mp_image_t *mpi;
/// Do not store B-frames
if (from_mpi->pict_type == FF_B_TYPE)
return to_mpi;
if (to_mpi &&
to_mpi->w == from_mpi->w &&
to_mpi->h == from_mpi->h &&
to_mpi->imgfmt == from_mpi->imgfmt)
mpi = to_mpi;
else {
if (to_mpi)
free_mp_image(to_mpi);
if (from_mpi->w == 0 || from_mpi->h == 0)
return NULL;
mpi = alloc_mpi(from_mpi->w, from_mpi->h, from_mpi->imgfmt);
}
copy_mpi(mpi, from_mpi);
return mpi;
}
static void mp_dvdnav_reset_stream(MPContext *ctx)
{
struct MPOpts *opts = &ctx->opts;
if (ctx->sh_video) {
/// clear video pts
ctx->d_video->pts = 0.0f;
ctx->sh_video->pts = 0.0f;
ctx->sh_video->i_pts = 0.0f;
ctx->sh_video->last_pts = 0.0f;
ctx->sh_video->num_buffered_pts = 0;
ctx->sh_video->num_frames = 0;
ctx->sh_video->num_frames_decoded = 0;
ctx->sh_video->timer = 0.0f;
ctx->sh_video->stream_delay = 0.0f;
ctx->sh_video->timer = 0;
ctx->demuxer->stream_pts = MP_NOPTS_VALUE;
}
if (ctx->sh_audio) {
/// free audio packets and reset
ds_free_packs(ctx->d_audio);
audio_delay -= ctx->sh_audio->stream_delay;
ctx->delay = -audio_delay;
ao_reset(ctx->ao);
resync_audio_stream(ctx->sh_audio);
}
audio_delay = 0.0f;
ctx->sub_counts[SUB_SOURCE_DEMUX] = mp_dvdnav_number_of_subs(ctx->stream);
if (opts->sub_lang && opts->sub_id == dvdsub_lang_id) {
dvdsub_lang_id = mp_dvdnav_sid_from_lang(ctx->stream, opts->sub_lang);
if (dvdsub_lang_id != opts->sub_id) {
opts->sub_id = dvdsub_lang_id;
select_subtitle(ctx);
}
}
/// clear all EOF related flags
ctx->d_video->eof = ctx->d_audio->eof = ctx->stream->eof = 0;
}
/// Restore last decoded DVDNAV (still frame)
static mp_image_t *mp_dvdnav_restore_smpi(struct MPContext *mpctx,
int *in_size,
unsigned char **start,
mp_image_t *decoded_frame)
{
if (mpctx->stream->type != STREAMTYPE_DVDNAV)
return decoded_frame;
/// a change occurred in dvdnav stream
if (mp_dvdnav_cell_has_changed(mpctx->stream, 0)) {
mp_dvdnav_read_wait(mpctx->stream, 1, 1);
mp_dvdnav_context_free(mpctx);
mp_dvdnav_reset_stream(mpctx);
mp_dvdnav_read_wait(mpctx->stream, 0, 1);
mp_dvdnav_cell_has_changed(mpctx->stream, 1);
}
if (*in_size < 0) {
float len;
/// Display still frame, if any
if (mpctx->nav_smpi && !mpctx->nav_buffer)
decoded_frame = mpctx->nav_smpi;
/// increment video frame : continue playing after still frame
len = get_time_length(mpctx);
if (mpctx->sh_video->pts >= len &&
mpctx->sh_video->pts > 0.0 && len > 0.0) {
mp_dvdnav_skip_still(mpctx->stream);
mp_dvdnav_skip_wait(mpctx->stream);
}
mpctx->sh_video->pts += 1 / mpctx->sh_video->fps;
if (mpctx->nav_buffer) {
*start = mpctx->nav_start;
*in_size = mpctx->nav_in_size;
if (mpctx->nav_start)
memcpy(*start, mpctx->nav_buffer, mpctx->nav_in_size);
}
}
return decoded_frame;
}
/// Save last decoded DVDNAV (still frame)
static void mp_dvdnav_save_smpi(struct MPContext *mpctx, int in_size,
unsigned char *start,
mp_image_t *decoded_frame)
{
if (mpctx->stream->type != STREAMTYPE_DVDNAV)
return;
free(mpctx->nav_buffer);
mpctx->nav_buffer = NULL;
mpctx->nav_start = NULL;
mpctx->nav_in_size = -1;
if (in_size > 0)
mpctx->nav_buffer = malloc(in_size);
if (mpctx->nav_buffer) {
mpctx->nav_start = start;
mpctx->nav_in_size = in_size;
memcpy(mpctx->nav_buffer, start, in_size);
}
if (decoded_frame && mpctx->nav_smpi != decoded_frame)
mpctx->nav_smpi = mp_dvdnav_copy_mpi(mpctx->nav_smpi, decoded_frame);
}
#endif /* CONFIG_DVDNAV */
/* Modify video timing to match the audio timeline. There are two main /* Modify video timing to match the audio timeline. There are two main
* reasons this is needed. First, video and audio can start from different * reasons this is needed. First, video and audio can start from different
* positions at beginning of file or after a seek (MPlayer starts both * positions at beginning of file or after a seek (MPlayer starts both
@ -2365,20 +2198,8 @@ static double update_video_nocorrect_pts(struct MPContext *mpctx)
while (!in_size) while (!in_size)
in_size = video_read_frame(sh_video, &sh_video->next_frame_time, in_size = video_read_frame(sh_video, &sh_video->next_frame_time,
&packet, force_fps); &packet, force_fps);
if (in_size < 0) { if (in_size < 0)
#ifdef CONFIG_DVDNAV
if (mpctx->stream->type == STREAMTYPE_DVDNAV) {
if (mp_dvdnav_is_eof(mpctx->stream))
return -1;
if (mpctx->d_video)
mpctx->d_video->eof = 0;
if (mpctx->d_audio)
mpctx->d_audio->eof = 0;
mpctx->stream->eof = 0;
} else
#endif
return -1; return -1;
}
if (in_size > max_framesize) if (in_size > max_framesize)
max_framesize = in_size; max_framesize = in_size;
sh_video->timer += frame_time; sh_video->timer += frame_time;
@ -2389,16 +2210,8 @@ static double update_video_nocorrect_pts(struct MPContext *mpctx)
int framedrop_type = check_framedrop(mpctx, frame_time); int framedrop_type = check_framedrop(mpctx, frame_time);
void *decoded_frame; void *decoded_frame;
#ifdef CONFIG_DVDNAV
decoded_frame = mp_dvdnav_restore_smpi(mpctx, &in_size, &packet, NULL);
if (in_size >= 0 && !decoded_frame)
#endif
decoded_frame = decode_video(sh_video, sh_video->ds->current, packet, decoded_frame = decode_video(sh_video, sh_video->ds->current, packet,
in_size, framedrop_type, sh_video->pts); in_size, framedrop_type, sh_video->pts);
#ifdef CONFIG_DVDNAV
// Save last still frame for future display
mp_dvdnav_save_smpi(mpctx, in_size, packet, decoded_frame);
#endif
if (decoded_frame) { if (decoded_frame) {
filter_video(sh_video, decoded_frame, sh_video->pts); filter_video(sh_video, decoded_frame, sh_video->pts);
} }
@ -3195,30 +3008,6 @@ static void run_playloop(struct MPContext *mpctx)
break; break;
} // video } // video
#ifdef CONFIG_DVDNAV
if (mpctx->stream->type == STREAMTYPE_DVDNAV) {
nav_highlight_t hl;
mp_dvdnav_get_highlight(mpctx->stream, &hl);
if (!vo_spudec || !spudec_apply_palette_crop(vo_spudec, hl.palette, hl.sx, hl.sy, hl.ex, hl.ey)) {
osd_set_nav_box(hl.sx, hl.sy, hl.ex, hl.ey);
vo_osd_changed(OSDTYPE_DVDNAV);
} else {
osd_set_nav_box(0, 0, 0, 0);
vo_osd_changed(OSDTYPE_DVDNAV);
vo_osd_changed(OSDTYPE_SPU);
}
if (mp_dvdnav_stream_has_changed(mpctx->stream)) {
double ar = -1.0;
if (mpctx->sh_video &&
stream_control(mpctx->demuxer->stream,
STREAM_CTRL_GET_ASPECT_RATIO, &ar)
!= STREAM_UNSUPPORTED)
mpctx->sh_video->stream_aspect = ar;
}
}
#endif
if (mpctx->sh_audio && (mpctx->restart_playback ? !video_left : if (mpctx->sh_audio && (mpctx->restart_playback ? !video_left :
mpctx->ao->untimed && (mpctx->delay <= 0 || mpctx->ao->untimed && (mpctx->delay <= 0 ||
!video_left))) { !video_left))) {
@ -3635,21 +3424,6 @@ static void play_current_file(struct MPContext *mpctx)
} }
#endif #endif
#ifdef CONFIG_DVDNAV
if (mpctx->stream->type == STREAMTYPE_DVDNAV) {
if (opts->audio_lang && opts->audio_id == -1)
opts->audio_id = mp_dvdnav_aid_from_lang(mpctx->stream,
opts->audio_lang);
dvdsub_lang_id = -3;
if (opts->sub_lang && opts->sub_id == -1)
dvdsub_lang_id = opts->sub_id = mp_dvdnav_sid_from_lang(
mpctx->stream, opts->sub_lang);
// setup global sub numbering
mpctx->sub_counts[SUB_SOURCE_DEMUX] = mp_dvdnav_number_of_subs(
mpctx->stream);
}
#endif
// CACHE2: initial prefill: 20% later: 5% (should be set by -cacheopts) // CACHE2: initial prefill: 20% later: 5% (should be set by -cacheopts)
goto_enable_cache: goto_enable_cache:
if (stream_cache_size > 0) { if (stream_cache_size > 0) {
@ -3763,8 +3537,7 @@ goto_enable_cache:
demux_info_print(mpctx->demuxer); demux_info_print(mpctx->demuxer);
//================= Read SUBTITLES (DVD & TEXT) ========================= //================= Read SUBTITLES (DVD & TEXT) =========================
if (vo_spudec == NULL && (mpctx->stream->type == STREAMTYPE_DVD if (vo_spudec == NULL && (mpctx->stream->type == STREAMTYPE_DVD))
|| mpctx->stream->type == STREAMTYPE_DVDNAV))
init_vo_spudec(mpctx); init_vo_spudec(mpctx);
open_subtitles_from_options(mpctx); open_subtitles_from_options(mpctx);
@ -3844,8 +3617,6 @@ goto_enable_cache:
//TODO: add desired (stream-based) sections here //TODO: add desired (stream-based) sections here
if (mpctx->stream->type == STREAMTYPE_TV) if (mpctx->stream->type == STREAMTYPE_TV)
mp_input_set_section(mpctx->input, "tv"); mp_input_set_section(mpctx->input, "tv");
if (mpctx->stream->type == STREAMTYPE_DVDNAV)
mp_input_set_section(mpctx->input, "dvdnav");
//==================== START PLAYING ======================= //==================== START PLAYING =======================
@ -3896,14 +3667,6 @@ goto_enable_cache:
end_at.type = END_AT_NONE; end_at.type = END_AT_NONE;
} }
#ifdef CONFIG_DVDNAV
mp_dvdnav_context_free(mpctx);
if (mpctx->stream->type == STREAMTYPE_DVDNAV) {
mp_dvdnav_read_wait(mpctx->stream, 0, 1);
mp_dvdnav_cell_has_changed(mpctx->stream, 1);
}
#endif
mpctx->seek = (struct seek_params){ 0 }; mpctx->seek = (struct seek_params){ 0 };
get_relative_time(mpctx); // reset current delta get_relative_time(mpctx); // reset current delta
// Make sure VO knows current pause state // Make sure VO knows current pause state

View File

@ -265,10 +265,9 @@ bool m_config_parse_mp_command_line(m_config_t *config, struct playlist *files,
// filename // filename
bstr file = p.arg; bstr file = p.arg;
char *file0 = bstrdup0(NULL, p.arg); char *file0 = bstrdup0(NULL, p.arg);
int is_dvdnav = bstr_startswith0(file, "dvdnav://");
// expand DVD filename entries like dvd://1-3 into component titles // expand DVD filename entries like dvd://1-3 into component titles
if (bstr_startswith0(file, "dvd://") || is_dvdnav) { if (bstr_startswith0(file, "dvd://")) {
int offset = is_dvdnav ? 9 : 6; int offset = 6;
char *splitpos = strstr(file0 + offset, "-"); char *splitpos = strstr(file0 + offset, "-");
if (splitpos != NULL) { if (splitpos != NULL) {
int start_title = strtol(file0 + offset, NULL, 10); int start_title = strtol(file0 + offset, NULL, 10);
@ -284,8 +283,7 @@ bool m_config_parse_mp_command_line(m_config_t *config, struct playlist *files,
&& (start_title < end_title)) { && (start_title < end_title)) {
for (int j = start_title; j <= end_title; j++) { for (int j = start_title; j <= end_title; j++) {
char entbuf[15]; char entbuf[15];
snprintf(entbuf, sizeof(entbuf), snprintf(entbuf, sizeof(entbuf), "dvd://%d", j);
is_dvdnav ? "dvdnav://%d" : "dvd://%d", j);
playlist_add_file(files, entbuf); playlist_add_file(files, entbuf);
} }
} else } else

View File

@ -71,7 +71,6 @@ extern const stream_info_t stream_info_radio;
extern const stream_info_t stream_info_pvr; extern const stream_info_t stream_info_pvr;
extern const stream_info_t stream_info_ftp; extern const stream_info_t stream_info_ftp;
extern const stream_info_t stream_info_vstream; extern const stream_info_t stream_info_vstream;
extern const stream_info_t stream_info_dvdnav;
extern const stream_info_t stream_info_smb; extern const stream_info_t stream_info_smb;
extern const stream_info_t stream_info_sdp; extern const stream_info_t stream_info_sdp;
extern const stream_info_t stream_info_rtsp_sip; extern const stream_info_t stream_info_rtsp_sip;
@ -130,9 +129,6 @@ static const stream_info_t* const auto_open_streams[] = {
&stream_info_ifo, &stream_info_ifo,
&stream_info_dvd, &stream_info_dvd,
#endif #endif
#ifdef CONFIG_DVDNAV
&stream_info_dvdnav,
#endif
#ifdef CONFIG_LIBBLURAY #ifdef CONFIG_LIBBLURAY
&stream_info_bluray, &stream_info_bluray,
#endif #endif
@ -313,10 +309,6 @@ int stream_read_internal(stream_t *s, void *buf, int len)
// do not retry if this looks like proper eof // do not retry if this looks like proper eof
if (s->eof || (s->end_pos && s->pos == s->end_pos)) if (s->eof || (s->end_pos && s->pos == s->end_pos))
goto eof_out; goto eof_out;
// dvdnav has some horrible hacks to "suspend" reads,
// we need to skip this code or seeks will hang.
if (s->type == STREAMTYPE_DVDNAV)
goto eof_out;
// just in case this is an error e.g. due to network // just in case this is an error e.g. due to network
// timeout reset and retry // timeout reset and retry

View File

@ -42,7 +42,6 @@
#define STREAMTYPE_MEMORY 4 // read data from memory area #define STREAMTYPE_MEMORY 4 // read data from memory area
#define STREAMTYPE_PLAYLIST 6 // FIXME!!! same as STREAMTYPE_FILE now #define STREAMTYPE_PLAYLIST 6 // FIXME!!! same as STREAMTYPE_FILE now
#define STREAMTYPE_DS 8 // read from a demuxer stream #define STREAMTYPE_DS 8 // read from a demuxer stream
#define STREAMTYPE_DVDNAV 9 // we cannot safely "seek" in this...
#define STREAMTYPE_CDDA 10 // raw audio CD reader #define STREAMTYPE_CDDA 10 // raw audio CD reader
#define STREAMTYPE_SMB 11 // smb:// url, using libsmbclient (samba) #define STREAMTYPE_SMB 11 // smb:// url, using libsmbclient (samba)
#define STREAMTYPE_VCDBINCUE 12 // vcd directly from bin/cue files #define STREAMTYPE_VCDBINCUE 12 // vcd directly from bin/cue files

File diff suppressed because it is too large Load Diff

View File

@ -1,49 +0,0 @@
/*
* 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.
*/
#ifndef MPLAYER_STREAM_DVDNAV_H
#define MPLAYER_STREAM_DVDNAV_H
#include <stdint.h>
#include "stream.h"
typedef struct {
uint16_t sx, sy;
uint16_t ex, ey;
uint32_t palette;
} nav_highlight_t;
int mp_dvdnav_number_of_subs(stream_t *stream);
int mp_dvdnav_aid_from_audio_num(stream_t *stream, int audio_num);
int mp_dvdnav_aid_from_lang(stream_t *stream, char **language);
int mp_dvdnav_sid_from_lang(stream_t *stream, char **language);
void mp_dvdnav_handle_input(stream_t *stream, int cmd, int *button);
void mp_dvdnav_update_mouse_pos(stream_t *stream, int32_t x, int32_t y, int* button);
void mp_dvdnav_get_highlight (stream_t *stream, nav_highlight_t *hl);
unsigned int *mp_dvdnav_get_spu_clut(stream_t *stream);
void mp_dvdnav_switch_title(stream_t *stream, int title);
int mp_dvdnav_is_eof (stream_t *stream);
int mp_dvdnav_skip_still (stream_t *stream);
int mp_dvdnav_skip_wait (stream_t *stream);
void mp_dvdnav_read_wait (stream_t *stream, int mode, int automode);
int mp_dvdnav_cell_has_changed (stream_t *stream, int clear);
int mp_dvdnav_audio_has_changed (stream_t *stream, int clear);
int mp_dvdnav_spu_has_changed (stream_t *stream, int clear);
int mp_dvdnav_stream_has_changed (stream_t *stream);
#endif /* MPLAYER_STREAM_DVDNAV_H */

View File

@ -26,8 +26,6 @@
#include "config.h" #include "config.h"
#include "stream/stream.h" #include "stream/stream.h"
#include "stream/stream_dvdnav.h"
#define OSD_NAV_BOX_ALPHA 0x7f
#include "osdep/timer.h" #include "osdep/timer.h"
@ -66,9 +64,6 @@ int sub_visibility=1;
int sub_bg_color=0; /* subtitles background color */ int sub_bg_color=0; /* subtitles background color */
int sub_bg_alpha=0; int sub_bg_alpha=0;
int sub_justify=0; int sub_justify=0;
#ifdef CONFIG_DVDNAV
static nav_highlight_t nav_hl;
#endif
int vo_osd_progbar_type=-1; int vo_osd_progbar_type=-1;
int vo_osd_progbar_value=100; // 0..256 int vo_osd_progbar_value=100; // 0..256
@ -123,52 +118,6 @@ void vo_draw_text_from_buffer(mp_osd_obj_t* obj,void (*draw_alpha)(void *ctx, in
} }
} }
#ifdef CONFIG_DVDNAV
void osd_set_nav_box (uint16_t sx, uint16_t sy, uint16_t ex, uint16_t ey) {
nav_hl.sx = sx;
nav_hl.sy = sy;
nav_hl.ex = ex;
nav_hl.ey = ey;
}
inline static void vo_update_nav (mp_osd_obj_t *obj, int dxs, int dys, int left_border, int top_border,
int right_border, int bottom_border, int orig_w, int orig_h) {
int len;
int sx = nav_hl.sx, sy = nav_hl.sy;
int ex = nav_hl.ex, ey = nav_hl.ey;
int scaled_w = dxs - left_border - right_border;
int scaled_h = dys - top_border - bottom_border;
if (scaled_w != orig_w) {
sx = sx * scaled_w / orig_w;
ex = ex * scaled_w / orig_w;
}
if (scaled_h != orig_h) {
sy = sy * scaled_h / orig_h;
ey = ey * scaled_h / orig_h;
}
sx += left_border; ex += left_border;
sy += top_border; ey += top_border;
sx = FFMIN(FFMAX(sx, 0), dxs);
ex = FFMIN(FFMAX(ex, 0), dxs);
sy = FFMIN(FFMAX(sy, 0), dys);
ey = FFMIN(FFMAX(ey, 0), dys);
obj->bbox.x1 = obj->x = sx;
obj->bbox.y1 = obj->y = sy;
obj->bbox.x2 = ex;
obj->bbox.y2 = ey;
osd_alloc_buf (obj);
len = obj->stride * (obj->bbox.y2 - obj->bbox.y1);
memset (obj->bitmap_buffer, OSD_NAV_BOX_ALPHA, len);
memset (obj->alpha_buffer, OSD_NAV_BOX_ALPHA, len);
obj->flags |= OSDFLAG_BBOX | OSDFLAG_CHANGED;
if (obj->bbox.y2 > obj->bbox.y1 && obj->bbox.x2 > obj->bbox.x1)
obj->flags |= OSDFLAG_VISIBLE;
}
#endif
inline static void vo_update_spudec_sub(struct osd_state *osd, mp_osd_obj_t* obj) inline static void vo_update_spudec_sub(struct osd_state *osd, mp_osd_obj_t* obj)
{ {
unsigned int bbox[4]; unsigned int bbox[4];
@ -238,11 +187,6 @@ static int osd_update_ext(struct osd_state *osd, int dxs, int dys,
int vis=obj->flags&OSDFLAG_VISIBLE; int vis=obj->flags&OSDFLAG_VISIBLE;
obj->flags&=~OSDFLAG_BBOX; obj->flags&=~OSDFLAG_BBOX;
switch(obj->type){ switch(obj->type){
#ifdef CONFIG_DVDNAV
case OSDTYPE_DVDNAV:
vo_update_nav(obj,dxs,dys, left_border, top_border, right_border, bottom_border, orig_w, orig_h);
break;
#endif
case OSDTYPE_SUBTITLE: case OSDTYPE_SUBTITLE:
vo_update_text_sub(osd, obj); vo_update_text_sub(osd, obj);
break; break;
@ -320,9 +264,6 @@ struct osd_state *osd_create(struct MPOpts *opts, struct ass_library *asslib)
new_osd_obj(OSDTYPE_SUBTITLE); new_osd_obj(OSDTYPE_SUBTITLE);
new_osd_obj(OSDTYPE_PROGBAR); new_osd_obj(OSDTYPE_PROGBAR);
new_osd_obj(OSDTYPE_SPU); new_osd_obj(OSDTYPE_SPU);
#ifdef CONFIG_DVDNAV
new_osd_obj(OSDTYPE_DVDNAV);
#endif
osd_font_invalidate(); osd_font_invalidate();
osd->osd_text = talloc_strdup(osd, ""); osd->osd_text = talloc_strdup(osd, "");
osd_init_backend(osd); osd_init_backend(osd);
@ -358,9 +299,6 @@ void osd_draw_text_ext(struct osd_state *osd, int dxs, int dys,
case OSDTYPE_SPU: case OSDTYPE_SPU:
vo_draw_spudec_sub(obj, draw_alpha, ctx); // FIXME vo_draw_spudec_sub(obj, draw_alpha, ctx); // FIXME
break; break;
#ifdef CONFIG_DVDNAV
case OSDTYPE_DVDNAV:
#endif
case OSDTYPE_OSD: case OSDTYPE_OSD:
case OSDTYPE_SUBTITLE: case OSDTYPE_SUBTITLE:
case OSDTYPE_PROGBAR: case OSDTYPE_PROGBAR:

View File

@ -29,7 +29,6 @@ typedef struct mp_osd_bbox_s {
#define OSDTYPE_SUBTITLE 2 #define OSDTYPE_SUBTITLE 2
#define OSDTYPE_PROGBAR 3 #define OSDTYPE_PROGBAR 3
#define OSDTYPE_SPU 4 #define OSDTYPE_SPU 4
#define OSDTYPE_DVDNAV 5
#define OSDFLAG_VISIBLE 1 #define OSDFLAG_VISIBLE 1
#define OSDFLAG_CHANGED 2 #define OSDFLAG_CHANGED 2
@ -173,11 +172,6 @@ void vo_osd_resized(void);
int vo_osd_check_range_update(int,int,int,int); int vo_osd_check_range_update(int,int,int,int);
void osd_free(struct osd_state *osd); void osd_free(struct osd_state *osd);
#ifdef CONFIG_DVDNAV
#include <inttypes.h>
void osd_set_nav_box (uint16_t sx, uint16_t sy, uint16_t ex, uint16_t ey);
#endif
// used only by osd_ft.c or osd_libass.c // used only by osd_ft.c or osd_libass.c
void osd_alloc_buf(mp_osd_obj_t* obj); void osd_alloc_buf(mp_osd_obj_t* obj);
void vo_draw_text_from_buffer(mp_osd_obj_t* obj,void (*draw_alpha)(void *ctx, int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride), void *ctx); void vo_draw_text_from_buffer(mp_osd_obj_t* obj,void (*draw_alpha)(void *ctx, int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride), void *ctx);