summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2012-12-26 21:24:54 +0100
committerwm4 <wm4@nowhere>2013-01-13 20:04:12 +0100
commit036d38580ac6d6d07e70aade8806d75d1989dd84 (patch)
tree1a97e8a0bb5375fc3712aa31d89e901be40372ab /video
parentba2e20414a86546e18b7b9fd9e28498e2888ebf1 (diff)
downloadmpv-036d38580ac6d6d07e70aade8806d75d1989dd84.tar.bz2
mpv-036d38580ac6d6d07e70aade8806d75d1989dd84.tar.xz
vf_flip: make it work with more image formats
Diffstat (limited to 'video')
-rw-r--r--video/filter/vf_flip.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/video/filter/vf_flip.c b/video/filter/vf_flip.c
index aa9fbaf0da..c94da49403 100644
--- a/video/filter/vf_flip.c
+++ b/video/filter/vf_flip.c
@@ -30,34 +30,34 @@
//===========================================================================//
-static int config(struct vf_instance *vf,
- int width, int height, int d_width, int d_height,
- unsigned int flags, unsigned int outfmt){
- flags&=~VOFLAG_FLIPPING; // remove the FLIP flag
+static int config(struct vf_instance *vf, int width, int height,
+ int d_width, int d_height,
+ unsigned int flags, unsigned int outfmt)
+{
+ flags &= ~VOFLAG_FLIPPING; // remove the VO flip flag
return vf_next_config(vf,width,height,d_width,d_height,flags,outfmt);
}
static struct mp_image *filter(struct vf_instance *vf, struct mp_image *mpi)
{
- mpi->planes[0]=mpi->planes[0]+
- mpi->stride[0]*(mpi->h-1);
- mpi->stride[0]=-mpi->stride[0];
- if(mpi->flags&MP_IMGFLAG_PLANAR){
- mpi->planes[1]=mpi->planes[1]+
- mpi->stride[1]*((mpi->h>>mpi->chroma_y_shift)-1);
- mpi->stride[1]=-mpi->stride[1];
- mpi->planes[2]=mpi->planes[2]+
- mpi->stride[2]*((mpi->h>>mpi->chroma_y_shift)-1);
- mpi->stride[2]=-mpi->stride[2];
+ for (int p = 0; p < mpi->num_planes; p++) {
+ mpi->planes[p] = mpi->planes[p] + mpi->stride[p] * (mpi->plane_h[p] - 1);
+ mpi->stride[p] = -mpi->stride[p];
}
return mpi;
}
-//===========================================================================//
+static int query_format(struct vf_instance *vf, unsigned int fmt)
+{
+ if (!IMGFMT_IS_HWACCEL(fmt))
+ return vf_next_query_format(vf, fmt);
+ return 0;
+}
static int vf_open(vf_instance_t *vf, char *args){
vf->config=config;
vf->filter=filter;
+ vf->query_format = query_format;
return 1;
}