* [FFmpeg-devel] [PATCH] avformat/avio: Add max_pkt_size option
@ 2025-03-13 12:48 Zhao Zhili
2025-03-13 20:03 ` Marton Balint
0 siblings, 1 reply; 3+ messages in thread
From: Zhao Zhili @ 2025-03-13 12:48 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Zhao Zhili
From: Zhao Zhili <zhilizhao@tencent.com>
Optimizing memory footprint in memory-constrained systems.
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
---
libavformat/avio.c | 2 ++
libavformat/version.h | 2 +-
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/libavformat/avio.c b/libavformat/avio.c
index d109f3adff..e1b959ed73 100644
--- a/libavformat/avio.c
+++ b/libavformat/avio.c
@@ -61,6 +61,8 @@ static const AVOption options[] = {
{"protocol_whitelist", "List of protocols that are allowed to be used", OFFSET(protocol_whitelist), AV_OPT_TYPE_STRING, { .str = NULL }, 0, 0, D },
{"protocol_blacklist", "List of protocols that are not allowed to be used", OFFSET(protocol_blacklist), AV_OPT_TYPE_STRING, { .str = NULL }, 0, 0, D },
{"rw_timeout", "Timeout for IO operations (in microseconds)", offsetof(URLContext, rw_timeout), AV_OPT_TYPE_INT64, { .i64 = 0 }, 0, INT64_MAX, AV_OPT_FLAG_ENCODING_PARAM | AV_OPT_FLAG_DECODING_PARAM },
+ {"max_pkt_size", "Default maximum packet size in bytes, could be overwritten by particular protocol",
+ offsetof(URLContext, max_packet_size), AV_OPT_TYPE_INT, { .i64 = IO_BUFFER_SIZE }, 0, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM | AV_OPT_FLAG_DECODING_PARAM },
{ NULL }
};
diff --git a/libavformat/version.h b/libavformat/version.h
index 6ffdf61b43..e1ab967f5b 100644
--- a/libavformat/version.h
+++ b/libavformat/version.h
@@ -32,7 +32,7 @@
#include "version_major.h"
#define LIBAVFORMAT_VERSION_MINOR 9
-#define LIBAVFORMAT_VERSION_MICRO 107
+#define LIBAVFORMAT_VERSION_MICRO 108
#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
LIBAVFORMAT_VERSION_MINOR, \
--
2.46.0
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [FFmpeg-devel] [PATCH] avformat/avio: Add max_pkt_size option
2025-03-13 12:48 [FFmpeg-devel] [PATCH] avformat/avio: Add max_pkt_size option Zhao Zhili
@ 2025-03-13 20:03 ` Marton Balint
2025-03-14 2:39 ` Zhao Zhili
0 siblings, 1 reply; 3+ messages in thread
From: Marton Balint @ 2025-03-13 20:03 UTC (permalink / raw)
To: FFmpeg development discussions and patches
On Thu, 13 Mar 2025, Zhao Zhili wrote:
> From: Zhao Zhili <zhilizhao@tencent.com>
>
> Optimizing memory footprint in memory-constrained systems.
>
> Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
> ---
> libavformat/avio.c | 2 ++
> libavformat/version.h | 2 +-
> 2 files changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/libavformat/avio.c b/libavformat/avio.c
> index d109f3adff..e1b959ed73 100644
> --- a/libavformat/avio.c
> +++ b/libavformat/avio.c
> @@ -61,6 +61,8 @@ static const AVOption options[] = {
> {"protocol_whitelist", "List of protocols that are allowed to be used", OFFSET(protocol_whitelist), AV_OPT_TYPE_STRING, { .str = NULL }, 0, 0, D },
> {"protocol_blacklist", "List of protocols that are not allowed to be used", OFFSET(protocol_blacklist), AV_OPT_TYPE_STRING, { .str = NULL }, 0, 0, D },
> {"rw_timeout", "Timeout for IO operations (in microseconds)", offsetof(URLContext, rw_timeout), AV_OPT_TYPE_INT64, { .i64 = 0 }, 0, INT64_MAX, AV_OPT_FLAG_ENCODING_PARAM | AV_OPT_FLAG_DECODING_PARAM },
> + {"max_pkt_size", "Default maximum packet size in bytes, could be overwritten by particular protocol",
> + offsetof(URLContext, max_packet_size), AV_OPT_TYPE_INT, { .i64 = IO_BUFFER_SIZE }, 0, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM | AV_OPT_FLAG_DECODING_PARAM },
> { NULL }
> };
This feels super confusing. A *max_packet_size* option which might not do
anything at all depending on the protocol the user is using, and which
the user might override with the protocol specific *pkt_size* option if it
exists. So I'd rather not expose ->max_pkt_size like that.
Regards,
Marton
>
> diff --git a/libavformat/version.h b/libavformat/version.h
> index 6ffdf61b43..e1ab967f5b 100644
> --- a/libavformat/version.h
> +++ b/libavformat/version.h
> @@ -32,7 +32,7 @@
> #include "version_major.h"
>
> #define LIBAVFORMAT_VERSION_MINOR 9
> -#define LIBAVFORMAT_VERSION_MICRO 107
> +#define LIBAVFORMAT_VERSION_MICRO 108
>
> #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
> LIBAVFORMAT_VERSION_MINOR, \
> --
> 2.46.0
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
>
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [FFmpeg-devel] [PATCH] avformat/avio: Add max_pkt_size option
2025-03-13 20:03 ` Marton Balint
@ 2025-03-14 2:39 ` Zhao Zhili
0 siblings, 0 replies; 3+ messages in thread
From: Zhao Zhili @ 2025-03-14 2:39 UTC (permalink / raw)
To: FFmpeg development discussions and patches
> On Mar 14, 2025, at 04:03, Marton Balint <cus@passwd.hu> wrote:
>
>
> On Thu, 13 Mar 2025, Zhao Zhili wrote:
>
>> From: Zhao Zhili <zhilizhao@tencent.com>
>>
>> Optimizing memory footprint in memory-constrained systems.
>>
>> Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
>> ---
>> libavformat/avio.c | 2 ++
>> libavformat/version.h | 2 +-
>> 2 files changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/libavformat/avio.c b/libavformat/avio.c
>> index d109f3adff..e1b959ed73 100644
>> --- a/libavformat/avio.c
>> +++ b/libavformat/avio.c
>> @@ -61,6 +61,8 @@ static const AVOption options[] = {
>> {"protocol_whitelist", "List of protocols that are allowed to be used", OFFSET(protocol_whitelist), AV_OPT_TYPE_STRING, { .str = NULL }, 0, 0, D },
>> {"protocol_blacklist", "List of protocols that are not allowed to be used", OFFSET(protocol_blacklist), AV_OPT_TYPE_STRING, { .str = NULL }, 0, 0, D },
>> {"rw_timeout", "Timeout for IO operations (in microseconds)", offsetof(URLContext, rw_timeout), AV_OPT_TYPE_INT64, { .i64 = 0 }, 0, INT64_MAX, AV_OPT_FLAG_ENCODING_PARAM | AV_OPT_FLAG_DECODING_PARAM },
>> + {"max_pkt_size", "Default maximum packet size in bytes, could be overwritten by particular protocol",
>> + offsetof(URLContext, max_packet_size), AV_OPT_TYPE_INT, { .i64 = IO_BUFFER_SIZE }, 0, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM | AV_OPT_FLAG_DECODING_PARAM },
>> { NULL }
>> };
>
>
> This feels super confusing. A *max_packet_size* option which might not do anything at all depending on the protocol the user is using, and which the user might override with the protocol specific *pkt_size* option if it exists. So I'd rather not expose ->max_pkt_size like that.
rw_timeout has the same issue, it’s still useful for users.
The patch is for
https://ffmpeg.org/pipermail/ffmpeg-devel/2025-March/341114.html
We can add pkt_size for more protocols, but it sounds weird for tcp
with pkt_size option.
Use can change AVIOContext::max_packet_size directly. I’m not sure
if it’s better or valid.
>
> Regards,
> Marton
>
>
>>
>> diff --git a/libavformat/version.h b/libavformat/version.h
>> index 6ffdf61b43..e1ab967f5b 100644
>> --- a/libavformat/version.h
>> +++ b/libavformat/version.h
>> @@ -32,7 +32,7 @@
>> #include "version_major.h"
>>
>> #define LIBAVFORMAT_VERSION_MINOR 9
>> -#define LIBAVFORMAT_VERSION_MICRO 107
>> +#define LIBAVFORMAT_VERSION_MICRO 108
>>
>> #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
>> LIBAVFORMAT_VERSION_MINOR, \
>> --
>> 2.46.0
>>
>> _______________________________________________
>> ffmpeg-devel mailing list
>> ffmpeg-devel@ffmpeg.org
>> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>>
>> To unsubscribe, visit link above, or email
>> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
>>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org <mailto:ffmpeg-devel@ffmpeg.org>
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org <mailto:ffmpeg-devel-request@ffmpeg.org> with subject "unsubscribe".
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-03-14 2:40 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-03-13 12:48 [FFmpeg-devel] [PATCH] avformat/avio: Add max_pkt_size option Zhao Zhili
2025-03-13 20:03 ` Marton Balint
2025-03-14 2:39 ` Zhao Zhili
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git