On 09/28/2012 07:52 PM, Josh Allmann wrote: > On 27 September 2012 16:19, Luca Barbato <[email protected]> wrote: >> On 09/28/2012 12:10 AM, Justin Ruggles wrote: >>> On 09/27/2012 05:41 PM, Luca Barbato wrote: >>>> --- >>>> libavformat/avformat.h | 25 +++++++++++++++++++++++++ >>>> libavformat/output.c | 43 +++++++++++++++++++++++++++++++++++++++++++ >>>> 2 files changed, 68 insertions(+) >>> [...] >>>> @@ -416,7 +431,13 @@ typedef struct AVOutputFormat { >>>> * data. >>>> */ >>>> int (*write_packet)(struct AVFormatContext *, AVPacket *pkt); >>>> + >>>> int (*write_trailer)(struct AVFormatContext *); >>>> + >>>> + int (*write_trailer2)(struct AVFormatContext *); >>>> + >>>> + int (*deinit)(struct AVFormatContext *); >>>> + >>> >>> Where are these used? >> >> In the upcoming patches, I'll split mpegts as first. >> >> Usages: >> >> - Quite low latency streaming (you spare some time if you have the muxer >> already configured and ready for your purposes) >> - Segment muxer with h264 and mpegts (and hls once I write the playlist >> code for it) >> - Any other application recycling a muxer more than once. >> > > Mentioning this in the commit message would be helpful.
I'll update it. > I'm not sure if deprecating write_header entirely is desirable, since > it reduces boilerplate for API users in the common case. write_header (the function ponter) should disappear, the api function should stay in a form or another. > An alternative behavior would be: if init is provided, don't try to > re-initialize inside write_header. (The same goes for deinit/trailer). > Segment muxers or users with specific needs can set init/deinit > themselves. Not sure if somebody wants to close w/out writing the header. But in that case we could provide an avformat_mux_flush. for the init is as simple as you stated. Not sure if would be clearer to keep two function that do both together. lu _______________________________________________ libav-devel mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-devel
