vcmohan
2nd November 2006, 05:40
In one of the posts it was pointed out to me that I should not create buffers in the GetFrame method and should create in constructor. My reasoning for that approach is:
I have option to restrict processing for a particular frame range ( without the need to use trim and subsequent joining).
When the call to this function is prior to the range, no buffers are created, and frame is returned immediately. The first time it receives a call GetFrame it creates the buffers. If the frame goes out of range it deletes the buffers. Thereafter it returns frame immediately. Flags for checking buffers are present or not are used. This can be done only in the GetFrame method. This has the advantage that memory not required is released immediately. I think that this method of buffer creation uses least memory in case where large number of trims are used and filtering is done with different parameters. It can also be used in normal way as the default start and end of frame range is 0 to end of clip. But then all buffers will be present throughout.
Will this interfere with set max memory in any way? Can there be crashes due to this. The only overhead I see is a call GetFrame by Avisynth for each frame.
I have option to restrict processing for a particular frame range ( without the need to use trim and subsequent joining).
When the call to this function is prior to the range, no buffers are created, and frame is returned immediately. The first time it receives a call GetFrame it creates the buffers. If the frame goes out of range it deletes the buffers. Thereafter it returns frame immediately. Flags for checking buffers are present or not are used. This can be done only in the GetFrame method. This has the advantage that memory not required is released immediately. I think that this method of buffer creation uses least memory in case where large number of trims are used and filtering is done with different parameters. It can also be used in normal way as the default start and end of frame range is 0 to end of clip. But then all buffers will be present throughout.
Will this interfere with set max memory in any way? Can there be crashes due to this. The only overhead I see is a call GetFrame by Avisynth for each frame.