comparison libvo/vo_dxr3.c @ 4160:ac62f8534409

hw spu support for dxr3 - patch by David Holm
author arpi
date Tue, 15 Jan 2002 00:23:16 +0000
parents 69eaa003a448
children a5ce64929fac
comparison
equal deleted inserted replaced
4159:42fec596fe7c 4160:ac62f8534409
89 while (data_left) 89 while (data_left)
90 data_left -= write(fd_video, (void*) data + (size - data_left), data_left); 90 data_left -= write(fd_video, (void*) data + (size - data_left), data_left);
91 } 91 }
92 #endif 92 #endif
93 93
94 extern int vidmode;
95
94 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) 96 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)
95 { 97 {
96 int tmp1,tmp2; 98 int tmp1,tmp2;
97 char devname[80]; 99 char devname[80];
98 100
110 /* Open the video packet interface */ 112 /* Open the video packet interface */
111 if (vo_subdevice) 113 if (vo_subdevice)
112 sprintf(devname, "/dev/em8300_mv-%s", vo_subdevice); 114 sprintf(devname, "/dev/em8300_mv-%s", vo_subdevice);
113 else 115 else
114 sprintf(devname, "/dev/em8300_mv"); 116 sprintf(devname, "/dev/em8300_mv");
115 fd_video = open(devname, O_WRONLY); 117 fd_video = open(devname, O_WRONLY | O_NONBLOCK);
116 if (fd_video < 0) { 118 if (fd_video < 0) {
117 printf("VO: [dxr3] Error opening %s for writing!\n", devname); 119 printf("VO: [dxr3] Error opening %s for writing!\n", devname);
118 uninit(); 120 uninit();
119 return -1; 121 return -1;
120 } else 122 } else
133 } 135 }
134 136
135 /* Subpic code isn't working yet, don't set to ON 137 /* Subpic code isn't working yet, don't set to ON
136 * unless you are really sure what you are doing 138 * unless you are really sure what you are doing
137 */ 139 */
138 ioval = EM8300_SPUMODE_OFF; 140 ioval = EM8300_SPUMODE_ON;
139 if (ioctl(fd_control, EM8300_IOCTL_SET_SPUMODE, &ioval) < 0) { 141 if (ioctl(fd_control, EM8300_IOCTL_SET_SPUMODE, &ioval) < 0) {
140 printf("VO: [dxr3] Unable to set subpicture mode!\n"); 142 printf("VO: [dxr3] Unable to set subpicture mode!\n");
141 uninit(); 143 uninit();
142 return -1; 144 return -1;
143 } 145 }
330 { 332 {
331 if (img_format == IMGFMT_MPEGPES) { 333 if (img_format == IMGFMT_MPEGPES) {
332 vo_mpegpes_t *p = (vo_mpegpes_t *) src[0]; 334 vo_mpegpes_t *p = (vo_mpegpes_t *) src[0];
333 size_t data_left = p->size; 335 size_t data_left = p->size;
334 336
335 if (ioctl(fd_video, EM8300_IOCTL_VIDEO_SETPTS, &vo_pts) < 0) 337 if (p->id == 0x20) {
336 printf("VO: [dxr3] Unable to set pts\n"); 338 if (ioctl(fd_spu, EM8300_IOCTL_SPU_SETPTS, &vo_pts) < 0)
339 printf("VO: [dxr3] Unable to set pts\n");
340
341 while (data_left)
342 data_left -= write(fd_spu, (void*) (p->data + p->size-data_left), data_left);
343 } else {
344 if (ioctl(fd_video, EM8300_IOCTL_VIDEO_SETPTS, &vo_pts) < 0)
345 printf("VO: [dxr3] Unable to set pts\n");
337 346
338 while (data_left) 347 while (data_left)
339 data_left -= write(fd_video, (void*) (p->data + p->size-data_left), data_left); 348 data_left -= write(fd_video, (void*) (p->data + p->size-data_left), data_left);
349 }
340 return 0; 350 return 0;
341 } 351 }
342 #ifdef USE_MP1E 352 #ifdef USE_MP1E
343 else if (img_format == IMGFMT_YUY2) { 353 else if (img_format == IMGFMT_YUY2) {
344 picture_data[0] = src[0]; 354 picture_data[0] = src[0];
437 static uint32_t query_format(uint32_t format) 447 static uint32_t query_format(uint32_t format)
438 { 448 {
439 uint32_t flag = 0; 449 uint32_t flag = 0;
440 450
441 if (format == IMGFMT_MPEGPES) 451 if (format == IMGFMT_MPEGPES)
442 flag = 0x2 | 0x4; 452 flag = 0x2 | 0x4 | 0x8;
443 #ifdef USE_MP1E 453 #ifdef USE_MP1E
444 if (format == IMGFMT_YV12) 454 if (format == IMGFMT_YV12)
445 flag = 0x1 | 0x4; 455 flag = 0x1 | 0x4;
446 if (format == IMGFMT_YUY2) 456 if (format == IMGFMT_YUY2)
447 flag = 0x1 | 0x4; 457 flag = 0x1 | 0x4;