[Mplayerxp-cvslog] SF.net SVN: mplayerxp:[491] mplayerxp
Brought to you by:
olov
From: <nic...@us...> - 2012-11-30 11:24:53
|
Revision: 491 http://mplayerxp.svn.sourceforge.net/mplayerxp/?rev=491&view=rev Author: nickols_k Date: 2012-11-30 11:24:40 +0000 (Fri, 30 Nov 2012) Log Message: ----------- next stage of full redesign of project: move audio->decoder_t from sh_video Modified Paths: -------------- mplayerxp/libmpcodecs/dec_video.cpp mplayerxp/libmpcodecs/vd.h mplayerxp/libmpcodecs/vd_divx4.cpp mplayerxp/libmpcodecs/vd_dmo.cpp mplayerxp/libmpcodecs/vd_dshow.cpp mplayerxp/libmpcodecs/vd_huffyuv.cpp mplayerxp/libmpcodecs/vd_internal.h mplayerxp/libmpcodecs/vd_lavc.cpp mplayerxp/libmpcodecs/vd_libdv.cpp mplayerxp/libmpcodecs/vd_libmpeg2.cpp mplayerxp/libmpcodecs/vd_mpegpes.cpp mplayerxp/libmpcodecs/vd_null.cpp mplayerxp/libmpcodecs/vd_nuv.cpp mplayerxp/libmpcodecs/vd_qtvideo.cpp mplayerxp/libmpcodecs/vd_raw.cpp mplayerxp/libmpcodecs/vd_real.cpp mplayerxp/libmpcodecs/vd_theora.cpp mplayerxp/libmpcodecs/vd_vfw.cpp mplayerxp/libmpcodecs/vd_xanim.cpp mplayerxp/libmpcodecs/vd_xvid.cpp mplayerxp/libmpdemux/stheader.h mplayerxp/mplayerxp.cpp mplayerxp/mplayerxp.h mplayerxp/xmpcore/xmp_vdecoder.cpp Modified: mplayerxp/libmpcodecs/dec_video.cpp =================================================================== --- mplayerxp/libmpcodecs/dec_video.cpp 2012-11-30 08:43:33 UTC (rev 490) +++ mplayerxp/libmpcodecs/dec_video.cpp 2012-11-30 11:24:40 UTC (rev 491) @@ -48,6 +48,7 @@ typedef struct priv_s { sh_video_t* parent; const vd_functions_t* mpvdec; + any_t* libinput; }priv_t; MPXP_Rc mpcv_get_quality_max(any_t *opaque,unsigned *quality){ @@ -128,11 +129,11 @@ any_t * mpcv_lavc_init(sh_video_t* sh_video,any_t* libinput) { priv_t* priv = new(zeromem) priv_t; priv->parent=sh_video; - sh_video->decoder=priv; + priv->libinput=libinput; /* Use lavc's drivers as last hope */ priv->mpvdec=vfm_find_driver("lavc"); if(priv->mpvdec) { - if(priv->mpvdec->init(sh_video,libinput)!=MPXP_Ok){ + if(priv->mpvdec->init(sh_video,priv)!=MPXP_Ok){ MSG_ERR(MSGTR_CODEC_CANT_INITV); return NULL; } @@ -150,7 +151,7 @@ sh_video->codec=NULL; priv_t* priv = new(zeromem) priv_t; priv->parent=sh_video; - sh_video->decoder=priv; + priv->libinput=libinput; if(vfm) { priv->mpvdec=vfm_find_driver(vfm); if(priv->mpvdec) vprobe=priv->mpvdec->probe(sh_video,sh_video->fourcc); @@ -167,7 +168,7 @@ priv->mpvdec=vfm_find_driver(vfm); } if(priv->mpvdec) { - if(priv->mpvdec->init(sh_video,libinput)!=MPXP_Ok){ + if(priv->mpvdec->init(sh_video,priv)!=MPXP_Ok){ MSG_ERR(MSGTR_CODEC_CANT_INITV); delete sh_video->codec; sh_video->codec=NULL; @@ -202,7 +203,7 @@ if(!(priv->mpvdec=vfm_find_driver(sh_video->codec->driver_name))) continue; else MSG_DBG3("mpcv_init: mpcodecs_vd_drivers[%s]->mpvdec==0\n",priv->mpvdec->info->driver_name); // it's available, let's try to init! - if(priv->mpvdec->init(sh_video,libinput)!=MPXP_Ok){ + if(priv->mpvdec->init(sh_video,priv)!=MPXP_Ok){ MSG_ERR(MSGTR_CODEC_CANT_INITV); continue; // try next... } @@ -401,12 +402,13 @@ #include "libvo/video_out.h" -MPXP_Rc mpcodecs_config_vf(sh_video_t *sh, int w, int h, any_t* libinput){ - priv_t* priv=(priv_t*)sh->decoder; +MPXP_Rc mpcodecs_config_vf(any_t *opaque, int w, int h){ + priv_t* priv=reinterpret_cast<priv_t*>(opaque); int i,j; unsigned int out_fmt=0; int screen_size_x=0;//SCREEN_SIZE_X; int screen_size_y=0;//SCREEN_SIZE_Y; + sh_video_t* sh = priv->parent; vf_instance_t* vf=sh->vfilter,*sc=NULL; int palette=0; @@ -461,13 +463,13 @@ MSG_WARN("'%s' ",vo_format_name(sh->codec->outfmt[ind])); } MSG_WARN("Trying -vf fmtcvt\n"); - sc=vf=vf_open_filter(vf,sh,"fmtcvt",NULL,libinput); + sc=vf=vf_open_filter(vf,sh,"fmtcvt",NULL,priv->libinput); goto csp_again; } else if(palette==1){ MSG_V("vd: Trying -vf palette...\n"); palette=-1; - vf=vf_open_filter(vf,sh,"palette",NULL,libinput); + vf=vf_open_filter(vf,sh,"palette",NULL,priv->libinput); goto csp_again; } else { // sws failed, if the last filter (vf_vo) support MPEGPES try to append vf_lavc @@ -501,7 +503,7 @@ if(vo_data->flags&VFCAP_FLIPPED) vo_data->FLIP_REVERT(); if(vo_data->FLIP() && !(vo_data->flags&VFCAP_FLIP)){ // we need to flip, but no flipping filter avail. - sh->vfilter=vf=vf_open_filter(vf,sh,"flip",NULL,libinput); + sh->vfilter=vf=vf_open_filter(vf,sh,"flip",NULL,priv->libinput); } // time to do aspect ratio corrections... Modified: mplayerxp/libmpcodecs/vd.h =================================================================== --- mplayerxp/libmpcodecs/vd.h 2012-11-30 08:43:33 UTC (rev 490) +++ mplayerxp/libmpcodecs/vd.h 2012-11-30 11:24:40 UTC (rev 491) @@ -53,7 +53,7 @@ const vd_info_t* info; const config_t* options;/**< Optional: MPlayerXP's option related */ const video_probe_t*(*__FASTCALL__ probe)(sh_video_t *sh,uint32_t fourcc); - MPXP_Rc (*__FASTCALL__ init)(sh_video_t *sh,any_t* libinput); + MPXP_Rc (*__FASTCALL__ init)(sh_video_t *sh,any_t*opaque); void (*__FASTCALL__ uninit)(sh_video_t *sh); MPXP_Rc (*control_vd)(sh_video_t *sh,int cmd,any_t* arg, ...); mp_image_t* (*__FASTCALL__ decode)(sh_video_t *sh,const enc_frame_t* frame); @@ -70,7 +70,7 @@ VDCTRL_RESYNC_STREAM =7 /* resync video stream if needed */ }; // callbacks: -MPXP_Rc __FASTCALL__ mpcodecs_config_vf(sh_video_t *sh, int w, int h, any_t* libinput); +MPXP_Rc __FASTCALL__ mpcodecs_config_vf(any_t *opaque, int w, int h); mp_image_t* __FASTCALL__ mpcodecs_get_image(sh_video_t *sh, int mp_imgtype, int mp_imgflag,int w, int h); void __FASTCALL__ mpcodecs_draw_slice(sh_video_t* sh, mp_image_t*); void __FASTCALL__ mpcodecs_draw_image(sh_video_t* sh, mp_image_t *mpi); Modified: mplayerxp/libmpcodecs/vd_divx4.cpp =================================================================== --- mplayerxp/libmpcodecs/vd_divx4.cpp 2012-11-30 08:43:33 UTC (rev 490) +++ mplayerxp/libmpcodecs/vd_divx4.cpp 2012-11-30 11:24:40 UTC (rev 491) @@ -209,12 +209,12 @@ } // init driver -static MPXP_Rc init(sh_video_t *sh,any_t* libinput){ +static MPXP_Rc init(sh_video_t *sh,any_t* opaque){ DecInit dinit; priv_t*p; int bits=12; if(!load_lib("libdivx"SLIBSUFFIX)) return MPXP_False; - if(!(mpcodecs_config_vf(sh,sh->src_w,sh->src_h,libinput))) return MPXP_False; + if(!(mpcodecs_config_vf(opaque,sh->src_w,sh->src_h))) return MPXP_False; switch(sh->codec->outfmt[sh->outfmtidx]){ case IMGFMT_YV12: case IMGFMT_I420: Modified: mplayerxp/libmpcodecs/vd_dmo.cpp =================================================================== --- mplayerxp/libmpcodecs/vd_dmo.cpp 2012-11-30 08:43:33 UTC (rev 490) +++ mplayerxp/libmpcodecs/vd_dmo.cpp 2012-11-30 11:24:40 UTC (rev 491) @@ -47,7 +47,7 @@ } // init driver -static MPXP_Rc init(sh_video_t *sh,any_t* libinput){ +static MPXP_Rc init(sh_video_t *sh,any_t* opaque){ unsigned int out_fmt; if(!(sh->context=DMO_VideoDecoder_Open(sh->codec->dll_name,&sh->codec->guid, sh->bih, 0, 0))){ MSG_ERR(MSGTR_MissingDLLcodec,sh->codec->dll_name); @@ -55,7 +55,7 @@ "package from: ftp://mplayerhq.hu/MPlayer/releases/w32codec.tar.bz2!\n"); return MPXP_False; } - if(!mpcodecs_config_vf(sh,sh->src_w,sh->src_h,libinput)) return MPXP_False; + if(!mpcodecs_config_vf(opaque,sh->src_w,sh->src_h)) return MPXP_False; out_fmt=sh->codec->outfmt[sh->outfmtidx]; switch(out_fmt){ case IMGFMT_YUY2: Modified: mplayerxp/libmpcodecs/vd_dshow.cpp =================================================================== --- mplayerxp/libmpcodecs/vd_dshow.cpp 2012-11-30 08:43:33 UTC (rev 490) +++ mplayerxp/libmpcodecs/vd_dshow.cpp 2012-11-30 11:24:40 UTC (rev 491) @@ -66,7 +66,7 @@ } // init driver -static MPXP_Rc init(sh_video_t *sh,any_t* libinput){ +static MPXP_Rc init(sh_video_t *sh,any_t* opaque){ unsigned int out_fmt; if(!(sh->context=DS_VideoDecoder_Open(sh->codec->dll_name,&sh->codec->guid, sh->bih, 0, 0))){ MSG_ERR(MSGTR_MissingDLLcodec,sh->codec->dll_name); @@ -74,7 +74,7 @@ MSG_HINT("package from: ftp://mplayerhq.hu/MPlayer/releases/w32codec.zip !\n"); return MPXP_False; } - if(!mpcodecs_config_vf(sh,sh->src_w,sh->src_h,libinput)) return MPXP_False; + if(!mpcodecs_config_vf(opaque,sh->src_w,sh->src_h)) return MPXP_False; out_fmt=sh->codec->outfmt[sh->outfmtidx]; switch(out_fmt){ case IMGFMT_YUY2: Modified: mplayerxp/libmpcodecs/vd_huffyuv.cpp =================================================================== --- mplayerxp/libmpcodecs/vd_huffyuv.cpp 2012-11-30 08:43:33 UTC (rev 490) +++ mplayerxp/libmpcodecs/vd_huffyuv.cpp 2012-11-30 11:24:40 UTC (rev 491) @@ -198,7 +198,7 @@ * Init HuffYUV decoder * */ -static MPXP_Rc init(sh_video_t *sh,any_t* libinput) +static MPXP_Rc init(sh_video_t *sh,any_t* opaque) { MPXP_Rc vo_ret; // Video output init ret value priv_t *priv; // Decoder context @@ -328,7 +328,7 @@ switch (priv->bitmaptype) { case BMPTYPE_RGB: case BMPTYPE_YUV: - vo_ret = mpcodecs_config_vf(sh,sh->src_w,sh->src_h,libinput); + vo_ret = mpcodecs_config_vf(opaque,sh->src_w,sh->src_h); break; case BMPTYPE_RGBA: MSG_ERR( "[HuffYUV] RGBA not supported yet.\n"); Modified: mplayerxp/libmpcodecs/vd_internal.h =================================================================== --- mplayerxp/libmpcodecs/vd_internal.h 2012-11-30 08:43:33 UTC (rev 490) +++ mplayerxp/libmpcodecs/vd_internal.h 2012-11-30 11:24:40 UTC (rev 491) @@ -14,7 +14,7 @@ static const video_probe_t* __FASTCALL__ probe(sh_video_t *sh,uint32_t fourcc); static MPXP_Rc control_vd(sh_video_t *sh,int cmd,any_t* arg,...); -static MPXP_Rc __FASTCALL__ init(sh_video_t *sh,any_t* libinput); +static MPXP_Rc __FASTCALL__ init(sh_video_t *sh,any_t*opaque); static void __FASTCALL__ uninit(sh_video_t *sh); static mp_image_t* __FASTCALL__ decode(sh_video_t *sh,const enc_frame_t* frame); Modified: mplayerxp/libmpcodecs/vd_lavc.cpp =================================================================== --- mplayerxp/libmpcodecs/vd_lavc.cpp 2012-11-30 08:43:33 UTC (rev 490) +++ mplayerxp/libmpcodecs/vd_lavc.cpp 2012-11-30 11:24:40 UTC (rev 491) @@ -243,7 +243,7 @@ return MPXP_False; } -static MPXP_Rc init(sh_video_t *sh,any_t* libinput){ +static MPXP_Rc init(sh_video_t *sh,any_t* opaque){ unsigned avc_version=0; priv_t *priv = reinterpret_cast<priv_t*>(sh->context); int pp_flags; @@ -425,7 +425,7 @@ } if(pp_flags) ppContext=pp2_get_context(sh->src_w,sh->src_h,pp_flags); } - return mpcodecs_config_vf(sh,sh->src_w,sh->src_h,libinput); + return mpcodecs_config_vf(opaque,sh->src_w,sh->src_h); } // uninit driver Modified: mplayerxp/libmpcodecs/vd_libdv.cpp =================================================================== --- mplayerxp/libmpcodecs/vd_libdv.cpp 2012-11-30 08:43:33 UTC (rev 490) +++ mplayerxp/libmpcodecs/vd_libdv.cpp 2012-11-30 11:24:40 UTC (rev 491) @@ -78,10 +78,10 @@ } // init driver -static MPXP_Rc init(sh_video_t *sh,any_t* libinput) +static MPXP_Rc init(sh_video_t *sh,any_t* opaque) { sh->context = (any_t*)init_global_rawdv_decoder(); - return mpcodecs_config_vf(sh,sh->src_w,sh->src_h,libinput); + return mpcodecs_config_vf(opaque,sh->src_w,sh->src_h); } // uninit driver Modified: mplayerxp/libmpcodecs/vd_libmpeg2.cpp =================================================================== --- mplayerxp/libmpcodecs/vd_libmpeg2.cpp 2012-11-30 08:43:33 UTC (rev 490) +++ mplayerxp/libmpcodecs/vd_libmpeg2.cpp 2012-11-30 11:24:40 UTC (rev 491) @@ -257,12 +257,12 @@ return MPXP_Unknown; } -static MPXP_Rc init(sh_video_t *sh,any_t* libinput){ +static MPXP_Rc init(sh_video_t *sh,any_t* opaque){ priv_t *priv; if(!load_lib("libmpeg2"SLIBSUFFIX)) return MPXP_False; sh->context=priv=new(zeromem) priv_t; if(!(priv->mpeg2dec=mpeg2_init(MPXPCtx->mplayer_accel))) return MPXP_False; - return mpcodecs_config_vf(sh,sh->src_w,sh->src_h,libinput); + return mpcodecs_config_vf(opaque,sh->src_w,sh->src_h); } // uninit driver Modified: mplayerxp/libmpcodecs/vd_mpegpes.cpp =================================================================== --- mplayerxp/libmpcodecs/vd_mpegpes.cpp 2012-11-30 08:43:33 UTC (rev 490) +++ mplayerxp/libmpcodecs/vd_mpegpes.cpp 2012-11-30 11:24:40 UTC (rev 491) @@ -101,8 +101,8 @@ } // init driver -static MPXP_Rc init(sh_video_t *sh,any_t* libinput){ - return mpcodecs_config_vf(sh,sh->src_w,sh->src_h,libinput); +static MPXP_Rc init(sh_video_t *sh,any_t* opaque){ + return mpcodecs_config_vf(opaque,sh->src_w,sh->src_h); } // uninit driver Modified: mplayerxp/libmpcodecs/vd_null.cpp =================================================================== --- mplayerxp/libmpcodecs/vd_null.cpp 2012-11-30 08:43:33 UTC (rev 490) +++ mplayerxp/libmpcodecs/vd_null.cpp 2012-11-30 11:24:40 UTC (rev 491) @@ -27,9 +27,9 @@ } // init driver -static MPXP_Rc init(sh_video_t *sh,any_t* libinput){ +static MPXP_Rc init(sh_video_t *sh,any_t* opaque){ UNUSED(sh); - UNUSED(libinput); + UNUSED(opaque); return MPXP_Ok; } Modified: mplayerxp/libmpcodecs/vd_nuv.cpp =================================================================== --- mplayerxp/libmpcodecs/vd_nuv.cpp 2012-11-30 08:43:33 UTC (rev 490) +++ mplayerxp/libmpcodecs/vd_nuv.cpp 2012-11-30 11:24:40 UTC (rev 491) @@ -49,8 +49,8 @@ } // init driver -static MPXP_Rc init(sh_video_t *sh,any_t* libinput){ - return mpcodecs_config_vf(sh,sh->src_w,sh->src_h,libinput); +static MPXP_Rc init(sh_video_t *sh,any_t* opaque){ + return mpcodecs_config_vf(opaque,sh->src_w,sh->src_h); } // uninit driver Modified: mplayerxp/libmpcodecs/vd_qtvideo.cpp =================================================================== --- mplayerxp/libmpcodecs/vd_qtvideo.cpp 2012-11-30 08:43:33 UTC (rev 490) +++ mplayerxp/libmpcodecs/vd_qtvideo.cpp 2012-11-30 11:24:40 UTC (rev 491) @@ -121,7 +121,7 @@ static int codec_inited=0; // init driver -static MPXP_Rc init(sh_video_t *sh,any_t* libinput){ +static MPXP_Rc init(sh_video_t *sh,any_t* opaque){ long result = 1; ComponentResult cres; ComponentDescription desc; @@ -293,9 +293,9 @@ } MSG_V("imgfmt: %s qt_imgfmt: %.4s\n", vo_format_name(imgfmt), &qt_imgfmt); sh->context = (any_t*)qt_imgfmt; - if(!mpcodecs_config_vf(sh,sh->src_w,sh->src_h,libinput)) return MPXP_False; + if(!mpcodecs_config_vf(opaque,sh->src_w,sh->src_h)) return MPXP_False; #else - if(!mpcodecs_config_vf(sh,sh->src_w,sh->src_h,libinput)) return MPXP_False; + if(!mpcodecs_config_vf(opaque,sh->src_w,sh->src_h)) return MPXP_False; #endif return MPXP_Ok; } Modified: mplayerxp/libmpcodecs/vd_raw.cpp =================================================================== --- mplayerxp/libmpcodecs/vd_raw.cpp 2012-11-30 08:43:33 UTC (rev 490) +++ mplayerxp/libmpcodecs/vd_raw.cpp 2012-11-30 11:24:40 UTC (rev 491) @@ -88,7 +88,7 @@ } // init driver -static MPXP_Rc init(sh_video_t *sh,any_t* libinput){ +static MPXP_Rc init(sh_video_t *sh,any_t* opaque){ // set format fourcc for raw RGB: if(sh->fourcc==0){ switch(sh->bih->biBitCount){ @@ -101,7 +101,7 @@ MSG_WARN("RAW: depth %d not supported\n",sh->bih->biBitCount); } } - return mpcodecs_config_vf(sh,sh->src_w,sh->src_h,libinput); + return mpcodecs_config_vf(opaque,sh->src_w,sh->src_h); } // uninit driver Modified: mplayerxp/libmpcodecs/vd_real.cpp =================================================================== --- mplayerxp/libmpcodecs/vd_real.cpp 2012-11-30 08:43:33 UTC (rev 490) +++ mplayerxp/libmpcodecs/vd_real.cpp 2012-11-30 11:24:40 UTC (rev 491) @@ -165,7 +165,7 @@ } rv_init_t; // init driver -static MPXP_Rc init(sh_video_t *sh,any_t* libinput){ +static MPXP_Rc init(sh_video_t *sh,any_t* opaque){ //unsigned int out_fmt; int result; // we export codec id and sub-id from demuxer in bitmapinfohdr: @@ -180,7 +180,7 @@ if(!load_syms(sh->codec->dll_name)) return MPXP_False; // only I420 supported - if(!mpcodecs_config_vf(sh,sh->src_w,sh->src_h,libinput)) return MPXP_False; + if(!mpcodecs_config_vf(opaque,sh->src_w,sh->src_h)) return MPXP_False; // init codec: sh->context=NULL; result=(*rvyuv_init)(&init_data, &sh->context); Modified: mplayerxp/libmpcodecs/vd_theora.cpp =================================================================== --- mplayerxp/libmpcodecs/vd_theora.cpp 2012-11-30 08:43:33 UTC (rev 490) +++ mplayerxp/libmpcodecs/vd_theora.cpp 2012-11-30 11:24:40 UTC (rev 491) @@ -67,7 +67,7 @@ /* * init driver */ -static MPXP_Rc init(sh_video_t *sh,any_t* libinput){ +static MPXP_Rc init(sh_video_t *sh,any_t* opaque){ priv_t *priv = NULL; int failed = 1; int errorCode = 0; @@ -127,7 +127,7 @@ MSG_V("INFO: Theora video init ok!\n"); - return mpcodecs_config_vf(sh,sh->src_w,sh->src_h,libinput); + return mpcodecs_config_vf(opaque,sh->src_w,sh->src_h); } /* Modified: mplayerxp/libmpcodecs/vd_vfw.cpp =================================================================== --- mplayerxp/libmpcodecs/vd_vfw.cpp 2012-11-30 08:43:33 UTC (rev 490) +++ mplayerxp/libmpcodecs/vd_vfw.cpp 2012-11-30 11:24:40 UTC (rev 491) @@ -246,7 +246,7 @@ } // init driver -static MPXP_Rc init(sh_video_t *sh,any_t* libinput){ +static MPXP_Rc init(sh_video_t *sh,any_t* opaque){ priv_t *priv; int vfw_ex; if(strcmp(sh->codec->driver_name,"vfwex") == 0) vfw_ex=1; @@ -259,7 +259,7 @@ priv->ex = vfw_ex; if(init_vfw_video_codec(sh)!=MPXP_Ok) return MPXP_False; MSG_V("INFO: Win32/VFW init OK!\n"); - return mpcodecs_config_vf(sh,sh->src_w,sh->src_h,libinput); + return mpcodecs_config_vf(opaque,sh->src_w,sh->src_h); } // uninit driver Modified: mplayerxp/libmpcodecs/vd_xanim.cpp =================================================================== --- mplayerxp/libmpcodecs/vd_xanim.cpp 2012-11-30 08:43:33 UTC (rev 490) +++ mplayerxp/libmpcodecs/vd_xanim.cpp 2012-11-30 11:24:40 UTC (rev 491) @@ -895,9 +895,9 @@ } // init driver -static MPXP_Rc init(sh_video_t *sh,any_t* libinput){ +static MPXP_Rc init(sh_video_t *sh,any_t* opaque){ if(xacodec_init_video(sh,sh->codec->outfmt[sh->outfmtidx])) - return mpcodecs_config_vf(sh,sh->src_w,sh->src_h,libinput); + return mpcodecs_config_vf(opaque,sh->src_w,sh->src_h); return MPXP_False; } Modified: mplayerxp/libmpcodecs/vd_xvid.cpp =================================================================== --- mplayerxp/libmpcodecs/vd_xvid.cpp 2012-11-30 08:43:33 UTC (rev 490) +++ mplayerxp/libmpcodecs/vd_xvid.cpp 2012-11-30 11:24:40 UTC (rev 491) @@ -315,7 +315,7 @@ } #endif // init driver -static MPXP_Rc init(sh_video_t *sh,any_t* libinput){ +static MPXP_Rc init(sh_video_t *sh,any_t* opaque){ xvid_gbl_info_t xvid_gbl_info; xvid_gbl_init_t xvid_ini; xvid_dec_create_t dec_p; @@ -434,7 +434,7 @@ priv->img_type = MP_IMGTYPE_TEMP; break; } - return mpcodecs_config_vf(sh, sh->src_w, sh->src_h,libinput); + return mpcodecs_config_vf(opaque, sh->src_w, sh->src_h); } // uninit driver Modified: mplayerxp/libmpdemux/stheader.h =================================================================== --- mplayerxp/libmpdemux/stheader.h 2012-11-30 08:43:33 UTC (rev 490) +++ mplayerxp/libmpdemux/stheader.h 2012-11-30 11:24:40 UTC (rev 491) @@ -83,8 +83,6 @@ uint32_t fourcc; int is_static; /* default: 0 - means movie; 1 - means picture (.jpg ...)*/ - any_t* decoder; - // output format: float fps; int chapter_change; Modified: mplayerxp/mplayerxp.cpp =================================================================== --- mplayerxp/mplayerxp.cpp 2012-11-30 08:43:33 UTC (rev 490) +++ mplayerxp/mplayerxp.cpp 2012-11-30 11:24:40 UTC (rev 491) @@ -199,7 +199,8 @@ MP_Config mp_conf; MPXPContext::MPXPContext() - :audio(*new(zeromem) audio_processing_t) + :audio(*new(zeromem) audio_processing_t), + video(*new(zeromem) video_processing_t) { seek_time=-1; bench=new(zeromem) time_usage_t; @@ -333,7 +334,7 @@ if(mask&INITED_VCODEC){ inited_flags&=~INITED_VCODEC; MP_UNIT("uninit_vcodec"); - mpcv_uninit(sh_video->decoder); + mpcv_uninit(MPXPCtx->video.decoder); sh_video=NULL; } @@ -701,7 +702,7 @@ if(sh_video){ MP_UNIT("seek_video_reset"); - mpcv_resync_stream(sh_video->decoder); + mpcv_resync_stream(MPXPCtx->video.decoder); vo_data->reset(); sh_video->chapter_change=-1; } @@ -1176,7 +1177,7 @@ if(vo_conf.softzoom) vo_data->ZOOM_SET(); if(vo_conf.flip>0) vo_data->FLIP_SET(); if(vo_conf.vidmode) vo_data->VM_SET(); - if((sh_video->decoder=mpcv_init(sh_video,mp_conf.video_codec,mp_conf.video_family,-1,MPXPSys->libinput()))) sh_video->inited=1; + if((MPXPCtx->video.decoder=mpcv_init(sh_video,mp_conf.video_codec,mp_conf.video_family,-1,MPXPSys->libinput()))) sh_video->inited=1; #ifdef ENABLE_WIN32LOADER if(!sh_video->inited) { /* Go through the codec.conf and find the best codec...*/ @@ -1197,7 +1198,7 @@ } } /* Use lavc decoders as last hope */ - if(!sh_video->inited) sh_video->decoder=mpcv_lavc_init(sh_video,MPXPSys->libinput()); + if(!sh_video->inited) MPXPCtx->video.decoder=mpcv_lavc_init(sh_video,MPXPSys->libinput()); #endif if(!sh_video->inited) { @@ -1521,7 +1522,7 @@ else v_cont+=v; if(v_cont > 100) v_cont=100; if(v_cont < -100) v_cont = -100; - if(mpcv_set_colors(sh_video->decoder,VO_EC_CONTRAST,v_cont)==MPXP_Ok){ + if(mpcv_set_colors(MPXPCtx->video.decoder,VO_EC_CONTRAST,v_cont)==MPXP_Ok){ #ifdef USE_OSD if(mp_conf.osd_level){ osd->visible=sh_video->fps; // 1 sec @@ -1539,7 +1540,7 @@ else v_bright+=v; if(v_bright > 100) v_bright = 100; if(v_bright < -100) v_bright = -100; - if(mpcv_set_colors(sh_video->decoder,VO_EC_BRIGHTNESS,v_bright)==MPXP_Ok){ + if(mpcv_set_colors(MPXPCtx->video.decoder,VO_EC_BRIGHTNESS,v_bright)==MPXP_Ok){ #ifdef USE_OSD if(mp_conf.osd_level){ osd->visible=sh_video->fps; // 1 sec @@ -1557,7 +1558,7 @@ else v_hue+=v; if(v_hue > 100) v_hue = 100; if(v_hue < -100) v_hue = -100; - if(mpcv_set_colors(sh_video->decoder,VO_EC_HUE,v_hue)==MPXP_Ok){ + if(mpcv_set_colors(MPXPCtx->video.decoder,VO_EC_HUE,v_hue)==MPXP_Ok){ #ifdef USE_OSD if(mp_conf.osd_level){ osd->visible=sh_video->fps; // 1 sec @@ -1575,7 +1576,7 @@ else v_saturation+=v; if(v_saturation > 100) v_saturation = 100; if(v_saturation < -100) v_saturation = -100; - if(mpcv_set_colors(sh_video->decoder,VO_EC_SATURATION,v_saturation)==MPXP_Ok){ + if(mpcv_set_colors(MPXPCtx->video.decoder,VO_EC_SATURATION,v_saturation)==MPXP_Ok){ #ifdef USE_OSD if(mp_conf.osd_level){ osd->visible=sh_video->fps; // 1 sec @@ -1934,12 +1935,12 @@ /* Auto quality option enabled*/ MPXP_Rc rc; unsigned quality; - rc=mpcv_get_quality_max(sh_video->decoder,&quality); + rc=mpcv_get_quality_max(MPXPCtx->video.decoder,&quality); if(rc==MPXP_Ok) MPXPCtx->output_quality=quality; if(mp_conf.autoq>MPXPCtx->output_quality) mp_conf.autoq=MPXPCtx->output_quality; else MPXPCtx->output_quality=mp_conf.autoq; MSG_V("AutoQ: setting quality to %d\n",MPXPCtx->output_quality); - mpcv_set_quality(sh_video->decoder,MPXPCtx->output_quality); + mpcv_set_quality(MPXPCtx->video.decoder,MPXPCtx->output_quality); } vf_showlist(reinterpret_cast<vf_instance_t*>(sh_video->vfilter)); Modified: mplayerxp/mplayerxp.h =================================================================== --- mplayerxp/mplayerxp.h 2012-11-30 08:43:33 UTC (rev 490) +++ mplayerxp/mplayerxp.h 2012-11-30 11:24:40 UTC (rev 491) @@ -125,6 +125,10 @@ any_t* decoder; }; + struct video_processing_t { + any_t* decoder; + }; + struct MPXPSystem; /* non-configurable through command line stuff */ struct MPXPContext :public Opaque { @@ -143,6 +147,7 @@ struct MPXPSystem* MPXPSys; any_t* msg_priv; audio_processing_t& audio; + video_processing_t& video; }; extern MPXPContext* MPXPCtx; Modified: mplayerxp/xmpcore/xmp_vdecoder.cpp =================================================================== --- mplayerxp/xmpcore/xmp_vdecoder.cpp 2012-11-30 08:43:33 UTC (rev 490) +++ mplayerxp/xmpcore/xmp_vdecoder.cpp 2012-11-30 11:24:40 UTC (rev 491) @@ -214,15 +214,15 @@ unsigned distance = dae_get_decoder_outrun(xp_core->video); int our_quality; our_quality = MPXPCtx->output_quality*distance/total; - if(drop_param) mpcv_set_quality(sh_video->decoder,0); + if(drop_param) mpcv_set_quality(MPXPCtx->video.decoder,0); else - if(mp_conf.autoq) mpcv_set_quality(sh_video->decoder,our_quality>0?our_quality:0); + if(mp_conf.autoq) mpcv_set_quality(MPXPCtx->video.decoder,our_quality>0?our_quality:0); } frame->flags=drop_param; - blit_frame=mpcv_decode(sh_video->decoder,frame); + blit_frame=mpcv_decode(MPXPCtx->video.decoder,frame); MSG_DBG2("DECODER: %i[%i] %f\n",dae_curr_vdecoded(xp_core),frame->len,frame->pts); if(MPXPCtx->output_quality) { - if(drop_param) mpcv_set_quality(sh_video->decoder,MPXPCtx->output_quality); + if(drop_param) mpcv_set_quality(MPXPCtx->video.decoder,MPXPCtx->output_quality); } if(!blit_frame && drop_param) priv->dae->num_dropped_frames++; if(blit_frame) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |