mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2026-03-13 09:00:40 +08:00
avformat/whip: add new option ts_buffer_size to deprecate buffer_size
See https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20965#issuecomment-15854 The old option name `buffer_size` maybe confusing because there're some protocols and muxer using this. Signed-off-by: Jack Lau <jacklau1222gm@gmail.com>
This commit is contained in:
@@ -3955,10 +3955,12 @@ Default value is 5000.
|
||||
Set the maximum size, in bytes, of RTP packets that send out.
|
||||
Default value is 1200.
|
||||
|
||||
@item buffer_size @var{integer}
|
||||
@item buffer_size, ts_buffer_size @var{integer}
|
||||
Set the buffer size, in bytes, of underlying protocol.
|
||||
Default value is -1(auto). The UDP auto selects a reasonable value.
|
||||
|
||||
Using the buffer_size option name is deprecated and should not be used.
|
||||
|
||||
@item whip_flags @var{flags}
|
||||
Possible values:
|
||||
|
||||
|
||||
@@ -324,7 +324,7 @@ typedef struct WHIPContext {
|
||||
* Note that pion requires a smaller value, for example, 1200.
|
||||
*/
|
||||
int pkt_size;
|
||||
int buffer_size;/* Underlying protocol send/receive buffer size */
|
||||
int ts_buffer_size;/* Underlying protocol send/receive buffer size */
|
||||
/**
|
||||
* The optional Bearer token for WHIP Authorization.
|
||||
* See https://www.ietf.org/archive/id/draft-ietf-wish-whip-08.html#name-authentication-and-authoriz
|
||||
@@ -1205,7 +1205,7 @@ static int udp_connect(AVFormatContext *s)
|
||||
av_dict_set_int(&opts, "fifo_size", 0, 0);
|
||||
/* Pass through the pkt_size and buffer_size to underling protocol */
|
||||
av_dict_set_int(&opts, "pkt_size", whip->pkt_size, 0);
|
||||
av_dict_set_int(&opts, "buffer_size", whip->buffer_size, 0);
|
||||
av_dict_set_int(&opts, "buffer_size", whip->ts_buffer_size, 0);
|
||||
|
||||
ret = ffurl_open_whitelist(&whip->udp, url, AVIO_FLAG_WRITE, &s->interrupt_callback,
|
||||
&opts, s->protocol_whitelist, s->protocol_blacklist, NULL);
|
||||
@@ -1927,7 +1927,7 @@ write_packet:
|
||||
av_log(whip, AV_LOG_WARNING, "Ignore failed to write packet=%dB, ret=%d\n", pkt->size, ret);
|
||||
ret = 0;
|
||||
} else if (ret == AVERROR(EAGAIN)) {
|
||||
av_log(whip, AV_LOG_ERROR, "UDP send blocked, please increase the buffer via -buffer_size\n");
|
||||
av_log(whip, AV_LOG_ERROR, "UDP send blocked, please increase the buffer via -ts_buffer_size\n");
|
||||
} else
|
||||
av_log(whip, AV_LOG_ERROR, "Failed to write packet, size=%d, ret=%d\n", pkt->size, ret);
|
||||
goto end;
|
||||
@@ -2006,10 +2006,12 @@ static int whip_check_bitstream(AVFormatContext *s, AVStream *st, const AVPacket
|
||||
|
||||
#define OFFSET(x) offsetof(WHIPContext, x)
|
||||
#define ENC AV_OPT_FLAG_ENCODING_PARAM
|
||||
#define DEP AV_OPT_FLAG_DEPRECATED
|
||||
static const AVOption options[] = {
|
||||
{ "handshake_timeout", "Timeout in milliseconds for ICE and DTLS handshake.", OFFSET(handshake_timeout), AV_OPT_TYPE_INT, { .i64 = 5000 }, -1, INT_MAX, ENC },
|
||||
{ "pkt_size", "The maximum size, in bytes, of RTP packets that send out", OFFSET(pkt_size), AV_OPT_TYPE_INT, { .i64 = 1200 }, -1, INT_MAX, ENC },
|
||||
{ "buffer_size", "The buffer size, in bytes, of underlying protocol", OFFSET(buffer_size), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, INT_MAX, ENC },
|
||||
{ "buffer_size", "The buffer size, in bytes, of underlying protocol", OFFSET(ts_buffer_size), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, INT_MAX, ENC | DEP },
|
||||
{ "ts_buffer_size", "The buffer size, in bytes, of underlying protocol", OFFSET(ts_buffer_size), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, INT_MAX, ENC },
|
||||
{ "whip_flags", "Set flags affecting WHIP connection behavior", OFFSET(flags), AV_OPT_TYPE_FLAGS, { .i64 = 0}, 0, UINT_MAX, ENC, .unit = "flags" },
|
||||
{ "dtls_active", "Set dtls role as active", 0, AV_OPT_TYPE_CONST, { .i64 = WHIP_DTLS_ACTIVE}, 0, UINT_MAX, ENC, .unit = "flags" },
|
||||
{ "authorization", "The optional Bearer token for WHIP Authorization", OFFSET(authorization), AV_OPT_TYPE_STRING, { .str = NULL }, 0, 0, ENC },
|
||||
|
||||
Reference in New Issue
Block a user