Hi Anton, Anton Khirnov wrote:
Hi, On Fri, 31 Jan 2014 14:48:11 -0200, Leandro Dorileo <[email protected]> wrote:We cannot easily determine if an mpeg TS's packet size is DVHS, FEC or so on, for that we need to expose the internal raw_packet_size field. Change-Id: I3eb179703b62748ae8bec6bd85a50760c0bc6d84 --- libavformat/mpegts.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c index 3f828b4..428ac79 100644 --- a/libavformat/mpegts.c +++ b/libavformat/mpegts.c @@ -134,6 +134,8 @@ struct MpegTSContext { static const AVOption options[] = { {"compute_pcr", "Compute exact PCR for each transport stream packet.", offsetof(MpegTSContext, mpeg2ts_compute_pcr), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, AV_OPT_FLAG_DECODING_PARAM }, + {"ts_packetsize", "Output option carrying the raw packet size.", offsetof(MpegTSContext, raw_packet_size), AV_OPT_TYPE_INT, + {.i64 = 0}, 0, 0, AV_OPT_FLAG_METADATA }, { NULL }, };Sorry for the delay. Adding such an option is quite ok, but I'm not quite sure using AV_OPT_FLAG_METADATA for this is a good idea. AV_OPT_FLAG_METADATA is currently documented as 'some data extracted or inserted into the file like title, comment', which does not quite match what you're using it for in the patch. It's not currently used anywhere, so in theory we could repurpose it for that, but I think I'd prefer a new flag (something like AV_OPT_FLAG_EXPORT) to mark such "options" that are used to export things from opaque structs.
I've looked at AV_OPT_FLAG_METADATA and - like you said - it's not being used, we actually have no effect on setting the opt as a AV_OPT_FLAG_METADATA. Do you think moving AV_OPT_FLAG_METADATA to AV_OPT_FLAG_EXPORT would be reasonable enough? Or do you intend to keep AV_OPT_FLAG_METADATA around? Regads... -- Dorileo _______________________________________________ libav-devel mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-devel
