comparison mplayer.c @ 1501:d40f2b686846

changes according to -utf8 option, draw_osd() function added
author atlka
date Mon, 13 Aug 2001 11:08:18 +0000
parents 6174b815b5f4
children f4f686aed404
comparison
equal deleted inserted replaced
1500:526047bdda07 1501:d40f2b686846
1214 } 1214 }
1215 1215
1216 vdecode_time=video_time_usage-vdecode_time; 1216 vdecode_time=video_time_usage-vdecode_time;
1217 1217
1218 //------------------------ frame decoded. -------------------- 1218 //------------------------ frame decoded. --------------------
1219 //------------------------ add OSD to frame contents ---------
1220 #ifndef USE_LIBVO2
1221 video_out->draw_osd();
1222 #endif
1219 1223
1220 // Increase video timers: 1224 // Increase video timers:
1221 sh_video->num_frames+=frame_time; 1225 sh_video->num_frames+=frame_time;
1222 frame_time*=sh_video->frametime; 1226 frame_time*=sh_video->frametime;
1223 if(file_format==DEMUXER_TYPE_ASF && !force_fps){ 1227 if(file_format==DEMUXER_TYPE_ASF && !force_fps){
1253 ++drop_frame_cnt; 1257 ++drop_frame_cnt;
1254 if (verbose > 0 && drop_frame_cnt%10 == 0) 1258 if (verbose > 0 && drop_frame_cnt%10 == 0)
1255 printf("\nstill dropping, %.2f\n", time_frame); 1259 printf("\nstill dropping, %.2f\n", time_frame);
1256 } 1260 }
1257 } 1261 }
1258 1262 video_out->check_events(); // check events AST
1259 } else { 1263 } else {
1260 // It's time to sleep... 1264 // It's time to sleep...
1261 current_module="sleep"; 1265 current_module="sleep";
1262 1266
1263 time_frame-=GetRelativeTime(); // reset timer 1267 time_frame-=GetRelativeTime(); // reset timer
1302 1306
1303 current_module="flip_page"; 1307 current_module="flip_page";
1304 #ifdef USE_LIBVO2 1308 #ifdef USE_LIBVO2
1305 if(blit_frame) vo2_flip(video_out,0); 1309 if(blit_frame) vo2_flip(video_out,0);
1306 #else 1310 #else
1311 video_out->check_events();
1307 if(blit_frame) video_out->flip_page(); 1312 if(blit_frame) video_out->flip_page();
1308 #endif 1313 #endif
1309 // usec_sleep(50000); // test only! 1314 // usec_sleep(50000); // test only!
1310 1315
1311 } 1316 }
1530 sub_delay -= 0.1; 1535 sub_delay -= 0.1;
1531 break; 1536 break;
1532 case 'x': 1537 case 'x':
1533 sub_delay += 0.1; 1538 sub_delay += 0.1;
1534 break; 1539 break;
1540 case '9': c='/'; goto _jump1;
1541 case '0': c='*';
1542 _jump1:
1535 case '*': 1543 case '*':
1536 case '/': { 1544 case '/': {
1537 float mixer_l, mixer_r; 1545 float mixer_l, mixer_r;
1538 mixer_getvolume( &mixer_l,&mixer_r ); 1546 mixer_getvolume( &mixer_l,&mixer_r );
1539 if(c=='*'){ 1547 if(c=='*'){
1540 mixer_l++; if ( mixer_l > 100 ) mixer_l = 100; 1548 if ( ++mixer_l > 100 ) mixer_l = 100;
1541 mixer_r++; if ( mixer_r > 100 ) mixer_r = 100; 1549 if ( ++mixer_r > 100 ) mixer_r = 100;
1542 } else { 1550 } else {
1543 mixer_l--; if ( mixer_l < 0 ) mixer_l = 0; 1551 if ( --mixer_l < 0 ) mixer_l = 0;
1544 mixer_r--; if ( mixer_r < 0 ) mixer_r = 0; 1552 if ( --mixer_r < 0 ) mixer_r = 0;
1545 } 1553 }
1546 mixer_setvolume( mixer_l,mixer_r ); 1554 mixer_setvolume( mixer_l,mixer_r );
1547 1555
1548 #ifdef USE_OSD 1556 #ifdef USE_OSD
1549 if(osd_level){ 1557 if(osd_level){
1561 1569
1562 // Contrast: 1570 // Contrast:
1563 case '1': 1571 case '1':
1564 case '2': 1572 case '2':
1565 if(c=='2'){ 1573 if(c=='2'){
1566 if ( v_cont++ > 100 ) v_cont = 100; 1574 if ( ++v_cont > 100 ) v_cont = 100;
1567 } else { 1575 } else {
1568 if ( v_cont-- < 0 ) v_cont = 0; 1576 if ( --v_cont < 0 ) v_cont = 0;
1569 } 1577 }
1570 if(set_video_colors(sh_video,"Contrast",v_cont)){ 1578 if(set_video_colors(sh_video,"Contrast",v_cont)){
1571 #ifdef USE_OSD 1579 #ifdef USE_OSD
1572 if(osd_level){ 1580 if(osd_level){
1573 osd_visible=sh_video->fps; // 1 sec 1581 osd_visible=sh_video->fps; // 1 sec
1580 1588
1581 // Brightness: 1589 // Brightness:
1582 case '3': 1590 case '3':
1583 case '4': 1591 case '4':
1584 if(c=='4'){ 1592 if(c=='4'){
1585 if ( v_bright++ > 100 ) v_bright = 100; 1593 if ( ++v_bright > 100 ) v_bright = 100;
1586 } else { 1594 } else {
1587 if ( v_bright-- < 0 ) v_bright = 0; 1595 if ( --v_bright < 0 ) v_bright = 0;
1588 } 1596 }
1589 if(set_video_colors(sh_video,"Brightness",v_bright)){ 1597 if(set_video_colors(sh_video,"Brightness",v_bright)){
1590 #ifdef USE_OSD 1598 #ifdef USE_OSD
1591 if(osd_level){ 1599 if(osd_level){
1592 osd_visible=sh_video->fps; // 1 sec 1600 osd_visible=sh_video->fps; // 1 sec
1599 1607
1600 // Hue: 1608 // Hue:
1601 case '5': 1609 case '5':
1602 case '6': 1610 case '6':
1603 if(c=='6'){ 1611 if(c=='6'){
1604 if ( v_hue++ > 100 ) v_hue = 100; 1612 if ( ++v_hue > 100 ) v_hue = 100;
1605 } else { 1613 } else {
1606 if ( v_hue-- < 0 ) v_hue = 0; 1614 if ( --v_hue < 0 ) v_hue = 0;
1607 } 1615 }
1608 if(set_video_colors(sh_video,"Hue",v_hue)){ 1616 if(set_video_colors(sh_video,"Hue",v_hue)){
1609 #ifdef USE_OSD 1617 #ifdef USE_OSD
1610 if(osd_level){ 1618 if(osd_level){
1611 osd_visible=sh_video->fps; // 1 sec 1619 osd_visible=sh_video->fps; // 1 sec
1618 1626
1619 // Saturation: 1627 // Saturation:
1620 case '7': 1628 case '7':
1621 case '8': 1629 case '8':
1622 if(c=='8'){ 1630 if(c=='8'){
1623 if ( v_saturation++ > 100 ) v_saturation = 100; 1631 if ( ++v_saturation > 100 ) v_saturation = 100;
1624 } else { 1632 } else {
1625 if ( v_saturation-- < 0 ) v_saturation = 0; 1633 if ( --v_saturation < 0 ) v_saturation = 0;
1626 } 1634 }
1627 if(set_video_colors(sh_video,"Saturation",v_saturation)){ 1635 if(set_video_colors(sh_video,"Saturation",v_saturation)){
1628 #ifdef USE_OSD 1636 #ifdef USE_OSD
1629 if(osd_level){ 1637 if(osd_level){
1630 osd_visible=sh_video->fps; // 1 sec 1638 osd_visible=sh_video->fps; // 1 sec