[vlc-devel] [PATCH 2/2] vlc_block: store per block ancillary

Rémi Denis-Courmont remi at remlab.net
Sun Jul 8 10:02:53 CEST 2018

Le sunnuntaina 8. heinäkuuta 2018, 0.17.44 EEST Denis Charmet a écrit :
> > But reassigning side data to the right block in block chain - uh??
> Well gathered blocks could append all their side data and split block
> could duplicate their side data at split but I get your point.

What about blocks that are made from parts of multiple blocks?

That you can freely duplicate the side data is a very and dubiously strong 
assumptions on the semantics on the side data.

> > AFAIK, there are basically two ways to pass them out of band:
> > 
> > - at ES output:
> >   - new control, or
> >   - new parameter to send callback control,
> > 
> > - at packetizer and decoder levels:
> >   - new optional callback, or
> >   - new parameter to decode/packetize callback.
> > 
> > New control and new callback would most certainly require much less
> > code churn
> > than new parameters.
> Sorry if that's obvious to you but I really cannot picture how to make
> it work as a control+callback.

It is not obvious to me how you make that work either, for lack of 
explanations on the use case of this. However, it is no more and no less 
obvious to me than how it would work with a new field in block_t though.

Obviously if you can pass something as a field to a structure pointed by a 
parameter, then you can also pass it as an extra parameter. Either way, the 
called code has the same data. And then, if you can pass it as an extra 
parameter, you can also pass it through an extra preceding function call with 
the same context (e.g. same packetizer, same decoder).

> - How would you link a block that will be put in the fifo and it's side
> data?
> - Where would it be stored while waiting for the decoder/packetizer?
> - What should release it?

> > Also ES timeshift needs to serialize/deserialize. Again, the side data
> > won't
> > magically pass through just by adding a new block_t field.
> But wouldn't serializing/deserializing risk to lose the reference to
> its needed side data as well?

Yes! That's the whole point:

*** You cannot just add a field to block_t and assume that it will work out of 
the box. ***

Rémi Denis-Courmont

More information about the vlc-devel mailing list