[MPlayer-dev-eng] [RFC] skipping video filters
Reimar Döffinger
Reimar.Doeffinger at stud.uni-karlsruhe.de
Thu Nov 23 19:57:14 CET 2006
Hello,
attached is a code fragment that would add a skip_filter variable to the
vf instance, which when set would just cause the put_image be skipped.
I wondered if you think this makes sense and will work with enough
filters so that applying this together with a slave command to
set/remove this flag would make sense...
Greetings,
Reimar Döffinger
-------------- next part --------------
Index: libmpcodecs/vf.c
===================================================================
--- libmpcodecs/vf.c (revision 21180)
+++ libmpcodecs/vf.c (working copy)
@@ -668,7 +672,9 @@
}
int vf_next_put_image(struct vf_instance_s* vf,mp_image_t *mpi, double pts){
- return vf->next->put_image(vf->next,mpi, pts);
+ vf = vf->next;
+ while (vf->skip_filter) vf = vf->next;
+ return vf->put_image(vf,mpi, pts);
}
void vf_next_draw_slice(struct vf_instance_s* vf,unsigned char** src, int * stride,int w, int h, int x, int y){
Index: libmpcodecs/vf.h
===================================================================
--- libmpcodecs/vf.h (revision 21180)
+++ libmpcodecs/vf.h (working copy)
@@ -55,6 +55,7 @@
struct vf_instance_s* next;
mp_image_t *dmpi;
struct vf_priv_s* priv;
+ int skip_filter;
} vf_instance_t;
// control codes:
Index: libmpcodecs/dec_video.c
===================================================================
--- libmpcodecs/dec_video.c (revision 21180)
+++ libmpcodecs/dec_video.c (working copy)
@@ -385,7 +385,9 @@
unsigned int t2 = GetTimer();
vf_instance_t *vf = sh_video->vfilter;
// apply video filters and call the leaf vo/ve
-int ret = vf->put_image(vf,mpi, pts);
+int ret;
+while (vf->skip_filter) vf = vf->next;
+ret = vf->put_image(vf,mpi, pts);
if(ret>0) {
vf->control(vf,VFCTRL_DRAW_OSD,NULL);
#ifdef USE_ASS
More information about the MPlayer-dev-eng
mailing list