[vlc-devel] Re: additional decoder support

Gildas Bazin gbazin at altern.org
Mon May 17 09:11:16 CEST 2004

On Monday 17 May 2004 06:22, Matthew Romaine wrote:
> I'm a little bit confused in how "packetizers" and "blocks" are used.  
> In poking around the other decoders (mpeg_audio.c and flac.c), I've 
> noticed extensive code in handling different states (STATE_NOSYNC, 
> etc.).  The questions that (I think) will help me along are:
> 1) are packetizers used for creating "frames" of audio for network 
> transmission?

Basically the packetizers are used to re-assemble complete frames of data 
(audio, video, etc...) and to timestamp them. All this is needed by the 
stream output layer for muxing and sending the data.

> 2) is flac.c's PacketizeBlock used to ensure a decode-able frame of 
> data is received before actually decoding the data?

Packetizers can also be used before the decoding stage if the decoder 
requires complete frames and the demuxer sends truncated ones.
This is what is done in the case of Flac (libFlac requires complete frames).

All you need in this case is provide a decoder and a packetizer and set the 
p_dec->b_need_packetized in the open function of your decoder. VLC core 
will automatically spawn the packetizer for you before running the decoder 
(the Flac decoder doesn't do that because it was done before this flag was 
introduced... and I wouldn't recommend it for learning purposes).

> In a hypothetical situation for the decoder I am working with, I need 
> to have a certain fixed-size frame of raw data before I can send it 
> along to the decoder.  I'm still trying to get my head wrapped around 
> the pipeline, but would someone kindly fill in the blanks below? :
> (blank - who calls OpenDecoder?)  -->  flac.c's DecodeBlock gets called 
> -->  (blank - where does the buffer go?)

The decoder is opened by the demuxer and the decoded data is sent to the 
(video/audio) outputs.
All this is managed by the core in src/input/input_dec.c.

> any other comments/suggestions on where I should look would be much 
> appreciated.  Ultimately my goal is to incorporate a network-streamed 
> version running (I already have a liveMedia test-app working), so if 
> there are certain network-related issues I should consider, please 
> comment as such.

Hmmm, I don't follow you here... what do you mean by a network streamed 
version (of what, etc...) ?


This is the vlc-devel mailing-list, see http://www.videolan.org/vlc/
To unsubscribe, please read http://developers.videolan.org/lists.html
If you are in trouble, please contact <postmaster at videolan.org>

More information about the vlc-devel mailing list