Mercurial > mplayer.hg
comparison libmpcodecs/vf_ow.c @ 30642:a972c1a4a012
cosmetics: Rename struct vf_instance_s --> vf_instance.
author | diego |
---|---|
date | Sun, 21 Feb 2010 15:48:03 +0000 |
parents | a7b908875c14 |
children |
comparison
equal
deleted
inserted
replaced
30641:b14b32c20935 | 30642:a972c1a4a012 |
---|---|
201 } | 201 } |
202 | 202 |
203 // printf("%f\n", sum/height/width); | 203 // printf("%f\n", sum/height/width); |
204 } | 204 } |
205 | 205 |
206 static int config(struct vf_instance_s* vf, int width, int height, int d_width, int d_height, unsigned int flags, unsigned int outfmt){ | 206 static int config(struct vf_instance *vf, int width, int height, int d_width, int d_height, unsigned int flags, unsigned int outfmt){ |
207 int h= (height+15)&(~15); | 207 int h= (height+15)&(~15); |
208 int i,j; | 208 int i,j; |
209 | 209 |
210 vf->priv->stride= (width+15)&(~15); | 210 vf->priv->stride= (width+15)&(~15); |
211 for(j=0; j<4; j++){ | 211 for(j=0; j<4; j++){ |
214 } | 214 } |
215 | 215 |
216 return vf_next_config(vf,width,height,d_width,d_height,flags,outfmt); | 216 return vf_next_config(vf,width,height,d_width,d_height,flags,outfmt); |
217 } | 217 } |
218 | 218 |
219 static void get_image(struct vf_instance_s* vf, mp_image_t *mpi){ | 219 static void get_image(struct vf_instance *vf, mp_image_t *mpi){ |
220 if(mpi->flags&MP_IMGFLAG_PRESERVE) return; // don't change | 220 if(mpi->flags&MP_IMGFLAG_PRESERVE) return; // don't change |
221 // ok, we can do pp in-place (or pp disabled): | 221 // ok, we can do pp in-place (or pp disabled): |
222 vf->dmpi=vf_get_image(vf->next,mpi->imgfmt, | 222 vf->dmpi=vf_get_image(vf->next,mpi->imgfmt, |
223 mpi->type, mpi->flags | MP_IMGFLAG_READABLE, mpi->width, mpi->height); | 223 mpi->type, mpi->flags | MP_IMGFLAG_READABLE, mpi->width, mpi->height); |
224 mpi->planes[0]=vf->dmpi->planes[0]; | 224 mpi->planes[0]=vf->dmpi->planes[0]; |
231 mpi->stride[2]=vf->dmpi->stride[2]; | 231 mpi->stride[2]=vf->dmpi->stride[2]; |
232 } | 232 } |
233 mpi->flags|=MP_IMGFLAG_DIRECT; | 233 mpi->flags|=MP_IMGFLAG_DIRECT; |
234 } | 234 } |
235 | 235 |
236 static int put_image(struct vf_instance_s* vf, mp_image_t *mpi, double pts){ | 236 static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts){ |
237 mp_image_t *dmpi; | 237 mp_image_t *dmpi; |
238 | 238 |
239 if(!(mpi->flags&MP_IMGFLAG_DIRECT)){ | 239 if(!(mpi->flags&MP_IMGFLAG_DIRECT)){ |
240 // no DR, so get a new image! hope we'll get DR buffer: | 240 // no DR, so get a new image! hope we'll get DR buffer: |
241 dmpi=vf_get_image(vf->next,mpi->imgfmt, | 241 dmpi=vf_get_image(vf->next,mpi->imgfmt, |
252 filter(vf->priv, dmpi->planes[2], mpi->planes[2], dmpi->stride[2], mpi->stride[2], mpi->w>>mpi->chroma_x_shift, mpi->h>>mpi->chroma_y_shift, 0); | 252 filter(vf->priv, dmpi->planes[2], mpi->planes[2], dmpi->stride[2], mpi->stride[2], mpi->w>>mpi->chroma_x_shift, mpi->h>>mpi->chroma_y_shift, 0); |
253 | 253 |
254 return vf_next_put_image(vf,dmpi, pts); | 254 return vf_next_put_image(vf,dmpi, pts); |
255 } | 255 } |
256 | 256 |
257 static void uninit(struct vf_instance_s* vf){ | 257 static void uninit(struct vf_instance *vf){ |
258 int i,j; | 258 int i,j; |
259 if(!vf->priv) return; | 259 if(!vf->priv) return; |
260 | 260 |
261 for(j=0; j<4; j++){ | 261 for(j=0; j<4; j++){ |
262 for(i=0; i<16; i++){ | 262 for(i=0; i<16; i++){ |
268 free(vf->priv); | 268 free(vf->priv); |
269 vf->priv=NULL; | 269 vf->priv=NULL; |
270 } | 270 } |
271 | 271 |
272 //===========================================================================// | 272 //===========================================================================// |
273 static int query_format(struct vf_instance_s* vf, unsigned int fmt){ | 273 static int query_format(struct vf_instance *vf, unsigned int fmt){ |
274 switch(fmt){ | 274 switch(fmt){ |
275 case IMGFMT_YVU9: | 275 case IMGFMT_YVU9: |
276 case IMGFMT_IF09: | 276 case IMGFMT_IF09: |
277 case IMGFMT_YV12: | 277 case IMGFMT_YV12: |
278 case IMGFMT_I420: | 278 case IMGFMT_I420: |