[Kdenlive-devel] command end

Jason Wood jasonwood at blueyonder.co.uk
Mon Nov 25 16:27:16 UTC 2002


On Monday 25 Nov 2002 3:20 pm, Rolf Dubitzky wrote:
> > 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.
>
> Sure, but the then you could still use select() or something, but idle
> looping with 100% CPU isn't the best thinf to do ;-)

Ah, didn't know about select() :-)

The idea was not to have idle looping though, if the main loop wasn't doing 
anything important, it would sleep() until it needed to do someting. I am 
unsure as to how this would affect latency though.

> > 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.
>
> sure we, can. just remove any double newlines from the buffer before
> sending.

What I mean is that it is a slight hack to the XML format, and I don't like 
that idea very much.

> > 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.)
>
> Implementing a Parser for complex document structures is more comlicated
> with SAX but if it can handle incomplete XML tags it might be worth it.
> Also it will probably have lower latency compared with DOM.

I just did a quick search and found this message, which is of somebody 
discussing how they did XML over TCP :

http://www.distributedcoalition.org/mailing_lists/dist-obj/msg02872.html

I know that SAX is more difficult to parse - that's why I wanted to use DOM 
instead :-) But I think in our case it will be more hassle to use DOM than it 
will be to use SAX, because with SAX we don't need to worry about determining 
the end of a message with any constructs other than plain XML.

Cheers,
Jason

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




More information about the Kdenlive mailing list