|
From: <lin...@us...> - 2002-06-18 13:31:32
|
Update of /cvsroot/dvbtools/dvbsubs
In directory usw-pr-cvs1:/tmp/cvs-serv26283
Modified Files:
dvbsubs.c
Log Message:
better hack for initial region position (but still a hack)
Index: dvbsubs.c
===================================================================
RCS file: /cvsroot/dvbtools/dvbsubs/dvbsubs.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** dvbsubs.c 18 Jun 2002 12:33:55 -0000 1.8
--- dvbsubs.c 18 Jun 2002 13:31:28 -0000 1.9
***************
*** 41,45 ****
int minx=0;
! int miny=0;
int width=720;
int height=226;
--- 41,45 ----
int minx=0;
! int miny=999;
int width=720;
int height=226;
***************
*** 85,89 ****
unsigned char img[720*576];
! int fd_osd;
int OSDcmd(int fd, OSD_Command cmd, int x0, int y0, int x1, int y1, int color, void* data) {
--- 85,89 ----
unsigned char img[720*576];
! int fd_osd=-1;
int OSDcmd(int fd, OSD_Command cmd, int x0, int y0, int x1, int y1, int color, void* data) {
***************
*** 102,105 ****
--- 102,107 ----
perror("OSDCmd");
}
+ } else {
+ fprintf(stderr,"in OSD_cmd, fd_osd=%d\n",fd_osd);
}
}
***************
*** 120,123 ****
--- 122,126 ----
OSDcmd(fd_osd, OSD_Hide,0,0,0,0,0,NULL);
OSDcmd(fd_osd, OSD_Clear,0,0,0,0,0,NULL);
+ OSDcmd(fd_osd, OSD_Show,0,0,0,0,0,NULL);
// OSDcmd(fd_osd, OSD_SetPalette,0,0,0,0,0,green); /* Bg colour */
// OSDcmd(fd_osd, OSD_SetPalette,1,0,0,0,1,blue);
***************
*** 382,385 ****
--- 385,390 ----
region_y=(buf[i]<<8)|buf[i+1]; i+=2;
+ if (region_y < miny) { miny=region_y; }
+
region_xs[region_id]=region_x;
region_ys[region_id]=region_y;
***************
*** 598,602 ****
OSDcmd(fd_osd, OSD_SetBlock,0,0,719,height,-1,img);
OSDcmd(fd_osd, OSD_Show,0,0,0,0,0,NULL);
! // usleep(20000);
}
printf("</object_data_segment>\n");
--- 603,607 ----
OSDcmd(fd_osd, OSD_SetBlock,0,0,719,height,-1,img);
OSDcmd(fd_osd, OSD_Show,0,0,0,0,0,NULL);
! usleep(20000);
}
printf("</object_data_segment>\n");
***************
*** 633,639 ****
}
! open_OSD();
! init_OSD();
! test_OSD();
if (is_num) {
--- 638,644 ----
}
! // open_OSD();
! // init_OSD();
! // test_OSD();
if (is_num) {
***************
*** 706,712 ****
/* SEGMENT_DATA_FIELD */
switch(segment_type) {
! case 0x10: process_page_composition_segment();
break;
case 0x11: process_region_composition_segment();
break;
case 0x12: process_CLUT_definition_segment();
--- 711,722 ----
/* SEGMENT_DATA_FIELD */
switch(segment_type) {
! case 0x10: process_page_composition_segment();
break;
case 0x11: process_region_composition_segment();
+ if ((fd_osd < 0) && (miny != 999)) {
+ fprintf(stderr,"opening osd device, miny=%d\n",miny);
+ open_OSD();
+ init_OSD();
+ }
break;
case 0x12: process_CLUT_definition_segment();
***************
*** 724,725 ****
--- 734,769 ----
}
}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|