[Mplayer-cvslog] CVS: main/libvo vo_dxr3.c,1.46,1.47

David Holm mswitch at mplayer.dev.hu
Sat Feb 9 11:43:16 CET 2002


Update of /cvsroot/mplayer/main/libvo
In directory mplayer:/var/tmp.root/cvs-serv1482/libvo

Modified Files:
	vo_dxr3.c 
Log Message:
Thanks to the new control() method I've finally been able to add prebuffering support. This 
should greatly inprove performance on all systems...


Index: vo_dxr3.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_dxr3.c,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -r1.46 -r1.47
--- vo_dxr3.c	9 Feb 2002 01:21:48 -0000	1.46
+++ vo_dxr3.c	9 Feb 2002 10:43:11 -0000	1.47
@@ -6,10 +6,14 @@
  */
 
 /* ChangeLog added 2002-01-10
+ * 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:
  *  Removal of libmp1e, libavcodec has finally become faster (and it's code is helluva lot cleaner)
- *  We will call this one the "gentoo" release in favour of the gentoo linux distribution (www.gentoo.org), which
- *  aims at providing maximum performance
  *
  * 2002-02-02:
  *  Cleaned out some old code which might have slowed down writes
@@ -80,6 +84,7 @@
 static int fd_control = -1;
 static int fd_video = -1;
 static int fd_spu = -1;
+static char fdv_name[80];
 
 /* Static variable used in ioctl's */
 static int ioval = 0;
@@ -92,12 +97,16 @@
 	""
 };
 
-static uint32_t control(uint32_t request, void *data, ...)
+uint32_t control(uint32_t request, void *data, ...)
 {
 	uint32_t flag = 0;
 	switch (request) {
 	case VOCTRL_RESET:
-		fsync(fd_video);
+		/* Apparently the new em8300 flushing code is still not working.
+		 * I'll get on it, but this should be good enough for now
+		 */
+		close(fd_video);
+		fd_video = open(fdv_name, O_WRONLY);
 		return VO_TRUE;
 	case VOCTRL_QUERY_FORMAT:
 		switch (*((uint32_t*)data)) {	
@@ -117,10 +126,10 @@
 			printf("VO: [dxr3] Format unsupported, mail dholm at iname.com\n");
 #else
 		default:
-			printf("VO: [dxr3] You have enable libavcodec support (Read DOCS/codecs.html)!\n");
+			printf("VO: [dxr3] You have disabled libavcodec support (Read DOCS/codecs.html)!\n");
 #endif
 		}
-		return flag;
+		return (flag | 0x100);
 	}
 	return VO_NOTIMPL;
 }
@@ -270,14 +279,11 @@
 	return &vo_info;
 }
 
-static void draw_alpha(int x0, int y0, int w, int h, unsigned char* src, unsigned char *srca, int srcstride)
+static void draw_alpha(int x, int y, int w, int h, unsigned char* src, unsigned char *srca, int srcstride)
 {
 #ifdef USE_LIBAVCODEC
-	/* This function draws the osd and subtitles etc. */
-	if (img_format != IMGFMT_MPEGPES) {
-		vo_draw_alpha_yv12(w, h, src, srca, srcstride,
-			avc_picture.data[0] + (x0 + d_pos_x) + (y0 + d_pos_y) * avc_picture.linesize[0], avc_picture.linesize[0]);
-	}
+	vo_draw_alpha_yv12(w, h, src, srca, srcstride,
+		avc_picture.data[0] + (x + d_pos_x) + (y + d_pos_y) * avc_picture.linesize[0], avc_picture.linesize[0]);
 #endif
 }
 
@@ -320,7 +326,8 @@
 
 static void flip_page(void)
 {
-	/* Flush the device if a seek occured */
+	ioctl(fd_video, EM8300_IOCTL_VIDEO_SETPTS, &vo_pts);
+	ioctl(fd_spu, EM8300_IOCTL_SPU_SETPTS, &vo_pts);
 #ifdef USE_LIBAVCODEC
 	if (img_format == IMGFMT_YV12) {
 		int out_size = avcodec_encode_video(avc_context, avc_outbuf, avc_outbuf_size, &avc_picture);
@@ -452,6 +459,7 @@
 	} else {
 		printf("VO: [dxr3] Opened %s\n", devname);
 	}
+	strcpy(fdv_name, devname);
 	
 	/* Open the subpicture interface */
 	if (vo_subdevice) {




More information about the MPlayer-cvslog mailing list