[theora-dev] My issues with ogg and directshow...
Timothy B. Terriberry
tterribe at xiph.org
Sat May 8 13:58:03 PDT 2004
> Ok, so given that the graph has to be built before data is passed
> downstream, there is a problem. How can the demuxer know what filters to
> connect to (ie what the streams are) ? The demux needs to read ahead
> to find the BOS pages. Now we know how many streams there are. How does
> know what kind of streams they are ? It has to be able to recognise the
> capture patterns of every possible codec. So a "codec oblivious" demux
> already out of the question.
This is an issue of where the separation line is drawn, not whether or not
separation can exist. The Ogg abstraction has a richer interaction between
codec and muxer than the DS framework mandates. But this doesn't prevent
you from defining an "Ogg codec" interface as a richer instance of the
general DS codec interface, adding such things as generic functions to
answer questions like, "Given this initial packet, can you decode this
stream?" or, "What are the DS media parameters corresponding to this
complete set of header packets?" or, "What is the time associated with
this granule position?" The muxer can still rely wholly on the codecs to
answer these questions, it just needs a richer codec API than the DS
framework in general has. New codecs can still be added without
modifications to the demux so long as they implement this extended API.
And as an aside, please don't use the phrase "granule rate"... it implies,
incorrectly, than the granule position->time mapping can be accomplished
by multiplying by a simple scale factor, and this is NOT true in general.
In particular, it is not true for Theora.
> Directshow works in UNITS of 1/10,000,000 of a second, it knows nothing
> granule pos. When something like media player requests a seek or a
> request it wants these units. So the seek request comes into the graph.
Generally one seeks to a time, not a granule position. The granule
position->time mapping is unique, but the reverse does not have to be. So
when dealing with multiple codecs, you convert everything to a time in
order to be able to compare values among them. It's unfortunate that DS
does not let one work in the native time base of the streams, but units of
100 nanoseconds should be accurate enough for most purposes.
--- >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-dev-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-dev