diff options
author | Anton Khirnov <anton@khirnov.net> | 2023-05-18 16:56:15 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2023-12-12 08:24:18 +0100 |
commit | 9b8cc36ce0b2417469d78c68780c8796886c202e (patch) | |
tree | 08e76a3dd3682ea98c4e05fe4a36b7f20ae2cb46 /fftools/ffmpeg_mux.h | |
parent | ee2a8cbfd14dab9a07f409ba322f405a633f84e7 (diff) | |
download | ffmpeg-9b8cc36ce0b2417469d78c68780c8796886c202e.tar.gz |
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.
Diffstat (limited to 'fftools/ffmpeg_mux.h')
-rw-r--r-- | fftools/ffmpeg_mux.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/fftools/ffmpeg_mux.h b/fftools/ffmpeg_mux.h index a2bb4dfc7d..eee2b2cb07 100644 --- a/fftools/ffmpeg_mux.h +++ b/fftools/ffmpeg_mux.h @@ -24,6 +24,7 @@ #include <stdatomic.h> #include <stdint.h> +#include "ffmpeg_sched.h" #include "thread_queue.h" #include "libavformat/avformat.h" @@ -50,6 +51,10 @@ typedef struct MuxStream { EncStats stats; + int sch_idx; + int sch_idx_enc; + int sch_idx_src; + int64_t max_frames; /* @@ -94,6 +99,13 @@ typedef struct Muxer { AVFormatContext *fc; + Scheduler *sch; + unsigned sch_idx; + + // OutputStream indices indexed by scheduler stream indices + int *sch_stream_idx; + int nb_sch_stream_idx; + pthread_t thread; ThreadQueue *tq; |