[Mplayer-cvslog] CVS: main/libvo sub.c,1.47,1.48 sub.h,1.13,1.14

Arpi of Ize arpi at mplayer.dev.hu
Tue Apr 16 00:08:53 CEST 2002


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

Modified Files:
	sub.c sub.h 
Log Message:
osd: ok, now it's possible to do partial draw/clear of the buffer only if changed

Index: sub.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/sub.c,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -r1.47 -r1.48
--- sub.c	15 Apr 2002 20:51:34 -0000	1.47
+++ sub.c	15 Apr 2002 22:08:50 -0000	1.48
@@ -427,13 +427,31 @@
     new_osd_obj(OSDTYPE_VOBSUB);
 }
 
-void vo_draw_text(int dxs,int dys,void (*draw_alpha)(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride)){
-    mp_osd_obj_t* obj=vo_osd_list;
+int vo_osd_changed_flag=0;
 
+void vo_remove_text(int dxs,int dys,void (*remove)(int x0,int y0, int w,int h)){
+    mp_osd_obj_t* obj=vo_osd_list;
     vo_update_osd(dxs,dys);
+    while(obj){
+      if(((obj->flags&OSDFLAG_CHANGED) || (obj->flags&OSDFLAG_VISIBLE)) && 
+         (obj->flags&OSDFLAG_OLD_BBOX)){
+          int w=obj->old_bbox.x2-obj->old_bbox.x1;
+	  int h=obj->old_bbox.y2-obj->old_bbox.y1;
+	  if(w>0 && h>0){
+	      vo_osd_changed_flag=obj->flags&OSDFLAG_CHANGED;	// temp hack
+              remove(obj->old_bbox.x1,obj->old_bbox.y1,w,h);
+	  }
+//	  obj->flags&=~OSDFLAG_OLD_BBOX;
+      }
+    }
+}
 
+void vo_draw_text(int dxs,int dys,void (*draw_alpha)(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride)){
+    mp_osd_obj_t* obj=vo_osd_list;
+    vo_update_osd(dxs,dys);
     while(obj){
-	if(obj->flags&OSDFLAG_VISIBLE)
+      if(obj->flags&OSDFLAG_VISIBLE){
+	vo_osd_changed_flag=obj->flags&OSDFLAG_CHANGED;	// temp hack
 	switch(obj->type){
 	case OSDTYPE_SPU:
 	    spudec_draw_scaled(vo_spudec, dxs, dys, draw_alpha); // FIXME
@@ -452,9 +470,10 @@
 	    break;
 	}
 	obj->old_bbox=obj->bbox;
-	obj->flags&=~OSDFLAG_CHANGED;
-
-	obj=obj->next;
+	obj->flags|=OSDFLAG_OLD_BBOX;
+      }
+      obj->flags&=~OSDFLAG_CHANGED;
+      obj=obj->next;
     }
 }
 

Index: sub.h
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/sub.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- sub.h	15 Apr 2002 19:17:12 -0000	1.13
+++ sub.h	15 Apr 2002 22:08:50 -0000	1.14
@@ -94,5 +94,7 @@
 int vo_update_osd(int dxs,int dys);
 int vo_osd_changed(int new_value);
 
+extern int vo_osd_changed_flag;
+
 #endif
 #endif




More information about the MPlayer-cvslog mailing list