Hi,
On Fri, 31 Jan 2014 14:48:11 -0200, Leandro Dorileo 
<leandro.maciel.dori...@intel.com> 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.

-- 
Anton Khirnov
_______________________________________________
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to