2002-07-18 14:59:55 +00:00
|
|
|
/*
|
2001-11-03 02:38:10 +00:00
|
|
|
* vo_dxr3.c - DXR3/H+ video out
|
|
|
|
*
|
2002-01-11 22:30:28 +00:00
|
|
|
* Copyright (C) 2002 David Holm <dholm@iname.com>
|
2001-11-03 02:38:10 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2002-01-11 22:30:28 +00:00
|
|
|
/* ChangeLog added 2002-01-10
|
2002-07-18 14:59:55 +00:00
|
|
|
* 2002-07-18:
|
|
|
|
* Disabled spuenc support, this is still not stable enough =(
|
|
|
|
*
|
2002-07-05 14:26:37 +00:00
|
|
|
* 2002-07-05:
|
|
|
|
* Removed lavc and fame encoder to be compatible with new libvo style.
|
|
|
|
* Added graphic equalizer support.
|
|
|
|
*
|
2002-04-16 11:14:49 +00:00
|
|
|
* 2002-04-15:
|
|
|
|
* The spuenc code isn't 100% stable yet, therefore I'm disabling
|
|
|
|
* it due to the upcoming stable release.
|
|
|
|
*
|
2002-04-04 16:11:09 +00:00
|
|
|
* 2002-04-03:
|
|
|
|
* Carl George added spuenc support
|
|
|
|
*
|
2002-03-26 18:47:42 +00:00
|
|
|
* 2002-03-26:
|
|
|
|
* XorA added an option parser and support for selecting encoder
|
|
|
|
* codec. We thank him again.
|
|
|
|
*
|
2002-03-25 05:13:19 +00:00
|
|
|
* 2002-03-25:
|
|
|
|
* A couple of bugfixes by XorA
|
|
|
|
*
|
2002-03-23 15:27:47 +00:00
|
|
|
* 2002-03-23:
|
|
|
|
* Thanks to Marcel Hild <hild@b4mad.net> the jitter-bug experienced
|
|
|
|
* with some videos have been fixed, many thanks goes to him.
|
|
|
|
*
|
2002-03-16 15:49:26 +00:00
|
|
|
* 2002-03-16:
|
|
|
|
* Fixed problems with fame, it gives a better picture than avcodec,
|
|
|
|
* but is slightly slower. Most notably the wobbling effect is gone
|
|
|
|
* with fame.
|
|
|
|
*
|
2002-03-13 14:15:00 +00:00
|
|
|
* 2002-03-13:
|
|
|
|
* Preliminary fame support added (it breaks after seeking, why?)
|
|
|
|
*
|
2002-02-18 18:23:14 +00:00
|
|
|
* 2002-02-18:
|
|
|
|
* Fixed sync problems when pausing video (while using prebuffering)
|
|
|
|
*
|
2002-02-16 12:51:33 +00:00
|
|
|
* 2002-02-16:
|
|
|
|
* Fixed bug which would case invalid output when using :noprebuf
|
|
|
|
* Removed equalization code, it caused problems on slow systems
|
|
|
|
*
|
2002-02-13 00:38:23 +00:00
|
|
|
* 2002-02-13:
|
|
|
|
* Using the swscaler instead of the old hand coded shit. (Checkout man mplayer and search for sws ;).
|
|
|
|
* Using aspect function to setup a proper mpeg1, no more hassling with odd resolutions or GOP-sizes,
|
|
|
|
* this would only create jitter on some vids!
|
|
|
|
* The swscaler sometimes exits with sig8 on mpegs, I don't know why yet (just use -vc mpegpes in this
|
|
|
|
* case, and report to me if you have any avi's etc which does this...)
|
|
|
|
*
|
2002-02-09 10:43:11 +00:00
|
|
|
* 2002-02-09:
|
|
|
|
* Thanks to the new control() method I have finally been able to enable the em8300 prebuffering.
|
|
|
|
* This should speed up playback on all systems, the vout cpu usage should rocket since I will be hogging
|
|
|
|
* the pci bus. Not to worry though, since frames are prebuffered it should be able to take a few blows
|
|
|
|
* if you start doing other stuff simultaneously.
|
|
|
|
*
|
2002-02-03 14:55:27 +00:00
|
|
|
* 2002-02-03:
|
|
|
|
* Removal of libmp1e, libavcodec has finally become faster (and it's code is helluva lot cleaner)
|
|
|
|
*
|
2002-02-02 18:09:35 +00:00
|
|
|
* 2002-02-02:
|
|
|
|
* Cleaned out some old code which might have slowed down writes
|
|
|
|
*
|
Added new syncengine thanks to a new previously undocumented feature of the em8300, this might fix playback on both slow and fast machines (more testing needed). This also requires users to get the em8300 driver from cvs until the next version is released (will probably happen this weekend)
Added lots of comments, should be pretty easy to understand most of the internals now
Added lots of brackets to if's for's while's etc, this is not a cosmetical thing but rather due to the fact I got some very odd bugs with else's since I didn't properly use brackets (and it's the K&R standard to have brackets everywhere)
Fixed some bugs that would occur when disabling libmp1e
Switched to default to the new naming scheme of device nodes, the driver will slowly switch over to this state, if it can't find devices under the new name it will try the old naming scheme
I stopped opening devices in non-blocking mode, it would break the new syncengine which tries to burst data to the device (alot of times meaning it will fill the fifo pretty fast which would previously result in jerkyness on fast machines)
The device now sets the initial state of the pts and speed (probably not needed, but assumption is the mother of all fuckups =)
Keep the control interface open during the entire duration of the libvo device, we might need this to flush video buffers on seeking (currently not implemented, therefore seeking is broken)
This is beta stuff to the driver, I will get some users to test it for me and do my best to fix seeking as soon as possible...
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@4219 b3059339-0415-0410-9bf9-f77b7e298cf2
2002-01-17 10:33:47 +00:00
|
|
|
* 2002-01-17:
|
2002-01-17 19:24:33 +00:00
|
|
|
* Testrelease of new sync engine (using previously undocumented feature of em8300).
|
Added new syncengine thanks to a new previously undocumented feature of the em8300, this might fix playback on both slow and fast machines (more testing needed). This also requires users to get the em8300 driver from cvs until the next version is released (will probably happen this weekend)
Added lots of comments, should be pretty easy to understand most of the internals now
Added lots of brackets to if's for's while's etc, this is not a cosmetical thing but rather due to the fact I got some very odd bugs with else's since I didn't properly use brackets (and it's the K&R standard to have brackets everywhere)
Fixed some bugs that would occur when disabling libmp1e
Switched to default to the new naming scheme of device nodes, the driver will slowly switch over to this state, if it can't find devices under the new name it will try the old naming scheme
I stopped opening devices in non-blocking mode, it would break the new syncengine which tries to burst data to the device (alot of times meaning it will fill the fifo pretty fast which would previously result in jerkyness on fast machines)
The device now sets the initial state of the pts and speed (probably not needed, but assumption is the mother of all fuckups =)
Keep the control interface open during the entire duration of the libvo device, we might need this to flush video buffers on seeking (currently not implemented, therefore seeking is broken)
This is beta stuff to the driver, I will get some users to test it for me and do my best to fix seeking as soon as possible...
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@4219 b3059339-0415-0410-9bf9-f77b7e298cf2
2002-01-17 10:33:47 +00:00
|
|
|
*
|
|
|
|
* 2002-01-15:
|
|
|
|
* Preliminary subpic support with -vc mpegpes and dvd's
|
|
|
|
* Device interfaces tries the new naming scheme by default (even though most users probably still use the old one)
|
|
|
|
*
|
2002-01-11 22:30:28 +00:00
|
|
|
* 2002-01-10:
|
|
|
|
* I rehauled the entire codebase. I have now changed to
|
|
|
|
* Kernighan & Ritchie codingstyle, please mail me if you
|
|
|
|
* find any inconcistencies.
|
|
|
|
*/
|
|
|
|
|
2001-11-16 08:31:18 +00:00
|
|
|
#include <linux/em8300.h>
|
|
|
|
#include <sys/ioctl.h>
|
|
|
|
#include <sys/stat.h>
|
|
|
|
#include <sys/types.h>
|
2002-02-13 00:38:23 +00:00
|
|
|
#include <sys/select.h>
|
2002-01-11 22:30:28 +00:00
|
|
|
#include <unistd.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
2001-11-16 08:31:18 +00:00
|
|
|
#include <fcntl.h>
|
2001-11-03 02:38:10 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <time.h>
|
|
|
|
|
|
|
|
#include "config.h"
|
2002-01-11 22:30:28 +00:00
|
|
|
#include "fastmemcpy.h"
|
|
|
|
|
2001-11-03 02:38:10 +00:00
|
|
|
#include "video_out.h"
|
|
|
|
#include "video_out_internal.h"
|
2002-02-13 00:38:23 +00:00
|
|
|
#include "aspect.h"
|
2002-03-30 06:24:49 +00:00
|
|
|
#include "cpudetect.h"
|
2002-04-04 16:11:09 +00:00
|
|
|
#include "spuenc.h"
|
2002-08-22 13:58:38 +00:00
|
|
|
#include "sub.h"
|
2002-03-13 14:15:00 +00:00
|
|
|
|
2002-07-05 14:26:37 +00:00
|
|
|
#define SPU_SUPPORT
|
2001-11-03 02:38:10 +00:00
|
|
|
|
2002-07-05 14:26:37 +00:00
|
|
|
static vo_info_t vo_info =
|
|
|
|
{
|
|
|
|
"DXR3/H+ video out",
|
|
|
|
"dxr3",
|
|
|
|
"David Holm <dholm@iname.com>",
|
|
|
|
""
|
2002-03-26 18:47:42 +00:00
|
|
|
};
|
2002-07-05 14:26:37 +00:00
|
|
|
LIBVO_EXTERN (dxr3)
|
2001-11-03 02:38:10 +00:00
|
|
|
|
2002-01-11 22:30:28 +00:00
|
|
|
/* Resolutions and positions */
|
|
|
|
static int v_width, v_height;
|
|
|
|
static int s_width, s_height;
|
|
|
|
static int osd_w, osd_h;
|
2002-02-09 11:35:24 +00:00
|
|
|
static int noprebuf = 0;
|
2001-11-08 21:51:28 +00:00
|
|
|
static int img_format = 0;
|
2001-12-04 23:14:31 +00:00
|
|
|
|
2002-01-11 22:30:28 +00:00
|
|
|
/* File descriptors */
|
2001-11-16 08:31:18 +00:00
|
|
|
static int fd_control = -1;
|
|
|
|
static int fd_video = -1;
|
|
|
|
static int fd_spu = -1;
|
2002-02-09 10:43:11 +00:00
|
|
|
static char fdv_name[80];
|
2002-04-06 07:30:28 +00:00
|
|
|
static char fds_name[80];
|
2002-01-11 22:30:28 +00:00
|
|
|
|
2002-07-05 14:26:37 +00:00
|
|
|
#ifdef SPU_SUPPORT
|
2002-04-04 16:11:09 +00:00
|
|
|
/* on screen display/subpics */
|
|
|
|
static char *osdpicbuf = NULL;
|
|
|
|
static int osdpicbuf_w;
|
|
|
|
static int osdpicbuf_h;
|
|
|
|
static int disposd = 0;
|
|
|
|
static encodedata *spued;
|
2002-08-22 13:58:38 +00:00
|
|
|
static encodedata *prebuf;
|
2002-07-05 14:26:37 +00:00
|
|
|
#endif
|
2002-04-04 16:11:09 +00:00
|
|
|
|
2002-01-11 22:30:28 +00:00
|
|
|
/* Static variable used in ioctl's */
|
2001-11-16 08:31:18 +00:00
|
|
|
static int ioval = 0;
|
2001-11-03 02:38:10 +00:00
|
|
|
|
2002-07-05 14:26:37 +00:00
|
|
|
static int get_video_eq(vidix_video_eq_t *info);
|
|
|
|
static int set_video_eq(vidix_video_eq_t *info);
|
2001-11-03 02:38:10 +00:00
|
|
|
|
2002-02-09 10:43:11 +00:00
|
|
|
uint32_t control(uint32_t request, void *data, ...)
|
2002-02-09 00:47:26 +00:00
|
|
|
{
|
|
|
|
switch (request) {
|
2002-08-14 23:02:45 +00:00
|
|
|
case VOCTRL_GUISUPPORT:
|
|
|
|
case VOCTRL_GUI_NOWINDOW:
|
|
|
|
return VO_TRUE;
|
2002-02-18 17:34:20 +00:00
|
|
|
case VOCTRL_RESUME:
|
|
|
|
if (!noprebuf) {
|
|
|
|
ioval = EM8300_PLAYMODE_PLAY;
|
|
|
|
if (ioctl(fd_control, EM8300_IOCTL_SET_PLAYMODE, &ioval) < 0) {
|
|
|
|
printf("VO: [dxr3] Unable to set playmode!\n");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return VO_TRUE;
|
|
|
|
case VOCTRL_PAUSE:
|
|
|
|
if (!noprebuf) {
|
|
|
|
ioval = EM8300_PLAYMODE_PAUSED;
|
|
|
|
if (ioctl(fd_control, EM8300_IOCTL_SET_PLAYMODE, &ioval) < 0) {
|
|
|
|
printf("VO: [dxr3] Unable to set playmode!\n");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return VO_TRUE;
|
2002-02-09 00:47:26 +00:00
|
|
|
case VOCTRL_RESET:
|
2002-02-09 11:35:24 +00:00
|
|
|
if (!noprebuf) {
|
|
|
|
close(fd_video);
|
|
|
|
fd_video = open(fdv_name, O_WRONLY);
|
2002-04-06 07:30:28 +00:00
|
|
|
close(fd_spu);
|
|
|
|
fd_spu = open(fds_name, O_WRONLY);
|
2002-02-09 14:44:09 +00:00
|
|
|
fsync(fd_video);
|
2002-04-06 07:30:28 +00:00
|
|
|
fsync(fd_spu);
|
2002-02-09 11:35:24 +00:00
|
|
|
}
|
2002-02-09 00:47:26 +00:00
|
|
|
return VO_TRUE;
|
|
|
|
case VOCTRL_QUERY_FORMAT:
|
2002-07-05 14:26:37 +00:00
|
|
|
{
|
|
|
|
uint32_t flag = 0;
|
|
|
|
|
|
|
|
if (*((uint32_t*)data) != IMGFMT_MPEGPES)
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
flag = VFCAP_CSP_SUPPORTED | VFCAP_CSP_SUPPORTED_BY_HW | VFCAP_SPU;
|
|
|
|
if (!noprebuf)
|
|
|
|
flag |= VFCAP_TIMER;
|
|
|
|
return flag;
|
|
|
|
}
|
2002-07-25 13:23:44 +00:00
|
|
|
case VOCTRL_SET_EQUALIZER:
|
2002-07-05 14:26:37 +00:00
|
|
|
{
|
2002-07-25 13:23:44 +00:00
|
|
|
va_list ap;
|
|
|
|
int value;
|
|
|
|
em8300_bcs_t bcs;
|
|
|
|
|
|
|
|
va_start(ap, data);
|
|
|
|
value = va_arg(ap, int);
|
|
|
|
va_end(ap);
|
|
|
|
|
|
|
|
if (ioctl(fd_control, EM8300_IOCTL_GETBCS, &bcs) < 0)
|
|
|
|
return VO_FALSE;
|
|
|
|
if (!strcasecmp(data, "brightness"))
|
2002-08-27 08:33:05 +00:00
|
|
|
bcs.brightness = (value+100)*5;
|
2002-07-25 13:23:44 +00:00
|
|
|
else if (!strcasecmp(data, "contrast"))
|
2002-08-27 08:33:05 +00:00
|
|
|
bcs.contrast = (value+100)*5;
|
2002-07-25 13:23:44 +00:00
|
|
|
else if (!strcasecmp(data, "saturation"))
|
2002-08-27 08:33:05 +00:00
|
|
|
bcs.saturation = (value+100)*5;
|
|
|
|
else return VO_FALSE;
|
|
|
|
|
2002-07-25 13:23:44 +00:00
|
|
|
if (ioctl(fd_control, EM8300_IOCTL_SETBCS, &bcs) < 0)
|
|
|
|
return VO_FALSE;
|
|
|
|
return VO_TRUE;
|
|
|
|
}
|
|
|
|
case VOCTRL_GET_EQUALIZER:
|
|
|
|
{
|
|
|
|
va_list ap;
|
|
|
|
int *value;
|
|
|
|
em8300_bcs_t bcs;
|
|
|
|
|
|
|
|
va_start(ap, data);
|
2002-07-30 16:40:42 +00:00
|
|
|
value = va_arg(ap, int*);
|
2002-07-25 13:23:44 +00:00
|
|
|
va_end(ap);
|
2002-07-18 14:59:55 +00:00
|
|
|
|
2002-07-25 13:23:44 +00:00
|
|
|
if (ioctl(fd_control, EM8300_IOCTL_GETBCS, &bcs) < 0)
|
|
|
|
return VO_FALSE;
|
|
|
|
|
|
|
|
if (!strcasecmp(data, "brightness"))
|
2002-08-27 08:33:05 +00:00
|
|
|
*value = (bcs.brightness/5)-100;
|
2002-07-25 13:23:44 +00:00
|
|
|
else if (!strcasecmp(data, "contrast"))
|
2002-08-27 08:33:05 +00:00
|
|
|
*value = (bcs.contrast/5)-100;
|
2002-07-25 13:23:44 +00:00
|
|
|
else if (!strcasecmp(data, "saturation"))
|
2002-08-27 08:33:05 +00:00
|
|
|
*value = (bcs.saturation/5)-100;
|
|
|
|
else return VO_FALSE;
|
|
|
|
|
2002-07-05 14:26:37 +00:00
|
|
|
return VO_TRUE;
|
|
|
|
}
|
2002-02-09 00:47:26 +00:00
|
|
|
}
|
|
|
|
return VO_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2002-03-20 17:26:52 +00:00
|
|
|
static uint32_t config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint32_t fullscreen, char *title, uint32_t format, const vo_tune_info_t *info)
|
2001-11-03 02:38:10 +00:00
|
|
|
{
|
2002-02-18 17:34:20 +00:00
|
|
|
int tmp1, tmp2, size;
|
Added new syncengine thanks to a new previously undocumented feature of the em8300, this might fix playback on both slow and fast machines (more testing needed). This also requires users to get the em8300 driver from cvs until the next version is released (will probably happen this weekend)
Added lots of comments, should be pretty easy to understand most of the internals now
Added lots of brackets to if's for's while's etc, this is not a cosmetical thing but rather due to the fact I got some very odd bugs with else's since I didn't properly use brackets (and it's the K&R standard to have brackets everywhere)
Fixed some bugs that would occur when disabling libmp1e
Switched to default to the new naming scheme of device nodes, the driver will slowly switch over to this state, if it can't find devices under the new name it will try the old naming scheme
I stopped opening devices in non-blocking mode, it would break the new syncengine which tries to burst data to the device (alot of times meaning it will fill the fifo pretty fast which would previously result in jerkyness on fast machines)
The device now sets the initial state of the pts and speed (probably not needed, but assumption is the mother of all fuckups =)
Keep the control interface open during the entire duration of the libvo device, we might need this to flush video buffers on seeking (currently not implemented, therefore seeking is broken)
This is beta stuff to the driver, I will get some users to test it for me and do my best to fix seeking as soon as possible...
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@4219 b3059339-0415-0410-9bf9-f77b7e298cf2
2002-01-17 10:33:47 +00:00
|
|
|
em8300_register_t reg;
|
2002-03-23 15:27:47 +00:00
|
|
|
extern float monitor_aspect;
|
2002-07-18 14:59:55 +00:00
|
|
|
|
2002-02-13 00:38:23 +00:00
|
|
|
/* Softzoom turned on, downscale */
|
Added new syncengine thanks to a new previously undocumented feature of the em8300, this might fix playback on both slow and fast machines (more testing needed). This also requires users to get the em8300 driver from cvs until the next version is released (will probably happen this weekend)
Added lots of comments, should be pretty easy to understand most of the internals now
Added lots of brackets to if's for's while's etc, this is not a cosmetical thing but rather due to the fact I got some very odd bugs with else's since I didn't properly use brackets (and it's the K&R standard to have brackets everywhere)
Fixed some bugs that would occur when disabling libmp1e
Switched to default to the new naming scheme of device nodes, the driver will slowly switch over to this state, if it can't find devices under the new name it will try the old naming scheme
I stopped opening devices in non-blocking mode, it would break the new syncengine which tries to burst data to the device (alot of times meaning it will fill the fifo pretty fast which would previously result in jerkyness on fast machines)
The device now sets the initial state of the pts and speed (probably not needed, but assumption is the mother of all fuckups =)
Keep the control interface open during the entire duration of the libvo device, we might need this to flush video buffers on seeking (currently not implemented, therefore seeking is broken)
This is beta stuff to the driver, I will get some users to test it for me and do my best to fix seeking as soon as possible...
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@4219 b3059339-0415-0410-9bf9-f77b7e298cf2
2002-01-17 10:33:47 +00:00
|
|
|
/* This activates the subpicture processor, you can safely disable this and still send */
|
|
|
|
/* broken subpics to the em8300, if it's enabled and you send broken subpics you will end */
|
|
|
|
/* up in a lockup */
|
2002-01-15 00:23:16 +00:00
|
|
|
ioval = EM8300_SPUMODE_ON;
|
2002-01-11 22:30:28 +00:00
|
|
|
if (ioctl(fd_control, EM8300_IOCTL_SET_SPUMODE, &ioval) < 0) {
|
|
|
|
printf("VO: [dxr3] Unable to set subpicture mode!\n");
|
|
|
|
uninit();
|
|
|
|
return -1;
|
|
|
|
}
|
2001-11-16 08:31:18 +00:00
|
|
|
|
2002-01-11 22:30:28 +00:00
|
|
|
/* Set the playmode to play (just in case another app has set it to something else) */
|
|
|
|
ioval = EM8300_PLAYMODE_PLAY;
|
Added new syncengine thanks to a new previously undocumented feature of the em8300, this might fix playback on both slow and fast machines (more testing needed). This also requires users to get the em8300 driver from cvs until the next version is released (will probably happen this weekend)
Added lots of comments, should be pretty easy to understand most of the internals now
Added lots of brackets to if's for's while's etc, this is not a cosmetical thing but rather due to the fact I got some very odd bugs with else's since I didn't properly use brackets (and it's the K&R standard to have brackets everywhere)
Fixed some bugs that would occur when disabling libmp1e
Switched to default to the new naming scheme of device nodes, the driver will slowly switch over to this state, if it can't find devices under the new name it will try the old naming scheme
I stopped opening devices in non-blocking mode, it would break the new syncengine which tries to burst data to the device (alot of times meaning it will fill the fifo pretty fast which would previously result in jerkyness on fast machines)
The device now sets the initial state of the pts and speed (probably not needed, but assumption is the mother of all fuckups =)
Keep the control interface open during the entire duration of the libvo device, we might need this to flush video buffers on seeking (currently not implemented, therefore seeking is broken)
This is beta stuff to the driver, I will get some users to test it for me and do my best to fix seeking as soon as possible...
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@4219 b3059339-0415-0410-9bf9-f77b7e298cf2
2002-01-17 10:33:47 +00:00
|
|
|
if (ioctl(fd_control, EM8300_IOCTL_SET_PLAYMODE, &ioval) < 0) {
|
2002-01-11 22:30:28 +00:00
|
|
|
printf("VO: [dxr3] Unable to set playmode!\n");
|
Added new syncengine thanks to a new previously undocumented feature of the em8300, this might fix playback on both slow and fast machines (more testing needed). This also requires users to get the em8300 driver from cvs until the next version is released (will probably happen this weekend)
Added lots of comments, should be pretty easy to understand most of the internals now
Added lots of brackets to if's for's while's etc, this is not a cosmetical thing but rather due to the fact I got some very odd bugs with else's since I didn't properly use brackets (and it's the K&R standard to have brackets everywhere)
Fixed some bugs that would occur when disabling libmp1e
Switched to default to the new naming scheme of device nodes, the driver will slowly switch over to this state, if it can't find devices under the new name it will try the old naming scheme
I stopped opening devices in non-blocking mode, it would break the new syncengine which tries to burst data to the device (alot of times meaning it will fill the fifo pretty fast which would previously result in jerkyness on fast machines)
The device now sets the initial state of the pts and speed (probably not needed, but assumption is the mother of all fuckups =)
Keep the control interface open during the entire duration of the libvo device, we might need this to flush video buffers on seeking (currently not implemented, therefore seeking is broken)
This is beta stuff to the driver, I will get some users to test it for me and do my best to fix seeking as soon as possible...
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@4219 b3059339-0415-0410-9bf9-f77b7e298cf2
2002-01-17 10:33:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Start em8300 prebuffering and sync engine */
|
2002-07-02 13:32:08 +00:00
|
|
|
#ifdef MVCOMMAND_SYNC
|
Added new syncengine thanks to a new previously undocumented feature of the em8300, this might fix playback on both slow and fast machines (more testing needed). This also requires users to get the em8300 driver from cvs until the next version is released (will probably happen this weekend)
Added lots of comments, should be pretty easy to understand most of the internals now
Added lots of brackets to if's for's while's etc, this is not a cosmetical thing but rather due to the fact I got some very odd bugs with else's since I didn't properly use brackets (and it's the K&R standard to have brackets everywhere)
Fixed some bugs that would occur when disabling libmp1e
Switched to default to the new naming scheme of device nodes, the driver will slowly switch over to this state, if it can't find devices under the new name it will try the old naming scheme
I stopped opening devices in non-blocking mode, it would break the new syncengine which tries to burst data to the device (alot of times meaning it will fill the fifo pretty fast which would previously result in jerkyness on fast machines)
The device now sets the initial state of the pts and speed (probably not needed, but assumption is the mother of all fuckups =)
Keep the control interface open during the entire duration of the libvo device, we might need this to flush video buffers on seeking (currently not implemented, therefore seeking is broken)
This is beta stuff to the driver, I will get some users to test it for me and do my best to fix seeking as soon as possible...
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@4219 b3059339-0415-0410-9bf9-f77b7e298cf2
2002-01-17 10:33:47 +00:00
|
|
|
reg.microcode_register = 1;
|
|
|
|
reg.reg = 0;
|
|
|
|
reg.val = MVCOMMAND_SYNC;
|
|
|
|
ioctl(fd_control, EM8300_IOCTL_WRITEREG, ®);
|
2002-07-02 13:32:08 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef EM8300_IOCTL_FLUSH
|
2002-02-09 14:27:24 +00:00
|
|
|
/* Clean buffer by syncing it */
|
2002-02-09 14:44:09 +00:00
|
|
|
ioval = EM8300_SUBDEVICE_VIDEO;
|
|
|
|
ioctl(fd_control, EM8300_IOCTL_FLUSH, &ioval);
|
|
|
|
ioval = EM8300_SUBDEVICE_AUDIO;
|
|
|
|
ioctl(fd_control, EM8300_IOCTL_FLUSH, &ioval);
|
2002-07-02 13:32:08 +00:00
|
|
|
#endif
|
|
|
|
|
2002-02-03 14:55:27 +00:00
|
|
|
fsync(fd_video);
|
2002-02-09 17:40:33 +00:00
|
|
|
if (!noprebuf) {
|
|
|
|
ioval = 0x900;
|
|
|
|
ioctl(fd_control, EM8300_IOCTL_SCR_SETSPEED, &ioval);
|
|
|
|
ioval = 0;
|
|
|
|
ioctl(fd_control, EM8300_IOCTL_SCR_SET, &ioval);
|
|
|
|
}
|
Added new syncengine thanks to a new previously undocumented feature of the em8300, this might fix playback on both slow and fast machines (more testing needed). This also requires users to get the em8300 driver from cvs until the next version is released (will probably happen this weekend)
Added lots of comments, should be pretty easy to understand most of the internals now
Added lots of brackets to if's for's while's etc, this is not a cosmetical thing but rather due to the fact I got some very odd bugs with else's since I didn't properly use brackets (and it's the K&R standard to have brackets everywhere)
Fixed some bugs that would occur when disabling libmp1e
Switched to default to the new naming scheme of device nodes, the driver will slowly switch over to this state, if it can't find devices under the new name it will try the old naming scheme
I stopped opening devices in non-blocking mode, it would break the new syncengine which tries to burst data to the device (alot of times meaning it will fill the fifo pretty fast which would previously result in jerkyness on fast machines)
The device now sets the initial state of the pts and speed (probably not needed, but assumption is the mother of all fuckups =)
Keep the control interface open during the entire duration of the libvo device, we might need this to flush video buffers on seeking (currently not implemented, therefore seeking is broken)
This is beta stuff to the driver, I will get some users to test it for me and do my best to fix seeking as soon as possible...
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@4219 b3059339-0415-0410-9bf9-f77b7e298cf2
2002-01-17 10:33:47 +00:00
|
|
|
|
|
|
|
/* Store some variables statically that we need later in another scope */
|
2002-01-11 22:30:28 +00:00
|
|
|
img_format = format;
|
2002-02-13 00:38:23 +00:00
|
|
|
v_width = width;
|
|
|
|
v_height = height;
|
2002-01-11 22:30:28 +00:00
|
|
|
|
2002-03-23 15:27:47 +00:00
|
|
|
/* Set monitor_aspect to avoid jitter */
|
|
|
|
monitor_aspect = (float) width / (float) height;
|
|
|
|
|
2002-02-13 00:38:23 +00:00
|
|
|
/* libavcodec requires a width and height that is x|16 */
|
2002-03-23 18:16:22 +00:00
|
|
|
aspect_save_orig(width, height);
|
2002-02-13 00:38:23 +00:00
|
|
|
aspect_save_prescale(d_width, d_height);
|
2002-07-02 13:32:08 +00:00
|
|
|
#ifdef EM8300_IOCTL_GET_VIDEOMODE
|
2002-02-13 00:38:23 +00:00
|
|
|
ioctl(fd_control, EM8300_IOCTL_GET_VIDEOMODE, &ioval);
|
|
|
|
if (ioval == EM8300_VIDEOMODE_NTSC) {
|
|
|
|
printf("VO: [dxr3] Setting up for NTSC.\n");
|
2002-03-13 14:39:24 +00:00
|
|
|
aspect_save_screenres(352, 240);
|
2002-02-13 00:38:23 +00:00
|
|
|
} else {
|
|
|
|
printf("VO: [dxr3] Setting up for PAL/SECAM.\n");
|
2002-03-13 14:39:24 +00:00
|
|
|
aspect_save_screenres(352, 288);
|
2002-02-13 00:38:23 +00:00
|
|
|
}
|
2002-07-02 13:32:08 +00:00
|
|
|
#endif
|
2002-02-13 00:38:23 +00:00
|
|
|
aspect(&s_width, &s_height, A_ZOOM);
|
2002-03-13 14:15:00 +00:00
|
|
|
s_width -= s_width % 16;
|
2002-03-23 18:16:22 +00:00
|
|
|
s_height -= s_height % 16;
|
2002-03-13 14:15:00 +00:00
|
|
|
|
2002-01-11 22:30:28 +00:00
|
|
|
/* Try to figure out whether to use widescreen output or not */
|
Added new syncengine thanks to a new previously undocumented feature of the em8300, this might fix playback on both slow and fast machines (more testing needed). This also requires users to get the em8300 driver from cvs until the next version is released (will probably happen this weekend)
Added lots of comments, should be pretty easy to understand most of the internals now
Added lots of brackets to if's for's while's etc, this is not a cosmetical thing but rather due to the fact I got some very odd bugs with else's since I didn't properly use brackets (and it's the K&R standard to have brackets everywhere)
Fixed some bugs that would occur when disabling libmp1e
Switched to default to the new naming scheme of device nodes, the driver will slowly switch over to this state, if it can't find devices under the new name it will try the old naming scheme
I stopped opening devices in non-blocking mode, it would break the new syncengine which tries to burst data to the device (alot of times meaning it will fill the fifo pretty fast which would previously result in jerkyness on fast machines)
The device now sets the initial state of the pts and speed (probably not needed, but assumption is the mother of all fuckups =)
Keep the control interface open during the entire duration of the libvo device, we might need this to flush video buffers on seeking (currently not implemented, therefore seeking is broken)
This is beta stuff to the driver, I will get some users to test it for me and do my best to fix seeking as soon as possible...
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@4219 b3059339-0415-0410-9bf9-f77b7e298cf2
2002-01-17 10:33:47 +00:00
|
|
|
/* Anamorphic widescreen modes makes this a pain in the ass */
|
2002-02-13 00:38:23 +00:00
|
|
|
tmp1 = abs(d_height - ((d_width / 4) * 3));
|
|
|
|
tmp2 = abs(d_height - (int) (d_width / 2.35));
|
2002-01-11 22:30:28 +00:00
|
|
|
if (tmp1 < tmp2) {
|
|
|
|
ioval = EM8300_ASPECTRATIO_4_3;
|
|
|
|
printf("VO: [dxr3] Setting aspect ratio to 4:3\n");
|
|
|
|
} else {
|
|
|
|
ioval = EM8300_ASPECTRATIO_16_9;
|
|
|
|
printf("VO: [dxr3] Setting aspect ratio to 16:9\n");
|
2001-11-29 17:31:58 +00:00
|
|
|
}
|
2002-01-11 22:30:28 +00:00
|
|
|
ioctl(fd_control, EM8300_IOCTL_SET_ASPECTRATIO, &ioval);
|
2002-03-26 18:47:42 +00:00
|
|
|
|
2002-07-05 14:26:37 +00:00
|
|
|
#ifdef SPU_SUPPORT
|
2002-08-22 13:58:38 +00:00
|
|
|
s_width*=2;
|
|
|
|
s_height*=2;
|
|
|
|
|
|
|
|
osdpicbuf = calloc( 1,s_width * s_height);
|
2002-07-05 14:26:37 +00:00
|
|
|
if (osdpicbuf == NULL) {
|
|
|
|
printf("vo_dxr3: out of mem\n");
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
spued = (encodedata *) malloc(sizeof(encodedata));
|
|
|
|
if (spued == NULL) {
|
2002-08-22 13:58:38 +00:00
|
|
|
free( osdpicbuf );
|
|
|
|
printf("vo_dxr3:out of mem\n");
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
prebuf = (encodedata *) malloc(sizeof(encodedata));
|
|
|
|
if (prebuf == NULL) {
|
|
|
|
free( osdpicbuf );
|
|
|
|
free( spued );
|
2002-07-05 14:26:37 +00:00
|
|
|
printf("vo_dxr3:out of mem\n");
|
|
|
|
return -1;
|
2001-11-29 17:31:58 +00:00
|
|
|
}
|
2002-07-05 14:26:37 +00:00
|
|
|
osd_w = s_width;
|
|
|
|
osd_h = s_height;
|
|
|
|
osdpicbuf_w = s_width;
|
|
|
|
osdpicbuf_h = s_height;
|
2002-08-22 13:58:38 +00:00
|
|
|
|
|
|
|
prebuf->count=0;
|
|
|
|
pixbuf_encode_rle( 0,0,osdpicbuf_w,osdpicbuf_h - 1,osdpicbuf,osdpicbuf_w,prebuf );
|
|
|
|
|
2002-07-05 14:26:37 +00:00
|
|
|
#endif
|
2001-11-08 21:51:28 +00:00
|
|
|
|
2002-07-05 14:26:37 +00:00
|
|
|
return 0;
|
2001-11-03 02:38:10 +00:00
|
|
|
}
|
|
|
|
|
2001-11-13 16:01:56 +00:00
|
|
|
static const vo_info_t* get_info(void)
|
2001-11-03 02:38:10 +00:00
|
|
|
{
|
2002-01-11 22:30:28 +00:00
|
|
|
return &vo_info;
|
2001-11-03 02:38:10 +00:00
|
|
|
}
|
|
|
|
|
2002-02-09 10:43:11 +00:00
|
|
|
static void draw_alpha(int x, int y, int w, int h, unsigned char* src, unsigned char *srca, int srcstride)
|
2001-11-03 02:38:10 +00:00
|
|
|
{
|
2002-07-05 14:26:37 +00:00
|
|
|
#ifdef SPU_SUPPORT
|
|
|
|
unsigned char *buf = &osdpicbuf[(y * osdpicbuf_w) + x];
|
2002-08-22 13:58:38 +00:00
|
|
|
int by = 0;
|
|
|
|
register int lx, ly;
|
|
|
|
register int stride = 0;
|
|
|
|
|
|
|
|
for (ly = 0; ly < h - 1; ly++)
|
|
|
|
{
|
|
|
|
for(lx = 0; lx < w; lx++ )
|
|
|
|
if ( ( srca[stride + lx] )&&( src[stride + lx] >= 128 ) ) buf[by + lx] = 3;
|
|
|
|
by+=osdpicbuf_w;
|
|
|
|
stride+=srcstride;
|
2002-04-04 16:11:09 +00:00
|
|
|
}
|
2002-07-05 14:26:37 +00:00
|
|
|
pixbuf_encode_rle(x, y, osdpicbuf_w, osdpicbuf_h - 1, osdpicbuf, osdpicbuf_w, spued);
|
|
|
|
#endif
|
2001-11-03 02:38:10 +00:00
|
|
|
}
|
|
|
|
|
2002-08-22 13:58:38 +00:00
|
|
|
extern int vo_osd_changed_flag;
|
|
|
|
extern mp_osd_obj_t* vo_osd_list;
|
|
|
|
|
2001-11-03 02:38:10 +00:00
|
|
|
static void draw_osd(void)
|
|
|
|
{
|
2002-07-05 14:26:37 +00:00
|
|
|
#ifdef SPU_SUPPORT
|
2002-08-22 13:58:38 +00:00
|
|
|
static int cleared = 0;
|
|
|
|
int changed = 0;
|
|
|
|
|
|
|
|
if ((disposd % 15) == 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
mp_osd_obj_t* obj = vo_osd_list;
|
|
|
|
vo_update_osd( osd_w,osd_h );
|
|
|
|
while( obj )
|
|
|
|
{
|
|
|
|
if ( obj->flags & OSDFLAG_VISIBLE ) { changed=1; break; }
|
|
|
|
obj=obj->next;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ( changed )
|
|
|
|
{
|
|
|
|
vo_draw_text(osd_w, osd_h, draw_alpha);
|
|
|
|
memset(osdpicbuf, 0, s_width * s_height);
|
|
|
|
cleared=0;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if ( !cleared )
|
|
|
|
{
|
|
|
|
spued->count=prebuf->count;
|
|
|
|
memcpy( spued->data,prebuf->data,DATASIZE );
|
|
|
|
cleared=1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2002-07-05 14:26:37 +00:00
|
|
|
|
2002-04-04 16:11:09 +00:00
|
|
|
/* could stand some check here to see if the subpic hasn't changed
|
|
|
|
* as if it hasn't and we re-send it it will "blink" as the last one
|
|
|
|
* is turned off, and the new one (same one) is turned on
|
|
|
|
*/
|
2002-07-18 14:59:55 +00:00
|
|
|
/* Subpics are not stable yet =(
|
2002-08-22 13:58:38 +00:00
|
|
|
expect lockups if you enable */
|
|
|
|
#if 1
|
2002-07-05 14:26:37 +00:00
|
|
|
if (!noprebuf) {
|
2002-04-04 16:11:09 +00:00
|
|
|
ioctl(fd_spu, EM8300_IOCTL_SPU_SETPTS, &vo_pts);
|
|
|
|
}
|
2002-08-22 13:58:38 +00:00
|
|
|
write(fd_spu, spued->data, spued->count);
|
|
|
|
#endif
|
Added new syncengine thanks to a new previously undocumented feature of the em8300, this might fix playback on both slow and fast machines (more testing needed). This also requires users to get the em8300 driver from cvs until the next version is released (will probably happen this weekend)
Added lots of comments, should be pretty easy to understand most of the internals now
Added lots of brackets to if's for's while's etc, this is not a cosmetical thing but rather due to the fact I got some very odd bugs with else's since I didn't properly use brackets (and it's the K&R standard to have brackets everywhere)
Fixed some bugs that would occur when disabling libmp1e
Switched to default to the new naming scheme of device nodes, the driver will slowly switch over to this state, if it can't find devices under the new name it will try the old naming scheme
I stopped opening devices in non-blocking mode, it would break the new syncengine which tries to burst data to the device (alot of times meaning it will fill the fifo pretty fast which would previously result in jerkyness on fast machines)
The device now sets the initial state of the pts and speed (probably not needed, but assumption is the mother of all fuckups =)
Keep the control interface open during the entire duration of the libvo device, we might need this to flush video buffers on seeking (currently not implemented, therefore seeking is broken)
This is beta stuff to the driver, I will get some users to test it for me and do my best to fix seeking as soon as possible...
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@4219 b3059339-0415-0410-9bf9-f77b7e298cf2
2002-01-17 10:33:47 +00:00
|
|
|
}
|
2002-07-05 14:26:37 +00:00
|
|
|
disposd++;
|
|
|
|
#endif
|
2001-11-03 02:38:10 +00:00
|
|
|
}
|
|
|
|
|
2002-04-04 16:11:09 +00:00
|
|
|
|
2001-11-03 02:38:10 +00:00
|
|
|
static uint32_t draw_frame(uint8_t * src[])
|
|
|
|
{
|
2002-04-16 11:14:49 +00:00
|
|
|
char *pData;
|
|
|
|
int pSize;
|
2002-07-05 14:26:37 +00:00
|
|
|
vo_mpegpes_t *p = (vo_mpegpes_t *) src[0];
|
2002-02-03 14:55:27 +00:00
|
|
|
|
2002-07-05 14:26:37 +00:00
|
|
|
#ifdef SPU_SUPPORT
|
|
|
|
if (p->id == 0x20) {
|
|
|
|
if (!noprebuf) {
|
|
|
|
ioctl(fd_spu, EM8300_IOCTL_SPU_SETPTS, &vo_pts);
|
2002-01-15 00:23:16 +00:00
|
|
|
}
|
2002-07-05 14:26:37 +00:00
|
|
|
write(fd_spu, p->data, p->size);
|
|
|
|
} else
|
2001-12-10 14:41:44 +00:00
|
|
|
#endif
|
2002-07-05 14:26:37 +00:00
|
|
|
write(fd_video, p->data, p->size);
|
|
|
|
return 0;
|
2001-11-03 02:38:10 +00:00
|
|
|
}
|
|
|
|
|
2002-01-11 22:30:28 +00:00
|
|
|
static void flip_page(void)
|
2001-11-03 02:38:10 +00:00
|
|
|
{
|
2002-03-28 15:05:51 +00:00
|
|
|
int size;
|
2002-02-18 18:23:14 +00:00
|
|
|
if (!noprebuf) {
|
|
|
|
ioctl(fd_video, EM8300_IOCTL_VIDEO_SETPTS, &vo_pts);
|
|
|
|
}
|
2001-11-03 02:38:10 +00:00
|
|
|
}
|
|
|
|
|
2002-01-11 22:30:28 +00:00
|
|
|
static uint32_t draw_slice(uint8_t *srcimg[], int stride[], int w, int h, int x0, int y0)
|
2001-11-03 02:38:10 +00:00
|
|
|
{
|
2002-01-11 22:30:28 +00:00
|
|
|
return -1;
|
2001-11-03 02:38:10 +00:00
|
|
|
}
|
|
|
|
|
2001-11-29 19:18:48 +00:00
|
|
|
static void uninit(void)
|
2001-11-03 02:38:10 +00:00
|
|
|
{
|
2002-01-11 22:30:28 +00:00
|
|
|
printf("VO: [dxr3] Uninitializing\n");
|
Added new syncengine thanks to a new previously undocumented feature of the em8300, this might fix playback on both slow and fast machines (more testing needed). This also requires users to get the em8300 driver from cvs until the next version is released (will probably happen this weekend)
Added lots of comments, should be pretty easy to understand most of the internals now
Added lots of brackets to if's for's while's etc, this is not a cosmetical thing but rather due to the fact I got some very odd bugs with else's since I didn't properly use brackets (and it's the K&R standard to have brackets everywhere)
Fixed some bugs that would occur when disabling libmp1e
Switched to default to the new naming scheme of device nodes, the driver will slowly switch over to this state, if it can't find devices under the new name it will try the old naming scheme
I stopped opening devices in non-blocking mode, it would break the new syncengine which tries to burst data to the device (alot of times meaning it will fill the fifo pretty fast which would previously result in jerkyness on fast machines)
The device now sets the initial state of the pts and speed (probably not needed, but assumption is the mother of all fuckups =)
Keep the control interface open during the entire duration of the libvo device, we might need this to flush video buffers on seeking (currently not implemented, therefore seeking is broken)
This is beta stuff to the driver, I will get some users to test it for me and do my best to fix seeking as soon as possible...
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@4219 b3059339-0415-0410-9bf9-f77b7e298cf2
2002-01-17 10:33:47 +00:00
|
|
|
if (fd_video) {
|
2002-01-11 22:30:28 +00:00
|
|
|
close(fd_video);
|
Added new syncengine thanks to a new previously undocumented feature of the em8300, this might fix playback on both slow and fast machines (more testing needed). This also requires users to get the em8300 driver from cvs until the next version is released (will probably happen this weekend)
Added lots of comments, should be pretty easy to understand most of the internals now
Added lots of brackets to if's for's while's etc, this is not a cosmetical thing but rather due to the fact I got some very odd bugs with else's since I didn't properly use brackets (and it's the K&R standard to have brackets everywhere)
Fixed some bugs that would occur when disabling libmp1e
Switched to default to the new naming scheme of device nodes, the driver will slowly switch over to this state, if it can't find devices under the new name it will try the old naming scheme
I stopped opening devices in non-blocking mode, it would break the new syncengine which tries to burst data to the device (alot of times meaning it will fill the fifo pretty fast which would previously result in jerkyness on fast machines)
The device now sets the initial state of the pts and speed (probably not needed, but assumption is the mother of all fuckups =)
Keep the control interface open during the entire duration of the libvo device, we might need this to flush video buffers on seeking (currently not implemented, therefore seeking is broken)
This is beta stuff to the driver, I will get some users to test it for me and do my best to fix seeking as soon as possible...
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@4219 b3059339-0415-0410-9bf9-f77b7e298cf2
2002-01-17 10:33:47 +00:00
|
|
|
}
|
|
|
|
if (fd_spu) {
|
2002-01-11 22:30:28 +00:00
|
|
|
close(fd_spu);
|
Added new syncengine thanks to a new previously undocumented feature of the em8300, this might fix playback on both slow and fast machines (more testing needed). This also requires users to get the em8300 driver from cvs until the next version is released (will probably happen this weekend)
Added lots of comments, should be pretty easy to understand most of the internals now
Added lots of brackets to if's for's while's etc, this is not a cosmetical thing but rather due to the fact I got some very odd bugs with else's since I didn't properly use brackets (and it's the K&R standard to have brackets everywhere)
Fixed some bugs that would occur when disabling libmp1e
Switched to default to the new naming scheme of device nodes, the driver will slowly switch over to this state, if it can't find devices under the new name it will try the old naming scheme
I stopped opening devices in non-blocking mode, it would break the new syncengine which tries to burst data to the device (alot of times meaning it will fill the fifo pretty fast which would previously result in jerkyness on fast machines)
The device now sets the initial state of the pts and speed (probably not needed, but assumption is the mother of all fuckups =)
Keep the control interface open during the entire duration of the libvo device, we might need this to flush video buffers on seeking (currently not implemented, therefore seeking is broken)
This is beta stuff to the driver, I will get some users to test it for me and do my best to fix seeking as soon as possible...
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@4219 b3059339-0415-0410-9bf9-f77b7e298cf2
2002-01-17 10:33:47 +00:00
|
|
|
}
|
|
|
|
if (fd_control) {
|
|
|
|
close(fd_control);
|
|
|
|
}
|
2002-07-05 14:26:37 +00:00
|
|
|
#ifdef SPU_SUPPORT
|
2002-04-04 16:11:09 +00:00
|
|
|
if(osdpicbuf) {
|
|
|
|
free(osdpicbuf);
|
|
|
|
}
|
|
|
|
if(spued) {
|
|
|
|
free(spued);
|
|
|
|
}
|
2002-07-05 14:26:37 +00:00
|
|
|
#endif
|
2001-11-03 02:38:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void check_events(void)
|
|
|
|
{
|
|
|
|
}
|
2002-01-26 16:01:26 +00:00
|
|
|
|
|
|
|
static uint32_t preinit(const char *arg)
|
|
|
|
{
|
2002-02-03 14:55:27 +00:00
|
|
|
char devname[80];
|
2002-02-09 11:35:24 +00:00
|
|
|
int fdflags = O_WRONLY;
|
2002-03-24 18:01:08 +00:00
|
|
|
CpuCaps cpucaps;
|
2002-03-15 17:24:27 +00:00
|
|
|
|
2002-03-24 18:01:08 +00:00
|
|
|
GetCpuCaps(&cpucaps);
|
2002-02-03 14:55:27 +00:00
|
|
|
/* Open the control interface */
|
2002-03-28 15:05:51 +00:00
|
|
|
if (arg && !strncmp("noprebuf", arg, 8)) {
|
2002-02-16 12:51:33 +00:00
|
|
|
printf("VO: [dxr3] Disabling prebuffering.\n");
|
|
|
|
noprebuf = 1;
|
|
|
|
fdflags |= O_NONBLOCK;
|
2002-03-28 15:05:51 +00:00
|
|
|
arg = strchr(arg, ':');
|
|
|
|
if (arg) {
|
|
|
|
arg++;
|
|
|
|
}
|
2002-02-16 12:51:33 +00:00
|
|
|
}
|
2002-03-20 17:26:52 +00:00
|
|
|
|
2002-03-28 15:05:51 +00:00
|
|
|
if (cpucaps.has3DNowExt) {
|
|
|
|
printf("VO: [dxr3] Fast AMD special disabling prebuffering.\n");
|
2002-03-26 18:47:42 +00:00
|
|
|
noprebuf = 1;
|
|
|
|
fdflags |= O_NONBLOCK;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (arg && arg[0]) {
|
2002-02-16 13:06:45 +00:00
|
|
|
printf("VO: [dxr3] Forcing use of device %s\n", arg);
|
|
|
|
sprintf(devname, "/dev/em8300-%s", arg);
|
2002-02-03 14:55:27 +00:00
|
|
|
} else {
|
|
|
|
/* Try new naming scheme by default */
|
|
|
|
sprintf(devname, "/dev/em8300-0");
|
|
|
|
}
|
|
|
|
fd_control = open(devname, fdflags);
|
|
|
|
if (fd_control < 1) {
|
|
|
|
/* Fall back to old naming scheme */
|
|
|
|
printf("VO: [dxr3] Error opening %s for writing, trying /dev/em8300 instead\n", devname);
|
|
|
|
sprintf(devname, "/dev/em8300");
|
|
|
|
fd_control = open(devname, fdflags);
|
|
|
|
if (fd_control < 1) {
|
|
|
|
printf("VO: [dxr3] Error opening /dev/em8300 for writing as well!\nBailing\n");
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Open the video interface */
|
2002-02-16 13:06:45 +00:00
|
|
|
if (arg && !noprebuf) {
|
|
|
|
sprintf(devname, "/dev/em8300_mv-%s", arg);
|
2002-02-03 14:55:27 +00:00
|
|
|
} else {
|
|
|
|
/* Try new naming scheme by default */
|
|
|
|
sprintf(devname, "/dev/em8300_mv-0");
|
|
|
|
}
|
|
|
|
fd_video = open(devname, fdflags);
|
|
|
|
if (fd_video < 0) {
|
|
|
|
/* Fall back to old naming scheme */
|
|
|
|
printf("VO: [dxr3] Error opening %s for writing, trying /dev/em8300_mv instead\n", devname);
|
|
|
|
sprintf(devname, "/dev/em8300_mv");
|
|
|
|
fd_video = open(devname, fdflags);
|
|
|
|
if (fd_video < 0) {
|
|
|
|
printf("VO: [dxr3] Error opening /dev/em8300_mv for writing as well!\nBailing\n");
|
|
|
|
uninit();
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
printf("VO: [dxr3] Opened %s\n", devname);
|
|
|
|
}
|
2002-02-09 10:43:11 +00:00
|
|
|
strcpy(fdv_name, devname);
|
2002-02-03 14:55:27 +00:00
|
|
|
|
|
|
|
/* Open the subpicture interface */
|
2002-04-16 11:14:49 +00:00
|
|
|
fdflags |= O_NONBLOCK;
|
2002-02-16 13:06:45 +00:00
|
|
|
if (arg && !noprebuf) {
|
|
|
|
sprintf(devname, "/dev/em8300_sp-%s", arg);
|
2002-02-03 14:55:27 +00:00
|
|
|
} else {
|
|
|
|
/* Try new naming scheme by default */
|
|
|
|
sprintf(devname, "/dev/em8300_sp-0");
|
|
|
|
}
|
|
|
|
fd_spu = open(devname, fdflags);
|
|
|
|
if (fd_spu < 0) {
|
|
|
|
/* Fall back to old naming scheme */
|
|
|
|
printf("VO: [dxr3] Error opening %s for writing, trying /dev/em8300_sp instead\n", devname);
|
|
|
|
sprintf(devname, "/dev/em8300_sp");
|
|
|
|
fd_spu = open(devname, fdflags);
|
|
|
|
if (fd_spu < 0) {
|
|
|
|
printf("VO: [dxr3] Error opening /dev/em8300_sp for writing as well!\nBailing\n");
|
|
|
|
uninit();
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
}
|
2002-04-06 07:30:28 +00:00
|
|
|
strcpy(fds_name, devname);
|
2002-02-03 14:55:27 +00:00
|
|
|
|
2002-02-02 18:09:35 +00:00
|
|
|
return 0;
|
2002-01-26 16:01:26 +00:00
|
|
|
}
|