[MPlayer-dev-eng] [PATCH V2.0] vf_next_draw_slice for vf_rotate

Balatoni Denes pnis at coder.hu
Wed Nov 20 23:51:31 CET 2002


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi!

Ok, I am no expert on this, I was looking at it for like 8 hours, but maybe
I still don't get the whole picture.

> > The problem was that vo wanted to use slices, but in passthrough draw
> > slice was not passed on to vf_vo by vf_rotate.
>
> heh ?????
>
> draw_slice is null by default and codec won't use it if it's null.
Ok, it is called. If vf_rotate is passthrough the codec will get mpi
made while looking at vf_vo's vf_instance , and when vf_get_image looks at 
vf->draw_slice  for vf_vo it will see it's not null (vf_vo supports slices 
most of the time). 

Anyway I attached a new patch with check for vf->next->draw_slice being null.
This is not fool proof either I think, if the next filter decides to not 
accept slices anymore, than this will break I am afraid. But there isn't such 
filter now, is there? And maybe that doesn't cause a problem, it needs to 
be thought over. By somebody.


bye
Denes


- -- 
"Use the source Luke !"
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.4 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE93BHzaQToeq3jgogRAoZuAJwN4zwksPcqM5iXEg8R/H80MCElhQCfd774
hkKbzJM1xWq0cR0uA2iqPOQ=
=7dH7
-----END PGP SIGNATURE-----
-------------- next part --------------
diff -Naur main/libmpcodecs/vf.c main.gany/libmpcodecs/vf.c
--- main/libmpcodecs/vf.c	Tue Nov  5 14:28:50 2002
+++ main.gany/libmpcodecs/vf.c	Wed Nov 20 12:24:28 2002
@@ -390,6 +390,10 @@
     return vf->next->put_image(vf->next,mpi);
 }
 
+void vf_next_draw_slice(struct vf_instance_s* vf,unsigned char** src, int * stride,int w, int h, int x, int y){
+    vf->next->draw_slice(vf->next,src,stride,w,h,x,y);
+}
+
 //============================================================================
 
 vf_instance_t* append_filters(vf_instance_t* last){
diff -Naur main/libmpcodecs/vf.h main.gany/libmpcodecs/vf.h
--- main/libmpcodecs/vf.h	Wed Sep 11 00:18:32 2002
+++ main.gany/libmpcodecs/vf.h	Wed Nov 20 12:23:13 2002
@@ -78,6 +78,8 @@
 int vf_next_control(struct vf_instance_s* vf, int request, void* data);
 int vf_next_query_format(struct vf_instance_s* vf, unsigned int fmt);
 int vf_next_put_image(struct vf_instance_s* vf,mp_image_t *mpi);
+void vf_next_draw_slice (struct vf_instance_s* vf, unsigned char** src, int* stride, int w,int h, int x, int y);
+
 
 vf_instance_t* append_filters(vf_instance_t* last);
 
diff -Naur main/libmpcodecs/vf_rotate.c main.gany/libmpcodecs/vf_rotate.c
--- main/libmpcodecs/vf_rotate.c	Wed Oct 23 19:51:49 2002
+++ main.gany/libmpcodecs/vf_rotate.c	Wed Nov 20 12:23:31 2002
@@ -61,6 +61,7 @@
     }
     if (vf->priv->direction & 4){
 	vf->put_image=vf_next_put_image; // passthru mode!
+	if (vf->next->draw_slice) vf->draw_slice=vf_next_draw_slice;
 	return vf_next_config(vf,width,height,d_width,d_height,flags,outfmt);
     }
     return vf_next_config(vf,height,width,d_height,d_width,flags,outfmt);


More information about the MPlayer-dev-eng mailing list