[Flac-dev] Decoding without read callbacks.
Josh Coalson
xflac at yahoo.com
Wed Mar 24 16:09:09 PST 2004
--- illiminable <ogg at illiminable.com> wrote:
> Thanks for the reply,
>
> But that still tries to read for itself from libogg... i need to be
> able to
> feed data only... it can never try and read for itself. That code is
> still
> trying to control the data flow. Basicly i need to operate like this.
>
> SetupCodec
>
> when i have data to give to the codec
> FeedDataToCodec(data)
> //Receive a bunch of callbacks somewhere returning me pcm data
> //Codec waits for more data and doesn't reset itself.
>
> I will always give it a complete ogg packet as a buffer (but not in
> an
> oggpacket struct because directshow uses a different sample
> structure.) and
> size. And i need it to process the data i give it and then wait until
> i give
> it some more. There is no way the codec can read data unless i give
> it to
> it.
assuming you can get whole ogg packets, it should work. let's
say the flow is X -> C -> Y (X feeds Ogg FLAC to codec C which
feeds PCM to Y):
- X feeds data to C until C gets one Ogg FLAC packet.
- C puts packet in global buffer B.
- C calls FLAC__*_process_single()
- FLAC__*_process_single() calls C's read_callback()
- read_callback returns B
- FLAC decodes B, calls C's write_callback with PCM data P
corresponding to the decoded samples from B
- C writes P to Y
Josh
__________________________________
Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.
http://taxes.yahoo.com/filing.html
More information about the Flac-dev
mailing list