1
mirror of https://github.com/mpv-player/mpv synced 2024-12-28 06:03:45 +01:00

hw spu support for dxr3 - patch by David Holm

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@4161 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
arpi 2002-01-15 00:23:16 +00:00
parent 6bc31aecea
commit b28a18c137
3 changed files with 44 additions and 22 deletions

View File

@ -17,20 +17,23 @@ How to use a Sigma Designs Hollywood Plus and/or a Creative DXR3 by David Holm
2. Usage 2. Usage
-vo dxr3:<devicenum> For video output -vo dxr3:<devicenum> For video output
-ao oss:<devicefile> For audio output -ao oss:<devicefile> For audio output
-ac hwac3 For digital audio output instead of analog -ac hwac3 For digital audio output instead of
-vc mpegpes For mpeg playback analog
<devicenum> Number of device to use for playback (if you -vc mpegpes For mpeg playback
have more than one card.). This can usually -aop list=resample:fout=48000 If samplerate is below 44100Hz
be left out (-vo dxr3). <devicenum> Number of device to use for playback
Mandrake 8.1 uses devfs by default. If you are (if you have more than one card.).
running mandrake 8.1 please use -vo dxr3:0 This can usually be left out (-vo dxr3).
<devicefile> Normally /dev/em8300_ma or Mandrake 8.1 uses devfs by default. If
/dev/em8300_ma-<devicenum> you are running mandrake 8.1 please use
(-ao dxr3:/dev/em8300_ma). If left out the -vo dxr3:0
default oss device will be used (normally <devicefile> Normally /dev/em8300_ma or
soundcard). /dev/em8300_ma-<devicenum>
(-ao dxr3:/dev/em8300_ma). If left out
the default oss device will be used
(normally soundcard).
MPEG-1, MPEG-2, VCD and DVD Notes MPEG-1, MPEG-2, VCD and DVD Notes
There are some important notes to take into account here for optimum playback. There are some important notes to take into account here for optimum playback.

View File

@ -91,6 +91,8 @@ void write_dxr3(rte_context* context, void* data, size_t size, void* user_data)
} }
#endif #endif
extern int vidmode;
static uint32_t init(uint32_t scr_width, uint32_t scr_height, uint32_t width, uint32_t height, uint32_t fullscreen, char *title, uint32_t format) static uint32_t init(uint32_t scr_width, uint32_t scr_height, uint32_t width, uint32_t height, uint32_t fullscreen, char *title, uint32_t format)
{ {
int tmp1,tmp2; int tmp1,tmp2;
@ -112,7 +114,7 @@ static uint32_t init(uint32_t scr_width, uint32_t scr_height, uint32_t width, ui
sprintf(devname, "/dev/em8300_mv-%s", vo_subdevice); sprintf(devname, "/dev/em8300_mv-%s", vo_subdevice);
else else
sprintf(devname, "/dev/em8300_mv"); sprintf(devname, "/dev/em8300_mv");
fd_video = open(devname, O_WRONLY); fd_video = open(devname, O_WRONLY | O_NONBLOCK);
if (fd_video < 0) { if (fd_video < 0) {
printf("VO: [dxr3] Error opening %s for writing!\n", devname); printf("VO: [dxr3] Error opening %s for writing!\n", devname);
uninit(); uninit();
@ -135,7 +137,7 @@ static uint32_t init(uint32_t scr_width, uint32_t scr_height, uint32_t width, ui
/* Subpic code isn't working yet, don't set to ON /* Subpic code isn't working yet, don't set to ON
* unless you are really sure what you are doing * unless you are really sure what you are doing
*/ */
ioval = EM8300_SPUMODE_OFF; ioval = EM8300_SPUMODE_ON;
if (ioctl(fd_control, EM8300_IOCTL_SET_SPUMODE, &ioval) < 0) { if (ioctl(fd_control, EM8300_IOCTL_SET_SPUMODE, &ioval) < 0) {
printf("VO: [dxr3] Unable to set subpicture mode!\n"); printf("VO: [dxr3] Unable to set subpicture mode!\n");
uninit(); uninit();
@ -332,11 +334,19 @@ static uint32_t draw_frame(uint8_t * src[])
vo_mpegpes_t *p = (vo_mpegpes_t *) src[0]; vo_mpegpes_t *p = (vo_mpegpes_t *) src[0];
size_t data_left = p->size; size_t data_left = p->size;
if (ioctl(fd_video, EM8300_IOCTL_VIDEO_SETPTS, &vo_pts) < 0) if (p->id == 0x20) {
printf("VO: [dxr3] Unable to set pts\n"); if (ioctl(fd_spu, EM8300_IOCTL_SPU_SETPTS, &vo_pts) < 0)
printf("VO: [dxr3] Unable to set pts\n");
while (data_left) while (data_left)
data_left -= write(fd_video, (void*) (p->data + p->size-data_left), data_left); data_left -= write(fd_spu, (void*) (p->data + p->size-data_left), data_left);
} else {
if (ioctl(fd_video, EM8300_IOCTL_VIDEO_SETPTS, &vo_pts) < 0)
printf("VO: [dxr3] Unable to set pts\n");
while (data_left)
data_left -= write(fd_video, (void*) (p->data + p->size-data_left), data_left);
}
return 0; return 0;
} }
#ifdef USE_MP1E #ifdef USE_MP1E
@ -439,7 +449,7 @@ static uint32_t query_format(uint32_t format)
uint32_t flag = 0; uint32_t flag = 0;
if (format == IMGFMT_MPEGPES) if (format == IMGFMT_MPEGPES)
flag = 0x2 | 0x4; flag = 0x2 | 0x4 | 0x8;
#ifdef USE_MP1E #ifdef USE_MP1E
if (format == IMGFMT_YV12) if (format == IMGFMT_YV12)
flag = 0x1 | 0x4; flag = 0x1 | 0x4;

View File

@ -2333,7 +2333,16 @@ if(rel_seek_secs || abs_seek_pos){
#ifdef USE_DVDREAD #ifdef USE_DVDREAD
// DVD sub: // DVD sub:
if(vo_spudec){ if(vo_flags & 0x08){
static vo_mpegpes_t packet;
static vo_mpegpes_t *pkg=&packet;
packet.timestamp=sh_video->timer*90000.0;
packet.id=0x20; /* Subpic */
while((packet.size=ds_get_packet_sub(d_dvdsub,&packet.data))>0){
mp_msg(MSGT_CPLAYER,MSGL_V,"\rDVD sub: len=%d v_pts=%5.3f s_pts=%5.3f \n",packet.size,d_video->pts,d_dvdsub->pts);
video_out->draw_frame(&pkg);
}
}else if(vo_spudec){
unsigned char* packet=NULL; unsigned char* packet=NULL;
int len; int len;
current_module="spudec"; current_module="spudec";