From: Duilio J. P. <dp...@fc...> - 2004-07-02 14:54:41
|
El vie, 02 de 07 de 2004 a las 08:43, Dennis Smit escribi=C3=B3: > Duilio, thanks for your HAVE_ALLOCATED_BUFFER work! >=20 > Following: >=20 > int visual_video_set_buffer (VisVideo *video, void *buffer) > { > visual_log_return_val_if_fail (video !=3D NULL, -1); >=20 > if (HAVE_ALLOCATED_BUFFER (video)) { > visual_log (VISUAL_LOG_CRITICAL, "Trying to set a scree= n > buffer on " > "a VisVideo structure which points to a= n > external screen buffer"); > return -1; > } >=20 > video->screenbuffer =3D buffer; >=20 > return 0; > } >=20 >=20 >=20 >=20 > Why is it illegal to set a screen buffer on a Visvideo which points to > an external screen buffer ? Sorry, the message is wrong, must say: "Trying to set a buffer on a VisVideo structure" "which points to an allocated screen buffer" Why not just freed the video->screenbuffer if it is an allocated buffer, and set the new one? Because if I do this, what value must contain the video->flags? The problem is that the void* not give us information about where it points, if it is an allocated or an external buffer.=20 I was thinking about adding a flag argument to visual_video_set_buffer() to give this info, but I'm not shure, we must trust so much on the client and the interface will be more 'hard' to learn. What do you think about it? Of course there are other possibilities such as changing the semantic of the constructors. I like more this option, but need discussion. > Also, please have a space between everything and '('. I don't understand this. Do you mean change 'if (x)' for 'if ( x )'? I like that, but is not the style you use on the sources. Bye, Duilio. |