[Mplayerxp-cvslog] SF.net SVN: mplayerxp:[342] mplayerxp
Brought to you by:
olov
From: <nic...@us...> - 2012-11-12 13:14:41
|
Revision: 342 http://mplayerxp.svn.sourceforge.net/mplayerxp/?rev=342&view=rev Author: nickols_k Date: 2012-11-12 13:14:33 +0000 (Mon, 12 Nov 2012) Log Message: ----------- function vf_get_image() had a viral nature. Use vf_get_new_image() instead Modified Paths: -------------- mplayerxp/libmpcodecs/dec_video.c mplayerxp/libmpcodecs/vd.c mplayerxp/libmpcodecs/vd_ffmpeg.c mplayerxp/osdep/mp_malloc.c mplayerxp/postproc/vf.c mplayerxp/postproc/vf.h mplayerxp/postproc/vf_1bpp.c mplayerxp/postproc/vf_2xsai.c mplayerxp/postproc/vf_delogo.c mplayerxp/postproc/vf_denoise3d.c mplayerxp/postproc/vf_dint.c mplayerxp/postproc/vf_down3dright.c mplayerxp/postproc/vf_eq.c mplayerxp/postproc/vf_expand.c mplayerxp/postproc/vf_flip.c mplayerxp/postproc/vf_framestep.c mplayerxp/postproc/vf_il.c mplayerxp/postproc/vf_menu.c mplayerxp/postproc/vf_mirror.c mplayerxp/postproc/vf_noise.c mplayerxp/postproc/vf_ow.c mplayerxp/postproc/vf_palette.c mplayerxp/postproc/vf_panscan.c mplayerxp/postproc/vf_perspective.c mplayerxp/postproc/vf_pp.c mplayerxp/postproc/vf_raw.c mplayerxp/postproc/vf_rectangle.c mplayerxp/postproc/vf_rgb2bgr.c mplayerxp/postproc/vf_rotate.c mplayerxp/postproc/vf_scale.c mplayerxp/postproc/vf_smartblur.c mplayerxp/postproc/vf_softpulldown.c mplayerxp/postproc/vf_swapuv.c mplayerxp/postproc/vf_test.c mplayerxp/postproc/vf_unsharp.c mplayerxp/postproc/vf_vo.c mplayerxp/postproc/vf_yuvcsp.c mplayerxp/postproc/vf_yuy2.c mplayerxp/postproc/vf_yvu9.c mplayerxp/xmpcore/mp_image.c mplayerxp/xmpcore/sig_hand.c Modified: mplayerxp/libmpcodecs/dec_video.c =================================================================== --- mplayerxp/libmpcodecs/dec_video.c 2012-11-12 11:15:50 UTC (rev 341) +++ mplayerxp/libmpcodecs/dec_video.c 2012-11-12 13:14:33 UTC (rev 342) @@ -178,7 +178,7 @@ if(sh->vf_flags&VF_FLAGS_SLICES) { unsigned j,i,y; - mp_image_t ampi[num_slices]; + mp_image_t *ampi[num_slices]; static int hello_printed=0; if(!hello_printed) { MSG_OK("[VC] using %u threads for video filters\n",smp_num_cpus); @@ -186,21 +186,25 @@ } y=0; for(i=0;i<num_slices;i++) { - mpi_fake_slice(&i[i],mpi,y,h_step); + ampi[i]=new_mp_image(mpi->w,y,h_step); + mpi_fake_slice(ampi[i],mpi,y,h_step); y+=h_step; } + free_mp_image(mpi); #ifdef _OPENMP if(use_vf_threads && (num_slices>smp_num_cpus)) { for(j=0;j<num_slices;j+=smp_num_cpus) { #pragma omp parallel for shared(vf) private(i) for(i=j;i<smp_num_cpus;i++) { MSG_DBG2("parallel: dec_video.put_slice[%ux%u] %i %i %i %i\n",ampi[i].width,ampi[i].height,ampi[i].x,ampi[i].y,ampi[i].w,ampi[i].h); - vf->put_slice(vf,&i[i]); + vf->put_slice(vf,ampi[i]); + free_mp_image(ampi[i]); } } for(;j<num_slices;j++) { MSG_DBG2("par_tail: dec_video.put_slice[%ux%u] %i %i %i %i\n",ampi[i].width,ampi[i].height,ampi[i].x,ampi[i].y,ampi[i].w,ampi[i].h); - vf->put_slice(vf,&i[j]); + vf->put_slice(vf,ampi[j]); + free_mp_image(ampi[j]); } } else @@ -209,12 +213,14 @@ /* execute slices instead of whole frame make faster multiple filters */ for(i=0;i<num_slices;i++) { MSG_DBG2("dec_video.put_slice[%ux%u] %i %i %i %i -> [%i]\n",ampi[i].width,ampi[i].height,ampi[i].x,ampi[i].y,ampi[i].w,ampi[i].h,ampi[i].xp_idx); - vf->put_slice(vf,&i[i]); + vf->put_slice(vf,ampi[i]); + free_mp_image(ampi[i]); } } } else { MSG_DBG2("Put whole frame[%ux%u]\n",mpi->width,mpi->height); vf->put_slice(vf,mpi); + free_mp_image(mpi); } } } Modified: mplayerxp/libmpcodecs/vd.c =================================================================== --- mplayerxp/libmpcodecs/vd.c 2012-11-12 11:15:50 UTC (rev 341) +++ mplayerxp/libmpcodecs/vd.c 2012-11-12 13:14:33 UTC (rev 342) @@ -278,7 +278,7 @@ // Note: buffer allocation may be moved to mpcodecs_config_vo() later... mp_image_t* mpcodecs_get_image(sh_video_t *sh, int mp_imgtype, int mp_imgflag,int w, int h){ MSG_DBG2("mpcodecs_get_image(vf_%s,%i,%i,%i,%i) was called\n",((vf_instance_t *)(sh->vfilter))->info->name,mp_imgtype,mp_imgflag,w,h); - mp_image_t* mpi=vf_get_image(sh->vfilter,sh->codec->outfmt[sh->outfmtidx],mp_imgtype,mp_imgflag,w,h,dae_curr_vdecoded(xp_core)); + mp_image_t* mpi=vf_get_new_image(sh->vfilter,sh->codec->outfmt[sh->outfmtidx],mp_imgtype,mp_imgflag,w,h,dae_curr_vdecoded(xp_core)); mpi->x=mpi->y=0; if(mpi->xp_idx==XP_IDX_INVALID) MSG_V("[mpcodecs_get_image] Incorrect mpi->xp_idx. Be ready for segfault!\n"); Modified: mplayerxp/libmpcodecs/vd_ffmpeg.c =================================================================== --- mplayerxp/libmpcodecs/vd_ffmpeg.c 2012-11-12 11:15:50 UTC (rev 341) +++ mplayerxp/libmpcodecs/vd_ffmpeg.c 2012-11-12 13:14:33 UTC (rev 342) @@ -684,6 +684,7 @@ } if(!(frame->flags&3) && priv->use_slices) { + if(mpi) free_mp_image(mpi); mpi=mpcodecs_get_image(sh, MP_IMGTYPE_EXPORT, MP_IMGFLAG_ACCEPT_STRIDE|MP_IMGFLAG_DRAW_CALLBACK|MP_IMGFLAG_DIRECT,sh->src_w, sh->src_h); priv->mpi = mpi; priv->frame_number++; @@ -708,6 +709,7 @@ if(!got_picture) return NULL; // skipped image if(!priv->ctx->draw_horiz_band) { + if(mpi) free_mp_image(mpi); mpi=mpcodecs_get_image(sh, MP_IMGTYPE_EXPORT, MP_IMGFLAG_ACCEPT_STRIDE,sh->src_w,sh->src_h); if(!mpi){ // temporary! MSG_ERR("couldn't allocate image for ffmpeg codec\n"); Modified: mplayerxp/osdep/mp_malloc.c =================================================================== --- mplayerxp/osdep/mp_malloc.c 2012-11-12 11:15:50 UTC (rev 341) +++ mplayerxp/osdep/mp_malloc.c 2012-11-12 13:14:33 UTC (rev 342) @@ -23,6 +23,7 @@ typedef struct mp_slot_container_s { mp_slot_t* slots; size_t nslots; + size_t size; }mp_slot_container_t; typedef struct priv_s { @@ -75,8 +76,17 @@ static mp_slot_t* prot_append_slot(mp_slot_container_t* c,any_t*ptr,size_t size) { mp_slot_t* s; - if(!c->slots) s=malloc(sizeof(mp_slot_t)); - else s=realloc(c->slots,sizeof(mp_slot_t)*(c->nslots+1)); + s=c->slots; + if(!c->slots) { + c->size=16; + s=malloc(sizeof(mp_slot_t)*16); + } + else { + if(c->nslots+1>c->size) { + c->size+=16; + s=realloc(c->slots,sizeof(mp_slot_t)*c->size); + } + } c->slots=s; memset(&c->slots[c->nslots],0,sizeof(mp_slot_t)); c->slots[c->nslots].page_ptr=ptr; @@ -90,7 +100,10 @@ if(idx!=UINT_MAX) { memmove(&c->slots[idx],&c->slots[idx+1],sizeof(mp_slot_t)*(c->nslots-(idx+1))); c->nslots--; - c->slots=realloc(c->slots,sizeof(mp_slot_t)*c->nslots); + if(c->nslots<c->size-16) { + c->size-=16; + c->slots=realloc(c->slots,sizeof(mp_slot_t)*c->size); + } } else printf("[prot_free_slot] Internal error! Can't find slot for address: %p\n",ptr); } Modified: mplayerxp/postproc/vf.c =================================================================== --- mplayerxp/postproc/vf.c 2012-11-12 11:15:50 UTC (rev 341) +++ mplayerxp/postproc/vf.c 2012-11-12 13:14:33 UTC (rev 342) @@ -153,123 +153,116 @@ } } -mp_image_t* __FASTCALL__ vf_get_image(vf_instance_t* vf, unsigned int outfmt, int mp_imgtype, int mp_imgflag, int w, int h,unsigned idx){ - mp_image_t* mpi=NULL; - int w2=(mp_imgflag&MP_IMGFLAG_ACCEPT_ALIGNED_STRIDE)?((w+15)&(~15)):w; - unsigned xp_idx=idx; - MSG_DBG2("vf_get_image(%s,0x%X,0x%X,0x%X,0x%X,0x%X) was called\n",vf->info->name,outfmt,mp_imgtype,mp_imgflag,w,h); +mp_image_t* __FASTCALL__ vf_get_new_image(vf_instance_t* vf, unsigned int outfmt, int mp_imgtype, int mp_imgflag, int w, int h,unsigned idx){ + int is_static=0; + mp_image_t* mpi=NULL; + int w2=(mp_imgflag&MP_IMGFLAG_ACCEPT_ALIGNED_STRIDE)?((w+15)&(~15)):w; + unsigned xp_idx=idx; + MSG_DBG2("vf_get_new_image(%s,0x%X,0x%X,0x%X,0x%X,0x%X) was called\n",vf->info->name,outfmt,mp_imgtype,mp_imgflag,w,h); - if(vf->put_slice==vf_next_put_slice){ - MSG_DBG2("passthru mode to %s\n",vf->next->info->name); - return vf_get_image(vf->next,outfmt,mp_imgtype,mp_imgflag,w,h,xp_idx); - } - // Note: we should call libvo first to check if it supports direct rendering - // and if not, then fallback to software buffers: - switch(mp_imgtype){ - case MP_IMGTYPE_EXPORT: - if(!vf->imgctx.export_images[0]) vf->imgctx.export_images[0]=new_mp_image(w2,h,xp_idx); - mpi=vf->imgctx.export_images[0]; - break; - case MP_IMGTYPE_STATIC: - if(!vf->imgctx.static_images[0]) vf->imgctx.static_images[0]=new_mp_image(w2,h,xp_idx); - mpi=vf->imgctx.static_images[0]; - break; - case MP_IMGTYPE_TEMP: - if(!vf->imgctx.temp_images[0]) vf->imgctx.temp_images[0]=new_mp_image(w2,h,xp_idx); - mpi=vf->imgctx.temp_images[0]; - break; - case MP_IMGTYPE_IPB: - if(!(mp_imgflag&MP_IMGFLAG_READABLE)){ // B frame: - if(!vf->imgctx.temp_images[0]) vf->imgctx.temp_images[0]=new_mp_image(w2,h,xp_idx); - mpi=vf->imgctx.temp_images[0]; - break; + if(vf->put_slice==vf_next_put_slice){ + MSG_DBG2("passthru mode to %s\n",vf->next->info->name); + return vf_get_new_image(vf->next,outfmt,mp_imgtype,mp_imgflag,w,h,xp_idx); } - case MP_IMGTYPE_IP: - if(!vf->imgctx.static_images[vf->imgctx.static_idx]) vf->imgctx.static_images[vf->imgctx.static_idx]=new_mp_image(w2,h,xp_idx); - mpi=vf->imgctx.static_images[vf->imgctx.static_idx]; - vf->imgctx.static_idx^=1; - break; - } - if(mpi){ - mpi->type=mp_imgtype; - mpi->w=w; mpi->h=h; - // keep buffer allocation status & color flags only: - mpi->flags&=MP_IMGFLAG_ALLOCATED|MP_IMGFLAG_TYPE_DISPLAYED|MP_IMGFLAGMASK_COLORS; - // accept restrictions & draw_slice flags only: - mpi->flags|=mp_imgflag&(MP_IMGFLAGMASK_RESTRICTIONS|MP_IMGFLAG_DRAW_CALLBACK); - MSG_DBG2("vf_get_image fills mpi structure. flags=0x%X\n",mpi->flags); - if(mpi->width!=w2 || mpi->height!=h){ - if(mpi->flags&MP_IMGFLAG_ALLOCATED){ - if(mpi->width<w2 || mpi->height<h){ - // need to re-allocate buffer memory: - mp_free(mpi->planes[0]); - mpi->flags&=~MP_IMGFLAG_ALLOCATED; - MSG_DBG2("vf.c: have to REALLOCATE buffer memory :(\n"); + // Note: we should call libvo first to check if it supports direct rendering + // and if not, then fallback to software buffers: + switch(mp_imgtype){ + case MP_IMGTYPE_IP: + case MP_IMGTYPE_STATIC: + is_static=1; + break; + case MP_IMGTYPE_IPB: + if(mp_imgflag&MP_IMGFLAG_READABLE) is_static=1; + default: + break; + } + mpi=new_mp_image(w2,h,xp_idx); + if(mpi){ + mpi->type=mp_imgtype; + mpi->w=w; mpi->h=h; + // keep buffer allocation status & color flags only: + mpi->flags&=MP_IMGFLAG_ALLOCATED|MP_IMGFLAG_TYPE_DISPLAYED|MP_IMGFLAGMASK_COLORS; + // accept restrictions & draw_slice flags only: + mpi->flags|=mp_imgflag&(MP_IMGFLAGMASK_RESTRICTIONS|MP_IMGFLAG_DRAW_CALLBACK); + MSG_DBG2("vf_get_new_image fills mpi structure. flags=0x%X\n",mpi->flags); + if(mpi->width!=w2 || mpi->height!=h){ + if(mpi->flags&MP_IMGFLAG_ALLOCATED){ + if(mpi->width<w2 || mpi->height<h){ + // need to re-allocate buffer memory: + mp_free(mpi->planes[0]); + mpi->flags&=~MP_IMGFLAG_ALLOCATED; + MSG_DBG2("vf.c: have to REALLOCATE buffer memory :(\n"); + } } + mpi->width=w2; mpi->chroma_width=(w2 + (1<<mpi->chroma_x_shift) - 1)>>mpi->chroma_x_shift; + mpi->height=h; mpi->chroma_height=(h + (1<<mpi->chroma_y_shift) - 1)>>mpi->chroma_y_shift; } - mpi->width=w2; mpi->chroma_width=(w2 + (1<<mpi->chroma_x_shift) - 1)>>mpi->chroma_x_shift; - mpi->height=h; mpi->chroma_height=(h + (1<<mpi->chroma_y_shift) - 1)>>mpi->chroma_y_shift; - } - if(!mpi->bpp) mp_image_setfmt(mpi,outfmt); - MSG_DBG2("vf_get_image setfmt. flags=0x%X\n",mpi->flags); - if(!(mpi->flags&MP_IMGFLAG_ALLOCATED) && mpi->type>MP_IMGTYPE_EXPORT){ - - // check libvo first! - if(vf->get_image) vf->get_image(vf,mpi); - MSG_DBG2("[vf->get_image] returns xp_idx=%u\n",mpi->xp_idx); + if(!mpi->bpp) mp_image_setfmt(mpi,outfmt); + MSG_DBG2("vf_get_new_image setfmt. flags=0x%X\n",mpi->flags); + if(!(mpi->flags&MP_IMGFLAG_ALLOCATED) && mpi->type>MP_IMGTYPE_EXPORT) { + // check libvo first! + if(vf->get_image) vf->get_image(vf,mpi); + MSG_DBG2("[vf->get_image] returns xp_idx=%u\n",mpi->xp_idx); - if(!(mpi->flags&MP_IMGFLAG_DIRECT)){ - // non-direct and not yet allocated image. allocate it! - - // check if codec prefer aligned stride: - if(mp_imgflag&MP_IMGFLAG_PREFER_ALIGNED_STRIDE){ - int align=(mpi->flags&MP_IMGFLAG_PLANAR && - mpi->flags&MP_IMGFLAG_YUV) ? - (8<<mpi->chroma_x_shift)-1 : 15; // -- maybe FIXME - w2=((w+align)&(~align)); - if(mpi->width!=w2){ - // we have to change width... check if we CAN co it: - int flags=vf->query_format(vf,outfmt,w,h); // should not fail - if(!(flags&3)) MSG_WARN("??? vf_get_image{vf->query_format(outfmt)} failed!\n"); -// printf("query -> 0x%X \n",flags); - if(flags&VFCAP_ACCEPT_STRIDE){ - mpi->width=w2; - mpi->chroma_width=(w2 + (1<<mpi->chroma_x_shift) - 1)>>mpi->chroma_x_shift; - } - } - } - - mpi_alloc_planes(mpi); -// printf("clearing img!\n"); -// vf_mpi_clear(mpi,0,0,mpi->width,mpi->height); - } - } - else { - MSG_DBG2("vf_get_image forces xp_idx retrieving\n"); - mpi->xp_idx=dae_curr_vdecoded(xp_core); - } - if(mpi->flags&MP_IMGFLAG_DRAW_CALLBACK) - if(vf->start_slice) vf->start_slice(vf,mpi); - if(!(mpi->flags&MP_IMGFLAG_TYPE_DISPLAYED)){ + if(!(mpi->flags&MP_IMGFLAG_DIRECT)) { + // non-direct and not yet allocated image. allocate it! + // check if codec prefer aligned stride: + if(mp_imgflag&MP_IMGFLAG_PREFER_ALIGNED_STRIDE) { + int align=( mpi->flags&MP_IMGFLAG_PLANAR && + mpi->flags&MP_IMGFLAG_YUV) ? + (8<<mpi->chroma_x_shift)-1 : 15; // -- maybe FIXME + w2=((w+align)&(~align)); + if(mpi->width!=w2) { + // we have to change width... check if we CAN co it: + int flags=vf->query_format(vf,outfmt,w,h); // should not fail + if(!(flags&3)) MSG_WARN("??? vf_get_new_image{vf->query_format(outfmt)} failed!\n"); + if(flags&VFCAP_ACCEPT_STRIDE){ + mpi->width=w2; + mpi->chroma_width=(w2 + (1<<mpi->chroma_x_shift) - 1)>>mpi->chroma_x_shift; + } + } + } + if(is_static) { + unsigned idx=0; + if(mpi->flags&(MP_IMGTYPE_IP|MP_IMGTYPE_IPB)) { + idx=vf->imgctx.static_idx; + vf->imgctx.static_idx^=1; + } + if(!vf->imgctx.static_planes[idx]) { + mpi_alloc_planes(mpi); + vf->imgctx.static_planes[idx]=mpi->planes[0]; + } + mpi->planes[0]=vf->imgctx.static_planes[idx]; + mpi->flags&=~MP_IMGFLAG_ALLOCATED; + } else + mpi_alloc_planes(mpi); + } // if !DIRECT + } else { + MSG_DBG2("vf_get_new_image forces xp_idx retrieving\n"); + mpi->xp_idx=dae_curr_vdecoded(xp_core); + mpi->flags&=~MP_IMGFLAG_ALLOCATED; + } + if(mpi->flags&MP_IMGFLAG_DRAW_CALLBACK && vf->start_slice) + vf->start_slice(vf,mpi); + if(!(mpi->flags&MP_IMGFLAG_TYPE_DISPLAYED)){ MSG_V("*** [%s] %s%s mp_image_t, %dx%dx%dbpp %s %s, %d bytes\n", - vf->info->name, - (mpi->type==MP_IMGTYPE_EXPORT)?"Exporting": - ((mpi->flags&MP_IMGFLAG_DIRECT)?"Direct Rendering":"Allocating"), - (mpi->flags&MP_IMGFLAG_DRAW_CALLBACK)?" (slices)":"", - mpi->width,mpi->height,mpi->bpp, - (mpi->flags&MP_IMGFLAG_YUV)?"YUV":((mpi->flags&MP_IMGFLAG_SWAPPED)?"BGR":"RGB"), - (mpi->flags&MP_IMGFLAG_PLANAR)?"planar":"packed", - mpi->bpp*mpi->width*mpi->height/8); + vf->info->name, + (mpi->type==MP_IMGTYPE_EXPORT)?"Exporting": + ((mpi->flags&MP_IMGFLAG_DIRECT)?"Direct Rendering":"Allocating"), + (mpi->flags&MP_IMGFLAG_DRAW_CALLBACK)?" (slices)":"", + mpi->width,mpi->height,mpi->bpp, + (mpi->flags&MP_IMGFLAG_YUV)?"YUV":((mpi->flags&MP_IMGFLAG_SWAPPED)?"BGR":"RGB"), + (mpi->flags&MP_IMGFLAG_PLANAR)?"planar":"packed", + mpi->bpp*mpi->width*mpi->height/8); MSG_DBG2("(imgfmt: %x, planes: %x,%x,%x strides: %d,%d,%d, chroma: %dx%d, shift: h:%d,v:%d)\n", mpi->imgfmt, mpi->planes[0], mpi->planes[1], mpi->planes[2], mpi->stride[0], mpi->stride[1], mpi->stride[2], mpi->chroma_width, mpi->chroma_height, mpi->chroma_x_shift, mpi->chroma_y_shift); mpi->flags|=MP_IMGFLAG_TYPE_DISPLAYED; + } } - - } - MSG_DBG2("vf_get_image returns xp_idx=%i\n",mpi->xp_idx); - return mpi; + MSG_DBG2("vf_get_new_image returns xp_idx=%i\n",mpi->xp_idx); + return mpi; } //============================================================================ @@ -418,7 +411,10 @@ } int __FASTCALL__ vf_next_put_slice(struct vf_instance_s* vf,mp_image_t *mpi){ - return vf->next->put_slice(vf->next,mpi); + int rc; + rc = vf->next->put_slice(vf->next,mpi); + free_mp_image(mpi); + return rc; } //============================================================================ @@ -431,10 +427,8 @@ void __FASTCALL__ vf_uninit_filter(vf_instance_t* vf){ if(vf->uninit) vf->uninit(vf); - free_mp_image(vf->imgctx.static_images[0]); - free_mp_image(vf->imgctx.static_images[1]); - free_mp_image(vf->imgctx.temp_images[0]); - free_mp_image(vf->imgctx.export_images[0]); + if(vf->imgctx.static_planes[0]) free(vf->imgctx.static_planes[0]); + if(vf->imgctx.static_planes[1]) free(vf->imgctx.static_planes[1]); mp_free(vf); } Modified: mplayerxp/postproc/vf.h =================================================================== --- mplayerxp/postproc/vf.h 2012-11-12 11:15:50 UTC (rev 341) +++ mplayerxp/postproc/vf.h 2012-11-12 13:14:33 UTC (rev 342) @@ -24,9 +24,7 @@ } vf_info_t; typedef struct vf_image_context_s { - mp_image_t* static_images[2]; - mp_image_t* temp_images[1]; - mp_image_t* export_images[1]; + mp_image_t* static_planes[2]; int static_idx; } vf_image_context_t; @@ -101,7 +99,7 @@ void __FASTCALL__ vf_reinit_vo(unsigned w,unsigned h,unsigned fmt,int reset_cache); void __FASTCALL__ vf_mpi_clear(mp_image_t* mpi,int x0,int y0,int w,int h); -mp_image_t* __FASTCALL__ vf_get_image(vf_instance_t* vf, unsigned int outfmt, int mp_imgtype, int mp_imgflag, int w, int h,unsigned idx); +mp_image_t* __FASTCALL__ vf_get_new_image(vf_instance_t* vf, unsigned int outfmt, int mp_imgtype, int mp_imgflag, int w, int h,unsigned idx); int __FASTCALL__ vf_query_format(vf_instance_t* vf, unsigned int fmt,unsigned width,unsigned height); vf_instance_t* __FASTCALL__ vf_open_filter(vf_instance_t* next,sh_video_t *sh,const char *name,const char *args,any_t*libinput); Modified: mplayerxp/postproc/vf_1bpp.c =================================================================== --- mplayerxp/postproc/vf_1bpp.c 2012-11-12 11:15:50 UTC (rev 341) +++ mplayerxp/postproc/vf_1bpp.c 2012-11-12 13:14:33 UTC (rev 342) @@ -110,7 +110,7 @@ mp_image_t *dmpi; // hope we'll get DR buffer: - dmpi=vf_get_image(vf->next,vf->priv->fmt, + dmpi=vf_get_new_image(vf->next,vf->priv->fmt, MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE, mpi->w, mpi->h,mpi->xp_idx); Modified: mplayerxp/postproc/vf_2xsai.c =================================================================== --- mplayerxp/postproc/vf_2xsai.c 2012-11-12 11:15:50 UTC (rev 341) +++ mplayerxp/postproc/vf_2xsai.c 2012-11-12 13:14:33 UTC (rev 342) @@ -282,7 +282,7 @@ mp_image_t *dmpi; // hope we'll get DR buffer: - dmpi=vf_get_image(vf->next,mpi->imgfmt, + dmpi=vf_get_new_image(vf->next,mpi->imgfmt, MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE, 2*mpi->w, 2*mpi->h,mpi->xp_idx); Modified: mplayerxp/postproc/vf_delogo.c =================================================================== --- mplayerxp/postproc/vf_delogo.c 2012-11-12 11:15:50 UTC (rev 341) +++ mplayerxp/postproc/vf_delogo.c 2012-11-12 13:14:33 UTC (rev 342) @@ -135,7 +135,7 @@ if(mpi->flags&MP_IMGFLAG_PRESERVE) return; // don't change if(mpi->imgfmt!=vf->priv->outfmt) return; // colorspace differ // ok, we can do pp in-place (or pp disabled): - vf->dmpi=vf_get_image(vf->next,mpi->imgfmt, + vf->dmpi=vf_get_new_image(vf->next,mpi->imgfmt, mpi->type, mpi->flags,mpi->w, mpi->h,mpi->xp_idx); mpi->planes[0]=vf->dmpi->planes[0]; mpi->stride[0]=vf->dmpi->stride[0]; @@ -155,7 +155,7 @@ if(!(mpi->flags&MP_IMGFLAG_DIRECT)){ // no DR, so get a new image! hope we'll get DR buffer: - vf->dmpi=vf_get_image(vf->next,vf->priv->outfmt, + vf->dmpi=vf_get_new_image(vf->next,vf->priv->outfmt, MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE, mpi->w,mpi->h,mpi->xp_idx); } Modified: mplayerxp/postproc/vf_denoise3d.c =================================================================== --- mplayerxp/postproc/vf_denoise3d.c 2012-11-12 11:15:50 UTC (rev 341) +++ mplayerxp/postproc/vf_denoise3d.c 2012-11-12 13:14:33 UTC (rev 342) @@ -183,7 +183,7 @@ int ch= mpi->h >> mpi->chroma_y_shift; int W = mpi->w, H = mpi->h; - mp_image_t *dmpi=vf_get_image(vf->next,mpi->imgfmt, + mp_image_t *dmpi=vf_get_new_image(vf->next,mpi->imgfmt, MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE, mpi->w,mpi->h,mpi->xp_idx); @@ -228,7 +228,7 @@ int ch= mpi->h >> mpi->chroma_y_shift; int W = mpi->w, H = mpi->h; - mp_image_t *dmpi=vf_get_image(vf->next,mpi->imgfmt, + mp_image_t *dmpi=vf_get_new_image(vf->next,mpi->imgfmt, MP_IMGTYPE_IP, MP_IMGFLAG_ACCEPT_STRIDE, mpi->w,mpi->h,mpi->xp_idx); Modified: mplayerxp/postproc/vf_dint.c =================================================================== --- mplayerxp/postproc/vf_dint.c 2012-11-12 11:15:50 UTC (rev 341) +++ mplayerxp/postproc/vf_dint.c 2012-11-12 13:14:33 UTC (rev 342) @@ -83,7 +83,7 @@ int finalize; mp_image_t *pmpi; - mp_image_t *dmpi=vf_get_image(vf->next,mpi->imgfmt, + mp_image_t *dmpi=vf_get_new_image(vf->next,mpi->imgfmt, MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE, mpi->w,mpi->h,mpi->xp_idx); if(!dmpi) return 0; @@ -301,7 +301,7 @@ { int rowsize; - vf->priv->pmpi = vf_get_image (vf->next, outfmt, MP_IMGTYPE_TEMP, + vf->priv->pmpi = vf_get_new_image (vf->next, outfmt, MP_IMGTYPE_TEMP, 0,width, height, XP_IDX_INVALID); if (!(vf->priv->pmpi->flags & MP_IMGFLAG_PLANAR) && outfmt != IMGFMT_RGB32 && outfmt != IMGFMT_BGR32 && Modified: mplayerxp/postproc/vf_down3dright.c =================================================================== --- mplayerxp/postproc/vf_down3dright.c 2012-11-12 11:15:50 UTC (rev 341) +++ mplayerxp/postproc/vf_down3dright.c 2012-11-12 13:14:33 UTC (rev 342) @@ -91,7 +91,7 @@ mp_image_t *dmpi; int finalize; // hope we'll get DR buffer: - dmpi=vf_get_image(vf->next, IMGFMT_YV12, + dmpi=vf_get_new_image(vf->next, IMGFMT_YV12, MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE, mpi->w * vf->priv->scalew, mpi->h / vf->priv->scaleh - vf->priv->skipline,mpi->xp_idx); Modified: mplayerxp/postproc/vf_eq.c =================================================================== --- mplayerxp/postproc/vf_eq.c 2012-11-12 11:15:50 UTC (rev 341) +++ mplayerxp/postproc/vf_eq.c 2012-11-12 13:14:33 UTC (rev 342) @@ -263,7 +263,7 @@ eq2->buf[0] = (unsigned char *) mp_realloc (eq2->buf[0], img_n); } - dst = vf_get_image (vf->next, src->imgfmt, MP_IMGTYPE_EXPORT, 0,src->w, src->h,src->xp_idx); + dst = vf_get_new_image (vf->next, src->imgfmt, MP_IMGTYPE_EXPORT, 0,src->w, src->h,src->xp_idx); #ifdef _OPENMP #pragma omp parallel for Modified: mplayerxp/postproc/vf_expand.c =================================================================== --- mplayerxp/postproc/vf_expand.c 2012-11-12 11:15:50 UTC (rev 341) +++ mplayerxp/postproc/vf_expand.c 2012-11-12 13:14:33 UTC (rev 342) @@ -51,16 +51,16 @@ if(vf->priv->new_frame) { vf->priv->new_frame = 0; - dmpi=vf_get_image(vf->next,mpi->imgfmt, + dmpi=vf_get_new_image(vf->next,mpi->imgfmt, MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE, vf->priv->w,vf->priv->up_h,mpi->xp_idx); vf_mpi_clear(dmpi,0,0,vf->priv->w,vf->priv->up_h); - dmpi=vf_get_image(vf->next,mpi->imgfmt, + dmpi=vf_get_new_image(vf->next,mpi->imgfmt, MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE, vf->priv->w,vf->priv->up_h+vf->priv->h+vf->priv->dn_h,mpi->xp_idx); vf_mpi_clear(dmpi,0,0,vf->priv->w,vf->priv->dn_h); } - dmpi=vf_get_image(vf->next,mpi->imgfmt, + dmpi=vf_get_new_image(vf->next,mpi->imgfmt, MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE, mpi->w,mpi->h+vf->priv->up_h,mpi->xp_idx); finalize = dmpi->flags&MP_IMGFLAG_FINALIZED; Modified: mplayerxp/postproc/vf_flip.c =================================================================== --- mplayerxp/postproc/vf_flip.c 2012-11-12 11:15:50 UTC (rev 341) +++ mplayerxp/postproc/vf_flip.c 2012-11-12 13:14:33 UTC (rev 342) @@ -45,7 +45,7 @@ return vf_next_put_slice(vf,(mp_image_t*)mpi->priv); } - vf->dmpi=vf_get_image(vf->next,mpi->imgfmt, + vf->dmpi=vf_get_new_image(vf->next,mpi->imgfmt, MP_IMGTYPE_EXPORT, MP_IMGFLAG_ACCEPT_STRIDE, mpi->width, mpi->height,mpi->xp_idx); Modified: mplayerxp/postproc/vf_framestep.c =================================================================== --- mplayerxp/postproc/vf_framestep.c 2012-11-12 11:15:50 UTC (rev 341) +++ mplayerxp/postproc/vf_framestep.c 2012-11-12 13:14:33 UTC (rev 342) @@ -109,7 +109,7 @@ if (skip == 0) { /* Get image, export type (we don't modify tghe image) */ - dmpi=vf_get_image(vf->next, mpi->imgfmt, + dmpi=vf_get_new_image(vf->next, mpi->imgfmt, MP_IMGTYPE_EXPORT, 0, mpi->w, mpi->h,mpi->xp_idx); /* Copy only the pointer ( MP_IMGTYPE_EXPORT ! ) */ Modified: mplayerxp/postproc/vf_il.c =================================================================== --- mplayerxp/postproc/vf_il.c 2012-11-12 11:15:50 UTC (rev 341) +++ mplayerxp/postproc/vf_il.c 2012-11-12 13:14:33 UTC (rev 342) @@ -95,7 +95,7 @@ FilterParam *luma = &vf->priv->lumaParam; FilterParam *chroma= &vf->priv->chromaParam; - mp_image_t *dmpi=vf_get_image(vf->next,mpi->imgfmt, + mp_image_t *dmpi=vf_get_new_image(vf->next,mpi->imgfmt, MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE, mpi->w,mpi->h,mpi->xp_idx); Modified: mplayerxp/postproc/vf_menu.c =================================================================== --- mplayerxp/postproc/vf_menu.c 2012-11-12 11:15:50 UTC (rev 341) +++ mplayerxp/postproc/vf_menu.c 2012-11-12 13:14:33 UTC (rev 342) @@ -125,7 +125,7 @@ mp_image_t *dmpi; if(mpi->type == MP_IMGTYPE_TEMP && (!(mpi->flags&MP_IMGFLAG_PRESERVE)) ) { - dmpi = vf_get_image(vf->next,mpi->imgfmt,mpi->type, mpi->flags,mpi->w, mpi->h,mpi->xp_idx); + dmpi = vf_get_new_image(vf->next,mpi->imgfmt,mpi->type, mpi->flags,mpi->w, mpi->h,mpi->xp_idx); memcpy(mpi->planes,dmpi->planes,MP_MAX_PLANES*sizeof(unsigned char*)); memcpy(mpi->stride,dmpi->stride,MP_MAX_PLANES*sizeof(unsigned int)); mpi->flags|=MP_IMGFLAG_DIRECT; @@ -142,7 +142,7 @@ mp_image_t *dmpi = NULL; if (vf->priv->passthrough) { - dmpi=vf_get_image(vf->next, IMGFMT_MPEGPES, MP_IMGTYPE_EXPORT, + dmpi=vf_get_new_image(vf->next, IMGFMT_MPEGPES, MP_IMGTYPE_EXPORT, 0, mpi->w, mpi->h,mpi->xp_idx); dmpi->planes[0]=mpi->planes[0]; return vf_next_put_slice(vf,dmpi); @@ -185,7 +185,7 @@ if(mpi->flags&MP_IMGFLAG_DIRECT) dmpi = mpi->priv; else { - dmpi = vf_get_image(vf->next,mpi->imgfmt, + dmpi = vf_get_new_image(vf->next,mpi->imgfmt, MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE, mpi->w,mpi->h,mpi->xp_idx); copy_mpi(dmpi,mpi); @@ -199,7 +199,7 @@ if(mpi->flags&MP_IMGFLAG_DIRECT) dmpi = mpi->priv; else { - dmpi = vf_get_image(vf->next,mpi->imgfmt, + dmpi = vf_get_new_image(vf->next,mpi->imgfmt, MP_IMGTYPE_EXPORT, MP_IMGFLAG_ACCEPT_STRIDE, mpi->w,mpi->h,mpi->xp_idx); Modified: mplayerxp/postproc/vf_mirror.c =================================================================== --- mplayerxp/postproc/vf_mirror.c 2012-11-12 11:15:50 UTC (rev 341) +++ mplayerxp/postproc/vf_mirror.c 2012-11-12 13:14:33 UTC (rev 342) @@ -99,7 +99,7 @@ mp_image_t *dmpi; int finalize; // hope we'll get DR buffer: - dmpi=vf_get_image(vf->next,mpi->imgfmt, + dmpi=vf_get_new_image(vf->next,mpi->imgfmt, MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE, mpi->w, mpi->h, mpi->xp_idx); finalize = dmpi->flags&MP_IMGFLAG_FINALIZED; Modified: mplayerxp/postproc/vf_noise.c =================================================================== --- mplayerxp/postproc/vf_noise.c 2012-11-12 11:15:50 UTC (rev 341) +++ mplayerxp/postproc/vf_noise.c 2012-11-12 13:14:33 UTC (rev 342) @@ -327,7 +327,7 @@ if(mpi->flags&MP_IMGFLAG_PRESERVE) return; // don't change if(mpi->imgfmt!=vf->priv->outfmt) return; // colorspace differ // ok, we can do pp in-place (or pp disabled): - vf->dmpi=vf_get_image(vf->next,mpi->imgfmt, + vf->dmpi=vf_get_new_image(vf->next,mpi->imgfmt, mpi->type, mpi->flags, mpi->w, mpi->h,mpi->xp_idx); mpi->planes[0]=vf->dmpi->planes[0]; mpi->stride[0]=vf->dmpi->stride[0]; @@ -347,7 +347,7 @@ if(!(mpi->flags&MP_IMGFLAG_DIRECT)){ // no DR, so get a new image! hope we'll get DR buffer: - vf->dmpi=vf_get_image(vf->next,vf->priv->outfmt, + vf->dmpi=vf_get_new_image(vf->next,vf->priv->outfmt, MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE, mpi->w,mpi->h,mpi->xp_idx); //printf("nodr\n"); Modified: mplayerxp/postproc/vf_ow.c =================================================================== --- mplayerxp/postproc/vf_ow.c 2012-11-12 11:15:50 UTC (rev 341) +++ mplayerxp/postproc/vf_ow.c 2012-11-12 13:14:33 UTC (rev 342) @@ -219,7 +219,7 @@ static void __FASTCALL__ get_image(struct vf_instance_s* vf, mp_image_t *mpi){ if(mpi->flags&MP_IMGFLAG_PRESERVE) return; // don't change // ok, we can do pp in-place (or pp disabled): - vf->dmpi=vf_get_image(vf->next,mpi->imgfmt, + vf->dmpi=vf_get_new_image(vf->next,mpi->imgfmt, mpi->type, mpi->flags | MP_IMGFLAG_READABLE, mpi->width, mpi->height,mpi->xp_idx); mpi->planes[0]=vf->dmpi->planes[0]; mpi->stride[0]=vf->dmpi->stride[0]; @@ -238,7 +238,7 @@ if(!(mpi->flags&MP_IMGFLAG_DIRECT)){ // no DR, so get a new image! hope we'll get DR buffer: - dmpi=vf_get_image(vf->next,mpi->imgfmt, + dmpi=vf_get_new_image(vf->next,mpi->imgfmt, MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE|MP_IMGFLAG_PREFER_ALIGNED_STRIDE, mpi->width,mpi->height,mpi->xp_idx); Modified: mplayerxp/postproc/vf_palette.c =================================================================== --- mplayerxp/postproc/vf_palette.c 2012-11-12 11:15:50 UTC (rev 341) +++ mplayerxp/postproc/vf_palette.c 2012-11-12 13:14:33 UTC (rev 342) @@ -78,7 +78,7 @@ mp_image_t *dmpi; // hope we'll get DR buffer: - dmpi=vf_get_image(vf->next,vf->priv->fmt, + dmpi=vf_get_new_image(vf->next,vf->priv->fmt, MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE, mpi->w, mpi->h, mpi->xp_idx); Modified: mplayerxp/postproc/vf_panscan.c =================================================================== --- mplayerxp/postproc/vf_panscan.c 2012-11-12 11:15:50 UTC (rev 341) +++ mplayerxp/postproc/vf_panscan.c 2012-11-12 13:14:33 UTC (rev 342) @@ -101,7 +101,7 @@ /* In hope that mpi->x === 0 */ cw=MIN(sw,dw); ch=MIN(sh,dh); - dmpi=vf_get_image(vf->next,mpi->imgfmt, + dmpi=vf_get_new_image(vf->next,mpi->imgfmt, MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE, cw,ch,mpi->xp_idx); finalize = dmpi->flags&MP_IMGFLAG_FINALIZED; Modified: mplayerxp/postproc/vf_perspective.c =================================================================== --- mplayerxp/postproc/vf_perspective.c 2012-11-12 11:15:50 UTC (rev 341) +++ mplayerxp/postproc/vf_perspective.c 2012-11-12 13:14:33 UTC (rev 342) @@ -258,7 +258,7 @@ int cw= mpi->w >> mpi->chroma_x_shift; int ch= mpi->h >> mpi->chroma_y_shift; - mp_image_t *dmpi=vf_get_image(vf->next,mpi->imgfmt, + mp_image_t *dmpi=vf_get_new_image(vf->next,mpi->imgfmt, MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE, mpi->w,mpi->h,mpi->xp_idx); Modified: mplayerxp/postproc/vf_pp.c =================================================================== --- mplayerxp/postproc/vf_pp.c 2012-11-12 11:15:50 UTC (rev 341) +++ mplayerxp/postproc/vf_pp.c 2012-11-12 13:14:33 UTC (rev 342) @@ -85,7 +85,7 @@ if(!(mpi->flags&MP_IMGFLAG_ACCEPT_STRIDE) && mpi->imgfmt!=vf->priv->outfmt) return; // colorspace differ // ok, we can do pp in-place (or pp disabled): - vf->dmpi=vf_get_image(vf->next,mpi->imgfmt, + vf->dmpi=vf_get_new_image(vf->next,mpi->imgfmt, mpi->type, mpi->flags, mpi->w, mpi->h,mpi->xp_idx); mpi->planes[0]=vf->dmpi->planes[0]; mpi->stride[0]=vf->dmpi->stride[0]; @@ -102,7 +102,7 @@ static int __FASTCALL__ put_slice(struct vf_instance_s* vf, mp_image_t *mpi){ if(!(mpi->flags&MP_IMGFLAG_DIRECT)){ // no DR, so get a new image! hope we'll get DR buffer: - vf->dmpi=vf_get_image(vf->next,mpi->imgfmt, + vf->dmpi=vf_get_new_image(vf->next,mpi->imgfmt, MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE|MP_IMGFLAG_PREFER_ALIGNED_STRIDE, (mpi->w+7)&(~7),(mpi->h+7)&(~7),mpi->xp_idx); } Modified: mplayerxp/postproc/vf_raw.c =================================================================== --- mplayerxp/postproc/vf_raw.c 2012-11-12 11:15:50 UTC (rev 341) +++ mplayerxp/postproc/vf_raw.c 2012-11-12 13:14:33 UTC (rev 342) @@ -33,7 +33,7 @@ mp_image_t *dmpi; // hope we'll get DR buffer: - dmpi=vf_get_image(vf->next,mpi->imgfmt, + dmpi=vf_get_new_image(vf->next,mpi->imgfmt, MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE, mpi->w,mpi->h,mpi->xp_idx); if(mpi->flags&MP_IMGFLAG_PLANAR){ Modified: mplayerxp/postproc/vf_rectangle.c =================================================================== --- mplayerxp/postproc/vf_rectangle.c 2012-11-12 11:15:50 UTC (rev 341) +++ mplayerxp/postproc/vf_rectangle.c 2012-11-12 13:14:33 UTC (rev 342) @@ -67,7 +67,7 @@ int finalize; unsigned int bpp = mpi->bpp / 8; unsigned int x, y, w, h; - dmpi = vf_get_image(vf->next, mpi->imgfmt, MP_IMGTYPE_TEMP, + dmpi = vf_get_new_image(vf->next, mpi->imgfmt, MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE | MP_IMGFLAG_PREFER_ALIGNED_STRIDE, mpi->w, mpi->h,mpi->xp_idx); finalize = dmpi->flags&MP_IMGFLAG_FINALIZED; Modified: mplayerxp/postproc/vf_rgb2bgr.c =================================================================== --- mplayerxp/postproc/vf_rgb2bgr.c 2012-11-12 11:15:50 UTC (rev 341) +++ mplayerxp/postproc/vf_rgb2bgr.c 2012-11-12 13:14:33 UTC (rev 342) @@ -51,7 +51,7 @@ mp_image_t *dmpi; // hope we'll get DR buffer: - dmpi=vf_get_image(vf->next,vf->priv->fmt, + dmpi=vf_get_new_image(vf->next,vf->priv->fmt, MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE, mpi->w, mpi->h, mpi->xp_idx); Modified: mplayerxp/postproc/vf_rotate.c =================================================================== --- mplayerxp/postproc/vf_rotate.c 2012-11-12 11:15:50 UTC (rev 341) +++ mplayerxp/postproc/vf_rotate.c 2012-11-12 13:14:33 UTC (rev 342) @@ -130,18 +130,18 @@ // hope we'll get DR buffer: if(vf->priv->direction==180) { - dmpi=vf_get_image(vf->next,mpi->imgfmt, + dmpi=vf_get_new_image(vf->next,mpi->imgfmt, MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE, mpi->w, mpi->h, mpi->xp_idx); } else { if(vf->priv->direction==90) - dmpi=vf_get_image(vf->next,mpi->imgfmt, + dmpi=vf_get_new_image(vf->next,mpi->imgfmt, MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE, mpi->h, mpi->w, mpi->xp_idx); else - dmpi=vf_get_image(vf->next,mpi->imgfmt, + dmpi=vf_get_new_image(vf->next,mpi->imgfmt, MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE, mpi->h, mpi->w, mpi->xp_idx); } Modified: mplayerxp/postproc/vf_scale.c =================================================================== --- mplayerxp/postproc/vf_scale.c 2012-11-12 11:15:50 UTC (rev 341) +++ mplayerxp/postproc/vf_scale.c 2012-11-12 13:14:33 UTC (rev 342) @@ -341,7 +341,7 @@ stride[3]=mpi->stride[3]; } MSG_DBG2("vf_scale.put_frame was called\n"); - dmpi=vf_get_image(vf->next,vf->priv->fmt, + dmpi=vf_get_new_image(vf->next,vf->priv->fmt, MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE | MP_IMGFLAG_PREFER_ALIGNED_STRIDE, vf->priv->w, vf->priv->h,mpi->xp_idx); scale(vf->priv->ctx, vf->priv->ctx2, planes, stride, mpi->y, mpi->h, dmpi->planes, dmpi->stride, vf->priv->interlaced); @@ -364,7 +364,7 @@ stride[3]=mpi->stride[3]; } MSG_DBG2("vf_scale.put_slice was called[%i %i]\n",mpi->y, mpi->h); - dmpi=vf_get_image(vf->next,vf->priv->fmt, + dmpi=vf_get_new_image(vf->next,vf->priv->fmt, MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE | MP_IMGFLAG_PREFER_ALIGNED_STRIDE, vf->priv->w, vf->priv->h,mpi->xp_idx); /* Try to fake first slice*/ Modified: mplayerxp/postproc/vf_smartblur.c =================================================================== --- mplayerxp/postproc/vf_smartblur.c 2012-11-12 11:15:50 UTC (rev 341) +++ mplayerxp/postproc/vf_smartblur.c 2012-11-12 13:14:33 UTC (rev 342) @@ -169,7 +169,7 @@ int cw= mpi->w >> mpi->chroma_x_shift; int ch= mpi->h >> mpi->chroma_y_shift; - mp_image_t *dmpi=vf_get_image(vf->next,mpi->imgfmt, + mp_image_t *dmpi=vf_get_new_image(vf->next,mpi->imgfmt, MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE, mpi->w,mpi->h,mpi->xp_idx); @@ -320,7 +320,7 @@ int cw= mpi->w >> mpi->chroma_x_shift; int ch= mpi->h >> mpi->chroma_y_shift; - mp_image_t *dmpi=vf_get_image(vf->next,mpi->imgfmt, + mp_image_t *dmpi=vf_get_new_image(vf->next,mpi->imgfmt, MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE, mpi->w,mpi->h,mpi->xp_idx); @@ -446,7 +446,7 @@ int cw= mpi->w >> mpi->chroma_x_shift; int ch= mpi->h >> mpi->chroma_y_shift; - mp_image_t *dmpi=vf_get_image(vf->next,mpi->imgfmt, + mp_image_t *dmpi=vf_get_new_image(vf->next,mpi->imgfmt, MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE, mpi->w,mpi->h,mpi->xp_idx); Modified: mplayerxp/postproc/vf_softpulldown.c =================================================================== --- mplayerxp/postproc/vf_softpulldown.c 2012-11-12 11:15:50 UTC (rev 341) +++ mplayerxp/postproc/vf_softpulldown.c 2012-11-12 13:14:33 UTC (rev 342) @@ -44,9 +44,9 @@ int flags = mpi->fields; int state = vf->priv->state; - dmpi = vf_get_image(vf->next, mpi->imgfmt, - MP_IMGTYPE_STATIC, MP_IMGFLAG_ACCEPT_STRIDE | - MP_IMGFLAG_PRESERVE, mpi->w, mpi->h,mpi->xp_idx); + dmpi = vf_get_new_image(vf->next, mpi->imgfmt, + MP_IMGTYPE_STATIC, MP_IMGFLAG_ACCEPT_STRIDE | + MP_IMGFLAG_PRESERVE, mpi->w, mpi->h,mpi->xp_idx); finalize = dmpi->flags&MP_IMGFLAG_FINALIZED; vf->priv->in++; Modified: mplayerxp/postproc/vf_swapuv.c =================================================================== --- mplayerxp/postproc/vf_swapuv.c 2012-11-12 11:15:50 UTC (rev 341) +++ mplayerxp/postproc/vf_swapuv.c 2012-11-12 13:14:33 UTC (rev 342) @@ -35,7 +35,7 @@ //===========================================================================// static void __FASTCALL__ get_image(struct vf_instance_s* vf, mp_image_t *mpi){ - mp_image_t *dmpi= vf_get_image(vf->next, mpi->imgfmt, + mp_image_t *dmpi= vf_get_new_image(vf->next, mpi->imgfmt, mpi->type, mpi->flags, mpi->w, mpi->h,mpi->xp_idx); mpi->planes[0]=dmpi->planes[0]; @@ -57,7 +57,7 @@ if(mpi->flags&MP_IMGFLAG_DIRECT){ dmpi=(mp_image_t*)mpi->priv; } else { - dmpi=vf_get_image(vf->next, mpi->imgfmt, MP_IMGTYPE_EXPORT, 0, mpi->w, mpi->h,mpi->xp_idx); + dmpi=vf_get_new_image(vf->next, mpi->imgfmt, MP_IMGTYPE_EXPORT, 0, mpi->w, mpi->h,mpi->xp_idx); assert(mpi->flags&MP_IMGFLAG_PLANAR); dmpi->planes[0]=mpi->planes[0]; dmpi->planes[1]=mpi->planes[2]; Modified: mplayerxp/postproc/vf_test.c =================================================================== --- mplayerxp/postproc/vf_test.c 2012-11-12 11:15:50 UTC (rev 341) +++ mplayerxp/postproc/vf_test.c 2012-11-12 13:14:33 UTC (rev 342) @@ -121,7 +121,7 @@ int x, y; // hope we'll get DR buffer: - dmpi=vf_get_image(vf->next,vf->priv->fmt, + dmpi=vf_get_new_image(vf->next,vf->priv->fmt, MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE, mpi->w, mpi->h, mpi->xp_idx); @@ -376,7 +376,7 @@ int frame= vf->priv->frame_num; // hope we'll get DR buffer: - dmpi=vf_get_image(vf->next,IMGFMT_YV12, + dmpi=vf_get_new_image(vf->next,IMGFMT_YV12, MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE, mpi->w,mpi->h,mpi->xp_idx); Modified: mplayerxp/postproc/vf_unsharp.c =================================================================== --- mplayerxp/postproc/vf_unsharp.c 2012-11-12 11:15:50 UTC (rev 341) +++ mplayerxp/postproc/vf_unsharp.c 2012-11-12 13:14:33 UTC (rev 342) @@ -187,7 +187,7 @@ if( mpi->imgfmt!=vf->priv->outfmt ) return; // colorspace differ - vf->dmpi = vf_get_image( vf->next, mpi->imgfmt, mpi->type, mpi->flags, mpi->w, mpi->h,mpi->xp_idx ); + vf->dmpi = vf_get_new_image( vf->next, mpi->imgfmt, mpi->type, mpi->flags, mpi->w, mpi->h,mpi->xp_idx ); mpi->planes[0] = vf->dmpi->planes[0]; mpi->stride[0] = vf->dmpi->stride[0]; mpi->width = vf->dmpi->width; @@ -206,7 +206,7 @@ if( !(mpi->flags & MP_IMGFLAG_DIRECT) ) // no DR, so get a new image! hope we'll get DR buffer: - vf->dmpi = vf_get_image( vf->next,vf->priv->outfmt, MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE, mpi->w, mpi->h,mpi->xp_idx); + vf->dmpi = vf_get_new_image( vf->next,vf->priv->outfmt, MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE, mpi->w, mpi->h,mpi->xp_idx); dmpi= vf->dmpi; finalize = dmpi->flags&MP_IMGFLAG_FINALIZED; Modified: mplayerxp/postproc/vf_vo.c =================================================================== --- mplayerxp/postproc/vf_vo.c 2012-11-12 11:15:50 UTC (rev 341) +++ mplayerxp/postproc/vf_vo.c 2012-11-12 13:14:33 UTC (rev 342) @@ -133,12 +133,11 @@ MSG_DBG2("vf_vo_get_image was called failed\n"); } -static int __FASTCALL__ put_slice(struct vf_instance_s* vf, - mp_image_t *mpi){ +static int __FASTCALL__ put_slice(struct vf_instance_s* vf, mp_image_t *mpi){ if(!vo_config_count) return 0; // vo not configured? if(!(mpi->flags & MP_IMGFLAG_FINAL) || (vf->sh->vfilter==vf && !(mpi->flags & MP_IMGFLAG_RENDERED))) { - MSG_DBG2("vf_vo_put_slice was called(%u): %u %u %u %u\n",mpi->xp_idx,mpi->x,mpi->y,mpi->w,mpi->h); - vo_draw_slice(vo_data,mpi); + MSG_DBG2("vf_vo_put_slice was called(%u): %u %u %u %u\n",mpi->xp_idx,mpi->x,mpi->y,mpi->w,mpi->h); + vo_draw_slice(vo_data,mpi); } return 1; } Modified: mplayerxp/postproc/vf_yuvcsp.c =================================================================== --- mplayerxp/postproc/vf_yuvcsp.c 2012-11-12 11:15:50 UTC (rev 341) +++ mplayerxp/postproc/vf_yuvcsp.c 2012-11-12 13:14:33 UTC (rev 342) @@ -36,7 +36,7 @@ uint8_t *y_in, *cb_in, *cr_in; uint8_t *y_out, *cb_out, *cr_out; - vf->dmpi=vf_get_image(vf->next,mpi->imgfmt, + vf->dmpi=vf_get_new_image(vf->next,mpi->imgfmt, MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE, mpi->w, mpi->h,mpi->xp_idx); Modified: mplayerxp/postproc/vf_yuy2.c =================================================================== --- mplayerxp/postproc/vf_yuy2.c 2012-11-12 11:15:50 UTC (rev 341) +++ mplayerxp/postproc/vf_yuy2.c 2012-11-12 13:14:33 UTC (rev 342) @@ -34,7 +34,7 @@ mp_image_t *dmpi; // hope we'll get DR buffer: - dmpi=vf_get_image(vf->next,IMGFMT_YUY2, + dmpi=vf_get_new_image(vf->next,IMGFMT_YUY2, MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE, mpi->w, mpi->h,mpi->xp_idx); Modified: mplayerxp/postproc/vf_yvu9.c =================================================================== --- mplayerxp/postproc/vf_yvu9.c 2012-11-12 11:15:50 UTC (rev 341) +++ mplayerxp/postproc/vf_yvu9.c 2012-11-12 13:14:33 UTC (rev 342) @@ -32,7 +32,7 @@ int y,w,h,finalize; // hope we'll get DR buffer: - dmpi=vf_get_image(vf->next,IMGFMT_YV12, + dmpi=vf_get_new_image(vf->next,IMGFMT_YV12, MP_IMGTYPE_TEMP, 0/*MP_IMGFLAG_ACCEPT_STRIDE*/, mpi->w, mpi->h,mpi->xp_idx); finalize = dmpi->flags&MP_IMGFLAG_FINALIZED; Modified: mplayerxp/xmpcore/mp_image.c =================================================================== --- mplayerxp/xmpcore/mp_image.c 2012-11-12 11:15:50 UTC (rev 341) +++ mplayerxp/xmpcore/mp_image.c 2012-11-12 13:14:33 UTC (rev 342) @@ -159,41 +159,39 @@ } mp_image_t* alloc_mpi(unsigned w, unsigned h, unsigned int fmt,unsigned xp_idx) { - mp_image_t* mpi = new_mp_image(w,h,xp_idx); + mp_image_t* mpi = new_mp_image(w,h,xp_idx); - mp_image_setfmt(mpi,fmt); - mpi_alloc_planes(mpi); - return mpi; + mp_image_setfmt(mpi,fmt); + mpi_alloc_planes(mpi); + return mpi; } void mpi_alloc_planes(mp_image_t *mpi) { - // IF09 - allocate space for 4. plane delta info - unused - if (mpi->imgfmt == IMGFMT_IF09) - { - mpi->planes[0]=mp_memalign(64, mpi->bpp*mpi->width*(mpi->height+2)/8+ - mpi->chroma_width*mpi->chroma_height); - /* delta table, just for fun ;) */ - mpi->planes[3]=mpi->planes[0]+2*(mpi->chroma_width*mpi->chroma_height); - } - else - mpi->planes[0]=mp_memalign(64, mpi->bpp*mpi->width*(mpi->height+2)/8); - if(mpi->flags&MP_IMGFLAG_PLANAR){ - // YV12/I420/YVU9/IF09. feel mp_free to add other planar formats here... - if(!mpi->stride[0]) mpi->stride[0]=mpi->width; - if(!mpi->stride[1]) mpi->stride[1]=mpi->stride[2]=mpi->chroma_width; - if(mpi->flags&MP_IMGFLAG_SWAPPED){ - // I420/IYUV (Y,U,V) - mpi->planes[1]=mpi->planes[0]+mpi->width*mpi->height; - mpi->planes[2]=mpi->planes[1]+mpi->chroma_width*mpi->chroma_height; + unsigned size,delta; + size=mpi->bpp*mpi->width*(mpi->height+2)/8; + delta=0; + // IF09 - allocate space for 4. plane delta info - unused + if (mpi->imgfmt == IMGFMT_IF09) delta=mpi->chroma_width*mpi->chroma_height; + mpi->planes[0]=mp_memalign(64,size+delta); + if(delta) /* delta table, just for fun ;) */ + mpi->planes[3]=mpi->planes[0]+2*(mpi->chroma_width*mpi->chroma_height); + if(mpi->flags&MP_IMGFLAG_PLANAR){ + // YV12/I420/YVU9/IF09. feel mp_free to add other planar formats here... + if(!mpi->stride[0]) mpi->stride[0]=mpi->width; + if(!mpi->stride[1]) mpi->stride[1]=mpi->stride[2]=mpi->chroma_width; + if(mpi->flags&MP_IMGFLAG_SWAPPED){ + // I420/IYUV (Y,U,V) + mpi->planes[1]=mpi->planes[0]+mpi->width*mpi->height; + mpi->planes[2]=mpi->planes[1]+mpi->chroma_width*mpi->chroma_height; + } else { + // YV12,YVU9,IF09 (Y,V,U) + mpi->planes[2]=mpi->planes[0]+mpi->width*mpi->height; + mpi->planes[1]=mpi->planes[2]+mpi->chroma_width*mpi->chroma_height; + } } else { - // YV12,YVU9,IF09 (Y,V,U) - mpi->planes[2]=mpi->planes[0]+mpi->width*mpi->height; - mpi->planes[1]=mpi->planes[2]+mpi->chroma_width*mpi->chroma_height; + if(!mpi->stride[0]) mpi->stride[0]=mpi->width*mpi->bpp/8; } - } else { - if(!mpi->stride[0]) mpi->stride[0]=mpi->width*mpi->bpp/8; - } - mpi->flags|=MP_IMGFLAG_ALLOCATED; + mpi->flags|=MP_IMGFLAG_ALLOCATED; } void copy_mpi(mp_image_t *dmpi,const mp_image_t *mpi) { @@ -218,4 +216,5 @@ dmpi->h = h; dmpi->chroma_height = h >> mpi->chroma_y_shift; dmpi->xp_idx = mpi->xp_idx; + dmpi->flags&=~MP_IMGFLAG_ALLOCATED; } Modified: mplayerxp/xmpcore/sig_hand.c =================================================================== --- mplayerxp/xmpcore/sig_hand.c 2012-11-12 11:15:50 UTC (rev 341) +++ mplayerxp/xmpcore/sig_hand.c 2012-11-12 13:14:33 UTC (rev 342) @@ -23,29 +23,9 @@ #ifdef HAVE_BACKTRACE #include <execinfo.h> -/* Obtain a backtrace and print it to stdout. */ -static void print_trace (void) -{ - any_t*array[10]; - size_t size; - char **strings; - size_t i; - - size = backtrace (array, 10); - strings = backtrace_symbols (array, size); - - MSG_ERR ("Obtained %zd stack frames.\n", size); - - for (i = 0; i < size; i++) - MSG_ERR ("%s\n", strings[i]); - - mp_free (strings); -} - /* A dummy function to make the backtrace more interesting. */ -static void dump_trace (void) -{ - print_trace (); +static void dump_trace (void) { + show_backtrace("Obtained %zd stack frames.\n",mp_conf.max_trace); } #endif static void my_callback(int signo) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |