[Theora-dev] ogg and keyframes

Conrad Parker conrad at metadecks.org
Tue Sep 28 17:59:53 PDT 2004


On Tue, Sep 28, 2004 at 10:24:26AM -0700, Ralph Giles wrote:
> On Tue, Sep 28, 2004 at 10:12:27AM +0200, Wim Taymans wrote:
> > Ah, fine. Better than checking 'the second most significant bit of the
> > first data byte'. Can you also add some method to check if it's a header
> > packet or a data packet?
> 
> There's theora_packet_isheader() too. It only checks the initial bit 
> though, so it's no good for bitstream identification. It seems like it 
> would also be nice to have something for that but lighter-weight than 
> theora_decode_header(). The problem is that we have room in the spec for 
> future optional additional headers that we don't want to include the 
> 'theora' magic, so checking the first bit is the only reliable approach.
> I'm open to suggestions here. Perhaps theora_decode_header() could just
> accept NULL for the info and comment structs.

that's exactly the reason to have an API call for it -- whatever logic
is needed to identify headers should be in the library, not randomly
implemented in every application. Of course a version of the library only
needs to be able to identify headers it knows about, not necessarily
future ones which it can't decode anyway. However if you did decide to
make a consistent pattern for recognizing future headers, then you'd be
able to wrap up this logic a little more easily.

as for heavyweight/lightweight header ID functions, maybe something like
fish_sound_identify():

http://www.annodex.net/software/libfishsound/html/fishsound_8h.html#a3

Conrad.


More information about the Theora-dev mailing list