[FFmpeg-devel] [PATCH] libavformat: add librist protocol

Marton Balint cus at passwd.hu
Sun Feb 28 23:49:16 EET 2021



On Sun, 28 Feb 2021, Paul B Mahol wrote:

> On Fri, Feb 26, 2021 at 9:54 PM Marton Balint <cus at passwd.hu> wrote:
>
>>
>>
>> On Fri, 26 Feb 2021, Paul B Mahol wrote:
>>
>> > This work is sponsored by Open Broadcast Systems.
>> >
>> > Signed-off-by: Paul B Mahol <onemda at gmail.com>
>> > ---
>> > configure               |   5 +
>> > doc/protocols.texi      |  29 +++++
>> > libavformat/Makefile    |   1 +
>> > libavformat/librist.c   | 248 ++++++++++++++++++++++++++++++++++++++++
>> > libavformat/protocols.c |   1 +
>> > 5 files changed, 284 insertions(+)
>> > create mode 100644 libavformat/librist.c
>> >
>>
>> > +#define D AV_OPT_FLAG_DECODING_PARAM
>> > +#define E AV_OPT_FLAG_ENCODING_PARAM
>> > +#define OFFSET(x) offsetof(RISTContext, x)
>> > +static const AVOption librist_options[] = {
>> > +    { "rist_profile","set profile",     OFFSET(profile),
>>  AV_OPT_TYPE_INT,   {.i64=RIST_PROFILE_MAIN},     0, 2, .flags = D|E,
>> "profile" },
>> > +    { "simple",      NULL,              0,
>>  AV_OPT_TYPE_CONST, {.i64=RIST_PROFILE_SIMPLE},   0, 0, .flags = D|E,
>> "profile" },
>> > +    { "main",        NULL,              0,
>>  AV_OPT_TYPE_CONST, {.i64=RIST_PROFILE_MAIN},     0, 0, .flags = D|E,
>> "profile" },
>> > +    { "advanced",    NULL,              0,
>>  AV_OPT_TYPE_CONST, {.i64=RIST_PROFILE_ADVANCED}, 0, 0, .flags = D|E,
>> "profile" },
>> > +    { "buffer_size", "set buffer_size", OFFSET(buffer_size),
>> AV_OPT_TYPE_INT,   {.i64=0},                     0, INT_MAX, .flags = D|E },
>> > +    { "log_level",   "set loglevel",    OFFSET(log_level),
>>  AV_OPT_TYPE_INT,   {.i64=-1},                   -1, INT_MAX, .flags = D|E
>> },
>> > +    { "secret", "set encryption secret",OFFSET(secret),
>> AV_OPT_TYPE_STRING,{.str=NULL},                  0, 0,       .flags = D|E },
>> > +    { "encryption","set encryption type",OFFSET(encryption),
>> AV_OPT_TYPE_INT   ,{.i64=0},                     0, INT_MAX, .flags = D|E },
>>
>> Why have you removed pkt_size? For writing, it is surely useful to be
>> configurable, please put it back with -1 as default, so different default
>> can be used for read and write. And for writing, the default of 1316
>> should be used, as we typically want to pump mpegts into it, split on
>> packet boundaries and want no fragmentation.
>>
>
> This options makes no sense for read/receive end.

Then use the value set by the option for the write/send case only.

Regards,
Marton


More information about the ffmpeg-devel mailing list