mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-12-13 02:20:07 +01:00
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.
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user