[Mplayerxp-cvslog] SF.net SVN: mplayerxp:[212] mplayerxp
Brought to you by:
olov
From: <nic...@us...> - 2012-10-26 07:04:32
|
Revision: 212 http://mplayerxp.svn.sourceforge.net/mplayerxp/?rev=212&view=rev Author: nickols_k Date: 2012-10-26 07:04:22 +0000 (Fri, 26 Oct 2012) Log Message: ----------- remove unused element Modified Paths: -------------- mplayerxp/libmpcodecs/dec_video.c mplayerxp/libmpdemux/demux_avi.c mplayerxp/libmpdemux/demux_lavf.c mplayerxp/libmpdemux/demux_mpg.c mplayerxp/libmpdemux/demux_mpxp64.c mplayerxp/libmpdemux/demux_pva.c mplayerxp/libmpdemux/demux_rawvideo.c mplayerxp/libmpdemux/demux_real.c mplayerxp/libmpdemux/demux_ts.c mplayerxp/libmpdemux/demux_ty.c mplayerxp/libmpdemux/stheader.h mplayerxp/libmpdemux/video.c Modified: mplayerxp/libmpcodecs/dec_video.c =================================================================== --- mplayerxp/libmpcodecs/dec_video.c 2012-10-26 06:43:08 UTC (rev 211) +++ mplayerxp/libmpcodecs/dec_video.c 2012-10-26 07:04:22 UTC (rev 212) @@ -152,7 +152,7 @@ case IMGFMT_BGR32: bpp = 32; break; } o_bps=sh_video->fps*sh_video->disp_w*sh_video->disp_h*bpp/8; - MSG_OK("[VC] %s decoder: [%s] drv:%s.%s (%dx%d (aspect %g) %4.2ffps ratio %i->%i\n" + MSG_OK("[VC] %s decoder: [%s] drv:%s.%s (%dx%d (aspect %g) %4.2ffps\n" ,video_codec?"Forcing":"Selected" ,sh_video->codec->codec_name ,mpvdec->info->driver_name @@ -160,9 +160,7 @@ ,sh_video->disp_w ,sh_video->disp_h ,sh_video->aspect - ,sh_video->fps - ,sh_video->i_bps - ,o_bps); + ,sh_video->fps); // Yeah! We got it! sh_video->inited=1; sh_video->vf_flags=vf_query_flags(sh_video->vfilter); Modified: mplayerxp/libmpdemux/demux_avi.c =================================================================== --- mplayerxp/libmpdemux/demux_avi.c 2012-10-26 06:43:08 UTC (rev 211) +++ mplayerxp/libmpdemux/demux_avi.c 2012-10-26 07:04:22 UTC (rev 212) @@ -1271,7 +1271,6 @@ } if(!priv->numberofframes) priv->numberofframes=vsamples; MSG_V("AVI video size=%lu (%lu) audio size=%lu (%lu)\n",vsize,priv->numberofframes,asize,asamples); - sh_video->i_bps=((float)vsize/(float)vsamples)*(float)sh_video->video.dwRate/(float)sh_video->video.dwScale; if(sh_audio) sh_audio->i_bps=((float)asize/(float)asamples)*(float)sh_audio->audio.dwRate/(float)sh_audio->audio.dwScale; } else { // guessing, results may be inaccurate: @@ -1298,16 +1297,13 @@ } vsize=demuxer->movi_end-demuxer->movi_start-asize-8*priv->numberofframes; MSG_V("AVI video size=%lu (%lu) audio size=%lu\n",vsize,priv->numberofframes,asize); - sh_video->i_bps=(float)vsize*sh_video->fps/priv->numberofframes; } - MSG_V("VIDEO: [%.4s] %ldx%ld %dbpp %4.2f fps %5.1f kbps (%4.1f kbyte/s)\n", + MSG_V("VIDEO: [%.4s] %ldx%ld %dbpp %4.2f fps\n", (char *)&sh_video->bih->biCompression, sh_video->bih->biWidth, sh_video->bih->biHeight, sh_video->bih->biBitCount, - sh_video->fps, - sh_video->i_bps*0.008f, - sh_video->i_bps/1024.0f ); + sh_video->fps); { sh_audio_t* sh_a; sh_a = (sh_audio_t*)demuxer->audio->sh; Modified: mplayerxp/libmpdemux/demux_lavf.c =================================================================== --- mplayerxp/libmpdemux/demux_lavf.c 2012-10-26 06:43:08 UTC (rev 211) +++ mplayerxp/libmpdemux/demux_lavf.c 2012-10-26 07:04:22 UTC (rev 212) @@ -367,8 +367,7 @@ sh_video->format = bih->biCompression; sh_video->aspect= codec->width * codec->sample_aspect_ratio.num / (float)(codec->height * codec->sample_aspect_ratio.den); - sh_video->i_bps= codec->bit_rate/8; - MSG_DBG2("aspect= %d*%d/(%d*%d)\n", + MSG_DBG2("aspect= %d*%d/(%d*%d)\n", codec->width, codec->sample_aspect_ratio.num, codec->height, codec->sample_aspect_ratio.den); Modified: mplayerxp/libmpdemux/demux_mpg.c =================================================================== --- mplayerxp/libmpdemux/demux_mpg.c 2012-10-26 06:43:08 UTC (rev 211) +++ mplayerxp/libmpdemux/demux_mpg.c 2012-10-26 07:04:22 UTC (rev 212) @@ -546,13 +546,10 @@ newpos+=(demuxer->movi_end-demuxer->movi_start)*seeka->secs; } else { // time seek (secs) - if(!sh_video->i_bps) // unspecified or VBR - newpos+=2324*75*seeka->secs; // 174.3 kbyte/sec - else - newpos+=sh_video->i_bps*seeka->secs; + newpos+=2324*75*seeka->secs; // 174.3 kbyte/sec } - if(newpos<demuxer->movi_start){ + if(newpos<demuxer->movi_start){ if(!(demuxer->stream->type&STREAMTYPE_PROGRAM)) demuxer->movi_start=0; // for VCD if(newpos<demuxer->movi_start) newpos=demuxer->movi_start; } Modified: mplayerxp/libmpdemux/demux_mpxp64.c =================================================================== --- mplayerxp/libmpdemux/demux_mpxp64.c 2012-10-26 06:43:08 UTC (rev 211) +++ mplayerxp/libmpdemux/demux_mpxp64.c 2012-10-26 07:04:22 UTC (rev 212) @@ -228,7 +228,6 @@ sh->format=sh->bih->biCompression; sh->disp_w=sh->bih->biWidth; sh->disp_h=sh->bih->biHeight; - sh->i_bps=priv->sprop[id].AveBitrate; MSG_V("FPS: %f\n",sh->fps); break; case mmioFOURCC('v','p','r','p'): Modified: mplayerxp/libmpdemux/demux_pva.c =================================================================== --- mplayerxp/libmpdemux/demux_pva.c 2012-10-26 06:43:08 UTC (rev 211) +++ mplayerxp/libmpdemux/demux_pva.c 2012-10-26 07:04:22 UTC (rev 212) @@ -476,9 +476,9 @@ int total_bitrate=0; off_t dest_offset; pva_priv_t * priv=demuxer->priv; - - total_bitrate=((sh_audio_t *)demuxer->audio->sh)->i_bps + ((sh_video_t *)demuxer->video->sh)->i_bps; + total_bitrate=((sh_audio_t *)demuxer->audio->sh)->i_bps;// + ((sh_video_t *)demuxer->video->sh)->i_bps; + /* * Compute SOF offset inside the stream. Approximate total bitrate with sum of bitrates * reported by the audio and video codecs. The seek is not accurate because, just like Modified: mplayerxp/libmpdemux/demux_rawvideo.c =================================================================== --- mplayerxp/libmpdemux/demux_rawvideo.c 2012-10-26 06:43:08 UTC (rev 211) +++ mplayerxp/libmpdemux/demux_rawvideo.c 2012-10-26 07:04:22 UTC (rev 212) @@ -14,37 +14,40 @@ #include "libvo/img_format.h" #include "demux_msg.h" -int use_rawvideo = 0; -static int format = IMGFMT_I420; -static int size_id = 0; -static int width = 0; -static int height = 0; -static float fps = 25; -static int imgsize=0; +typedef struct priv_s { + int use_rawvideo; + int format; + int size_id; + int width; + int height; + float fps; + int imgsize; +}priv_t; +static priv_t priv; static const config_t demux_rawvideo_opts[] = { - { "on", &use_rawvideo, CONF_TYPE_FLAG, 0,0, 1, NULL, "forces treating stream as raw-vidio" }, + { "on", &priv.use_rawvideo, CONF_TYPE_FLAG, 0,0, 1, NULL, "forces treating stream as raw-vidio" }, // size: - { "w", &width, CONF_TYPE_INT,CONF_RANGE,1,8192, NULL, "specifies image width of raw-video stream" }, - { "h", &height, CONF_TYPE_INT,CONF_RANGE,1,8192, NULL, "specifies image height of raw-video stream" }, - { "sqcif", &size_id, CONF_TYPE_FLAG,0,0,1, NULL, "sets image size to SQCIF standard" }, - { "qcif", &size_id, CONF_TYPE_FLAG,0,0,2, NULL, "sets image size to QCIF standard" }, - { "cif", &size_id, CONF_TYPE_FLAG,0,0,3, NULL, "sets image size to CIF standard" }, - { "4cif", &size_id, CONF_TYPE_FLAG,0,0,4, NULL, "sets image size to 4CIF standard" }, - { "pal", &size_id, CONF_TYPE_FLAG,0,0,5, NULL, "sets image size to PAL standard" }, - { "ntsc", &size_id, CONF_TYPE_FLAG,0,0,6, NULL, "sets image size to NTSC standard" }, - { "16cif", &size_id, CONF_TYPE_FLAG,0,0,7, NULL, "sets image size to 16CIF standard" }, - { "sif", &size_id, CONF_TYPE_FLAG,0,0,8, NULL, "sets image size to SIF standard" }, + { "w", &priv.width, CONF_TYPE_INT,CONF_RANGE,1,8192, NULL, "specifies image width of raw-video stream" }, + { "h", &priv.height, CONF_TYPE_INT,CONF_RANGE,1,8192, NULL, "specifies image height of raw-video stream" }, + { "sqcif", &priv.size_id, CONF_TYPE_FLAG,0,0,1, NULL, "sets image size to SQCIF standard" }, + { "qcif", &priv.size_id, CONF_TYPE_FLAG,0,0,2, NULL, "sets image size to QCIF standard" }, + { "cif", &priv.size_id, CONF_TYPE_FLAG,0,0,3, NULL, "sets image size to CIF standard" }, + { "4cif", &priv.size_id, CONF_TYPE_FLAG,0,0,4, NULL, "sets image size to 4CIF standard" }, + { "pal", &priv.size_id, CONF_TYPE_FLAG,0,0,5, NULL, "sets image size to PAL standard" }, + { "ntsc", &priv.size_id, CONF_TYPE_FLAG,0,0,6, NULL, "sets image size to NTSC standard" }, + { "16cif", &priv.size_id, CONF_TYPE_FLAG,0,0,7, NULL, "sets image size to 16CIF standard" }, + { "sif", &priv.size_id, CONF_TYPE_FLAG,0,0,8, NULL, "sets image size to SIF standard" }, // format: - { "format", &format, CONF_TYPE_INT, 0, 0 , 0, NULL, "specifies colorspace (fourcc) in hex or string constant" }, - { "i420", &format, CONF_TYPE_FLAG, 0, 0 , IMGFMT_I420, NULL, "treats raw-video as I420 fourcc" }, - { "yv12", &format, CONF_TYPE_FLAG, 0, 0 , IMGFMT_YV12, NULL, "treats raw-video as YV12 fourcc" }, - { "yuy2", &format, CONF_TYPE_FLAG, 0, 0 , IMGFMT_YUY2, NULL, "treats raw-video as YUY2 fourcc" }, - { "uyvy", &format, CONF_TYPE_FLAG, 0, 0 , IMGFMT_UYVY, NULL, "treats raw-video as UYVY fourcc" }, - { "y8", &format, CONF_TYPE_FLAG, 0, 0 , IMGFMT_Y8, NULL, "treats raw-video as Y8 fourcc" }, + { "format", &priv.format, CONF_TYPE_INT, 0, 0 , 0, NULL, "specifies colorspace (fourcc) in hex or string constant" }, + { "i420", &priv.format, CONF_TYPE_FLAG, 0, 0 , IMGFMT_I420, NULL, "treats raw-video as I420 fourcc" }, + { "yv12", &priv.format, CONF_TYPE_FLAG, 0, 0 , IMGFMT_YV12, NULL, "treats raw-video as YV12 fourcc" }, + { "yuy2", &priv.format, CONF_TYPE_FLAG, 0, 0 , IMGFMT_YUY2, NULL, "treats raw-video as YUY2 fourcc" }, + { "uyvy", &priv.format, CONF_TYPE_FLAG, 0, 0 , IMGFMT_UYVY, NULL, "treats raw-video as UYVY fourcc" }, + { "y8", &priv.format, CONF_TYPE_FLAG, 0, 0 , IMGFMT_Y8, NULL, "treats raw-video as Y8 fourcc" }, // misc: - { "fps", &fps, CONF_TYPE_FLOAT,CONF_RANGE,0.001,1000, NULL, "specifies rate in frames per second of raw-video stream" }, - { "size", &imgsize, CONF_TYPE_INT, CONF_RANGE, 1 , 8192*8192*4, NULL, "specifies frame size in bytes" }, + { "fps", &priv.fps, CONF_TYPE_FLOAT,CONF_RANGE,0.001,1000, NULL, "specifies rate in frames per second of raw-video stream" }, + { "size", &priv.imgsize, CONF_TYPE_INT, CONF_RANGE, 1 , 8192*8192*4, NULL, "specifies frame size in bytes" }, {NULL, NULL, 0, 0, 0, 0, NULL, NULL} }; @@ -55,8 +58,8 @@ static int rawvideo_probe(demuxer_t* demuxer) { - if(demuxer->stream->type & STREAMTYPE_RAWVIDEO || use_rawvideo) - { + if(demuxer->stream->type & STREAMTYPE_RAWVIDEO || priv.use_rawvideo) { + priv.fps=25; demuxer->file_format=DEMUXER_TYPE_RAWVIDEO; return 1; } @@ -67,49 +70,48 @@ static demuxer_t* rawvideo_open(demuxer_t* demuxer) { sh_video_t* sh_video; - switch(size_id){ - case 1: width=128; height=96; break; - case 2: width=176; height=144; break; - case 3: width=352; height=288; break; - case 4: width=704; height=576; break; - case 5: width=720; height=576; break; - case 6: width=720; height=480; break; - case 7: width=1408;height=1152;break; - case 8: width=352; height=240; break; + switch(priv.size_id){ + case 1: priv.width=128; priv.height=96; break; + case 2: priv.width=176; priv.height=144; break; + case 3: priv.width=352; priv.height=288; break; + case 4: priv.width=704; priv.height=576; break; + case 5: priv.width=720; priv.height=576; break; + case 6: priv.width=720; priv.height=480; break; + case 7: priv.width=1408;priv.height=1152;break; + case 8: priv.width=352; priv.height=240; break; } - demuxer->stream->driver->control(demuxer->stream,SCTRL_VID_GET_WIDTH,&width); - demuxer->stream->driver->control(demuxer->stream,SCTRL_VID_GET_HEIGHT,&height); - demuxer->stream->driver->control(demuxer->stream,SCTRL_VID_GET_FORMAT,&format); - demuxer->stream->driver->control(demuxer->stream,SCTRL_VID_GET_FPS,&fps); + demuxer->stream->driver->control(demuxer->stream,SCTRL_VID_GET_WIDTH,&priv.width); + demuxer->stream->driver->control(demuxer->stream,SCTRL_VID_GET_HEIGHT,&priv.height); + demuxer->stream->driver->control(demuxer->stream,SCTRL_VID_GET_FORMAT,&priv.format); + demuxer->stream->driver->control(demuxer->stream,SCTRL_VID_GET_FPS,&priv.fps); - if(!width || !height){ + if(!priv.width || !priv.height){ MSG_ERR("rawvideo: width or height not specified!\n"); return NULL; } - if(!imgsize) - switch(format){ - case IMGFMT_I420: - case IMGFMT_IYUV: - case IMGFMT_YV12: imgsize=width*height+2*(width>>1)*(height>>1);break; - case IMGFMT_YUY2: imgsize=width*height*2;break; - case IMGFMT_UYVY: imgsize=width*height*2;break; - case IMGFMT_Y8: imgsize=width*height;break; - default: + if(!priv.imgsize) + switch(priv.format){ + case IMGFMT_I420: + case IMGFMT_IYUV: + case IMGFMT_YV12: priv.imgsize=priv.width*priv.height+2*(priv.width>>1)*(priv.height>>1);break; + case IMGFMT_YUY2: priv.imgsize=priv.width*priv.height*2;break; + case IMGFMT_UYVY: priv.imgsize=priv.width*priv.height*2;break; + case IMGFMT_Y8: priv.imgsize=priv.width*priv.height;break; + default: MSG_ERR("rawvideo: img size not specified and unknown format!\n"); return NULL; } sh_video = new_sh_video(demuxer,0); - sh_video->format=format; - sh_video->fps=fps; - sh_video->disp_w=width; - sh_video->disp_h=height; - sh_video->i_bps=fps*imgsize; + sh_video->format=priv.format; + sh_video->fps=priv.fps; + sh_video->disp_w=priv.width; + sh_video->disp_h=priv.height; demuxer->movi_start = demuxer->stream->start_pos; demuxer->movi_end = demuxer->stream->end_pos; - demuxer->movi_length = (demuxer->movi_end-demuxer->movi_start)/sh_video->i_bps; + demuxer->movi_length = (demuxer->movi_end-demuxer->movi_start)/(priv.fps*priv.imgsize); demuxer->video->sh = sh_video; sh_video->ds = demuxer->video; @@ -122,7 +124,7 @@ if(stream_eof(demuxer->stream)) return 0; if(ds!=demuxer->video) return 0; - ds_read_packet(ds,demuxer->stream,imgsize,0,stream_tell(demuxer->stream),DP_KEYFRAME); + ds_read_packet(ds,demuxer->stream,priv.imgsize,0,stream_tell(demuxer->stream),DP_KEYFRAME); return 1; } @@ -133,14 +135,14 @@ off_t pos; pos =(seeka->flags & DEMUX_SEEK_SET)?demuxer->movi_start:stream_tell(s); - pos+=(seeka->flags&DEMUX_SEEK_PERCENTS?demuxer->movi_end-demuxer->movi_start:sh_video->i_bps)*seeka->secs; - pos/=imgsize; - stream_seek(s,pos*imgsize); + pos+=(seeka->flags&DEMUX_SEEK_PERCENTS?demuxer->movi_end-demuxer->movi_start:(priv.fps*priv.imgsize))*seeka->secs; + pos/=priv.imgsize; + stream_seek(s,pos*priv.imgsize); sh_video->timer=pos / sh_video->fps; // printf("demux_rawvideo: streamtell=%d\n",(int)stream_tell(demuxer->stream)); } -static void rawvideo_close(demuxer_t *demuxer) {} +static void rawvideo_close(demuxer_t *demuxer) { } static int rawvideo_control(demuxer_t *demuxer,int cmd,any_t*args) { Modified: mplayerxp/libmpdemux/demux_real.c =================================================================== --- mplayerxp/libmpdemux/demux_real.c 2012-10-26 06:43:08 UTC (rev 211) +++ mplayerxp/libmpdemux/demux_real.c 2012-10-26 07:04:22 UTC (rev 212) @@ -1240,11 +1240,11 @@ sh->fps=tmp; } } else { - int fps=stream_read_word(demuxer->stream); + int fps=stream_read_word(demuxer->stream); MSG_WARN("realvid: ignoring FPS = %d\n",fps); } stream_skip(demuxer->stream, 2); - + // read codec sub-format (to make difference between low and high rate codec) ((unsigned int*)(sh->bih+1))[0]=stream_read_dword(demuxer->stream); Modified: mplayerxp/libmpdemux/demux_ts.c =================================================================== --- mplayerxp/libmpdemux/demux_ts.c 2012-10-26 06:43:08 UTC (rev 211) +++ mplayerxp/libmpdemux/demux_ts.c 2012-10-26 07:04:22 UTC (rev 212) @@ -3085,20 +3085,15 @@ video_stats = (sh_video != NULL); - if(video_stats) - { - MSG_V("IBPS: %d, vb: %d\r\n", sh_video->i_bps, priv->vbitrate); - if(priv->vbitrate) - video_stats = priv->vbitrate; - else - video_stats = sh_video->i_bps; + if(video_stats) { + if(priv->vbitrate) video_stats = priv->vbitrate; + else video_stats = 2324*75; } newpos = (seeka->flags & DEMUX_SEEK_SET) ? demuxer->movi_start : demuxer->filepos; if(seeka->flags & DEMUX_SEEK_PERCENTS) // float seek 0..1 newpos+=(demuxer->movi_end-demuxer->movi_start)*seeka->secs; - else - { + else { // time seek (secs) if(! video_stats) // unspecified or VBR newpos += 2324*75*seeka->secs; // 174.3 kbyte/sec Modified: mplayerxp/libmpdemux/demux_ty.c =================================================================== --- mplayerxp/libmpdemux/demux_ty.c 2012-10-26 06:43:08 UTC (rev 211) +++ mplayerxp/libmpdemux/demux_ty.c 2012-10-26 07:04:22 UTC (rev 212) @@ -768,13 +768,9 @@ if( seeka->flags & 2 ) // float seek 0..1 newpos += ( demuxer->movi_end - demuxer->movi_start ) * seeka->secs; - else - { - // time seek (secs) - if( ! sh_video->i_bps ) // unspecified or VBR - newpos += 2324 * 75 * seeka->secs; // 174.3 kbyte/sec - else - newpos += sh_video->i_bps * seeka->secs; + else { + // time seek (secs) + newpos += 2324 * 75 * seeka->secs; // 174.3 kbyte/sec } if ( newpos < demuxer->movi_start ) newpos = demuxer->movi_start; @@ -829,12 +825,7 @@ switch(cmd) { case DEMUX_CMD_GET_TIME_LENGTH: - if(!sh_video->i_bps) // unspecified or VBR return DEMUXER_CTRL_DONTKNOW; - *(double *)arg= - (double)demuxer->movi_end-demuxer->movi_start/sh_video->i_bps; - return DEMUX_OK; - case DEMUX_CMD_GET_PERCENT_POS: return DEMUX_UNKNOWN; default: Modified: mplayerxp/libmpdemux/stheader.h =================================================================== --- mplayerxp/libmpdemux/stheader.h 2012-10-26 06:43:08 UTC (rev 211) +++ mplayerxp/libmpdemux/stheader.h 2012-10-26 07:04:22 UTC (rev 212) @@ -67,7 +67,6 @@ float timer; // value of old v_frame float fps; int chapter_change; - unsigned i_bps; // == bitrate (compressed bytes/sec) unsigned disp_w,disp_h;// display size (filled by fileformat parser) // int coded_w,coded_h; // coded size (filled by video codec) float aspect; Modified: mplayerxp/libmpdemux/video.c =================================================================== --- mplayerxp/libmpdemux/video.c 2012-10-26 06:43:08 UTC (rev 211) +++ mplayerxp/libmpdemux/video.c 2012-10-26 07:04:22 UTC (rev 212) @@ -359,9 +359,6 @@ #endif sh_video->disp_w=picture.display_picture_width; sh_video->disp_h=picture.display_picture_height; - // bitrate: - if(picture.bitrate!=0x3FFFF) // unspecified/VBR ? - sh_video->i_bps=1000*picture.bitrate/16; // info: MSG_DBG2("mpeg bitrate: %d (%X)\n",picture.bitrate,picture.bitrate); MSG_V("VIDEO: %s %dx%d (aspect %d) %4.2f fps %5.1f kbps (%4.1f kbyte/s)\n", This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |