1
0
mirror of https://github.com/mpv-player/mpv synced 2025-01-11 17:39:38 +00:00

Make compilation depending on USE_OSD unconditional.

USE_OSD was hardcoded to true in configure, manually turning it off
would break compilation, and most OSD-related code wasn't affected by it
anyway so it did nothing useful.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21177 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
uau 2006-11-22 19:21:16 +00:00
parent 6982f81d90
commit 544233bded
12 changed files with 6 additions and 72 deletions

View File

@ -407,13 +407,6 @@ void ShowPreferences( void )
gtk_widget_set_sensitive( SBASSBottomMargin,FALSE );
#endif
#ifndef USE_OSD
gtk_widget_set_sensitive( RBOSDNone,FALSE );
gtk_widget_set_sensitive( RBOSDTandP,FALSE );
gtk_widget_set_sensitive( RBOSDIndicator,FALSE );
gtk_widget_set_sensitive( RBOSDTPTT,FALSE );
#endif
// -- signals
gtk_signal_connect( GTK_OBJECT( CBExtraStereo ),"toggled",GTK_SIGNAL_FUNC( prToggled ),(void*)0 );
gtk_signal_connect( GTK_OBJECT( CBNormalize ),"toggled",GTK_SIGNAL_FUNC( prToggled ),(void*)1 );

View File

@ -263,7 +263,6 @@ set_volume:
// printf( "!!! v: %.2f b: %.2f -> %.2f x %.2f\n",guiIntfStruct.Volume,guiIntfStruct.Balance,l,r );
mixer_setvolume( &mixer,l,r );
}
#ifdef USE_OSD
if ( osd_level )
{
osd_visible=(GetTimerMS() + 1000) | 1;
@ -271,7 +270,6 @@ set_volume:
vo_osd_progbar_value=( ( guiIntfStruct.Volume ) * 256.0 ) / 100.0;
vo_osd_changed( OSDTYPE_PROGBAR );
}
#endif
break;

View File

