Commit Graph

12 Commits

Author SHA1 Message Date
Anton Khirnov 6ccbff2631 fftools/ffmpeg_sched: allow encoders to send to multiple destinations
Will become useful in following commits.
2024-03-13 08:01:15 +01:00
Anton Khirnov 2ee9362419 fftools/ffmpeg: remove unncessary casts for *_thread() return values
These functions used to be passed directly to pthread_create(), which
required them to return void*. This is no longer the case, so they can
return a plain int.
2024-03-13 08:01:15 +01:00
Anton Khirnov c19c2078f3 fftools/ffmpeg_sched: remove a triggerable assert in send_to_enc_sq()
It can be triggered when send_to_enc_thread() returns AVERROR(ENOMEM).
Propagate the error to the caller instead.

Reported-by: Andreas Rheinhardt
2024-02-24 11:51:41 +01:00
Anton Khirnov a00765fcbe fftools/ffmpeg_sched: simplify failure path in sch_dec_send() 2024-02-24 11:51:41 +01:00
Anton Khirnov e0da916b8f fftools/ffmpeg: optimize inter-thread queue sizes
Use 8 packets/frames by default rather than 1, which seems to provide
better throughput.

Allow -thread_queue_size to set the muxer queue size manually again.
2024-01-28 13:34:56 +01:00
Anton Khirnov 00013341df fftools/ffmpeg_sched: add filter API to signal EOF on input 2024-01-27 09:24:29 +01:00
Anton Khirnov 5c5140ded2 fftools/ffmpeg_sched: track dts+duration as last_dts
This should be slightly (probably negligibly) more accurate for
scheduling, but mainly it improves the final reported time.

Reported-by: Paul B Mahol
2023-12-14 20:16:54 +01:00
Anton Khirnov 2305091a3a fftools/ffmpeg: update the reported timestamp at the end
Reported-by: microchip
2023-12-14 20:16:54 +01:00
Anton Khirnov 98d706b818 fftools/ffmpeg_sched: move trailing_dts() higher up
Will be useful in following commit.
2023-12-14 20:16:54 +01:00
Anton Khirnov 06d5dc11db fftools/ffmpeg_sched: actually initialize/destroy schedule_lock 2023-12-14 10:16:39 +01:00
James Almer 7cc4b306eb ffmpeg_sched: initialize have_unchoked
Should fix valgrind warnings about Conditional jump or move depends on uninitialised value.

Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: James Almer <jamrial@gmail.com>
2023-12-12 16:10:28 -03:00
Anton Khirnov 9b8cc36ce0 fftools/ffmpeg: add thread-aware transcode scheduling infrastructure
See the comment block at the top of fftools/ffmpeg_sched.h for more
details on what this scheduler is for.

This commit adds the scheduling code itself, along with minimal
integration with the rest of the program:
* allocating and freeing the scheduler
* passing it throughout the call stack in order to register the
  individual components (demuxers/decoders/filtergraphs/encoders/muxers)
  with the scheduler

The scheduler is not actually used as of this commit, so it should not
result in any change in behavior. That will change in future commits.
2023-12-12 08:24:18 +01:00