Log in

View Full Version : problem with avisynth.h


kassandro
25th May 2003, 14:00
While writing my first filter I stumbled into the following problem with avisynth.h (Avisynth 2.51). It concerns the class PVideoFrame which is just a smart pointer to an object of class VideoFrame. When I pass such a pointer object to a function, a new instance is created, whence the refcount of the underlying VideoFrame is increased. Consequently a call to GetWritePtr() or GetWritePtr(PLANAR_Y) always fails within a function. While this is not a bug, this is certainly not a smooth design. It makes functions of type f(int plane, PVideoFrame vf, ..) impossible, although such filters for a single plane of a frame are quite natural.

Bidoche
25th May 2003, 14:25
just use :
f(int plane, PVideoFrame& vf, ..)

kassandro
25th May 2003, 22:33
Originally posted by Bidoche
just use :
f(int plane, PVideoFrame& vf, ..)

That certainly works, but it is not ideal to use a pointer to a pointer as a function argument when you really want a pointer. Of course, the idea behind PVideoFrame was that the pointer automaticly releases its resources when it exits its name space.

Bidoche
3rd June 2003, 09:32
Well PVideoFrame is incomplete in the first place, it just can't do what you want.