[Kdenlive-devel] command end

Jason Wood jasonwood at blueyonder.co.uk
Mon Nov 25 15:03:31 UTC 2002


On Monday 25 Nov 2002 2:00 pm, Rolf Dubitzky wrote:
> Hi,
>
> I am not sure why you used non-blocking IO in the nullcutter, I think it
> makes much more sense to use blocking IO (eventually in a seperate thread
> of course), or am I missing something?

I used non-blocking IO so that the renderer would continue working in the main 
loop even if no commands were available to be read. So for instance, once we 
have started a render, or playback the renderer would get on and do that, 
whilst still checking for new IO.

With blocking IO and no threads, this doesn't work, because the renderer would 
pause everytime it checked for a command :-)

So if you use blocking IO, you will have to use threads as soon as you 
implement any command that starts doing something, but may recieve other 
commands before it finishes. Things such as playback and rendering.

> Well, for now I just switched to
> blocking IO, but we have to make sure that we know when a complete command
> sequence has been send. One could think of parsing the XML but that will be
> very complicated when the doc is incomplete. The easiest way (I can think
> of) is to disallow empty lines (i.e. "\n\n") in commands and close every
> command with an empty line. I think that's a very common technique for text
> based protokolls.

I'm not convinced with using newlines to denote new commands. XML does allow 
newlines inside the document, and I don't think we can reliable go against 
that without breaking things somewhere in the future.

I am starting to think that using a SAX parser from the outset may be the 
correct approach. It allows us to parse "what we have recieved so far", and 
perform a command once it has been completed.

It is easy for instance, to know that we have started a command (we have 
recieved the first tag), and it is easy to determine that a command has 
finished ( we parse the closing tag for the command.)

Using DOM, I can't think of any way to figure out when we have a full command 
except by parsing for these tags ourselves anyway.

Cheers,
Jason

-- 
Jason Wood
Homepage : www.uchian.pwp.blueyonder.co.uk




More information about the Kdenlive mailing list