[Mplayer-cvslog] CVS: main/libvo vo_mpegpes.c,1.5,1.6

Arpi of Ize arpi at mplayer.dev.hu
Sun Sep 23 20:42:56 CEST 2001


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

Modified Files:
	vo_mpegpes.c 
Log Message:
software OSD support

Index: vo_mpegpes.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_mpegpes.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- vo_mpegpes.c	22 Sep 2001 22:02:04 -0000	1.5
+++ vo_mpegpes.c	23 Sep 2001 18:42:39 -0000	1.6
@@ -58,6 +58,8 @@
 static int s_pos_x,s_pos_y;
 static int d_pos_x,d_pos_y;
 
+static int osd_w,osd_h;
+
 static AVPicture picture;
 static AVCodec *codec=NULL;
 static AVCodecContext codec_context;
@@ -183,16 +185,20 @@
     }
 #endif
 
+    osd_w=s_width;
     d_pos_x=(codec_context.width-(int)s_width)/2;
     if(d_pos_x<0){
       s_pos_x=-d_pos_x;d_pos_x=0;
+      osd_w=codec_context.width;
     } else s_pos_x=0;
 
+    osd_h=s_height;
     d_pos_y=(codec_context.height-(int)s_height)/2;
     if(d_pos_y<0){
       s_pos_y=-d_pos_y;d_pos_y=0;
+      osd_h=codec_context.height;
     } else s_pos_y=0;
-    
+
     printf("[vo] position mapping: %d;%d => %d;%d\n",s_pos_x,s_pos_y,d_pos_x,d_pos_y);
 
     /* open it */
@@ -228,8 +234,21 @@
     return &vo_info;
 }
 
+#ifdef USE_LIBAVCODEC
+static void draw_alpha(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride){
+    int x,y;
+    vo_draw_alpha_yv12(w,h,src,srca,stride,
+      picture.data[0]+(x0+d_pos_x)+(y0+d_pos_y)*picture.linesize[0],picture.linesize[0]);
+}
+#endif
+
 static void draw_osd(void)
 {
+#ifdef USE_LIBAVCODEC
+  if(picture_buf){ // YV12 only:
+    vo_draw_text(osd_w,osd_h,draw_alpha);
+  }
+#endif
 }
 
 #define NFD   2




More information about the MPlayer-cvslog mailing list