mirror of https://github.com/mpv-player/mpv
Updated docs with DXR3 overlay info
Cleaned new sync code in dxr3 Renamed some internal variables to allow access from GUI git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@8089 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
bdc4ec9153
commit
96c86b0385
|
@ -1173,7 +1173,14 @@ for 16:9 TV: -vop lavc,expand=-1:576:-1:-1:1,scale=-1:0,dvbscale=1024
|
||||||
<H4>Usage:</H4>
|
<H4>Usage:</H4>
|
||||||
<DL>
|
<DL>
|
||||||
<DT><CODE>-vo dxr3:prebuf:sync:<device></CODE></DT>
|
<DT><CODE>-vo dxr3:prebuf:sync:<device></CODE></DT>
|
||||||
<DD><CODE>prebuf</CODE> turns on prebuffering. Prebuffering is a feature
|
<DD><CODE>overlay</CODE> activates the overlay instead of TVOut. It requires
|
||||||
|
that you have a properly configured overlay setup to work right. The easiest
|
||||||
|
way to configure the overlay is to first run autocal. Then run mplayer with
|
||||||
|
dxr3 output and without overlay turned on, run dxr3view. In dxr3view you can
|
||||||
|
tweak the overlay settings and see the effects in realtime, perhaps this
|
||||||
|
feature will be supported by the MPlayer GUI in the future. When overlay is
|
||||||
|
properly set up you will no longer need to use dxr3view.<BR>
|
||||||
|
<CODE>prebuf</CODE> turns on prebuffering. Prebuffering is a feature
|
||||||
of the em8300 chip that enables it to hold more than one frame of video at
|
of the em8300 chip that enables it to hold more than one frame of video at
|
||||||
a time. This means that when you are running with prebuffering
|
a time. This means that when you are running with prebuffering
|
||||||
MPlayer will try to keep the video buffer filled with data at all
|
MPlayer will try to keep the video buffer filled with data at all
|
||||||
|
@ -1235,13 +1242,6 @@ for 16:9 TV: -vop lavc,expand=-1:576:-1:-1:1,scale=-1:0,dvbscale=1024
|
||||||
section for further information on AC3.</DD>
|
section for further information on AC3.</DD>
|
||||||
</DL>
|
</DL>
|
||||||
|
|
||||||
<H4>Overlay</H4>
|
|
||||||
|
|
||||||
<P>To get overlay run dxr3view that comes with the em8300 package before
|
|
||||||
starting MPlayer. You can set various options in dxr3view by pressing
|
|
||||||
<CODE>T</CODE> while holding the mouse cursor above the window. Activating
|
|
||||||
rectangle mode seems to work for alot of people.</P>
|
|
||||||
|
|
||||||
<H4>MPEG1, MPEG2, VCD and DVD Notes</H4>
|
<H4>MPEG1, MPEG2, VCD and DVD Notes</H4>
|
||||||
|
|
||||||
<P>In some instances, subtitles may not appear properly in sync with the A/V
|
<P>In some instances, subtitles may not appear properly in sync with the A/V
|
||||||
|
|
116
libvo/vo_dxr3.c
116
libvo/vo_dxr3.c
|
@ -6,6 +6,10 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* ChangeLog added 2002-01-10
|
/* ChangeLog added 2002-01-10
|
||||||
|
* 2002-01-03:
|
||||||
|
* Cleaned up syncing code and renamed setup variables so
|
||||||
|
* they can be accessed from the GUI.
|
||||||
|
*
|
||||||
* 2002-01-02:
|
* 2002-01-02:
|
||||||
* Added native overlay support, activate with :overlay
|
* Added native overlay support, activate with :overlay
|
||||||
* you have to run dxr3view to modify settings (or manually
|
* you have to run dxr3view to modify settings (or manually
|
||||||
|
@ -136,12 +140,18 @@ LIBVO_EXTERN (dxr3)
|
||||||
static int v_width, v_height;
|
static int v_width, v_height;
|
||||||
static int s_width, s_height;
|
static int s_width, s_height;
|
||||||
static int osd_w, osd_h;
|
static int osd_w, osd_h;
|
||||||
static int prebuf = 0;
|
|
||||||
static int newsync = 0;
|
|
||||||
static int overlay = 0;
|
|
||||||
static int fullscreen = 0;
|
static int fullscreen = 0;
|
||||||
static int img_format = 0;
|
static int img_format = 0;
|
||||||
|
|
||||||
|
/* Configuration values
|
||||||
|
* Don't declare these static, they
|
||||||
|
* should be accessible from the gui.
|
||||||
|
*/
|
||||||
|
int dxr3_prebuf = 0;
|
||||||
|
int dxr3_newsync = 0;
|
||||||
|
int dxr3_overlay = 0;
|
||||||
|
int dxr3_device_num = 0;
|
||||||
|
|
||||||
/* File descriptors */
|
/* File descriptors */
|
||||||
static int fd_control = -1;
|
static int fd_control = -1;
|
||||||
static int fd_video = -1;
|
static int fd_video = -1;
|
||||||
|
@ -240,13 +250,19 @@ static uint32_t control(uint32_t request, void *data, ...)
|
||||||
case VOCTRL_GUISUPPORT:
|
case VOCTRL_GUISUPPORT:
|
||||||
return VO_TRUE;
|
return VO_TRUE;
|
||||||
case VOCTRL_GUI_NOWINDOW:
|
case VOCTRL_GUI_NOWINDOW:
|
||||||
if (overlay) {
|
if (dxr3_overlay) {
|
||||||
return VO_FALSE;
|
return VO_FALSE;
|
||||||
}
|
}
|
||||||
return VO_TRUE;
|
return VO_TRUE;
|
||||||
|
case VOCTRL_SET_SPU_PALETTE:
|
||||||
|
if (ioctl(fd_spu, EM8300_IOCTL_SPU_SETPALETTE, data) < 0) {
|
||||||
|
printf("VO: [dxr3] Unable to load new SPU palette!\n");
|
||||||
|
return VO_ERROR;
|
||||||
|
}
|
||||||
|
return VO_TRUE;
|
||||||
#ifdef HAVE_X11
|
#ifdef HAVE_X11
|
||||||
case VOCTRL_FULLSCREEN:
|
case VOCTRL_FULLSCREEN:
|
||||||
if (overlay) {
|
if (dxr3_overlay) {
|
||||||
vo_x11_fullscreen();
|
vo_x11_fullscreen();
|
||||||
if (fullscreen) {
|
if (fullscreen) {
|
||||||
overlay_signalmode(overlay_data, EM8300_OVERLAY_SIGNAL_WITH_VGA);
|
overlay_signalmode(overlay_data, EM8300_OVERLAY_SIGNAL_WITH_VGA);
|
||||||
|
@ -260,7 +276,15 @@ static uint32_t control(uint32_t request, void *data, ...)
|
||||||
return VO_FALSE;
|
return VO_FALSE;
|
||||||
#endif
|
#endif
|
||||||
case VOCTRL_RESUME:
|
case VOCTRL_RESUME:
|
||||||
if (prebuf) {
|
if (dxr3_newsync) {
|
||||||
|
ioctl(fd_control, EM8300_IOCTL_SCR_GET, &ioval);
|
||||||
|
pts_offset = vo_pts - (ioval << 1);
|
||||||
|
if (pts_offset < 0) {
|
||||||
|
pts_offset = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (dxr3_prebuf) {
|
||||||
ioval = EM8300_PLAYMODE_PLAY;
|
ioval = EM8300_PLAYMODE_PLAY;
|
||||||
if (ioctl(fd_control, EM8300_IOCTL_SET_PLAYMODE, &ioval) < 0) {
|
if (ioctl(fd_control, EM8300_IOCTL_SET_PLAYMODE, &ioval) < 0) {
|
||||||
printf("VO: [dxr3] Unable to set playmode!\n");
|
printf("VO: [dxr3] Unable to set playmode!\n");
|
||||||
|
@ -268,7 +292,7 @@ static uint32_t control(uint32_t request, void *data, ...)
|
||||||
}
|
}
|
||||||
return VO_TRUE;
|
return VO_TRUE;
|
||||||
case VOCTRL_PAUSE:
|
case VOCTRL_PAUSE:
|
||||||
if (prebuf) {
|
if (dxr3_prebuf) {
|
||||||
ioval = EM8300_PLAYMODE_PAUSED;
|
ioval = EM8300_PLAYMODE_PAUSED;
|
||||||
if (ioctl(fd_control, EM8300_IOCTL_SET_PLAYMODE, &ioval) < 0) {
|
if (ioctl(fd_control, EM8300_IOCTL_SET_PLAYMODE, &ioval) < 0) {
|
||||||
printf("VO: [dxr3] Unable to set playmode!\n");
|
printf("VO: [dxr3] Unable to set playmode!\n");
|
||||||
|
@ -276,7 +300,7 @@ static uint32_t control(uint32_t request, void *data, ...)
|
||||||
}
|
}
|
||||||
return VO_TRUE;
|
return VO_TRUE;
|
||||||
case VOCTRL_RESET:
|
case VOCTRL_RESET:
|
||||||
if (prebuf || sync) {
|
if (dxr3_prebuf) {
|
||||||
close(fd_video);
|
close(fd_video);
|
||||||
fd_video = open(fdv_name, O_WRONLY);
|
fd_video = open(fdv_name, O_WRONLY);
|
||||||
close(fd_spu);
|
close(fd_spu);
|
||||||
|
@ -293,7 +317,7 @@ static uint32_t control(uint32_t request, void *data, ...)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
flag = VFCAP_CSP_SUPPORTED | VFCAP_CSP_SUPPORTED_BY_HW | VFCAP_SPU;
|
flag = VFCAP_CSP_SUPPORTED | VFCAP_CSP_SUPPORTED_BY_HW | VFCAP_SPU;
|
||||||
if (prebuf)
|
if (dxr3_prebuf)
|
||||||
flag |= VFCAP_TIMER;
|
flag |= VFCAP_TIMER;
|
||||||
return flag;
|
return flag;
|
||||||
}
|
}
|
||||||
|
@ -392,7 +416,7 @@ static uint32_t config(uint32_t width, uint32_t height, uint32_t d_width, uint32
|
||||||
#ifdef MVCOMMAND_SYNC
|
#ifdef MVCOMMAND_SYNC
|
||||||
reg.microcode_register = 1;
|
reg.microcode_register = 1;
|
||||||
reg.reg = 0;
|
reg.reg = 0;
|
||||||
reg.val = MVCOMMAND_SYNC;
|
reg.val = MVCOMMAND_START;
|
||||||
ioctl(fd_control, EM8300_IOCTL_WRITEREG, ®);
|
ioctl(fd_control, EM8300_IOCTL_WRITEREG, ®);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -411,8 +435,6 @@ static uint32_t config(uint32_t width, uint32_t height, uint32_t d_width, uint32
|
||||||
fsync(fd_video);
|
fsync(fd_video);
|
||||||
ioval = 0x900;
|
ioval = 0x900;
|
||||||
ioctl(fd_control, EM8300_IOCTL_SCR_SETSPEED, &ioval);
|
ioctl(fd_control, EM8300_IOCTL_SCR_SETSPEED, &ioval);
|
||||||
ioval = 0;
|
|
||||||
ioctl(fd_control, EM8300_IOCTL_SCR_SET, &ioval);
|
|
||||||
|
|
||||||
/* Store some variables statically that we need later in another scope */
|
/* Store some variables statically that we need later in another scope */
|
||||||
img_format = format;
|
img_format = format;
|
||||||
|
@ -489,7 +511,7 @@ static uint32_t config(uint32_t width, uint32_t height, uint32_t d_width, uint32
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_X11
|
#ifdef HAVE_X11
|
||||||
if (overlay) {
|
if (dxr3_overlay) {
|
||||||
XVisualInfo vinfo;
|
XVisualInfo vinfo;
|
||||||
XSetWindowAttributes xswa;
|
XSetWindowAttributes xswa;
|
||||||
XSizeHints hint;
|
XSizeHints hint;
|
||||||
|
@ -677,7 +699,7 @@ static uint32_t draw_frame(uint8_t * src[])
|
||||||
static void flip_page(void)
|
static void flip_page(void)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_X11
|
#ifdef HAVE_X11
|
||||||
if (overlay) {
|
if (dxr3_overlay) {
|
||||||
int event = vo_x11_check_events(mDisplay);
|
int event = vo_x11_check_events(mDisplay);
|
||||||
if (event & VO_EVENT_RESIZE) {
|
if (event & VO_EVENT_RESIZE) {
|
||||||
Window junkwindow;
|
Window junkwindow;
|
||||||
|
@ -696,7 +718,7 @@ static void flip_page(void)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (newsync) {
|
if (dxr3_newsync) {
|
||||||
ioctl(fd_control, EM8300_IOCTL_SCR_GET, &ioval);
|
ioctl(fd_control, EM8300_IOCTL_SCR_GET, &ioval);
|
||||||
ioval <<= 1;
|
ioval <<= 1;
|
||||||
if (vo_pts == 0) {
|
if (vo_pts == 0) {
|
||||||
|
@ -716,7 +738,7 @@ static void flip_page(void)
|
||||||
ioctl(fd_video, EM8300_IOCTL_SPU_SETPTS, &ioval);
|
ioctl(fd_video, EM8300_IOCTL_SPU_SETPTS, &ioval);
|
||||||
ioctl(fd_video, EM8300_IOCTL_VIDEO_SETPTS, &ioval);
|
ioctl(fd_video, EM8300_IOCTL_VIDEO_SETPTS, &ioval);
|
||||||
prev_pts = vo_pts;
|
prev_pts = vo_pts;
|
||||||
} else if (prebuf) {
|
} else if (dxr3_prebuf) {
|
||||||
ioctl(fd_spu, EM8300_IOCTL_SPU_SETPTS, &vo_pts);
|
ioctl(fd_spu, EM8300_IOCTL_SPU_SETPTS, &vo_pts);
|
||||||
ioctl(fd_video, EM8300_IOCTL_VIDEO_SETPTS, &vo_pts);
|
ioctl(fd_video, EM8300_IOCTL_VIDEO_SETPTS, &vo_pts);
|
||||||
}
|
}
|
||||||
|
@ -731,7 +753,7 @@ static void uninit(void)
|
||||||
{
|
{
|
||||||
printf("VO: [dxr3] Uninitializing\n");
|
printf("VO: [dxr3] Uninitializing\n");
|
||||||
#ifdef HAVE_X11
|
#ifdef HAVE_X11
|
||||||
if (overlay) {
|
if (dxr3_overlay) {
|
||||||
overlay_set_mode(overlay_data, EM8300_OVERLAY_MODE_OFF);
|
overlay_set_mode(overlay_data, EM8300_OVERLAY_MODE_OFF);
|
||||||
overlay_release(overlay_data);
|
overlay_release(overlay_data);
|
||||||
|
|
||||||
|
@ -739,6 +761,7 @@ static void uninit(void)
|
||||||
if (!use_gui) {
|
if (!use_gui) {
|
||||||
#endif
|
#endif
|
||||||
vo_x11_uninit();
|
vo_x11_uninit();
|
||||||
|
|
||||||
#ifdef HAVE_NEW_GUI
|
#ifdef HAVE_NEW_GUI
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -770,26 +793,26 @@ static void check_events(void)
|
||||||
static uint32_t preinit(const char *arg)
|
static uint32_t preinit(const char *arg)
|
||||||
{
|
{
|
||||||
char devname[80];
|
char devname[80];
|
||||||
char devnum = 0;
|
|
||||||
int fdflags = O_WRONLY;
|
int fdflags = O_WRONLY;
|
||||||
|
|
||||||
/* Parse commandline */
|
/* Parse commandline */
|
||||||
while (arg) {
|
while (arg) {
|
||||||
if (!strncmp("prebuf", arg, 6) && !prebuf) {
|
if (!strncmp("prebuf", arg, 6) && !dxr3_prebuf) {
|
||||||
printf("VO: [dxr3] Enabling prebuffering.\n");
|
printf("VO: [dxr3] Enabling prebuffering.\n");
|
||||||
prebuf = 1;
|
dxr3_prebuf = 1;
|
||||||
} else if (!strncmp("sync", arg, 4) && !newsync) {
|
fdflags |= O_NONBLOCK;
|
||||||
|
} else if (!strncmp("sync", arg, 4) && !dxr3_newsync) {
|
||||||
printf("VO: [dxr3] Using new sync engine.\n");
|
printf("VO: [dxr3] Using new sync engine.\n");
|
||||||
newsync = 1;
|
dxr3_newsync = 1;
|
||||||
} else if (!strncmp("overlay", arg, 7) && !overlay) {
|
} else if (!strncmp("overlay", arg, 7) && !dxr3_overlay) {
|
||||||
#ifdef HAVE_X11
|
#ifdef HAVE_X11
|
||||||
printf("VO: [dxr3] Using overlay.\n");
|
printf("VO: [dxr3] Using overlay.\n");
|
||||||
overlay = 1;
|
dxr3_overlay = 1;
|
||||||
#else
|
#else
|
||||||
printf("VO: [dxr3] Error: You need to compile mplayer with x11 libraries and headers installed to use overlay.\n");
|
printf("VO: [dxr3] Error: You need to compile mplayer with x11 libraries and headers installed to use overlay.\n");
|
||||||
#endif
|
#endif
|
||||||
} else if (arg[0] == '0' || arg[0] == '1' || arg[0] == '2' || arg[0] == '3') {
|
} else if (arg[0] == '0' || arg[0] == '1' || arg[0] == '2' || arg[0] == '3') {
|
||||||
devnum = arg[0];
|
dxr3_device_num = arg[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
arg = strchr(arg, ':');
|
arg = strchr(arg, ':');
|
||||||
|
@ -798,19 +821,9 @@ static uint32_t preinit(const char *arg)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (prebuf) {
|
|
||||||
fdflags |= O_NONBLOCK;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* Open the control interface */
|
/* Open the control interface */
|
||||||
if (devnum) {
|
sprintf(devname, "/dev/em8300-%d", dxr3_device_num);
|
||||||
printf("VO: [dxr3] Forcing use of device %c\n", devnum);
|
|
||||||
sprintf(devname, "/dev/em8300-%c", devnum);
|
|
||||||
} else {
|
|
||||||
/* Try new naming scheme by default */
|
|
||||||
sprintf(devname, "/dev/em8300-0");
|
|
||||||
}
|
|
||||||
fd_control = open(devname, fdflags);
|
fd_control = open(devname, fdflags);
|
||||||
if (fd_control < 1) {
|
if (fd_control < 1) {
|
||||||
/* Fall back to old naming scheme */
|
/* Fall back to old naming scheme */
|
||||||
|
@ -821,15 +834,12 @@ static uint32_t preinit(const char *arg)
|
||||||
printf("VO: [dxr3] Error opening /dev/em8300 for writing as well!\nBailing\n");
|
printf("VO: [dxr3] Error opening /dev/em8300 for writing as well!\nBailing\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
printf("VO: [dxr3] Opened %s\n", devname);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Open the video interface */
|
/* Open the video interface */
|
||||||
if (devnum) {
|
sprintf(devname, "/dev/em8300_mv-%d", dxr3_device_num);
|
||||||
sprintf(devname, "/dev/em8300_mv-%c", devnum);
|
|
||||||
} else {
|
|
||||||
/* Try new naming scheme by default */
|
|
||||||
sprintf(devname, "/dev/em8300_mv-0");
|
|
||||||
}
|
|
||||||
fd_video = open(devname, fdflags);
|
fd_video = open(devname, fdflags);
|
||||||
if (fd_video < 0) {
|
if (fd_video < 0) {
|
||||||
/* Fall back to old naming scheme */
|
/* Fall back to old naming scheme */
|
||||||
|
@ -848,12 +858,7 @@ static uint32_t preinit(const char *arg)
|
||||||
|
|
||||||
/* Open the subpicture interface */
|
/* Open the subpicture interface */
|
||||||
fdflags |= O_NONBLOCK;
|
fdflags |= O_NONBLOCK;
|
||||||
if (devnum) {
|
sprintf(devname, "/dev/em8300_sp-%d", dxr3_device_num);
|
||||||
sprintf(devname, "/dev/em8300_sp-%c", devnum);
|
|
||||||
} else {
|
|
||||||
/* Try new naming scheme by default */
|
|
||||||
sprintf(devname, "/dev/em8300_sp-0");
|
|
||||||
}
|
|
||||||
fd_spu = open(devname, fdflags);
|
fd_spu = open(devname, fdflags);
|
||||||
if (fd_spu < 0) {
|
if (fd_spu < 0) {
|
||||||
/* Fall back to old naming scheme */
|
/* Fall back to old naming scheme */
|
||||||
|
@ -865,14 +870,13 @@ static uint32_t preinit(const char *arg)
|
||||||
uninit();
|
uninit();
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
printf("VO: [dxr3] Opened %s\n", devname);
|
||||||
}
|
}
|
||||||
strcpy(fds_name, devname);
|
strcpy(fds_name, devname);
|
||||||
|
|
||||||
ioctl(fd_control, EM8300_IOCTL_SCR_GET, &ioval);
|
|
||||||
pts_offset = vo_pts - (ioval << 1);
|
|
||||||
|
|
||||||
#ifdef HAVE_X11
|
#ifdef HAVE_X11
|
||||||
if (overlay) {
|
if (dxr3_overlay) {
|
||||||
|
|
||||||
/* Fucked up hack needed to enable overlay.
|
/* Fucked up hack needed to enable overlay.
|
||||||
* Will be removed as soon as I figure out
|
* Will be removed as soon as I figure out
|
||||||
|
@ -913,6 +917,14 @@ static uint32_t preinit(const char *arg)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
if (dxr3_newsync) {
|
||||||
|
ioctl(fd_control, EM8300_IOCTL_SCR_GET, &ioval);
|
||||||
|
pts_offset = vo_pts - (ioval << 1);
|
||||||
|
if (pts_offset < 0) {
|
||||||
|
pts_offset = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue