Commit Graph

28884 Commits

Author SHA1 Message Date
caifan3 1bbb7f368d libavformat/id3v2: fix disable-id3 decoding mp3 time exception
Signed-off-by: caifan3 <caifan3@xiaomi.com>
2026-04-20 20:58:48 +08:00
zengshuang a062f93f0f ffmpeg: fix log warning.
Signed-off-by: zengshuang <zengshuang@xiaomi.com>
2026-04-20 20:58:47 +08:00
caifan3 0aebd61b29 libavformat/file: apply pkt_size option to read mode
Previously, the pkt_size option only affected write buffering in the file
protocol. This change extends its effect to read mode as well.
On embedded systems with limited RAM, users can now reduce I/O buffer
memory by setting a smaller pkt_size.

Signed-off-by: caifan3 <caifan3@xiaomi.com>
2026-04-20 20:58:46 +08:00
caifan3 61b521eee8 avformat/unix: add pkt_size option
Add a "pkt_size" AVOption to the Unix domain socket protocol. This option
allows the user to specify the maximum packet size for packet-oriented
sockets (SOCK_DGRAM and SOCK_SEQPACKET).

Signed-off-by: caifan3 <caifan3@xiaomi.com>
2026-04-20 20:58:45 +08:00
caifan3 225f4eb4b5 avformat/rpmsg: add pkt_size option
This option allows the user to specify the maximum packet size for packet-oriented
sockets (SOCK_DGRAM and SOCK_SEQPACKET).
For SOCK_STREAM, it sets the I/O buffer size to reduce memory usage.

Signed-off-by: caifan3 <caifan3@xiaomi.com>
2026-04-20 20:58:45 +08:00
wangwenchao10 12edb5ae2d external/ffmpeg:Fix the issue where av_find_stream_info needs to read a large amount of data when playing PCM
Signed-off-by: wangwenchao10 <wangwenchao10@xiaomi.com>
2026-04-20 20:58:45 +08:00
zengshuang 7355bbb91b libavformat: resolve complation errors
Signed-off-by: zengshuang <zengshuang@xiaomi.com>
Signed-off-by: zengshuang <zengshuang@xiaomi.com>
2026-04-20 20:58:44 +08:00
jinxiuxu b14fd65105 FFMPEG: change offset when cache missed
Signed-off-by: jinxiuxu <jinxiuxu@xiaomi.com>
2026-04-20 20:58:44 +08:00
wurui3 f598c6ff75 libavformat: Replace strncat with av_strlcat while concatenating media cache_ threadname string.
Use a more secure and consistent function av_strlcat to replace strncat function .

Signed-off-by: wurui3 <wurui3@xiaomi.com>
2026-04-20 20:58:44 +08:00
wurui3 bbb34206ec libavformat: Add suffix on cache_thread name.
Add a "_cache" suffix on cache_thread name to distinguish from
movie_async_thread.

Signed-off-by: wurui3 <wurui3@xiaomi.com>
2026-04-20 20:58:44 +08:00
yangsen5 d2f6524ead FFmpeg: fix format warning in libavformat/cache.c
fmpeg/libavformat/cache.c:130:52: warning: format '%lld' expects argument of type 'long long int', but argument 6 has type 'int64_t' {aka 'long int'} [-Wformat=]
  130 |     av_log(h, AV_LOG_INFO, "%s end ret %d bytes %lld %lldbps\n", __func__, ret, offset, bps);
      |                                                 ~~~^                            ~~~~~~
      |                                                    |                            |
      |                                                    long long int                int64_t {aka long int}
      |                                                 %ld
ffmpeg/libavformat/cache.c:130:57: warning: format '%lld' expects argument of type 'long long int', but argument 7 has type 'int64_t' {aka 'long int'} [-Wformat=]
  130 |     av_log(h, AV_LOG_INFO, "%s end ret %d bytes %lld %lldbps\n", __func__, ret, offset, bps);
      |                                                      ~~~^                               ~~~
      |                                                         |                               |
      |                                                         long long int                   int64_t {aka long int}
      |                                                      %ld
ffmpeg/libavformat/cache.c: In function 'add_entry':
ffmpeg/libavformat/cache.c:200:66: warning: format '%lld' expects argument of type 'long long int', but argument 4 has type 'int64_t' {aka 'long int'} [-Wformat=]
  200 |         av_log(h, AV_LOG_ERROR, "Failed to seek in cache, ret %lld errno %d\n", pos, errno);
      |                                                               ~~~^              ~~~
      |                                                                  |              |
      |                                                                  long long int  int64_t {aka long int}
      |                                                               %ld

Signed-off-by: yangsen5 <yangsen5@xiaomi.com>
2026-04-20 20:58:44 +08:00
qiaohaijiao1 5d1e863aec FFMPEG: add debug log.
Signed-off-by: qiaohaijiao1 <qiaohaijiao1@xiaomi.com>
Signed-off-by: qiaohaijiao1 <qiaohaijiao1@xiaomi.com>
2026-04-20 20:58:44 +08:00
qiaohaijiao1 a509499b30 FFMPEG: add error handle in cache protocol
_url_close does't called when init_input failed in avformat_open_input.

Signed-off-by: qiaohaijiao1 <qiaohaijiao1@xiaomi.com>
Signed-off-by: qiaohaijiao1 <qiaohaijiao1@xiaomi.com>
2026-04-20 20:58:43 +08:00
qiaohaijiao1 d38558d89a FFMPEG: use ffurl_read_complete to read 2K once in cache thread.
Signed-off-by: qiaohaijiao1 <qiaohaijiao1@xiaomi.com>
Signed-off-by: qiaohaijiao1 <qiaohaijiao1@xiaomi.com>
2026-04-20 20:58:43 +08:00
qiaohaijiao1 4f0e0b7898 FFMPEG: calculate average bps in cache protocol.
1, calculate average bps.
2, log when EOF.

Signed-off-by: qiaohaijiao1 <qiaohaijiao1@xiaomi.com>
Signed-off-by: qiaohaijiao1 <qiaohaijiao1@xiaomi.com>
2026-04-20 20:58:43 +08:00
qiaohaijiao1 307d30c72e FFMPEG: unlink cache file when cache_close
mkstemp->unlink->close(fd) doest't release space.

Signed-off-by: qiaohaijiao1 <qiaohaijiao1@xiaomi.com>
Signed-off-by: qiaohaijiao1 <qiaohaijiao1@xiaomi.com>
2026-04-20 20:58:43 +08:00
qiaohaijiao1 72fa6b236a FFMPEG: add thread to cache data in cache protocol
Signed-off-by: qiaohaijiao1 <qiaohaijiao1@xiaomi.com>
Signed-off-by: qiaohaijiao1 <qiaohaijiao1@xiaomi.com>
2026-04-20 20:58:43 +08:00
qiaohaijiao1 5c5c06c7c6 FFMPEG: add cache_pread function.
Signed-off-by: qiaohaijiao1 <qiaohaijiao1@xiaomi.com>
Signed-off-by: qiaohaijiao1 <qiaohaijiao1@xiaomi.com>
2026-04-20 20:58:43 +08:00
hanqiyuan fa0e94644d FFMPEG: codesize optimize for --disable-id3
disabled by --disable-id3, default enabled.
The size optimized 11,008 bytes @ gcc -Os,-flto by --disable-id3 on L71,and optimized 196,692 bytes on SIM.

Signed-off-by: hanqiyuan <hanqiyuan@xiaomi.com>
Signed-off-by: fangyibo <fangyibo@xiaomi.com>
2026-04-20 20:58:41 +08:00
hanqiyuan 9d7b568aae ffmpeg: codesize optimize for CONFIG_AUDIO_ONLY.
Enabled by --enable-audio-only, default disabled.
The size optimized 114656 bytes @ gcc -Os,-flto by --enable-audio-only.

Signed-off-by: hanqiyuan <hanqiyuan@xiaomi.com>
2026-04-20 20:58:41 +08:00
wangwenchao10 a01104b8b6 ffmpeg/libavformat:Optimizing the avformat_find_stream_info function takes time
Signed-off-by: wangwenchao10 <wangwenchao10@xiaomi.com>
Signed-off-by: fangyibo <fangyibo@xiaomi.com>
2026-04-20 20:58:40 +08:00
wangwenchao10 07cc97d914 ffmpeg/libavformat:mod sasp demux
Signed-off-by: wangwenchao10 <wangwenchao10@xiaomi.com>
2026-04-20 20:58:40 +08:00
lile7 b45d853260 ffmpeg/sasp: fix stream timestamp
miss live stream timestamp_s is always 0 according to the miss protocol

neededby:3631230

Signed-off-by: lile7 <lile7@xiaomi.com>
2026-04-20 20:58:40 +08:00
zhushiqshi 989cb96cd2 FFMPEG: disable sasp_dec parser
Signed-off-by: zhushiqshi <zhushiqshi@xiaomi.com>
2026-04-20 20:58:40 +08:00
zhushiqshi cd6efd74d0 FFMPEG: Fix the problem that the stream of sasp mux cannot be recognized by itself
Signed-off-by: zhushiqshi <zhushiqshi@xiaomi.com>
2026-04-20 20:58:39 +08:00
yangsen5 0100cb913c avformat/file: add pkt_size option
The min_packet_size/max_packet_size were hardcoded to 256KB for
performance. The new option makes it possible to configure a
smaller packet size on embedded devices with limited memory
resources.

Signed-off-by: yangsen5 <1441923451@qq.com>
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2026-04-20 20:58:37 +08:00
anjiahao a2afedb6b4 ffmpeg:add missing header file
ffmpeg/libavdevice/nuttx.c:206:5: error: implicit declaration of function 'close'; did you mean 'pclose'? [-Werror=implicit-function-declaration]
  206 |     close(fd);
      |     ^~~~~
      |     pclose
At top level:
ffmpeg/libavfilter/af_amix.c:727:5: error: implicit declaration of function 'close'; did you mean 'pclose'? [-Werror=implicit-function-declaration]
  727 |     close(s->timer_fd);
      |     ^~~~~
      |     pclose
ffmpeg/libavfilter/af_amix.c: In function 'process_command':
ffmpeg/libavfilter/af_amix.c:806:13: error: implicit declaration of function 'read'; did you mean 'fread'? [-Werror=implicit-function-declaration]
  806 |             read(pollfd->fd, &exp, sizeof(exp));
      |             ^~~~
      |             fread
ffmpeg/libavfilter/sink_movie_async.c:82:5: error: unknown type name 'pthread_cond_t'
   82 |     pthread_cond_t            cond;
      |     ^~~~~~~~~~~~~~
ffmpeg/libavfilter/sink_movie_async.c: In function 'moviesink_send_cmd':
ffmpeg/libavfilter/sink_movie_async.c:116:5: error: implicit declaration of function 'pthread_mutex_lock' [-Werror=implicit-function-declaration]
  116 |     pthread_mutex_lock(&priv->mutex);
      |     ^~~~~~~~~~~~~~~~~~
ffmpeg/libavfilter/sink_movie_async.c:118:5: error: implicit declaration of function 'pthread_cond_signal' [-Werror=implicit-function-declaration]
  118 |     pthread_cond_signal(&priv->cond);
      |     ^~~~~~~~~~~~~~~~~~~
ffmpeg/libavfilter/sink_movie_async.c:119:5: error: implicit declaration of function 'pthread_mutex_unlock'; did you mean 'nxrmutex_unlock'? [-Werror=implicit-function-declaration]
  119 |     pthread_mutex_unlock(&priv->mutex);
      |     ^~~~~~~~~~~~~~~~~~~~
      |     nxrmutex_unlock
ffmpeg/libavfilter/sink_movie_async.c: In function 'moviesink_thread':
ffmpeg/libavfilter/sink_movie_async.c:669:13: error: implicit declaration of function 'pthread_cond_wait' [-Werror=implicit-function-declaration]
  669 |             pthread_cond_wait(&priv->cond, &priv->mutex);
      |             ^~~~~~~~~~~~~~~~~
ffmpeg/libavfilter/sink_movie_async.c: In function 'moviesink_uninit':
ffmpeg/libavfilter/sink_movie_async.c:763:5: error: implicit declaration of function 'pthread_mutex_destroy'; did you mean 'nxrmutex_destroy'? [-Werror=implicit-function-declaration]
  763 |     pthread_mutex_destroy(&priv->mutex);
      |     ^~~~~~~~~~~~~~~~~~~~~
      |     nxrmutex_destroy
ffmpeg/libavfilter/sink_movie_async.c:764:5: error: implicit declaration of function 'pthread_cond_destroy' [-Werror=implicit-function-declaration]

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2026-04-20 20:58:32 +08:00
Marton Balint ae45715675 avformat/internal: retire ff_get_frame_filename
It no longer has any users.

Signed-off-by: Marton Balint <cus@passwd.hu>
Signed-off-by: caifan3 <caifan3@xiaomi.com>
2026-04-20 20:58:28 +08:00
Marton Balint 00cabb0559 avformat/img2enc: use a AVBPrint buffer for generating the filename
This removes all path length limits from img2enc.

Signed-off-by: Marton Balint <cus@passwd.hu>
2026-04-20 20:58:28 +08:00
Marton Balint f8077720c4 avformat/utils: add ff_bprint_get_frame_filename
Signed-off-by: Marton Balint <cus@passwd.hu>
Signed-off-by: caifan3 <caifan3@xiaomi.com>
2026-04-20 20:58:28 +08:00
Marton Balint cc71e33a57 avformat/img2enc: allocate temp and target filename dynamically
To avoid truncation of filename with additional .tmp extension.

Signed-off-by: Marton Balint <cus@passwd.hu>
2026-04-20 20:58:28 +08:00
jinxiuxu f9894a7a92 libavformat/sasp_dec: fix FF_FMT_INIT_CLEANUP flag
Signed-off-by: jinxiuxu <jinxiuxu@xiaomi.com>
2026-04-20 20:58:27 +08:00
zhaozhenghang 315b478766 libavformat/mov.c: Fix "statement will never be executed" warning
That occurs when H261, H263, and MPEG4 decoders are disabled.

Signed-off-by: zhaozhenghang <15083277223@163.com>
2026-04-20 20:58:27 +08:00
fangyibo 7fc0282060 ffmpeg: silk codec adapt to 7.x
Signed-off-by: fangyibo <fangyibo@xiaomi.com>
2026-04-20 20:58:26 +08:00
qiaohaijiao1 ab45daa6eb FFMPEG: add raw silk demuxer/decoder/muxer/encoder support
Signed-off-by: qiaohaijiao1 <qiaohaijiao1@xiaomi.com>
Signed-off-by: qiaohaijiao1 <qiaohaijiao1@xiaomi.com>
Signed-off-by: fangyibo <fangyibo@xiaomi.com>
2026-04-20 20:58:26 +08:00
niyinghao 0d1d8bd135 FFMPEG: fix opusraw build error
Signed-off-by: niyinghao <niyinghao@xiaomi.com>
2026-04-20 20:58:26 +08:00
yangyalei a00fbde915 FFMPEG: adapt rpmsg protocol to ffmpeg7.x
Signed-off-by: yangyalei <yangyalei@xiaomi.com>
2026-04-20 20:58:15 +08:00
yangliming cad8fc3bb5 ffmpeg : add ldac demuxer and decoder.
add ldac demuxer and decoder in ffmpeg base on the libldac provided by sony

Signed-off-by: yangliming <yangliming@xiaomi.com>
2026-04-20 20:58:04 +08:00
guliangzeng 670c3fd278 ffmpeg: add default amr muxer back for fate
Signed-off-by: guliangzeng <guliangzeng@xiaomi.com>
2026-04-20 20:58:03 +08:00
guliangzeng 07810eae73 ffmpeg: fix amrwb muxer compile error
Signed-off-by: guliangzeng <guliangzeng@xiaomi.com>
2026-04-20 20:58:03 +08:00
qiaohaijiao1 eea71a41c8 FFMPEG: add opusraw muxer.
Signed-off-by: qiaohaijiao1 <qiaohaijiao1@xiaomi.com>
Signed-off-by: qiaohaijiao1 <qiaohaijiao1@xiaomi.com>
2026-04-20 20:58:02 +08:00
xumin6 68d80af450 external/ffmpeg: modify macro definition for offloding audio recording with amr format.
Signed-off-by: xumin6 <xumin6@xiaomi.com>
2026-04-20 20:58:01 +08:00
xumin6 305cfea57f external/ffmpeg: add offloding audio recording with amr format.
Signed-off-by: xumin6 <xumin6@xiaomi.com>
2026-04-20 20:58:01 +08:00
renjianguang 2e9d7b812d ffmpeg: Modify amrnb & amrwb to amrnbraw & amrwbraw
Signed-off-by: renjianguang <renjianguang@xiaomi.com>
2026-04-20 20:58:01 +08:00
renjianguang 38e5e29397 FFMPEG: Add amrnb amrwb muxer, don't add file header to amr file
Signed-off-by: renjianguang <renjianguang@xiaomi.com>
2026-04-20 20:58:01 +08:00
lile7 780d6b7663 ffmpeg: Optimize memory layout for struct SASPFrameHeader
Signed-off-by: lile7 <lile7@xiaomi.com>
2026-04-20 20:58:01 +08:00
yaojingwei 2adbb417a0 ffmpeg: adapt to latest SASPFrameHeader.
Signed-off-by: yaojingwei <yaojingwei@xiaomi.com>
2026-04-20 20:58:01 +08:00
lile7 a8c72c3843 ffmpeg/sasp: fix stream timestamp
miss live stream timestamp_s is always 0 according to the miss protocol

neededby:3631230

Signed-off-by: lile7 <lile7@xiaomi.com>
2026-04-20 20:58:01 +08:00
yaojingwei e4a7511fe5 extern/ffmpeg : add Simplified Abstraction Stream Protocol Muxer.
Signed-off-by: yaojingwei <yaojingwei@xiaomi.com>
2026-04-20 20:58:01 +08:00
lile7 56e050fd0b external/ffmpeg: only set the default value for SASP when user has not specified
Signed-off-by: lile7 <lile7@xiaomi.com>
2026-04-20 20:58:01 +08:00