[Mplayer-cvslog] CVS: main/libvo sub.h,NONE,1.1 video_out.h,1.3,1.4 sub.c,1.2,1.3
GEREOFFY
arpi_esp at users.sourceforge.net
Tue Mar 27 02:32:26 CEST 2001
Update of /cvsroot/mplayer/main/libvo
In directory usw-pr-cvs1:/tmp/cvs-serv7121
Modified Files:
video_out.h sub.c
Added Files:
sub.h
Log Message:
sub/osd interface changes
--- NEW FILE ---
extern font_desc_t* vo_font;
extern unsigned char* vo_osd_text;
extern int vo_osd_progbar_type;
extern int vo_osd_progbar_value; // 0..255
extern int vo_sub_lines;
extern unsigned char* vo_sub_text[8];
#define OSD_PLAY 0x01
#define OSD_PAUSE 0x02
#define OSD_STOP 0x03
#define OSD_REW 0x04
#define OSD_FFW 0x05
#define OSD_CLOCK 0x06
#define OSD_CONTRAST 0x07
#define OSD_SATURATION 0x08
#define OSD_VOLUME 0x09
#define OSD_BRIGHTNESS 0x0A
#define OSD_HUE 0x0B
#define OSD_PB_START 0x10
#define OSD_PB_0 0x11
#define OSD_PB_END 0x12
#define OSD_PB_1 0x13
Index: video_out.h
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/video_out.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** video_out.h 2001/03/25 04:28:40 1.3
--- video_out.h 2001/03/27 00:32:24 1.4
***************
*** 106,112 ****
extern vo_functions_t* video_out_drivers[];
- extern int vo_sub_lines;
- extern unsigned char* vo_sub_text[8];
- extern unsigned char* vo_osd_text;
- extern font_desc_t* vo_font;
--- 106,108 ----
Index: sub.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/sub.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** sub.c 2001/03/25 04:28:40 1.2
--- sub.c 2001/03/27 00:32:24 1.3
***************
*** 1,18 ****
//static int vo_font_loaded=-1;
font_desc_t* vo_font=NULL;
- int vo_sub_lines=2;
- unsigned char* vo_sub_text[8];
-
unsigned char* vo_osd_text="00:00:00";
! 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)){
! int i;
! int y;
!
! if(!vo_font) return; // no font
!
! if(vo_osd_text){
int len=strlen(vo_osd_text);
int j;
--- 1,11 ----
+ #include "sub.h"
+
//static int vo_font_loaded=-1;
font_desc_t* vo_font=NULL;
unsigned char* vo_osd_text="00:00:00";
! void vo_draw_text_osd(int dxs,int dys,void (*draw_alpha)(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride)){
int len=strlen(vo_osd_text);
int j;
***************
*** 32,41 ****
x+=vo_font->width[c]+vo_font->charspace;
}
! }
! #if 1
! if(vo_sub_lines<=0) return; // no text
y=dys-(1+vo_sub_lines)*vo_font->height;
--- 25,100 ----
x+=vo_font->width[c]+vo_font->charspace;
}
+
+ }
+
+ int vo_osd_progbar_type=-1;
+ int vo_osd_progbar_value=100; // 0..255
+
+ void vo_draw_text_progbar(int dxs,int dys,void (*draw_alpha)(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride)){
+ int len=strlen(vo_osd_text);
+ int i;
+ int y=dys/2;
+ int x;
+ int c,font;
+ int width=(dxs/2-vo_font->width[0x10]-vo_font->width[0x12]);
+ int elems=width/vo_font->width[0x11];
+ int mark=(vo_osd_progbar_value*(elems+1))>>8;
+ x=(dxs-width)/2;
+ // printf("osd.progbar width=%d xpos=%d\n",width,x);
+
+ c=vo_osd_progbar_type;font=vo_font->font[c];
+ if(vo_osd_progbar_type>0 && font>=0)
+ draw_alpha(x-vo_font->width[c]-vo_font->spacewidth,y,
+ vo_font->width[c],
+ vo_font->pic_a[font]->h,
+ vo_font->pic_b[font]->bmp+vo_font->start[c],
+ vo_font->pic_a[font]->bmp+vo_font->start[c],
+ vo_font->pic_a[font]->w);
+
+ c=OSD_PB_START;font=vo_font->font[c];
+ if(font>=0)
+ draw_alpha(x,y,
+ vo_font->width[c],
+ vo_font->pic_a[font]->h,
+ vo_font->pic_b[font]->bmp+vo_font->start[c],
+ vo_font->pic_a[font]->bmp+vo_font->start[c],
+ vo_font->pic_a[font]->w);
+ x+=vo_font->width[c];
+
+ for(i=0;i<elems;i++){
+ c=(i<mark)?OSD_PB_0:OSD_PB_1;font=vo_font->font[c];
+ if(font>=0)
+ draw_alpha(x,y,
+ vo_font->width[c],
+ vo_font->pic_a[font]->h,
+ vo_font->pic_b[font]->bmp+vo_font->start[c],
+ vo_font->pic_a[font]->bmp+vo_font->start[c],
+ vo_font->pic_a[font]->w);
+ x+=vo_font->width[c];
+ }
+
+ c=OSD_PB_END;font=vo_font->font[c];
+ if(font>=0)
+ draw_alpha(x,y,
+ vo_font->width[c],
+ vo_font->pic_a[font]->h,
+ vo_font->pic_b[font]->bmp+vo_font->start[c],
+ vo_font->pic_a[font]->bmp+vo_font->start[c],
+ vo_font->pic_a[font]->w);
+ // x+=vo_font->width[c];
!
! // vo_osd_progbar_value=(vo_osd_progbar_value+1)&0xFF;
!
! }
!
! int vo_sub_lines=2;
! unsigned char* vo_sub_text[8];
! void vo_draw_text_sub(int dxs,int dys,void (*draw_alpha)(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride)){
! int i;
! int y;
!
y=dys-(1+vo_sub_lines)*vo_font->height;
***************
*** 75,82 ****
}
- #endif
-
}
--- 134,156 ----
}
}
+ 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)){
+
+ if(!vo_font) return; // no font
+
+ if(vo_osd_text){
+ vo_draw_text_osd(dxs,dys,draw_alpha);
+ }
+
+ if(vo_sub_lines>0){
+ vo_draw_text_sub(dxs,dys,draw_alpha);
+ }
+
+ if(vo_osd_progbar_type>=0){
+ vo_draw_text_progbar(dxs,dys,draw_alpha);
+ }
+
+ }
_______________________________________________
Mplayer-cvslog mailing list
Mplayer-cvslog at lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/mplayer-cvslog
More information about the MPlayer-cvslog
mailing list