[theora] [PATCH] splayer aspect ratio + zoom

Philip Jägenstedt philipj at telia.com
Thu Jul 24 03:37:54 PDT 2003



Hello Markus!

On 24 Jul 2003 01:15:18 +0200
Markus Meyer <meyer at mesw.de> wrote:

> What I would really be interested in is how you implemented seeking
> (positioning inside the stream), because that's the next item on my
> feature whish list.

I don't actually know how seeking is done in ogg (you could look at
xines ogg demuxer, but it's not the simplest, most straightforward
implementation because xine does alot of other things than simply play
theora), but have one thing you might want to think about if you
implement seeking in splayer.

Ogg permits two types of multiplexing -- grouping and chaining. grouping
is what we have in theora+vorbis where the two streams are interleaved
side by side. Chaining, or sequential multiplexing is a fancy name for
putting two (or more) logical bitstreams after each other. I think the
constraint is that all previous streams must be closed (by an EOS
oggpacket and/or page, not sure how these work together) before new ones
are opened. To chain logical bitstreams into one physical bitstream,
simply add one file to the end of the other (with cat, if you have a
unix-like OS). This might be useful if you want to have a theora file
where the size or bitrate of the video changes, or if you want only
video and no audio for a part of the stream, or whatever.

Unfortunately, the example players (player_example, and splayer I
presume) don't support this, and make the assumption that the streams at
the beginning of the file will last until the end of the file. xine
doesn't handle it either. Instead, they just read through the whole file
hoping to find more pages from the streams which are already closed (the
players don't actually check for the EOS packet).

I've tried to make player_example work with such files, but reorganized
the decoding loop in such a way that the decoding took more CPU power
than before. So I just dropped it, I might try again. If you want to add
support for this to splayer, that would be great. At some point or
another, I mean to put it into xine, if I can figure it out. Anyway,
this has some implications when it comes to seeking:

* You can't assume that the whole file is the same pair of streams. This
is exactly what xine does. So for such a file in xine, an incorrect
estimate of the length of the stream is made, and seeking beyond where
the original streams end will cause playback to stop.

* If you seek beyond the end (or beyond the beginning) of the current
logical bitstream, you'll have to figure out what the bitstreams are,
and perhaps resize the video window etc. It's even possible that there
won't be any video, but only audio, or a stream that you don't recognize
for that matter.

I don't know how I'll approach this in xine. Maybe I'll treat the stream
as having several chapters, like a DVD or something. Perhaps you have
some ideas about this which I could benefit from. Anyway, good luck!

// Philip Jägenstedt
--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'theora-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the Theora mailing list