[FFmpeg-devel] [RFC] General design for subtitles demuxers

Clément Bœsch ubitux at gmail.com
Wed Jun 13 09:30:26 CEST 2012


On Wed, Jun 13, 2012 at 09:29:17AM +0200, Clément Bœsch wrote:
> On Wed, Jun 13, 2012 at 08:20:48AM +0100, JULIAN GARDNER wrote:
> [...]
> > >>  >    events from lavf/assdec.c.
> > >> 
> > >>  This part I am not sure I understand. Do you mean that the demuxer is
> > >>  supposed to translate into ASS?
> > >> 
> > > 
> > > I'm just refering here to:
> > > 
> > >     static int event_cmp(uint8_t **a, uint8_t **b)
> > >     {
> > >         return get_pts(*a) - get_pts(*b);
> > >     }
> > > 
> > >     [...]
> > > 
> > >     qsort(ass->event, ass->event_count, sizeof(*ass->event), 
> > > (void*)event_cmp);
> > > 
> > >>  >    We should take out read_seek2() from lavf/assdec.
> > >> 
> > >>  Looks reasonable.
> > >> 
> > > 
> > > We just need to find a better way of storing the events & pts; maybe to
> > > something simple like
> > > 
> > >     typedef struct {
> > >         int64_t pts;
> > >         uint8_t *data;
> > >     } FFSubtitle;
> > > 
> > > We will BTW be able to have a generic read_packet() as well, and greatly
> > > simplify again all this stuff.
> > > 
> > 
> > Dont we already have that information in the AVSubtitle structure, this is what i used, i created a FIFO of pointers to structs as all subtitles are alreardy read in fully, which is what caused me problems in getting the conversion to dvb subtitles.
> > 
> 
> It might be a possibility, though, from a demuxer point of view, this list
> will be used to create AVPacket (in the read_packet() callback). Which
> will then be used by the main application to create an AVPacket. So the
                                                         ^^^^^^^^
                                                       AVSubtitle*...
> situation will looks like:
> 
>   AVSubtitles (demux/read_header) -> AVPacket (demux/read_packet) -> AVSubtitles (decode)
> 
> Sure we can do that (AVSubtitles stores the start & end, and we can put
> some text in it), but it looks very confusing.
> 
> OTOH, we could use AVPacket directly: read_header() constructs a list of
> read-to-use AVPacket (pts, duration and data are in it), and we can raise
> them directly. It should also works for bitmap-based subtitles demuxer.
> 

-- 
Clément B.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120613/053aae96/attachment.asc>


More information about the ffmpeg-devel mailing list