@ -288,7 +288,6 @@
{"sub-bg-alpha", &sub_bg_alpha, CONF_TYPE_INT, CONF_RANGE, 0, 255, NULL},
{"sub-no-text-pp", &sub_no_text_pp, CONF_TYPE_FLAG, 0, 0, 1, NULL},
{"sub-fuzziness", &sub_match_fuzziness, CONF_TYPE_INT, CONF_RANGE, 0, 2, NULL},
#ifdef USE_OSD
{"font", &font_name, CONF_TYPE_STRING, 0, 0, 0, NULL},
{"ffactor", &font_factor, CONF_TYPE_FLOAT, CONF_RANGE, 0.0, 10.0, NULL},
{"subpos", &sub_pos, CONF_TYPE_INT, CONF_RANGE, 0, 100, NULL},
@ -328,7 +327,6 @@
{"fontconfig", "MPlayer was compiled without fontconfig support.\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL},
{"nofontconfig", "MPlayer was compiled without fontconfig support.\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL},
#endif
#endif
#else

View File

@ -52,9 +52,7 @@ extern int opt_screen_size_y;
extern int fullscreen;
extern int vidmode;
#ifdef USE_OSD
extern int osd_level;
#endif
extern char *ao_outputfilename;
extern int ao_pcm_waveheader;

2
configure vendored
View File

@ -7531,8 +7531,6 @@ $_def_named_asm_args
#define PREFIX "$_prefix"
#define USE_OSD 1
/* enable/disable SIGHANDLER */
$_def_sighandler

View File

@ -4,8 +4,6 @@
#include "config.h"
#ifdef USE_OSD
#include <stdio.h>
#include "libvo/video_out.h"
@ -151,5 +149,3 @@ void find_sub(sub_data* subd,int key){
vo_sub=NULL; // no sub here
}
#endif

View File

@ -88,12 +88,10 @@ static int control(struct vf_instance_s* vf, int request, void* data)
return(video_out->control(VOCTRL_SET_DEINTERLACE, data)
== VO_TRUE) ? CONTROL_TRUE : CONTROL_FALSE;
}
#ifdef USE_OSD
case VFCTRL_DRAW_OSD:
if(!vo_config_count) return CONTROL_FALSE; // vo not configured?
video_out->draw_osd();
return CONTROL_TRUE;
#endif
case VFCTRL_FLIP_PAGE:
{
if(!vo_config_count) return CONTROL_FALSE; // vo not configured?

View File

@ -1150,7 +1150,6 @@ void load_font_ft(int width, int height)
if (vo_font) free_font_desc(vo_font);
#ifdef USE_OSD
#ifdef HAVE_FONTCONFIG
if (font_fontconfig)
{
@ -1176,5 +1175,4 @@ void load_font_ft(int width, int height)
else
#endif
vo_font=read_font_desc_ft(font_name, width, height);
#endif
}

View File

@ -78,9 +78,7 @@ char posbar[MESSAGE_SIZE];
static int osdx, osdy;
static int osd_text_length = 0;
int aaconfigmode=1;
#ifdef USE_OSD
font_desc_t* vo_font_save = NULL;
#endif
static struct SwsContext *sws=NULL;
/* our version of the playmodes :) */
@ -248,7 +246,6 @@ config(uint32_t width, uint32_t height, uint32_t d_width,
/* nothing will change its size, be we need some values initialized */
resize();
#ifdef USE_OSD
/* now init out own 'font' (to use vo_draw_text_sub without edit them) */
if(!vo_font_save) vo_font_save = vo_font;
if(vo_font == vo_font_save) {
@ -280,7 +277,7 @@ config(uint32_t width, uint32_t height, uint32_t d_width,
vo_font->pic_b[0]->bmp[i]=i;
}
}
#endif
/* say hello */
osdmessage(5, 1, "Welcome to ASCII ART MPlayer");
@ -334,11 +331,7 @@ query_format(uint32_t format) {
case IMGFMT_RGB24:
case IMGFMT_Y8:
case IMGFMT_Y800:
return VFCAP_CSP_SUPPORTED|VFCAP_SWSCALE
#ifdef USE_OSD
| VFCAP_OSD
#endif
;
return VFCAP_CSP_SUPPORTED | VFCAP_SWSCALE | VFCAP_OSD;
}
return 0;
}
@ -419,9 +412,7 @@ flip_page(void) {
}
}
/* OSD time & playmode , subtitles */
#ifdef USE_OSD
printosdtext();
#endif
/* print out */
@ -516,7 +507,6 @@ uninit(void) {
if (strstr(c->driver->name,"Curses") || strstr(c->driver->name,"Linux")){
freopen("/dev/tty", "w", stderr);
}
#ifdef USE_OSD
if(vo_font_save) {
free(vo_font->pic_a[0]->bmp);
free(vo_font->pic_a[0]);
@ -526,11 +516,9 @@ uninit(void) {
vo_font = vo_font_save;
vo_font_save = NULL;
}
#endif
aa_close(c);
}
#ifdef USE_OSD
static void draw_alpha(int x,int y, int w,int h, unsigned char* src, unsigned char *srca, int stride){
int i,j;
for (i = 0; i < h; i++) {
@ -553,11 +541,8 @@ static void clear_alpha(int x0,int y0, int w,int h) {
}
#endif
static void
draw_osd(void){
#ifdef USE_OSD
char * vo_osd_text_save;
int vo_osd_progbar_type_save;
@ -571,7 +556,6 @@ draw_osd(void){
vo_draw_text(aa_scrwidth(c), aa_scrheight(c), draw_alpha);
vo_osd_text=vo_osd_text_save;
vo_osd_progbar_type=vo_osd_progbar_type_save;
#endif
}
static int

View File

@ -284,12 +284,10 @@ static void uninit(void)
static void draw_osd(void)
{
#ifdef USE_OSD
if (vo_osd_progbar_type != -1)
osdpercent(MESSAGE_DURATION, 0, 255,
vo_osd_progbar_value, __sub_osd_names[vo_osd_progbar_type],
"");
#endif
}
static int preinit(const char *arg)
@ -318,11 +316,7 @@ static int preinit(const char *arg)
static int query_format(uint32_t format)
{
if (format == IMGFMT_BGR24)
return
#ifdef USE_OSD
VFCAP_OSD |
#endif
VFCAP_CSP_SUPPORTED;
return VFCAP_OSD | VFCAP_CSP_SUPPORTED;
return 0;
}

View File

@ -520,7 +520,6 @@ if (frameno_filename) {
#endif
// check font
#ifdef USE_OSD
#ifdef HAVE_FREETYPE
init_freetype();
#endif
@ -541,7 +540,6 @@ if (frameno_filename) {
#endif
#ifdef HAVE_FONTCONFIG
}
#endif
#endif
vo_init_osd();

View File

@ -1443,14 +1443,6 @@ static mp_osd_msg_t* get_osd_msg(void) {
return NULL;
}
// Make a define to test if we are using the term OSD without having
// to #ifdef USE_OSD all the time.
#ifdef USE_OSD
#define use_term_osd (term_osd && !sh_video)
#else
#define use_term_osd (term_osd)
#endif
/**
* \brief Display the OSD bar.
*
@ -1462,7 +1454,6 @@ static void set_osd_bar(int type,const char* name,double min,double max,double v
if(osd_level < 1) return;
#ifdef USE_OSD
if(sh_video) {
osd_visible = (GetTimerMS() + 1000) | 1;
vo_osd_progbar_type = type;
@ -1470,7 +1461,6 @@ static void set_osd_bar(int type,const char* name,double min,double max,double v
vo_osd_changed(OSDTYPE_PROGBAR);
return;
}
#endif
set_osd_msg(OSD_MSG_BAR,1,osd_duration,"%s: %d %%",
name,ROUND(100*(val-min)/(max-min)));
@ -1491,24 +1481,19 @@ static void update_osd_msg(void) {
static char osd_text[64] = "";
static char osd_text_timer[64];
#ifdef USE_OSD
// we need some mem for vo_osd_text
vo_osd_text = (unsigned char*)osd_text;
#endif
// Look if we have a msg
if((msg = get_osd_msg())) {
if(strcmp(osd_text,msg->msg)) {
strncpy((char*)osd_text, msg->msg, 63);
#ifdef USE_OSD
if(sh_video) vo_osd_changed(OSDTYPE_OSD); else
#endif
if(term_osd) mp_msg(MSGT_CPLAYER,MSGL_STATUS,"%s%s\n",term_osd_esc,msg->msg);
}
return;
}
#ifdef USE_OSD
if(sh_video) {
// fallback on the timer
if(osd_level>=2) {
@ -1547,7 +1532,6 @@ static void update_osd_msg(void) {
}
return;
}
#endif
// Clear the term osd line
if(term_osd && osd_text[0]) {
@ -3435,7 +3419,7 @@ void pause_loop(void)
// Small hack to display the pause message on the OSD line.
// The pause string is: "\n == PAUSE == \r" so we need to
// take the first and the last char out
if (use_term_osd) {
if (term_osd && !sh_video) {
char msg[128] = MSGTR_Paused;
int mlen = strlen(msg);
msg[mlen-1] = '\0';
@ -3765,7 +3749,6 @@ if(!codecs_file || !parse_codec_cfg(codecs_file)){
//------ load global data first ------
// check font
#ifdef USE_OSD
#ifdef HAVE_FREETYPE
init_freetype();
#endif
@ -3788,7 +3771,7 @@ if(!codecs_file || !parse_codec_cfg(codecs_file)){
#ifdef HAVE_FONTCONFIG
}
#endif
#endif /* USE_OSD */
vo_init_osd();
#ifdef USE_ASS
@ -4717,7 +4700,6 @@ if(auto_quality>0){
current_module="pause";
#ifdef USE_OSD
if(osd_visible){
// 36000000 means max timed visibility is 1 hour into the future, if
// the difference is greater assume it's wrapped around from below 0
@ -4729,7 +4711,6 @@ if(auto_quality>0){
osd_function = OSD_PLAY;
}
}
#endif
if (osd_function == OSD_PAUSE) {
pause_loop();
@ -4972,7 +4953,7 @@ if(step_sec>0) {
} break;
case MP_CMD_OSD : {
int v = cmd->args[0].v.i;
int max = use_term_osd ? MAX_TERM_OSD_LEVEL : MAX_OSD_LEVEL;
int max = (term_osd && !sh_video) ? MAX_TERM_OSD_LEVEL : MAX_OSD_LEVEL;
if(osd_level > max) osd_level = max;
if(v < 0)
osd_level=(osd_level+1)%(max+1);