aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--libao2/ao_sun.c15
-rw-r--r--libmpcodecs/ad_acm.c4
-rw-r--r--libmpcodecs/ad_twin.c6
-rw-r--r--libmpcodecs/ae_lame.c3
-rw-r--r--libmpcodecs/vd.c2
-rw-r--r--libmpcodecs/vd_ffmpeg.c6
-rw-r--r--libmpcodecs/vd_vfw.c4
-rw-r--r--libmpcodecs/vf_scale.c2
-rw-r--r--libmpdemux/asf_streaming.c3
-rw-r--r--libmpdemux/asfheader.c18
-rw-r--r--libmpdemux/aviheader.c16
-rw-r--r--libmpdemux/demux_asf.c4
-rw-r--r--libmpdemux/demux_audio.c2
-rw-r--r--libmpdemux/demux_lavf.c4
-rw-r--r--libmpdemux/demux_mov.c2
-rw-r--r--libmpdemux/demux_ogg.c10
-rw-r--r--libmpdemux/demux_real.c4
-rw-r--r--libmpdemux/demuxer.c2
-rw-r--r--libmpdemux/http.c2
-rw-r--r--libmpdemux/stream.c5
-rw-r--r--libmpdemux/video.c2
-rw-r--r--libvo/vesa_lvo.c26
-rw-r--r--libvo/vo_png.c35
-rw-r--r--libvo/vo_sdl.c90
-rw-r--r--libvo/vo_svga.c39
-rw-r--r--libvo/vo_vesa.c53
-rw-r--r--libvo/vo_xvmc.c69
-rw-r--r--libvo/vosub_vidix.c25
-rw-r--r--loader/win32.c2
-rw-r--r--mencoder.c4
-rw-r--r--mplayer.c6
31 files changed, 261 insertions, 204 deletions
diff --git a/libao2/ao_sun.c b/libao2/ao_sun.c
index da2d4e9e7c..ea3f5f3e37 100644
--- a/libao2/ao_sun.c
+++ b/libao2/ao_sun.c
@@ -64,7 +64,6 @@ static enum {
RTSC_DISABLED
} enable_sample_timing;
-extern int verbose;
// convert an OSS audio format specification into a sun audio encoding
@@ -127,19 +126,19 @@ static int realtime_samplecounter_available(char *dev)
info.play.encoding = AUDIO_ENCODING_LINEAR;
info.play.samples = 0;
if (ioctl(fd, AUDIO_SETINFO, &info)) {
- if (verbose>0)
+ if ( mp_msg_test(MSGT_AO,MSGL_V) )
mp_msg(MSGT_AO, MSGL_ERR, MSGTR_AO_SUN_RtscSetinfoFailed);
goto error;
}
if (write(fd, silence, len) != len) {
- if (verbose>0)
+ if ( mp_msg_test(MSGT_AO,MSGL_V) )
mp_msg(MSGT_AO, MSGL_ERR, MSGTR_AO_SUN_RtscWriteFailed);
goto error;
}
if (ioctl(fd, AUDIO_GETINFO, &info)) {
- if (verbose>0)
+ if ( mp_msg_test(MSGT_AO,MSGL_V) )
perror("rtsc: GETINFO1");
goto error;
}
@@ -161,18 +160,18 @@ static int realtime_samplecounter_available(char *dev)
break;
if (ioctl(fd, AUDIO_GETINFO, &info)) {
- if (verbose>0)
+ if ( mp_msg_test(MSGT_AO,MSGL_V) )
perror("rtsc: GETINFO2 failed");
goto error;
}
if (info.play.samples < last_samplecnt) {
- if (verbose>0)
+ if ( mp_msg_test(MSGT_AO,MSGL_V) )
printf("rtsc: %d > %d?\n", last_samplecnt, info.play.samples);
goto error;
}
if ((increment = info.play.samples - last_samplecnt) > 0) {
- if (verbose>0)
+ if ( mp_msg_test(MSGT_AO,MSGL_V) )
printf("ao_sun: sample counter increment: %d\n", increment);
if (increment < min_increment) {
min_increment = increment;
@@ -195,7 +194,7 @@ static int realtime_samplecounter_available(char *dev)
if (min_increment < 2000)
rtsc_ok = RTSC_ENABLED;
- if (verbose>0)
+ if ( mp_msg_test(MSGT_AO,MSGL_V) )
printf("ao_sun: minimum sample counter increment per 10msec interval: %d\n"
"\t%susing sample counter based timing code\n",
min_increment, rtsc_ok == RTSC_ENABLED ? "" : "not ");
diff --git a/libmpcodecs/ad_acm.c b/libmpcodecs/ad_acm.c
index 6b670d6760..7e60805fb2 100644
--- a/libmpcodecs/ad_acm.c
+++ b/libmpcodecs/ad_acm.c
@@ -74,7 +74,7 @@ static int preinit(sh_audio_t *sh_audio)
// priv->o_wf->wBitsPerSample = inf_fmt->wBitsPerSample;
priv->o_wf->cbSize = 0;
- if (verbose>0)
+ if ( mp_msg_test(MSGT_DECAUDIO,MSGL_V) )
{
mp_msg(MSGT_DECAUDIO, MSGL_V, "Input format:\n");
print_wave_header(in_fmt);
@@ -98,7 +98,7 @@ static int preinit(sh_audio_t *sh_audio)
mp_msg(MSGT_WIN32, MSGL_V, "Audio codec opened OK! ;-)\n");
acmStreamSize(priv->handle, in_fmt->nBlockAlign, &srcsize, ACM_STREAMSIZEF_SOURCE);
- //if (verbose) printf("Audio ACM output buffer min. size: %ld (reported by codec)\n", srcsize);
+ //if ( mp_msg_test(MSGT_DECAUDIO,MSGL_V) ) printf("Audio ACM output buffer min. size: %ld (reported by codec)\n", srcsize);
srcsize *= 2;
//if (srcsize < MAX_OUTBURST) srcsize = MAX_OUTBURST;
if (!srcsize)
diff --git a/libmpcodecs/ad_twin.c b/libmpcodecs/ad_twin.c
index 8059106ced..c01d90cd27 100644
--- a/libmpcodecs/ad_twin.c
+++ b/libmpcodecs/ad_twin.c
@@ -110,11 +110,11 @@ static int init_vqf_audio_codec(sh_audio_t *sh_audio){
priv->o_wf.wBitsPerSample=in_fmt->wBitsPerSample;
priv->o_wf.cbSize=0;
- if(verbose)
+ if( mp_msg_test(MSGT_DECAUDIO,MSGL_V) )
{
- mp_msg(MSGT_DECAUDIO, MSGL_INFO, "Input format:\n");
+ mp_msg(MSGT_DECAUDIO, MSGL_V, "Input format:\n");
print_wave_header(in_fmt);
- mp_msg(MSGT_DECAUDIO, MSGL_INFO, "Output fmt:\n");
+ mp_msg(MSGT_DECAUDIO, MSGL_V, "Output fmt:\n");
print_wave_header(&priv->o_wf);
}
memcpy(&priv->hi,&in_fmt[1],sizeof(headerInfo));
diff --git a/libmpcodecs/ae_lame.c b/libmpcodecs/ae_lame.c
index d47e91dc0f..d0f4b051ad 100644
--- a/libmpcodecs/ae_lame.c
+++ b/libmpcodecs/ae_lame.c
@@ -70,7 +70,6 @@ m_option_t lameopts_conf[]={
static int pass;
-extern int verbose;
static int bind_lame(audio_encoder_t *encoder, muxer_stream_t *mux_a)
{
@@ -192,7 +191,7 @@ int mpae_init_lame(audio_encoder_t *encoder)
mp_msg(MSGT_MENCODER, MSGL_FATAL, MSGTR_LameCantInit);
return 0;
}
- if(verbose>0) {
+ if( mp_msg_test(MSGT_MENCODER,MSGL_V) ) {
lame_print_config(lame);
lame_print_internals(lame);
}
diff --git a/libmpcodecs/vd.c b/libmpcodecs/vd.c
index 42b0697f2a..426fd05b09 100644
--- a/libmpcodecs/vd.c
+++ b/libmpcodecs/vd.c
@@ -174,7 +174,7 @@ int mpcodecs_config_vo(sh_video_t *sh, int w, int h, unsigned int preferred_outf
// check if libvo and codec has common outfmt (no conversion):
csp_again:
- if(verbose>0){
+ if( mp_msg_test(MSGT_DECVIDEO,MSGL_V) ){
vf_instance_t* f=vf;
mp_msg(MSGT_DECVIDEO,MSGL_V,"Trying filter chain:");
for(f = vf ; f ; f = f->next)
diff --git a/libmpcodecs/vd_ffmpeg.c b/libmpcodecs/vd_ffmpeg.c
index b96973d45e..3818c3f0ae 100644
--- a/libmpcodecs/vd_ffmpeg.c
+++ b/libmpcodecs/vd_ffmpeg.c
@@ -1001,7 +1001,7 @@ static int mc_get_buffer(AVCodecContext *avctx, AVFrame *pic){
}
assert(avctx->draw_horiz_band == mc_render_slice);
assert(avctx->release_buffer == mc_release_buffer);
- if(verbose > 4)
+ if( mp_msg_test(MSGT_DECVIDEO,MSGL_DBG5) )
printf("vd_ffmpeg::mc_get_buffer\n");
if(init_vo(sh,avctx->pix_fmt) < 0){
@@ -1068,7 +1068,7 @@ static int mc_get_buffer(AVCodecContext *avctx, AVFrame *pic){
pic->type= FF_BUFFER_TYPE_USER;
render=(xvmc_render_state_t*)mpi->priv;//same as data[2]
- if(verbose > 4)
+ if( mp_msg_test(MSGT_DECVIDEO,MSGL_DBG5) )
printf("vd_ffmpeg::mc_get_buffer (render=%p)\n",render);
assert(render != 0);
assert(render->magic == MP_XVMC_RENDER_MAGIC);
@@ -1095,7 +1095,7 @@ static void mc_release_buffer(AVCodecContext *avctx, AVFrame *pic){
//printf("R%X %X\n", pic->linesize[0], pic->data[0]);
//mark the surface as not requared for prediction
render=(xvmc_render_state_t*)pic->data[2];//same as mpi->priv
- if(verbose > 4)
+ if( mp_msg_test(MSGT_DECVIDEO,MSGL_DBG5) )
printf("vd_ffmpeg::mc_release_buffer (render=%p)\n",render);
assert(render!=NULL);
assert(render->magic==MP_XVMC_RENDER_MAGIC);
diff --git a/libmpcodecs/vd_vfw.c b/libmpcodecs/vd_vfw.c
index e13097d67e..eb8d304a29 100644
--- a/libmpcodecs/vd_vfw.c
+++ b/libmpcodecs/vd_vfw.c
@@ -241,9 +241,9 @@ static int init(sh_video_t *sh){
set_csp(priv->o_bih,sh->codec->outfmt[sh->outfmtidx]);
mp_msg(MSGT_WIN32, MSGL_V, "Input format:\n");
- if(verbose>0) print_video_header(sh->bih);
+ if( mp_msg_test(MSGT_HEADER,MSGL_V) ) print_video_header(sh->bih);
mp_msg(MSGT_WIN32, MSGL_V, "Output format:\n");
- if(verbose>0) print_video_header(priv->o_bih);
+ if( mp_msg_test(MSGT_HEADER,MSGL_V) ) print_video_header(priv->o_bih);
// set postprocessing level in xvid/divx4 .dll
ICSendMessage(priv->handle, ICM_USER+80, (long)(&divx_quality), 0);
diff --git a/libmpcodecs/vf_scale.c b/libmpcodecs/vf_scale.c
index fc4ce1c48a..6dd093251a 100644
--- a/libmpcodecs/vf_scale.c
+++ b/libmpcodecs/vf_scale.c
@@ -522,7 +522,7 @@ void sws_getFlagsAndFilterFromCmdLine(int *flags, SwsFilter **srcFilterParam, Sw
firstTime=0;
*flags= SWS_PRINT_INFO;
}
- else if(verbose>1) *flags= SWS_PRINT_INFO;
+ else if( mp_msg_test(MSGT_VFILTER,MSGL_DBG2) ) *flags= SWS_PRINT_INFO;
if(src_filter) sws_freeFilter(src_filter);
diff --git a/libmpdemux/asf_streaming.c b/libmpdemux/asf_streaming.c
index 30ebc29dc7..2ddfbecc14 100644
--- a/libmpdemux/asf_streaming.c
+++ b/libmpdemux/asf_streaming.c
@@ -31,7 +31,6 @@
((guid)[3] << 24 | (guid)[2] << 16 | (guid)[1] << 8 | (guid)[0])
#endif
-extern int verbose;
extern int network_bandwidth;
int asf_mmst_streaming_start( stream_t *stream );
@@ -759,7 +758,7 @@ static int asf_http_streaming_start( stream_t *stream, int *demuxer_type ) {
}
http_response_append( http_hdr, buffer, i );
} while( !http_is_header_entire( http_hdr ) );
- if( verbose>0 ) {
+ if( mp_msg_test(MSGT_NETWORK,MSGL_V) ) {
http_hdr->buffer[http_hdr->buffer_size]='\0';
mp_msg(MSGT_NETWORK,MSGL_DBG2,"Response [%s]\n", http_hdr->buffer );
}
diff --git a/libmpdemux/asfheader.c b/libmpdemux/asfheader.c
index e69d94608d..72179bd445 100644
--- a/libmpdemux/asfheader.c
+++ b/libmpdemux/asfheader.c
@@ -5,8 +5,6 @@
#include <stdlib.h>
#include <unistd.h>
-extern int verbose; // defined in mplayer.c
-
#include "config.h"
#include "mp_msg.h"
#include "help_mp.h"
@@ -212,7 +210,7 @@ int read_asf_header(demuxer_t *demuxer){
sh_audio->wf=calloc((streamh->type_size<sizeof(WAVEFORMATEX))?sizeof(WAVEFORMATEX):streamh->type_size,1);
memcpy(sh_audio->wf,buffer,streamh->type_size);
le2me_WAVEFORMATEX(sh_audio->wf);
- if(verbose>=1) print_wave_header(sh_audio->wf);
+ if( mp_msg_test(MSGT_HEADER,MSGL_V) ) print_wave_header(sh_audio->wf);
if(ASF_LOAD_GUID_PREFIX(streamh->concealment)==ASF_GUID_PREFIX_audio_conceal_interleave){
buffer = &hdr[pos];
pos += streamh->stream_size;
@@ -240,7 +238,7 @@ int read_asf_header(demuxer_t *demuxer){
mp_msg(MSGT_DEMUXER, MSGL_WARN, MSGTR_MPDEMUX_ASFHDR_DVRWantsLibavformat);
//sh_video->fps=(float)sh_video->video.dwRate/(float)sh_video->video.dwScale;
//sh_video->frametime=(float)sh_video->video.dwScale/(float)sh_video->video.dwRate;
- if(verbose>=1) print_video_header(sh_video->bih);
+ if( mp_msg_test(MSGT_DEMUX,MSGL_V) ) print_video_header(sh_video->bih);
//asf_video_id=streamh.stream_no & 0x7F;
//if(demuxer->video->id==-1) demuxer->video->id=streamh.stream_no & 0x7F;
break;
@@ -283,7 +281,7 @@ int read_asf_header(demuxer_t *demuxer){
string = &hdr[pos];
pos += contenth->title_size;
if (pos > hdr_len) goto len_err_out;
- if(verbose>0)
+ if( mp_msg_test(MSGT_HEADER,MSGL_V) )
print_asf_string(" Title: ", string, contenth->title_size);
else
pack_asf_string(string, contenth->title_size);
@@ -294,7 +292,7 @@ int read_asf_header(demuxer_t *demuxer){
string = &hdr[pos];
pos += contenth->author_size;
if (pos > hdr_len) goto len_err_out;
- if(verbose>0)
+ if( mp_msg_test(MSGT_HEADER,MSGL_V) )
print_asf_string(" Author: ", string, contenth->author_size);
else
pack_asf_string(string, contenth->author_size);
@@ -305,7 +303,7 @@ int read_asf_header(demuxer_t *demuxer){
string = &hdr[pos];
pos += contenth->copyright_size;
if (pos > hdr_len) goto len_err_out;
- if(verbose>0)
+ if( mp_msg_test(MSGT_HEADER,MSGL_V) )
print_asf_string(" Copyright: ", string, contenth->copyright_size);
else
pack_asf_string(string, contenth->copyright_size);
@@ -316,7 +314,7 @@ int read_asf_header(demuxer_t *demuxer){
string = &hdr[pos];
pos += contenth->comment_size;
if (pos > hdr_len) goto len_err_out;
- if(verbose>0)
+ if( mp_msg_test(MSGT_HEADER,MSGL_V) )
print_asf_string(" Comment: ", string, contenth->comment_size);
else
pack_asf_string(string, contenth->comment_size);
@@ -327,7 +325,7 @@ int read_asf_header(demuxer_t *demuxer){
string = &hdr[pos];
pos += contenth->rating_size;
if (pos > hdr_len) goto len_err_out;
- if(verbose>0)
+ if( mp_msg_test(MSGT_HEADER,MSGL_V) )
print_asf_string(" Rating: ", string, contenth->rating_size);
}
mp_msg(MSGT_HEADER,MSGL_V,"\n");
@@ -418,7 +416,7 @@ if(!video_streams){
} else if (best_video > 0 && demuxer->video->id == -1) demuxer->video->id = best_video;
#if 0
-if(verbose){
+if( mp_msg_test(MSGT_HEADER,MSGL_V) ){
printf("ASF duration: %d\n",(int)fileh.duration);
printf("ASF start pts: %d\n",(int)fileh.start_timestamp);
printf("ASF end pts: %d\n",(int)fileh.end_timestamp);
diff --git a/libmpdemux/aviheader.c b/libmpdemux/aviheader.c
index 19ec696bef..e360149dfe 100644
--- a/libmpdemux/aviheader.c
+++ b/libmpdemux/aviheader.c
@@ -185,7 +185,7 @@ while(1){
stream_read(demuxer->stream,(char*) &avih,MIN(size2,sizeof(avih)));
le2me_MainAVIHeader(&avih); // swap to machine endian
chunksize-=MIN(size2,sizeof(avih));
- if(verbose>0) print_avih(&avih); // else print_avih_flags(&avih);
+ if( mp_msg_test(MSGT_HEADER,MSGL_V) ) print_avih(&avih); // else print_avih_flags(&avih);
break;
case ckidSTREAMHEADER: { // read 'strh'
AVIStreamHeader h;
@@ -202,7 +202,7 @@ while(1){
memcpy(&sh_audio->audio,&h,sizeof(h));
}
last_fccType=h.fccType;
- if(verbose>=1) print_strh(&h);
+ if( mp_msg_test(MSGT_HEADER,MSGL_V) ) print_strh(&h);
break; }
case mmioFOURCC('i', 'n', 'd', 'x'): {
uint32_t i;
@@ -254,7 +254,7 @@ while(1){
// fixup MS-RLE header (seems to be broken for <256 color files)
if(sh_video->bih->biCompression<=1 && sh_video->bih->biSize==40)
sh_video->bih->biSize=chunksize;
- if(verbose>=1) print_video_header(sh_video->bih);
+ if( mp_msg_test(MSGT_HEADER,MSGL_V) ) print_video_header(sh_video->bih);
chunksize=0;
// sh_video->fps=(float)sh_video->video.dwRate/(float)sh_video->video.dwScale;
// sh_video->frametime=(float)sh_video->video.dwScale/(float)sh_video->video.dwRate;
@@ -309,7 +309,7 @@ while(1){
sh_audio->wf=realloc(sh_audio->wf, sizeof(WAVEFORMATEX)+sh_audio->wf->cbSize);
}
chunksize=0;
- if(verbose>=1) print_wave_header(sh_audio->wf);
+ if( mp_msg_test(MSGT_HEADER,MSGL_V) ) print_wave_header(sh_audio->wf);
++priv->audio_streams;
// if(demuxer->audio->id==-1) demuxer->audio->id=stream_id;
}
@@ -332,7 +332,7 @@ while(1){
if (sh_video) {
sh_video->aspect = GET_AVI_ASPECT(vprp->dwFrameAspectRatio);
}
- if(verbose>=1) print_vprp(vprp);
+ if( mp_msg_test(MSGT_HEADER,MSGL_V) ) print_vprp(vprp);
free(vprp);
break;
}
@@ -368,7 +368,7 @@ while(1){
entry->dwFlags&=0xffff;
}
chunksize-=priv->idx_size<<4;
- if(verbose>=2) print_index(priv->idx,priv->idx_size);
+ if( mp_msg_test(MSGT_HEADER,MSGL_DBG2) ) print_index(priv->idx,priv->idx_size);
}
break;
/* added May 2002 */
@@ -539,7 +539,7 @@ if (priv->isodml && (index_mode==-1 || index_mode==0 || index_mode==1)) {
}
}
- if (verbose>=2) print_index(priv->idx, priv->idx_size);
+ if ( mp_msg_test(MSGT_HEADER,MSGL_DBG2) ) print_index(priv->idx, priv->idx_size);
demuxer->movi_end=demuxer->stream->end_pos;
@@ -677,7 +677,7 @@ skip_chunk:
}
priv->idx_size=priv->idx_pos;
mp_msg(MSGT_HEADER,MSGL_INFO,MSGTR_MPDEMUX_AVIHDR_IdxGeneratedForHowManyChunks,priv->idx_size);
- if(verbose>=2) print_index(priv->idx,priv->idx_size);
+ if( mp_msg_test(MSGT_HEADER,MSGL_DBG2) ) print_index(priv->idx,priv->idx_size);
/* Write generated index to a file */
if (index_file_save) {
diff --git a/libmpdemux/demux_asf.c b/libmpdemux/demux_asf.c
index c21ed166f6..343752e070 100644
--- a/libmpdemux/demux_asf.c
+++ b/libmpdemux/demux_asf.c
@@ -178,7 +178,7 @@ static int demux_asf_fill_buffer(demuxer_t *demux, demux_stream_t *ds){
unsigned char segsizetype=0x80;
int seg=-1;
- if(verbose>1){
+ if( mp_msg_test(MSGT_DEMUX,MSGL_DBG2) ){
int i;
for(i=0;i<16;i++) printf(" %02X",asf_packet[i]);
printf("\n");
@@ -260,7 +260,7 @@ static int demux_asf_fill_buffer(demuxer_t *demux, demux_stream_t *ds){
if(p>=p_end) mp_msg(MSGT_DEMUX,MSGL_V,"Warning! invalid packet 1, sig11 coming soon...\n");
- if(verbose>1){
+ if( mp_msg_test(MSGT_DEMUX,MSGL_DBG2) ){
int i;
printf("seg %d:",seg);
for(i=0;i<16;i++) printf(" %02X",p[i]);
diff --git a/libmpdemux/demux_audio.c b/libmpdemux/demux_audio.c
index 1681110c8b..880677bf5f 100644
--- a/libmpdemux/demux_audio.c
+++ b/libmpdemux/demux_audio.c
@@ -438,7 +438,7 @@ static int demux_audio_open(demuxer_t* demuxer) {
}
}
- if(verbose>0) print_wave_header(w);
+ if( mp_msg_test(MSGT_DEMUX,MSGL_V) ) print_wave_header(w);
if(l)
stream_skip(s,l);
do
diff --git a/libmpdemux/demux_lavf.c b/libmpdemux/demux_lavf.c
index e2aaa64de7..057f4e315d 100644
--- a/libmpdemux/demux_lavf.c
+++ b/libmpdemux/demux_lavf.c
@@ -237,7 +237,7 @@ static demuxer_t* demux_open_lavf(demuxer_t *demuxer){
sh_audio->format = 0x7;
break;
}
- if(verbose>=1) print_wave_header(sh_audio->wf);
+ if( mp_msg_test(MSGT_HEADER,MSGL_V) ) print_wave_header(sh_audio->wf);
if(demuxer->audio->id != i && demuxer->audio->id != -1)
st->discard= AVDISCARD_ALL;
else{
@@ -286,7 +286,7 @@ static demuxer_t* demux_open_lavf(demuxer_t *demuxer){
sh_video->ds= demuxer->video;
if(codec->extradata_size)
memcpy(sh_video->bih + 1, codec->extradata, codec->extradata_size);
- if(verbose>=1) print_video_header(sh_video->bih);
+ if( mp_msg_test(MSGT_HEADER,MSGL_V) ) print_video_header(sh_video->bih);
/* short biPlanes;
int biXPelsPerMeter;
int biYPelsPerMeter;
diff --git a/libmpdemux/demux_mov.c b/libmpdemux/demux_mov.c
index bef99cccbd..eaffa1f963 100644
--- a/libmpdemux/demux_mov.c
+++ b/libmpdemux/demux_mov.c
@@ -1802,7 +1802,7 @@ static demuxer_t* mov_read_header(demuxer_t* demuxer){
}
#if 1
- if(verbose>2){
+ if( mp_msg_test(MSGT_DEMUX,MSGL_DBG3) ){
for(t_no=0;t_no<priv->track_db;t_no++){
mov_track_t* trak=priv->tracks[t_no];
if(trak->type==MOV_TRAK_GENERIC){
diff --git a/libmpdemux/demux_ogg.c b/libmpdemux/demux_ogg.c
index 459d4a4461..76f97b41f0 100644
--- a/libmpdemux/demux_ogg.c
+++ b/libmpdemux/demux_ogg.c
@@ -993,7 +993,7 @@ int demux_ogg_open(demuxer_t* demuxer) {
(int)inf.version_minor,
(int)inf.version_subminor,
n_video - 1);
- if(verbose>0) print_video_header(sh_v->bih);
+ if( mp_msg_test(MSGT_HEADER,MSGL_V) ) print_video_header(sh_v->bih);
}
# endif /* HAVE_OGGTHEORA */
# ifdef HAVE_FLAC
@@ -1036,7 +1036,7 @@ int demux_ogg_open(demuxer_t* demuxer) {
n_video++;
mp_msg(MSGT_DEMUX,MSGL_INFO,"[Ogg] stream %d: video (FOURCC %c%c%c%c), -vid %d\n",
ogg_d->num_sub,pack.packet[68],pack.packet[69],pack.packet[70],pack.packet[71],n_video-1);
- if(verbose>0) print_video_header(sh_v->bih);
+ if( mp_msg_test(MSGT_HEADER,MSGL_V) ) print_video_header(sh_v->bih);
// Old audio header
} else if(get_uint32(pack.packet+96) == 0x05589F81) {
unsigned int extra_size;
@@ -1060,7 +1060,7 @@ int demux_ogg_open(demuxer_t* demuxer) {
ogg_d->subs[ogg_d->num_sub].id = n_audio;
n_audio++;
mp_msg(MSGT_DEMUX,MSGL_INFO,"[Ogg] stream %d: audio (format 0x%04x), -aid %d\n",ogg_d->num_sub,sh_a->format,n_audio-1);
- if(verbose>0) print_wave_header(sh_a->wf);
+ if( mp_msg_test(MSGT_HEADER,MSGL_V) ) print_wave_header(sh_a->wf);
} else
mp_msg(MSGT_DEMUX,MSGL_WARN,"Ogg stream %d contains an old header but the header type is unknown\n",ogg_d->num_sub);
@@ -1092,7 +1092,7 @@ int demux_ogg_open(demuxer_t* demuxer) {
n_video++;
mp_msg(MSGT_DEMUX,MSGL_INFO,"[Ogg] stream %d: video (FOURCC %c%c%c%c), -vid %d\n",
ogg_d->num_sub,st->subtype[0],st->subtype[1],st->subtype[2],st->subtype[3],n_video-1);
- if(verbose>0) print_video_header(sh_v->bih);
+ if( mp_msg_test(MSGT_HEADER,MSGL_V) ) print_video_header(sh_v->bih);
/// New audio header
} else if(strncmp(st->streamtype,"audio",5) == 0) {
char buffer[5];
@@ -1131,7 +1131,7 @@ int demux_ogg_open(demuxer_t* demuxer) {
ogg_d->subs[ogg_d->num_sub].id = n_audio;
n_audio++;
mp_msg(MSGT_DEMUX,MSGL_INFO,"[Ogg] stream %d: audio (format 0x%04x), -aid %d\n",ogg_d->num_sub,sh_a->format,n_audio-1);
- if(verbose>0) print_wave_header(sh_a->wf);
+ if( mp_msg_test(MSGT_HEADER,MSGL_V) ) print_wave_header(sh_a->wf);
/// Check for text (subtitles) header
} else if (strncmp(st->streamtype, "text", 4) == 0) {
diff --git a/libmpdemux/demux_real.c b/libmpdemux/demux_real.c
index 39dd5fb75c..6aae5c5f39 100644
--- a/libmpdemux/demux_real.c
+++ b/libmpdemux/demux_real.c
@@ -159,7 +159,7 @@ static void dump_index(demuxer_t *demuxer, int stream_id)
real_index_table_t *index;
int i, entries;
- if (verbose<=1)
+ if ( mp_msg_test(MSGT_DEMUX,MSGL_V) )
return;
if (stream_id >= MAX_STREAMS)
@@ -1448,7 +1448,7 @@ static demuxer_t* demux_open_real(demuxer_t* demuxer)
sh->wf->wFormatTag = sh->format;
mp_msg(MSGT_DEMUX,MSGL_V,"audio fourcc: %.4s (%x)\n", (char *)&sh->format, sh->format);
- if (verbose > 0)
+ if ( mp_msg_test(MSGT_DEMUX,MSGL_V) )
print_wave_header(sh->wf);
/* Select audio stream with highest bitrate if multirate file*/
diff --git a/libmpdemux/demuxer.c b/libmpdemux/demuxer.c
index b8b0a14ae9..282c6e97cf 100644
--- a/libmpdemux/demuxer.c
+++ b/libmpdemux/demuxer.c
@@ -340,7 +340,7 @@ int demux_fill_buffer(demuxer_t *demux,demux_stream_t *ds){
int ds_fill_buffer(demux_stream_t *ds){
demuxer_t *demux=ds->demuxer;
if(ds->current) free_demux_packet(ds->current);
- if(verbose>2){
+ if( mp_msg_test(MSGT_DEMUXER,MSGL_DBG3) ){
if(ds==demux->audio) mp_dbg(MSGT_DEMUXER,MSGL_DBG3,"ds_fill_buffer(d_audio) called\n");else
if(ds==demux->video) mp_dbg(MSGT_DEMUXER,MSGL_DBG3,"ds_fill_buffer(d_video) called\n");else
if(ds==demux->sub) mp_dbg(MSGT_DEMUXER,MSGL_DBG3,"ds_fill_buffer(d_sub) called\n");else
diff --git a/libmpdemux/http.c b/libmpdemux/http.c
index 3476db30d0..f5eb844312 100644
--- a/libmpdemux/http.c
+++ b/libmpdemux/http.c
@@ -735,7 +735,7 @@ static int http_streaming_start(stream_t *stream, int* file_format) {
}
stream->fd=fd;
- if( verbose>0 ) {
+ if( mp_msg_test(MSGT_NETWORK,MSGL_V) ) {
http_debug_hdr( http_hdr );
}
diff --git a/libmpdemux/stream.c b/libmpdemux/stream.c
index 869b3e1f62..0ea628a008 100644
--- a/libmpdemux/stream.c
+++ b/libmpdemux/stream.c
@@ -32,7 +32,6 @@
#include "m_struct.h"
-extern int verbose; // defined in mplayer.c
void cache_uninit(stream_t *s); // defined in cache2.c
//#include "vcd_read_bincue.h"
@@ -246,7 +245,7 @@ int stream_fill_buffer(stream_t *s){
int stream_seek_long(stream_t *s,off_t pos){
off_t newpos=0;
-// if(verbose>=3) printf("seek_long to 0x%X\n",(unsigned int)pos);
+// if( mp_msg_test(MSGT_STREAM,MSGL_DBG3) ) printf("seek_long to 0x%X\n",(unsigned int)pos);
s->buf_pos=s->buf_len=0;
@@ -271,7 +270,7 @@ off_t newpos=0;
break;
}
-if(verbose>=3){
+if( mp_msg_test(MSGT_STREAM,MSGL_DBG3) ){
printf("s->pos=%"PRIX64" newpos=%"PRIX64" new_bufpos=%"PRIX64" buflen=%X \n",
(int64_t)s->pos,(int64_t)newpos,(int64_t)pos,s->buf_len);
}
diff --git a/libmpdemux/video.c b/libmpdemux/video.c
index 89415fe944..499bf4ab9a 100644
--- a/libmpdemux/video.c
+++ b/libmpdemux/video.c
@@ -285,7 +285,7 @@ mpeg_header_parser:
int i=sync_video_packet(d_video);
if(i==0x1B3) break; // found it!
if(!i || !skip_video_packet(d_video)){
- if(verbose>0) mp_msg(MSGT_DECVIDEO,MSGL_V,"NONE :(\n");
+ if( mp_msg_test(MSGT_DECVIDEO,MSGL_V) ) mp_msg(MSGT_DECVIDEO,MSGL_V,"NONE :(\n");
mp_msg(MSGT_DECVIDEO,MSGL_ERR,MSGTR_MpegNoSequHdr);
return 0;
}
diff --git a/libvo/vesa_lvo.c b/libvo/vesa_lvo.c
index 2ab2c0d798..b108bfbfac 100644
--- a/libvo/vesa_lvo.c
+++ b/libvo/vesa_lvo.c
@@ -20,6 +20,7 @@
#include <string.h>
#include "config.h"
+#include "mp_msg.h"
#include "vesa_lvo.h"
#include "img_format.h"
@@ -40,7 +41,6 @@ static uint8_t *lvo_mem = NULL;
static uint8_t next_frame;
static mga_vid_config_t mga_vid_config;
static unsigned image_bpp,image_height,image_width,src_format;
-extern int verbose;
uint32_t vlvo_control(uint32_t request, void *data, ...);
#define PIXEL_SIZE() ((video_mode_info.BitsPerPixel+7)/8)
@@ -54,7 +54,8 @@ int vlvo_preinit(const char *drvname)
printf("vesa_lvo: This branch is no longer supported.\n"
"vesa_lvo: Please use -vo vesa:vidix instead\n");
return -1;
- if(verbose > 1) printf("vesa_lvo: vlvo_preinit(%s) was called\n",drvname);
+ if( mp_msg_test(MSGT_VO,MSGL_DBG2) ) {
+ printf("vesa_lvo: vlvo_preinit(%s) was called\n",drvname); }
lvo_handler = open(drvname,O_RDWR);
if(lvo_handler == -1)
{
@@ -78,7 +79,8 @@ int vlvo_init(unsigned src_width,unsigned src_height,
printf("vesa_lvo: This branch is no longer supported.\n"
"vesa_lvo: Please use -vo vesa:vidix instead\n");
return -1;
- if(verbose > 1) printf("vesa_lvo: vlvo_init() was called\n");
+ if( mp_msg_test(MSGT_VO,MSGL_DBG2) ) {
+ printf("vesa_lvo: vlvo_init() was called\n"); }
image_width = src_width;
image_height = src_height;
mga_vid_config.version=MGA_VID_VERSION;
@@ -146,7 +148,8 @@ int vlvo_init(unsigned src_width,unsigned src_height,
void vlvo_term( void )
{
- if(verbose > 1) printf("vesa_lvo: vlvo_term() was called\n");
+ if( mp_msg_test(MSGT_VO,MSGL_DBG2) ) {
+ printf("vesa_lvo: vlvo_term() was called\n"); }
ioctl( lvo_handler,MGA_VID_OFF,0 );
munmap(frames[0],mga_vid_config.frame_size*mga_vid_config.num_frames);
if(lvo_handler != -1) close(lvo_handler);
@@ -194,7 +197,8 @@ uint32_t vlvo_draw_slice_420(uint8_t *image[], int stride[], int w,int h,int x,i
uint32_t vlvo_draw_slice(uint8_t *image[], int stride[], int w,int h,int x,int y)
{
- if(verbose > 1) printf("vesa_lvo: vlvo_draw_slice() was called\n");
+ if( mp_msg_test(MSGT_VO,MSGL_DBG2) ) {
+ printf("vesa_lvo: vlvo_draw_slice() was called\n"); }
if(src_format == IMGFMT_YV12 || src_format == IMGFMT_I420 || src_format == IMGFMT_IYUV)
vlvo_draw_slice_420(image,stride,w,h,x,y);
else
@@ -213,13 +217,15 @@ uint32_t vlvo_draw_frame(uint8_t *image[])
{
/* Note it's very strange but sometime for YUY2 draw_frame is called */
memcpy(lvo_mem,image[0],mga_vid_config.frame_size);
- if(verbose > 1) printf("vesa_lvo: vlvo_draw_frame() was called\n");
+ if( mp_msg_test(MSGT_VO,MSGL_DBG2) ) {
+ printf("vesa_lvo: vlvo_draw_frame() was called\n"); }
return 0;
}
void vlvo_flip_page(void)
{
- if(verbose > 1) printf("vesa_lvo: vlvo_flip_page() was called\n");
+ if( mp_msg_test(MSGT_VO,MSGL_DBG2) ) {
+ printf("vesa_lvo: vlvo_flip_page() was called\n"); }
if(vo_doublebuffering)
{
ioctl(lvo_handler,MGA_VID_FSEL,&next_frame);
@@ -277,7 +283,8 @@ static void draw_alpha(int x0,int y0, int w,int h, unsigned char* src, unsigned
void vlvo_draw_osd(void)
{
- if(verbose > 1) printf("vesa_lvo: vlvo_draw_osd() was called\n");
+ if( mp_msg_test(MSGT_VO,MSGL_DBG2) ) {
+ printf("vesa_lvo: vlvo_draw_osd() was called\n"); }
/* TODO: hw support */
#if 0
/* disable this stuff until new fbvid.h interface will be implemented
@@ -289,7 +296,8 @@ void vlvo_draw_osd(void)
uint32_t vlvo_query_info(uint32_t format)
{
- if(verbose > 1) printf("vesa_lvo: query_format was called: %x (%s)\n",format,vo_format_name(format));
+ if( mp_msg_test(MSGT_VO,MSGL_DBG2) ) {
+ printf("vesa_lvo: query_format was called: %x (%s)\n",format,vo_format_name(format)); }
return VFCAP_CSP_SUPPORTED;
}
diff --git a/libvo/vo_png.c b/libvo/vo_png.c
index 41dcdc3290..7b2fe72540 100644
--- a/libvo/vo_png.c
+++ b/libvo/vo_png.c
@@ -14,6 +14,7 @@
#include <png.h>
+#include "mp_msg.h"
#include "config.h"
#include "video_out.h"
#include "video_out_internal.h"
@@ -29,7 +30,6 @@ static vo_info_t info =
LIBVO_EXTERN (png)
-extern int verbose;
int z_compression = Z_NO_COMPRESSION;
static int framenum = 0;
@@ -50,7 +50,8 @@ config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uin
printf("PNG Info: (0 = no compression, 1 = fastest, lowest - 9 best, slowest compression)\n");
}
- if(verbose) printf("PNG Compression level %i\n", z_compression);
+ if( mp_msg_test(MSGT_VO,MSGL_DBG2) ) {
+ printf("PNG Compression level %i\n", z_compression); }
return 0;
}
@@ -70,13 +71,15 @@ struct pngdata create_png (char * fname, int image_width, int image_height, int
png.info_ptr = png_create_info_struct(png.png_ptr);
if (!png.png_ptr) {
- if(verbose > 1) printf("PNG Failed to init png pointer\n");
+ if( mp_msg_test(MSGT_VO,MSGL_DBG2) ) {
+ printf("PNG Failed to init png pointer\n"); }
png.status = ERROR;
return png;
}
if (!png.info_ptr) {
- if(verbose > 1) printf("PNG Failed to init png infopointer\n");
+ if( mp_msg_test(MSGT_VO,MSGL_DBG2) ) {
+ printf("PNG Failed to init png infopointer\n"); }
png_destroy_write_struct(&png.png_ptr,
(png_infopp)NULL);
png.status = ERROR;
@@ -84,7 +87,8 @@ struct pngdata create_png (char * fname, int image_width, int image_height, int
}
if (setjmp(png.png_ptr->jmpbuf)) {
- if(verbose > 1) printf("PNG Internal error!\n");
+ if( mp_msg_test(MSGT_VO,MSGL_DBG2) ) {
+ printf("PNG Internal error!\n");}
png_destroy_write_struct(&png.png_ptr, &png.info_ptr);
fclose(png.fp);
png.status = ERROR;
@@ -98,7 +102,8 @@ struct pngdata create_png (char * fname, int image_width, int image_height, int
return png;
}
- if(verbose > 1) printf("PNG Init IO\n");
+ if( mp_msg_test(MSGT_VO,MSGL_DBG2) ) {
+ printf("PNG Init IO\n"); }
png_init_io(png.png_ptr, png.fp);
/* set the zlib compression level */
@@ -112,11 +117,13 @@ struct pngdata create_png (char * fname, int image_width, int image_height, int
8, PNG_COLOR_TYPE_RGB, PNG_INTERLACE_NONE,
PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT);
- if(verbose > 1) printf("PNG Write Info\n");
+ if( mp_msg_test(MSGT_VO,MSGL_DBG2) ) {
+ printf("PNG Write Info\n"); }
png_write_info(png.png_ptr, png.info_ptr);
if(swapped) {
- if(verbose > 1) printf("PNG Set BGR Conversion\n");
+ if( mp_msg_test(MSGT_VO,MSGL_DBG2) ) {
+ printf("PNG Set BGR Conversion\n"); }
png_set_bgr(png.png_ptr);
}
@@ -126,10 +133,12 @@ struct pngdata create_png (char * fname, int image_width, int image_height, int
static uint8_t destroy_png(struct pngdata png) {
- if(verbose > 1) printf("PNG Write End\n");
+ if( mp_msg_test(MSGT_VO,MSGL_DBG2) ) {
+ printf("PNG Write End\n"); }
png_write_end(png.png_ptr, png.info_ptr);
- if(verbose > 1) printf("PNG Destroy Write Struct\n");
+ if( mp_msg_test(MSGT_VO,MSGL_DBG2) ) {
+ printf("PNG Destroy Write Struct\n"); }
png_destroy_write_struct(&png.png_ptr, &png.info_ptr);
fclose (png.fp);
@@ -155,14 +164,16 @@ static uint32_t draw_image(mp_image_t* mpi){
return 1;
}
- if(verbose > 1) printf("PNG Creating Row Pointers\n");
+ if( mp_msg_test(MSGT_VO,MSGL_DBG2) ) {
+ printf("PNG Creating Row Pointers\n"); }
for ( k = 0; k < mpi->h; k++ )
row_pointers[k] = mpi->planes[0]+mpi->stride[0]*k;
//png_write_flush(png.png_ptr);
//png_set_flush(png.png_ptr, nrows);
- if(verbose > 1) printf("PNG Writing Image Data\n");
+ if( mp_msg_test(MSGT_VO,MSGL_DBG2) ) {
+ printf("PNG Writing Image Data\n"); }
png_write_image(png.png_ptr, row_pointers);
destroy_png(png);
diff --git a/libvo/vo_sdl.c b/libvo/vo_sdl.c
index 078951d474..da18fe463b 100644
--- a/libvo/vo_sdl.c
+++ b/libvo/vo_sdl.c
@@ -105,6 +105,7 @@
#include <string.h>
#include <inttypes.h>
+#include "mp_msg.h"
#include "config.h"
#include "video_out.h"
#include "video_out_internal.h"
@@ -123,8 +124,6 @@
#include "input/mouse.h"
#include "subopt-helper.h"
-extern int verbose;
-
static vo_info_t info =
{
"SDL YUV/RGB/BGR renderer (SDL v1.1.7+ only!)",
@@ -141,14 +140,16 @@ LIBVO_EXTERN(sdl)
#ifdef SDL_ENABLE_LOCKS
#define SDL_OVR_LOCK(x) if (SDL_LockYUVOverlay (priv->overlay)) { \
- if(verbose) printf("SDL: Couldn't lock YUV overlay\n"); \
+ if( mp_msg_test(MSGT_VO,MSGL_V) ) { \
+ printf("SDL: Couldn't lock YUV overlay\n");} \
return x; \
}
#define SDL_OVR_UNLOCK SDL_UnlockYUVOverlay (priv->overlay);
#define SDL_SRF_LOCK(srf, x) if(SDL_MUSTLOCK(srf)) { \
if(SDL_LockSurface (srf)) { \
- if(verbose) printf("SDL: Couldn't lock RGB surface\n"); \
+ if( mp_msg_test(MSGT_VO,MSGL_V) ) { \
+ printf("SDL: Couldn't lock RGB surface\n"); } \
return x; \
} \
}
@@ -422,18 +423,21 @@ static int sdl_open (void *plugin, void *name)
/* other default values */
#ifdef SDL_NOHWSURFACE
- if(verbose) printf("SDL: using software-surface\n");
+ if( mp_msg_test(MSGT_VO,MSGL_V) ) {
+ printf("SDL: using software-surface\n"); }
priv->sdlflags = SDL_SWSURFACE|SDL_RESIZABLE|SDL_ANYFORMAT;
priv->sdlfullflags = SDL_SWSURFACE|SDL_FULLSCREEN|SDL_ANYFORMAT;
// XXX:FIXME: ASYNCBLIT should be enabled for SMP systems
#else
/*if((strcmp(priv->driver, "dga") == 0) && (priv->mode)) {
- if(verbose) printf("SDL: using software-surface\n");
+ if( mp_msg_test(MSGT_VO,MSGL_V) ) {
+ printf("SDL: using software-surface\n"); }
priv->sdlflags = SDL_SWSURFACE|SDL_FULLSCREEN|SDL_ASYNCBLIT|SDL_HWACCEL|SDL_ANYFORMAT;
priv->sdlfullflags = SDL_SWSURFACE|SDL_FULLSCREEN|SDL_ASYNCBLIT|SDL_HWACCEL|SDL_ANYFORMAT;
}
else { */
- if(verbose) printf("SDL: using hardware-surface\n");
+ if( mp_msg_test(MSGT_VO,MSGL_V) ) {
+ printf("SDL: using hardware-surface\n"); }
priv->sdlflags = SDL_HWSURFACE|SDL_RESIZABLE/*|SDL_ANYFORMAT*/;
priv->sdlfullflags = SDL_HWSURFACE|SDL_FULLSCREEN/*|SDL_ANYFORMAT*/;
// XXX:FIXME: ASYNCBLIT should be enabled for SMP systems
@@ -483,7 +487,8 @@ static int sdl_open (void *plugin, void *name)
priv->bpp = vidInfo->vfmt->BitsPerPixel;
if (priv->mode == YUV && priv->bpp < 16) {
- if(verbose) printf("SDL: Your SDL display target wants to be at a color "
+ if( mp_msg_test(MSGT_VO,MSGL_V) )
+ printf("SDL: Your SDL display target wants to be at a color "
"depth of (%d), but we need it to be at least 16 "
"bits, so we need to emulate 16-bit color. This is "
"going to slow things down; you might want to "
@@ -561,7 +566,8 @@ static int sdl_close (void)
#if 0
static SDL_Rect aspect(int srcw, int srch, int dstw, int dsth) {
SDL_Rect newres;
- if(verbose > 1) printf("SDL Aspect: src: %ix%i dst: %ix%i\n", srcw, srch, dstw, dsth);
+ if( mp_msg_test(MSGT_VO,MSGL_V) ) {
+ printf("SDL Aspect: src: %ix%i dst: %ix%i\n", srcw, srch, dstw, dsth); }
newres.h = ((float)dstw / (float)srcw * (float)srch) * ((float)dsth/((float)dstw/(MONITOR_ASPECT)));
if(newres.h > dsth) {
newres.w = ((float)dsth / (float)newres.h) * dstw;
@@ -575,7 +581,8 @@ static SDL_Rect aspect(int srcw, int srch, int dstw, int dsth) {
newres.y = (dsth - newres.h) / 2;
}
- if(verbose) printf("SDL Aspect-Destinationres: %ix%i (x: %i, y: %i)\n", newres.w, newres.h, newres.x, newres.y);
+ if( mp_msg_test(MSGT_VO,MSGL_V) ) {
+ printf("SDL Aspect-Destinationres: %ix%i (x: %i, y: %i)\n", newres.w, newres.h, newres.x, newres.y); }
return newres;
}
@@ -676,7 +683,7 @@ static void set_fullmode (int mode) {
else if (mode < 0) {
int i,j,imax;
mode = 0; // Default to the biggest mode avaible
- if (verbose) for(i=0;priv->fullmodes[i];++i)
+ if ( mp_msg_test(MSGT_VO,MSGL_V) ) for(i=0;priv->fullmodes[i];++i)
printf("SDL Mode: %d: %d x %d\n", i, priv->fullmodes[i]->w, priv->fullmodes[i]->h);
for(i = findArrayEnd(priv->fullmodes) - 1; i >=0; i--) {
if( (priv->fullmodes[i]->w >= priv->dstwidth) &&
@@ -691,7 +698,8 @@ static void set_fullmode (int mode) {
break;
}
}
- if (verbose) printf("SET SDL Mode: %d: %d x %d\n", mode, priv->fullmodes[mode]->w, priv->fullmodes[mode]->h);
+ if ( mp_msg_test(MSGT_VO,MSGL_V) ) {
+ printf("SET SDL Mode: %d: %d x %d\n", mode, priv->fullmodes[mode]->w, priv->fullmodes[mode]->h); }
priv->fullmode = mode;
screen_surface_h = priv->fullmodes[mode]->h;
screen_surface_w = priv->fullmodes[mode]->w;
@@ -800,8 +808,8 @@ config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uin
if ( vo_config_count ) sdl_close();
- if(verbose) printf("SDL: Using 0x%X (%s) image format\n", format,
- vo_format_name(format));
+ if( mp_msg_test(MSGT_VO,MSGL_V) ) {
+ printf("SDL: Using 0x%X (%s) image format\n", format, vo_format_name(format)); }
if(priv->mode != YUV) {
priv->sdlflags |= SDL_ANYFORMAT;
@@ -848,11 +856,13 @@ config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uin
// printf("SDL: flags are set to: %i\n", flags);
// printf("SDL: Width: %i Height: %i D_Width %i D_Height: %i\n", width, height, d_width, d_height);
if(flags&VOFLAG_FLIPPING) {
- if(verbose) printf("SDL: using flipped video (only with RGB/BGR/packed YUV)\n");
+ if( mp_msg_test(MSGT_VO,MSGL_V) ) {
+ printf("SDL: using flipped video (only with RGB/BGR/packed YUV)\n"); }
priv->flip = 1;
}
if(flags&VOFLAG_FULLSCREEN) {
- if(verbose) printf("SDL: setting zoomed fullscreen without modeswitching\n");
+ if( mp_msg_test(MSGT_VO,MSGL_V) ) {
+ printf("SDL: setting zoomed fullscreen without modeswitching\n"); }
printf("SDL: Info - please use -vm or -zoom to switch to best resolution.\n");
priv->fulltype = VOFLAG_FULLSCREEN;
set_fullmode(priv->fullmode);
@@ -860,14 +870,16 @@ config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uin
SDL_ShowCursor(0);*/
} else
if(flags&VOFLAG_MODESWITCHING) {
- if(verbose) printf("SDL: setting zoomed fullscreen with modeswitching\n");
+ if( mp_msg_test(MSGT_VO,MSGL_V) ) {
+ printf("SDL: setting zoomed fullscreen with modeswitching\n"); }
priv->fulltype = VOFLAG_MODESWITCHING;
set_fullmode(priv->fullmode);
/*if((priv->surface = SDL_SetVideoMode (d_width ? d_width : width, d_height ? d_height : height, priv->bpp, priv->sdlfullflags)))
SDL_ShowCursor(0);*/
} else
if(flags&VOFLAG_SWSCALE) {
- if(verbose) printf("SDL: setting zoomed fullscreen with modeswitching\n");
+ if( mp_msg_test(MSGT_VO,MSGL_V) ) {
+ printf("SDL: setting zoomed fullscreen with modeswitching\n"); }
priv->fulltype = VOFLAG_SWSCALE;
set_fullmode(priv->fullmode);
}
@@ -878,11 +890,13 @@ config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uin
||(strcmp(priv->driver, "Quartz") == 0)
||(strcmp(priv->driver, "cgx") == 0)
||((strcmp(priv->driver, "aalib") == 0) && priv->X)){
- if(verbose) printf("SDL: setting windowed mode\n");
+ if( mp_msg_test(MSGT_VO,MSGL_V) ) {
+ printf("SDL: setting windowed mode\n"); }
set_video_mode(priv->dstwidth, priv->dstheight, priv->bpp, priv->sdlflags);
}
else {
- if(verbose) printf("SDL: setting zoomed fullscreen with modeswitching\n");
+ if( mp_msg_test(MSGT_VO,MSGL_V) ) {
+ printf("SDL: setting zoomed fullscreen with modeswitching\n"); }
priv->fulltype = VOFLAG_SWSCALE;
set_fullmode(priv->fullmode);
}
@@ -1167,7 +1181,8 @@ static void check_events (void)
priv->windowsize.w = priv->surface->w;
priv->windowsize.h = priv->surface->h;
//}
- if(verbose > 2) printf("SDL: Window resize\n");
+ if( mp_msg_test(MSGT_VO,MSGL_DBG3) ) {
+ printf("SDL: Window resize\n"); }
break;
case SDL_MOUSEBUTTONDOWN:
@@ -1207,7 +1222,8 @@ static void check_events (void)
case SDL_KEYDOWN:
#endif
keypressed = event.key.keysym.sym;
- if(verbose > 1) printf("SDL: Key pressed: '%i'\n", keypressed);
+ if( mp_msg_test(MSGT_VO,MSGL_DBG2) ) {
+ printf("SDL: Key pressed: '%i'\n", keypressed); }
/* c key pressed. c cycles through available fullscreenmodes, if we have some */
if ( ((keypressed == SDLK_c)) && (priv->fullmodes) ) {
@@ -1216,7 +1232,8 @@ static void check_events (void)
if (priv->fullmode > (findArrayEnd(priv->fullmodes) - 1)) priv->fullmode = 0;
set_fullmode(priv->fullmode);
- if(verbose > 1) printf("SDL: Set next available fullscreen mode.\n");
+ if( mp_msg_test(MSGT_VO,MSGL_DBG2) ) {
+ printf("SDL: Set next available fullscreen mode.\n"); }
}
else if ( keypressed == SDLK_n ) {
@@ -1227,13 +1244,15 @@ static void check_events (void)
set_video_mode(priv->dstwidth, priv->dstheight, priv->bpp, priv->sdlflags);
priv->windowsize.w = priv->surface->w;
priv->windowsize.h = priv->surface->h;
- if(verbose > 1) printf("SDL: Normal size\n");
+ if( mp_msg_test(MSGT_VO,MSGL_DBG2) ) {
+ printf("SDL: Normal size\n"); }
} else
if (priv->surface->w != priv->dstwidth * 2 || priv->surface->h != priv->dstheight * 2) {
set_video_mode(priv->dstwidth * 2, priv->dstheight * 2, priv->bpp, priv->sdlflags);
priv->windowsize.w = priv->surface->w;
priv->windowsize.h = priv->surface->h;
- if(verbose > 1) printf("SDL: Double size\n");
+ if( mp_msg_test(MSGT_VO,MSGL_DBG2) ) {
+ printf("SDL: Double size\n"); }
}
}
@@ -1555,7 +1574,8 @@ uninit(void)
#ifdef HAVE_X11
struct sdl_priv_s *priv = &sdl_priv;
if(priv->X) {
- if(verbose) printf("SDL: activating XScreensaver/DPMS\n");
+ if( mp_msg_test(MSGT_VO,MSGL_V) ) {
+ printf("SDL: activating XScreensaver/DPMS\n"); }
vo_x11_uninit();
}
#endif
@@ -1565,7 +1585,8 @@ uninit(void)
if(SDL_WasInit(SDL_INIT_VIDEO))
SDL_QuitSubSystem(SDL_INIT_VIDEO);
- if(verbose > 2) printf("SDL: Closed Plugin\n");
+ if( mp_msg_test(MSGT_VO,MSGL_DBG3) ) {
+ printf("SDL: Closed Plugin\n"); }
}
@@ -1591,7 +1612,8 @@ static int preinit(const char *arg)
priv->overlay = NULL;
priv->surface = NULL;
- if(verbose > 2) printf("SDL: Opening Plugin\n");
+ if( mp_msg_test(MSGT_VO,MSGL_DBG3) ) {
+ printf("SDL: Opening Plugin\n"); }
if(sdl_driver) {
setenv("SDL_VIDEODRIVER", sdl_driver, 1);
@@ -1626,11 +1648,13 @@ static int preinit(const char *arg)
priv->X = 0;
#ifdef HAVE_X11
if(vo_init()) {
- if(verbose) printf("SDL: deactivating XScreensaver/DPMS\n");
+ if( mp_msg_test(MSGT_VO,MSGL_V) ) {
+ printf("SDL: deactivating XScreensaver/DPMS\n"); }
priv->XWidth = vo_screenwidth;
priv->XHeight = vo_screenheight;
priv->X = 1;
- if(verbose) printf("SDL: X11 Resolution %ix%i\n", priv->XWidth, priv->XHeight);
+ if( mp_msg_test(MSGT_VO,MSGL_V) ) {
+ printf("SDL: X11 Resolution %ix%i\n", priv->XWidth, priv->XHeight); }
}
#endif
@@ -1695,10 +1719,12 @@ static int control(uint32_t request, void *data, ...)
if (priv->surface->flags & SDL_FULLSCREEN) {
set_video_mode(priv->windowsize.w, priv->windowsize.h, priv->bpp, priv->sdlflags);
SDL_ShowCursor(1);
- if(verbose > 1) printf("SDL: Windowed mode\n");
+ if( mp_msg_test(MSGT_VO,MSGL_DBG2) ) {
+ printf("SDL: Windowed mode\n"); }
} else if (priv->fullmodes) {
set_fullmode(priv->fullmode);
- if(verbose > 1) printf("SDL: Set fullscreen mode\n");
+ if( mp_msg_test(MSGT_VO,MSGL_DBG2) ) {
+ printf("SDL: Set fullscreen mode\n"); }
}
return VO_TRUE;
}
diff --git a/libvo/vo_svga.c b/libvo/vo_svga.c
index aa9158b093..ebc51a3a19 100644
--- a/libvo/vo_svga.c
+++ b/libvo/vo_svga.c
@@ -52,7 +52,6 @@ TODO:
//silence warnings, probably it have to go in some global header
#define UNUSED(x) ((void)(x))
-extern int verbose;
static int query_format(uint32_t format);
static void draw_alpha(int x0, int y0, int w, int h, unsigned char *src,
@@ -172,7 +171,7 @@ char s[64];
force_vm=vga_getmodenumber(s);
if(force_vm>0) {
- if(verbose) printf("vo_svga: Forcing mode %i\n",force_vm);
+ if( mp_msg_test(MSGT_VO,MSGL_V) ) printf("vo_svga: Forcing mode %i\n",force_vm);
}else{
force_vm = 0;
}
@@ -191,7 +190,7 @@ uint8_t * rgbplane;
int i;
if (mode_capabilities&CAP_ACCEL_CLEAR){
- if(verbose > 2)
+ if( mp_msg_test(MSGT_VO,MSGL_DBG3) )
printf("vo_svga: clearing box %d,%d - %d,%d with HW acceleration\n",
x,y,w,h);
if(mode_capabilities&CAP_ACCEL_BACKGR)
@@ -201,7 +200,7 @@ int i;
return;
}
if (mode_capabilities & CAP_LINEAR){
- if(verbose > 2)
+ if( mp_msg_test(MSGT_VO,MSGL_DBG3) )
printf("vo_svga: clearing box %d,%d - %d,%d with memset\n",x,y,w,h);
rgbplane=PageStore[0].vbase + (y*mode_stride) + (x*modeinfo->bytesperpixel);
for(i=0;i<h;i++){
@@ -213,7 +212,7 @@ int i;
return;
}
//native
- if(verbose > 2)
+ if( mp_msg_test(MSGT_VO,MSGL_DBG3) )
printf("vo_svga: clearing box %d,%d - %d,%d with native draw \n",x,y,w,h);
if(modeinfo->bytesperpixel!=0) w*=modeinfo->bytesperpixel;
for(i=0;i<h;i++){
@@ -229,7 +228,7 @@ int bytesperline;
int page;
if(mpi->flags & MP_IMGFLAG_DIRECT){
- if(verbose > 2)
+ if( mp_msg_test(MSGT_VO,MSGL_DBG3) )
printf("vo_svga: drawing direct rendered surface\n");
cpage=(uint32_t)mpi->priv;
assert((cpage>=0)&&(cpage<max_pages));
@@ -259,7 +258,7 @@ int page;
(stride == mode_stride) ){ //only monolite image can be accelerated
w=(stride*8)/mpi->bpp;//we transfer pixels in the stride so the source
//ACCELERATE
- if(verbose>2)
+ if( mp_msg_test(MSGT_VO,MSGL_DBG3) )
printf("vo_svga: using HW PutImage (x=%d,y=%d,w=%d,h=%d)\n",x,y,w,h);
if(mode_capabilities & CAP_ACCEL_BACKGR)
vga_accel(ACCEL_SYNC);
@@ -270,7 +269,7 @@ int page;
if( mode_capabilities&CAP_LINEAR){
//DIRECT
- if(verbose>2)
+ if( mp_msg_test(MSGT_VO,MSGL_DBG3) )
printf("vo_svga: using Direct memcpy (x=%d,y=%d,w=%d,h=%d)\n",x,y,w,h);
bytesperline=(w*mpi->bpp)/8;
base=PageStore[cpage].vbase + (y*mode_stride) + (x*mpi->bpp)/8;
@@ -292,7 +291,7 @@ int page;
//one byte per pixel! svgalib innovation
if(mpi->imgfmt==IMGFMT_RG4B || mpi->imgfmt==IMGFMT_BG4B) length=w;
- if(verbose>2)
+ if( mp_msg_test(MSGT_VO,MSGL_DBG3) )
printf("vo_svga: using Native vga_draw(x=%d,y=%d,w=%d,h=%d)\n",x,y,w,h);
y+=PageStore[cpage].yoffset;//y position of the page beggining
for(i=0;i<h;i++){
@@ -328,7 +327,7 @@ int find_best_svga_mode(int req_w,int req_h, int req_bpp){
for(i=1;i<=lastmode;i++){
vminfo = vga_getmodeinfo(i);
if( vminfo == NULL ) continue;
- if(verbose>3)
+ if( mp_msg_test(MSGT_VO,MSGL_DBG4) )
printf("vo_svga: testing mode %d (%s)\n",i,vga_getmodename(i));
if( vga_hasmode(i) == 0 ) continue;
if( req_bpp != bpp_from_vminfo(vminfo) )continue;
@@ -341,7 +340,7 @@ int find_best_svga_mode(int req_w,int req_h, int req_bpp){
if( bestmode==0 || prev_badness >= badness ){//modeX etc...
prev_badness=badness;
bestmode=i;
- if(verbose>3)
+ if( mp_msg_test(MSGT_VO,MSGL_DBG4) )
printf("vo_svga: found good mode %d with badness %d\n",i,badness);
}
}
@@ -404,7 +403,7 @@ static int config(uint32_t width, uint32_t height, uint32_t d_width,
int32_t req_bpp;
uint32_t accflags;
- if(verbose)
+ if( mp_msg_test(MSGT_VO,MSGL_V) )
printf("vo_svga: config(%i, %i, %i, %i, %08x, %s, %08x)\n", width, height,
d_width, d_height, flags, title, format);
//Only RGB modes supported
@@ -414,7 +413,7 @@ static int config(uint32_t width, uint32_t height, uint32_t d_width,
if( vo_dbpp!=0 && vo_dbpp!=req_bpp) {assert(0);return-1;}
if(!force_vm) {
- if (verbose) {
+ if ( mp_msg_test(MSGT_VO,MSGL_V) ) {
printf("vo_svga: Looking for the best resolution...\n");
printf("vo_svga: req_w: %d, req_h: %d, bpp: %d\n",req_w,req_h,req_bpp);
}
@@ -593,7 +592,7 @@ UNUSED(src);
static void draw_osd(void)
{
- if(verbose > 3)
+ if( mp_msg_test(MSGT_VO,MSGL_DBG4) )
printf("vo_svga: draw_osd()\n");
//only modes with bytesperpixel>0 can draw OSD
if(modeinfo->bytesperpixel==0) return;
@@ -622,10 +621,10 @@ static void flip_page(void) {
PageStore[old_page].locks=PAGE_EMPTY;
PageStore[cpage].locks=PAGE_BUSY;
- if(verbose > 2)
+ if( mp_msg_test(MSGT_VO,MSGL_DBG3) )
printf("vo_svga: viewing page %d\n",cpage);
if(sync_flip && old_page!=cpage){
- if(verbose > 2) printf("vo_svga:vga_waitretrace\n");
+ if( mp_msg_test(MSGT_VO,MSGL_DBG3) ) printf("vo_svga:vga_waitretrace\n");
vga_waitretrace();
}
vga_setdisplaystart(PageStore[cpage].doffset);
@@ -650,7 +649,7 @@ int32_t req_bpp,flags;
int i,lastmode;
vga_modeinfo * vminfo;
- if (verbose >3)
+ if ( mp_msg_test(MSGT_VO,MSGL_DBG4) )
printf("vo_svga: query_format=%X \n",format);
//only RGB modes supported
if( (!IMGFMT_IS_RGB(format)) && (!IMGFMT_IS_BGR(format)) ) return 0;
@@ -688,7 +687,7 @@ static void draw_alpha(int x0, int y0, int w, int h, unsigned char *src,
unsigned char *srca, int stride) {
char* base;
- if(verbose>2)
+ if( mp_msg_test(MSGT_VO,MSGL_DBG3) )
printf("vo_svga: draw_alpha(x0=%d,y0=%d,w=%d,h=%d,src=%p,srca=%p,stride=%d\n",
x0,y0,w,h,src,srca,stride);
if(!blackbar_osd) {
@@ -697,7 +696,7 @@ static void draw_alpha(int x0, int y0, int w, int h, unsigned char *src,
y0+=y_pos;
}
- if(verbose>3)
+ if( mp_msg_test(MSGT_VO,MSGL_DBG4) )
printf("vo_svga: OSD draw in page %d\n",cpage);
base=PageStore[cpage].vbase + y0*mode_stride + x0*modeinfo->bytesperpixel;
switch (mode_bpp) {
@@ -745,7 +744,7 @@ int page;
mpi->planes[0] = PageStore[page].vbase +
y_pos*mode_stride + (x_pos*mpi->bpp)/8;
mpi->priv=(void *)page;
- if(verbose>2)
+ if( mp_msg_test(MSGT_VO,MSGL_DBG3) )
printf("vo_svga: direct render allocated! page=%d\n",page);
return(VO_TRUE);
}
diff --git a/libvo/vo_vesa.c b/libvo/vo_vesa.c
index 80f98df911..705b6f2ed7 100644
--- a/libvo/vo_vesa.c
+++ b/libvo/vo_vesa.c
@@ -43,6 +43,7 @@
#ifdef CONFIG_VIDIX
#include "vosub_vidix.h"
#endif
+#include "mp_msg.h"
#include "postproc/swscale.h"
#include "libmpcodecs/vf_scale.h"
@@ -52,8 +53,6 @@
extern vo_functions_t video_out_png;
#endif
-extern int verbose;
-
extern char *monitor_hfreq_str;
extern char *monitor_vfreq_str;
extern char *monitor_dotclock_str;
@@ -280,7 +279,7 @@ static int draw_slice(uint8_t *image[], int stride[], int w,int h,int x,int y)
int dstride=HAS_DGA()?video_mode_info.XResolution:dstW;
uint8_t *dst[3]= {dga_buffer, NULL, NULL};
int dstStride[3];
- if(verbose > 2)
+ if( mp_msg_test(MSGT_VO,MSGL_DBG3) )
printf("vo_vesa: draw_slice was called: w=%u h=%u x=%u y=%u\n",w,h,x,y);
dstStride[0]=dstride*((dstBpp+7)/8);
dstStride[1]=
@@ -361,7 +360,7 @@ static void draw_alpha_null(int x0,int y0, int w,int h, unsigned char* src, unsi
static void draw_osd(void)
{
uint32_t w,h;
- if(verbose > 2)
+ if( mp_msg_test(MSGT_VO,MSGL_DBG3) )
printf("vo_vesa: draw_osd was called\n");
{
#ifdef OSD_OUTSIDE_MOVIE
@@ -377,7 +376,7 @@ static void draw_osd(void)
static void flip_page(void)
{
- if(verbose > 2)
+ if( mp_msg_test(MSGT_VO,MSGL_DBG3) )
printf("vo_vesa: flip_page was called\n");
if(flip_trigger)
{
@@ -412,7 +411,7 @@ static void flip_page(void)
/* is called for rgb only */
static int draw_frame(uint8_t *src[])
{
- if(verbose > 2)
+ if( mp_msg_test(MSGT_VO,MSGL_DBG3) )
printf("vo_vesa: draw_frame was called\n");
if(sws)
{
@@ -463,7 +462,7 @@ static uint32_t parseSubDevice(const char *sd)
static int query_format(uint32_t format)
{
- if(verbose > 2)
+ if( mp_msg_test(MSGT_VO,MSGL_DBG3) )
printf("vo_vesa: query_format was called: %x (%s)\n",format,vo_format_name(format));
#ifdef CONFIG_VIDIX
if(vidix_name)return(vidix_query_fourcc(format));
@@ -538,7 +537,8 @@ unsigned fillMultiBuffer( unsigned long vsize, unsigned nbuffs )
screen_size = video_mode_info.XResolution*video_mode_info.YResolution*((dstBpp+7)/8);
if(screen_size%64) screen_size=((screen_size/64)*64)+64;
total = vsize / screen_size;
- if(verbose) printf("vo_vesa: Can use up to %u video buffers\n",total);
+ if( mp_msg_test(MSGT_VO,MSGL_V) )
+ printf("vo_vesa: Can use up to %u video buffers\n",total);
i = 0;
offset = 0;
total = min(total,nbuffs);
@@ -715,7 +715,7 @@ config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uin
dstFourcc = IMGFMT_BGR16;
break;
}
- if(verbose)
+ if( mp_msg_test(MSGT_VO,MSGL_V) )
{
printf("vo_vesa: Requested mode: %ux%u@%u (%s)\n",width,height,bpp,vo_format_name(format));
printf("vo_vesa: Total modes found: %u\n",num_modes);
@@ -758,7 +758,7 @@ config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uin
best_mode_idx = i;
}
}
- if(verbose)
+ if( mp_msg_test(MSGT_VO,MSGL_V) )
{
printf("vo_vesa: Mode (%03u): mode=%04X %ux%u@%u attr=%04X\n"
"vo_vesa: #planes=%u model=%u(%s) #pages=%u\n"
@@ -783,7 +783,8 @@ config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uin
PRINT_VBE_ERR("vbeGetMode",err);
return -1;
}
- if(verbose) printf("vo_vesa: Initial video mode: %x\n",init_mode);
+ if( mp_msg_test(MSGT_VO,MSGL_V) ) {
+ printf("vo_vesa: Initial video mode: %x\n",init_mode); }
if((err=vbeGetModeInfo(video_mode,&video_mode_info)) != VBE_OK)
{
PRINT_VBE_ERR("vbeGetModeInfo",err);
@@ -828,7 +829,8 @@ config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uin
printf("vo_vesa: Can't initialize SwScaler\n");
return -1;
}
- else if(verbose) printf("vo_vesa: Using SW BES emulator\n");
+ else if( mp_msg_test(MSGT_VO,MSGL_V) ) {
+ printf("vo_vesa: Using SW BES emulator\n"); }
}
if((video_mode_info.WinAAttributes & FRAME_MODE) == FRAME_MODE)
win.idx = 0; /* frame A */
@@ -855,7 +857,8 @@ config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uin
printf("vo_vesa: Using DGA (physical resources: %08lXh, %08lXh)"
,video_mode_info.PhysBasePtr
,vsize);
- if(verbose) printf(" at %08lXh",(unsigned long)lfb);
+ if( mp_msg_test(MSGT_VO,MSGL_V) ) {
+ printf(" at %08lXh",(unsigned long)lfb); }
printf("\n");
if(!(multi_size = fillMultiBuffer(vsize,2))) return -1;
if(vo_doublebuffering && multi_size < 2)
@@ -891,7 +894,7 @@ config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uin
if(video_mode_info.YResolution > dstH)
y_offset = (video_mode_info.YResolution - dstH) / 2;
else y_offset = 0;
- if(verbose)
+ if( mp_msg_test(MSGT_VO,MSGL_V) )
printf("vo_vesa: image: %ux%u screen = %ux%u x_offset = %u y_offset = %u\n"
,dstW,dstH
,video_mode_info.XResolution,video_mode_info.YResolution
@@ -915,7 +918,8 @@ config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uin
printf("vo_vesa: Can't allocate temporary buffer\n");
return -1;
}
- if(verbose) printf("vo_vesa: dga emulator was allocated = %p\n",dga_buffer);
+ if( mp_msg_test(MSGT_VO,MSGL_V) ) {
+ printf("vo_vesa: dga emulator was allocated = %p\n",dga_buffer); }
}
}
if((err=vbeSaveState(&init_state)) != VBE_OK)
@@ -956,7 +960,7 @@ config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uin
}
/* Now we are in video mode!!!*/
/* Below 'return -1' is impossible */
- if(verbose)
+ if( mp_msg_test(MSGT_VO,MSGL_V) )
{
printf("vo_vesa: Graphics mode was activated\n");
fflush(stdout);
@@ -1013,7 +1017,7 @@ config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uin
printf("vo_vesa: Can't find mode for: %ux%u@%u\n",width,height,bpp);
return -1;
}
- if(verbose)
+ if( mp_msg_test(MSGT_VO,MSGL_V) )
{
printf("vo_vesa: VESA initialization complete\n");
fflush(stdout);
@@ -1024,13 +1028,13 @@ config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uin
{
win.ptr = dga_buffer = video_base + multi_buff[i];
clear_screen(); /* Clear screen for stupid BIOSes */
- if(verbose>1) paintBkGnd();
+ if( mp_msg_test(MSGT_VO,MSGL_DBG2) ) paintBkGnd();
}
}
else
{
clear_screen(); /* Clear screen for stupid BIOSes */
- if(verbose>1)
+ if( mp_msg_test(MSGT_VO,MSGL_DBG2) )
{
int x;
x = (video_mode_info.XResolution/video_mode_info.XCharSize)/2-strlen(title)/2;
@@ -1047,14 +1051,14 @@ uninit(void)
{
// not inited
vesa_term();
- if(verbose > 2)
+ if( mp_msg_test(MSGT_VO,MSGL_DBG3) )
printf("vo_vesa: uninit was called\n");
}
static void check_events(void)
{
- if(verbose > 2)
+ if( mp_msg_test(MSGT_VO,MSGL_DBG3) )
printf("vo_vesa: check_events was called\n");
/* Nothing to do */
}
@@ -1063,8 +1067,9 @@ static int preinit(const char *arg)
{
int pre_init_err = 0;
int fd;
- if(verbose>1) printf("vo_vesa: preinit(%s) was called\n",arg);
- if(verbose > 2)
+ if( mp_msg_test(MSGT_VO,MSGL_DBG2) )
+ printf("vo_vesa: preinit(%s) was called\n",arg);
+ if( mp_msg_test(MSGT_VO,MSGL_DBG3) )
printf("vo_vesa: subdevice %s is being initialized\n",arg);
subdev_flags = 0;
lvo_name = NULL;
@@ -1083,7 +1088,7 @@ static int preinit(const char *arg)
return -1;
else
close(fd);
- if(verbose > 2)
+ if( mp_msg_test(MSGT_VO,MSGL_DBG3) )
printf("vo_subdevice: initialization returns: %i\n",pre_init_err);
return pre_init_err;
}
diff --git a/libvo/vo_xvmc.c b/libvo/vo_xvmc.c
index c2f452b31a..555f689e61 100644
--- a/libvo/vo_xvmc.c
+++ b/libvo/vo_xvmc.c
@@ -46,8 +46,6 @@
#define UNUSED(x) ((void)(x))
-extern int vo_verbose;
-
static int benchmark;
static int use_sleep;
static int first_frame;//draw colorkey on first frame
@@ -270,21 +268,26 @@ XvMCSurfaceInfo * mc_surf_list;
rez = XvQueryAdaptors(mDisplay,DefaultRootWindow(mDisplay),&num_adaptors,&ai);
if( rez != Success ) return -1;
- if( verbose > 2 ) printf("vo_xvmc: Querying %d adaptors\n",num_adaptors);
+ if( mp_msg_test(MSGT_VO,MSGL_DBG3) ) {
+ printf("vo_xvmc: Querying %d adaptors\n",num_adaptors); }
for(i=0; i<num_adaptors; i++)
{
- if( verbose > 2) printf("vo_xvmc: Quering adaptor #%d\n",i);
+ if( mp_msg_test(MSGT_VO,MSGL_DBG3) ) {
+ printf("vo_xvmc: Quering adaptor #%d\n",i); }
if( ai[i].type == 0 ) continue;// we need at least dummy type!
//probing ports
for(p=ai[i].base_id; p<ai[i].base_id+ai[i].num_ports; p++)
{
- if( verbose > 2) printf("vo_xvmc: probing port #%ld\n",p);
+ if( mp_msg_test(MSGT_VO,MSGL_DBG3) ) {
+ printf("vo_xvmc: probing port #%ld\n",p); }
mc_surf_list = XvMCListSurfaceTypes(mDisplay,p,&mc_surf_num);
if( mc_surf_list == NULL || mc_surf_num == 0){
- if( verbose > 2) printf("vo_xvmc: No XvMC supported. \n");
+ if( mp_msg_test(MSGT_VO,MSGL_DBG3) ) {
+ printf("vo_xvmc: No XvMC supported. \n"); }
continue;
}
- if( verbose > 2) printf("vo_xvmc: XvMC list have %d surfaces\n",mc_surf_num);
+ if( mp_msg_test(MSGT_VO,MSGL_DBG3) ) {
+ printf("vo_xvmc: XvMC list have %d surfaces\n",mc_surf_num); }
//we have XvMC list!
for(s=0; s<mc_surf_num; s++)
{
@@ -301,7 +304,8 @@ XvMCSurfaceInfo * mc_surf_list;
if(!query){
rez = XvGrabPort(mDisplay,p,CurrentTime);
if(rez != Success){
- if (verbose > 2) printf("vo_xvmc: Fail to grab port %ld\n",p);
+ if ( mp_msg_test(MSGT_VO,MSGL_DBG3) ) {
+ printf("vo_xvmc: Fail to grab port %ld\n",p); }
continue;
}
printf("vo_xvmc: Port %ld grabed\n",p);
@@ -320,7 +324,7 @@ XvMCSurfaceInfo * mc_surf_list;
surface_found:
memcpy(surf_info,&mc_surf_list[s],sizeof(XvMCSurfaceInfo));
- if( verbose > 2 || !query)
+ if( mp_msg_test(MSGT_VO,MSGL_DBG3) || !query)
printf("vo_xvmc: Found matching surface with id=%X on %ld port at %d adapter\n",
mc_surf_list[s].surface_type_id,p,i);
return mc_surf_list[s].surface_type_id;
@@ -336,7 +340,7 @@ xvmc_render_state_t * rndr;
rndr = (xvmc_render_state_t*)mpi->priv;//there is copy in plane[2]
assert( rndr != NULL );
assert( rndr->magic == MP_XVMC_RENDER_MAGIC );
- if( verbose > 3 )
+ if( mp_msg_test(MSGT_VO,MSGL_DBG4) )
printf("vo_xvmc: draw_image(show rndr=%p)\n",rndr);
// the surface have passed vf system without been skiped, it will be displayed
rndr->state |= MP_XVMC_STATE_DISPLAY_PENDING;
@@ -500,7 +504,7 @@ static uint32_t vm_height;
surface_render[i].chroma_format = surface_info.chroma_format;
surface_render[i].unsigned_intra = (surface_info.flags & XVMC_INTRA_UNSIGNED) == XVMC_INTRA_UNSIGNED;
surface_render[i].p_surface = &surface_array[i];
- if( verbose > 3 )
+ if( mp_msg_test(MSGT_VO,MSGL_DBG4) )
printf("vo_xvmc: surface[%d] = %p .rndr=%p\n",i,&surface_array[i], &surface_render[i]);
}
number_of_surfaces = i;
@@ -532,7 +536,7 @@ static uint32_t vm_height;
surface_info.surface_type_id, &num_subpic);
if(num_subpic != 0 && xvfmv != NULL){
- if(verbose > 3){//Print All subpicture types for debug
+ if( mp_msg_test(MSGT_VO,MSGL_DBG4) ){//Print all subpicture types for debug
for(s=0;s<num_subpic;s++)
print_xvimage_format_values(&xvfmv[s]);
}
@@ -813,7 +817,7 @@ unsigned short osd_height, osd_width;
int rez;
if(subpicture_alloc){
- if(verbose>3)
+ if( mp_msg_test(MSGT_VO,MSGL_DBG4) )
printf("vo_xvmc: destroying subpicture\n");
XvMCDestroySubpicture(mDisplay,&subpicture);
deallocate_xvimage();
@@ -836,7 +840,7 @@ int rez;
if(osd_width == 0 || osd_height == 0)
return;//if called before window size is known
- if(verbose > 3)
+ if( mp_msg_test(MSGT_VO,MSGL_DBG4) )
printf("vo_xvmc: creating subpicture (%d,%d) format %X\n",
osd_width,osd_height,subpicture_info.id);
@@ -847,7 +851,7 @@ int rez;
printf("vo_xvmc: Create Subpicture failed, OSD disabled\n");
return;
}
- if(verbose > 3){
+ if( mp_msg_test(MSGT_VO,MSGL_DBG4) ){
int i;
printf("vo_xvmc: Created Subpicture:\n");
printf(" xvimage_id=0x%X\n",subpicture.xvimage_id);
@@ -865,7 +869,7 @@ int rez;
//call init for the surface type
init_osd_fnc();//init palete,clear color etc ...
- if(verbose > 3)
+ if( mp_msg_test(MSGT_VO,MSGL_DBG4) )
printf("vo_xvmc: clearing subpicture\n");
clear_osd_fnc(0, 0, subpicture.width, subpicture.height);
@@ -877,7 +881,7 @@ static void draw_osd_IA44(int x0,int y0, int w,int h, unsigned char* src, unsign
int ox,oy;
int rez;
- if(verbose > 3)
+ if( mp_msg_test(MSGT_VO,MSGL_DBG4) )
printf("vo_xvmc:composite AI44 subpicture (%d,%d - %d,%d)\n",x0,y0,w,h);
for(ox=0; ox<w; ox++){
@@ -896,7 +900,7 @@ int rez;
static void draw_osd_AI44(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride){
int ox,oy;
int rez;
- if( verbose > 3)
+ if( mp_msg_test(MSGT_VO,MSGL_DBG4) )
printf("vo_xvmc:composite AI44 subpicture (%d,%d - %d,%d)\n",x0,y0,w,h);
for(ox=0; ox<w; ox++){
@@ -918,7 +922,7 @@ int osd_has_changed;
int have_osd_to_draw;
int rez;
- if(verbose > 3)
+ if( mp_msg_test(MSGT_VO,MSGL_DBG4) )
printf("vo_xvmc: draw_osd ,OSD_mode=%d, surface_to_show=%p\n",
subpicture_mode,p_render_surface_to_show);
@@ -973,7 +977,7 @@ int rez;
p_render_surface_to_show = osd_rndr;
p_render_surface_to_show->state = MP_XVMC_STATE_DISPLAY_PENDING;
- if(verbose > 3)
+ if( mp_msg_test(MSGT_VO,MSGL_DBG4) )
printf("vo_xvmc:draw_osd: surface_to_show changed to %p\n",osd_rndr);
}//endof if(BLEND)
if(subpicture_mode == BACKEND_SUBPICTURE){
@@ -1042,7 +1046,7 @@ static void flip_page(void){
int i,cfs;
- if( verbose > 3 )
+ if( mp_msg_test(MSGT_VO,MSGL_DBG4) )
printf("vo_xvmc: flip_page show(rndr=%p)\n\n",p_render_surface_to_show);
if(p_render_surface_to_show == NULL) return;
@@ -1060,7 +1064,7 @@ int i,cfs;
return;
}
p_render_surface_to_show=show_queue[0];
- if(verbose > 4)
+ if( mp_msg_test(MSGT_VO,MSGL_DBG5) )
printf("vo_xvmc: flip_queue free_element=%d\n",free_element);
free_element--;
for(i=0; i<free_element; i++){
@@ -1128,7 +1132,7 @@ int i;
subpicture_alloc = 0;
- if(verbose > 3)
+ if( mp_msg_test(MSGT_VO,MSGL_DBG4) )
printf("vo_xvmc: subpicture destroyed\n");
}
@@ -1154,19 +1158,22 @@ int i;
XvMCDestroyContext(mDisplay,&ctx);
number_of_surfaces = 0;
- if(verbose > 3) printf("vo_xvmc: Context sucessfuly freed\n");
+ if( mp_msg_test(MSGT_VO,MSGL_DBG4) ) {
+ printf("vo_xvmc: Context sucessfuly freed\n"); }
}
if( xv_port !=0 ){
XvUngrabPort(mDisplay,xv_port,CurrentTime);
xv_port = 0;
- if(verbose > 3) printf("vo_xvmc: xv_port sucessfuly ungrabed\n");
+ if( mp_msg_test(MSGT_VO,MSGL_DBG4) ) {
+ printf("vo_xvmc: xv_port sucessfuly ungrabed\n"); }
}
}
static void uninit(void){
- if( verbose > 3 ) printf("vo_xvmc: uninit called\n");
+ if( mp_msg_test(MSGT_VO,MSGL_DBG4) ) {
+ printf("vo_xvmc: uninit called\n"); }
xvmc_free();
//from vo_xv
#ifdef HAVE_XF86VM
@@ -1180,7 +1187,7 @@ uint32_t flags;
XvMCSurfaceInfo qsurface_info;
int mode_id;
- if(verbose > 3)
+ if( mp_msg_test(MSGT_VO,MSGL_DBG4) )
printf("vo_xvmc: query_format=%X\n",format);
if(!IMGFMT_IS_XVMC(format)) return 0;// no caps supported
@@ -1204,7 +1211,7 @@ static int draw_slice(uint8_t *image[], int stride[],
xvmc_render_state_t * rndr;
int rez;
- if(verbose > 3)
+ if( mp_msg_test(MSGT_VO,MSGL_DBG4) )
printf("vo_xvmc: draw_slice y=%d\n",y);
rndr = (xvmc_render_state_t*)image[2];//this is copy of priv-ate
@@ -1246,7 +1253,7 @@ int rez;
}
#endif
assert(rez==Success);
- if(verbose > 3 ) printf("vo_xvmc: flush surface\n");
+ if( mp_msg_test(MSGT_VO,MSGL_DBG4) ) printf("vo_xvmc: flush surface\n");
rez = XvMCFlushSurface(mDisplay, rndr->p_surface);
assert(rez==Success);
@@ -1266,7 +1273,7 @@ xvmc_render_state_t * osd_rndr;
int stat;
//If this is source surface, check does the OSD rendering is compleate
if(src_rndr->state & MP_XVMC_STATE_OSD_SOURCE){
- if(verbose > 3)
+ if( mp_msg_test(MSGT_VO,MSGL_DBG4) )
printf("vo_xvmc: OSD surface=%p quering\n",src_rndr);
osd_rndr = src_rndr->p_osd_target_surface_render;
XvMCGetSurfaceStatus(mDisplay, osd_rndr->p_surface, &stat);
@@ -1354,7 +1361,7 @@ assert(rndr->next_free_data_block_num == 0);
rndr->filled_mv_blocks_num = 0;
rndr->next_free_data_block_num = 0;
- if( verbose > 3 )
+ if( mp_msg_test(MSGT_VO,MSGL_DBG4) )
printf("vo_xvmc: get_image: rndr=%p (surface=%p) \n",
rndr,rndr->p_surface);
return VO_TRUE;
diff --git a/libvo/vosub_vidix.c b/libvo/vosub_vidix.c
index 8cc45d2349..31dc21cd6c 100644
--- a/libvo/vosub_vidix.c
+++ b/libvo/vosub_vidix.c
@@ -24,6 +24,7 @@
#include <errno.h>
#include "config.h"
+#include "mp_msg.h"
#include "vosub_vidix.h"
#include "vidix/vidixlib.h"
@@ -41,7 +42,6 @@ static VDL_HANDLE vidix_handler = NULL;
static uint8_t *vidix_mem = NULL;
static uint8_t next_frame;
static unsigned image_Bpp,image_height,image_width,src_format,forced_fourcc=0;
-extern int verbose;
static int video_on=0;
static vidix_capability_t vidix_cap;
@@ -84,7 +84,8 @@ int vidix_stop(void)
void vidix_term( void )
{
- if(verbose > 1) printf("vosub_vidix: vidix_term() was called\n");
+ if( mp_msg_test(MSGT_VO,MSGL_DBG2) ) {
+ printf("vosub_vidix: vidix_term() was called\n"); }
vidix_stop();
vdlClose(vidix_handler);
// ((vo_functions_t *)vo_server)->control=server_control;
@@ -253,7 +254,8 @@ uint32_t vidix_draw_slice(uint8_t *image[], int stride[], int w,int h,int x,int
}
static uint32_t vidix_draw_image(mp_image_t *mpi){
- if(verbose > 1) printf("vosub_vidix: vidix_draw_image() was called\n");
+ if( mp_msg_test(MSGT_VO,MSGL_DBG2) ) {
+ printf("vosub_vidix: vidix_draw_image() was called\n"); }
// if -dr or -slices then do nothing:
if(mpi->flags&(MP_IMGFLAG_DIRECT|MP_IMGFLAG_DRAW_CALLBACK)) return VO_TRUE;
@@ -271,7 +273,8 @@ uint32_t vidix_draw_frame(uint8_t *image[])
void vidix_flip_page(void)
{
- if(verbose > 1) printf("vosub_vidix: vidix_flip_page() was called\n");
+ if( mp_msg_test(MSGT_VO,MSGL_DBG2) ) {
+ printf("vosub_vidix: vidix_flip_page() was called\n"); }
if(vo_doublebuffering)
{
vdlPlaybackFrameSelect(vidix_handler,next_frame);
@@ -331,14 +334,16 @@ static void draw_alpha(int x0,int y0, int w,int h, unsigned char* src, unsigned
void vidix_draw_osd(void)
{
- if(verbose > 1) printf("vosub_vidix: vidix_draw_osd() was called\n");
+ if( mp_msg_test(MSGT_VO,MSGL_DBG2) ) {
+ printf("vosub_vidix: vidix_draw_osd() was called\n"); }
/* TODO: hw support */
vo_draw_text(vidix_play.src.w,vidix_play.src.h,draw_alpha);
}
uint32_t vidix_query_fourcc(uint32_t format)
{
- if(verbose > 1) printf("vosub_vidix: query_format was called: %x (%s)\n",format,vo_format_name(format));
+ if( mp_msg_test(MSGT_VO,MSGL_DBG2) ) {
+ printf("vosub_vidix: query_format was called: %x (%s)\n",format,vo_format_name(format)); }
vidix_fourcc.fourcc = format;
vdlQueryFourcc(vidix_handler,&vidix_fourcc);
if (vidix_fourcc.depth == VID_DEPTH_NONE)
@@ -408,7 +413,7 @@ int vidix_init(unsigned src_width,unsigned src_height,
size_t i;
int err;
uint32_t sstride,apitch;
- if(verbose > 1)
+ if( mp_msg_test(MSGT_VO,MSGL_DBG2) )
printf("vosub_vidix: vidix_init() was called\n"
"src_w=%u src_h=%u dest_x_y_w_h = %u %u %u %u\n"
"format=%s dest_bpp=%u vid_w=%u vid_h=%u\n"
@@ -492,7 +497,8 @@ int vidix_init(unsigned src_width,unsigned src_height,
printf("vosub_vidix: Can't configure playback: %s\n",strerror(err));
return -1;
}
- if (verbose) printf("vosub_vidix: using %d buffer(s)\n", vidix_play.num_frames);
+ if ( mp_msg_test(MSGT_VO,MSGL_V) ) {
+ printf("vosub_vidix: using %d buffer(s)\n", vidix_play.num_frames); }
vidix_mem = vidix_play.dga_addr;
@@ -702,7 +708,8 @@ uint32_t vidix_control(uint32_t request, void *data, ...)
int vidix_preinit(const char *drvname,void *server)
{
int err;
- if(verbose > 1) printf("vosub_vidix: vidix_preinit(%s) was called\n",drvname);
+ if( mp_msg_test(MSGT_VO,MSGL_DBG2) ) {
+ printf("vosub_vidix: vidix_preinit(%s) was called\n",drvname); }
if(vdlGetVersion() != VIDIX_VERSION)
{
printf("vosub_vidix: You have wrong version of VIDIX library\n");
diff --git a/loader/win32.c b/loader/win32.c
index b800b5b454..e756d1e4bc 100644
--- a/loader/win32.c
+++ b/loader/win32.c
@@ -214,7 +214,7 @@ static inline void dbgprintf(char* fmt, ...)
}
#endif
#ifdef MPLAYER
- if (verbose > 2)
+ if ( mp_msg_test(MSGT_WIN32,MSGL_DBG3) )
{
va_list va;
diff --git a/mencoder.c b/mencoder.c
index a2eff6be11..8bb49dfeba 100644
--- a/mencoder.c
+++ b/mencoder.c
@@ -964,7 +964,7 @@ case ACODEC_COPY:
break;
}
-if (verbose>1) print_wave_header(mux_a->wf);
+if ( mp_msg_test(MSGT_MENCODER,MSGL_DBG2) ) print_wave_header(mux_a->wf);
if (! ignore_start)
muxer->audio_delay_fix += sh_audio->stream_delay;
@@ -1447,7 +1447,7 @@ if(sh_audio && !demuxer2){
(int)demuxer->movi_end);
#else
if(!quiet) {
- if(verbose>0) {
+ if( mp_msg_test(MSGT_AVSYNC,MSGL_V) ) {
mp_msg(MSGT_AVSYNC,MSGL_STATUS,"Pos:%6.1fs %6df (%2d%%) %3dfps Trem:%4dmin %3dmb A-V:%5.3f [%d:%d] A/Vms %d/%d D/B/S %d/%d/%d \r",
mux_v->timer, decoded_frameno, (int)(p*100),
(t>1) ? (int)(decoded_frameno/t+0.5) : 0,
diff --git a/mplayer.c b/mplayer.c
index f378553eeb..fda6bd9d48 100644
--- a/mplayer.c
+++ b/mplayer.c
@@ -2110,7 +2110,7 @@ if(!codecs_file || !parse_codec_cfg(codecs_file)){
}
// Many users forget to include command line in bugreports...
- if(verbose>0){
+ if( mp_msg_test(MSGT_CPLAYER,MSGL_V) ){
mp_msg(MSGT_CPLAYER, MSGL_INFO, MSGTR_CommandLine);
for(i=1;i<argc;i++)mp_msg(MSGT_CPLAYER, MSGL_INFO," '%s'",argv[i]);
mp_msg(MSGT_CPLAYER, MSGL_INFO, "\n");
@@ -3358,7 +3358,7 @@ if(!sh_video) {
}
-// if(verbose>1)printf("sleep: %5.3f a:%6.3f v:%6.3f \n",time_frame,sh_audio->timer,sh_video->timer);
+// if(mp_msg_test(MSGT_CPLAYER,MSGL_DBG2)printf("sleep: %5.3f a:%6.3f v:%6.3f \n",time_frame,sh_audio->timer,sh_video->timer);
aq_sleep_time+=time_frame;
@@ -4592,7 +4592,7 @@ if(rel_seek_secs || abs_seek_pos){
if(sh_audio){
if(d_audio->packs == 0)
ds_fill_buffer(d_audio);
- if(verbose>0){
+ if( mp_msg_test(MSGT_AVSYNC,MSGL_V) ){
float a_pts=d_audio->pts;
a_pts+=(ds_tell_pts(d_audio)-sh_audio->a_in_buffer_len)/(float)sh_audio->i_bps;
mp_msg(MSGT_AVSYNC,MSGL_V,"SEEK: A: %5.3f V: %5.3f A-V: %5.3f \n",a_pts,d_video->pts,a_pts-d_video->pts);