This commit is contained in:
Romain Vimont
2021-07-04 23:36:32 +02:00
parent 40721126e2
commit 729be4eef7
4 changed files with 125 additions and 11 deletions

View File

@@ -14,11 +14,25 @@ typedef struct AVFrame AVFrame;
struct sc_video_buffer_frame {
AVFrame *frame;
sc_tick system_pts;
struct sc_video_buffer_frame *next;
};
struct sc_video_buffer_frame_queue SC_QUEUE(struct sc_video_buffer_frame);
struct sc_clock {
double coeff;
sc_tick offset;
unsigned weight;
struct {
sc_tick system;
sc_tick stream;
} last;
sc_tick mad; // mean absolute difference
};
struct sc_video_buffer {
struct sc_frame_buffer fb;
@@ -29,6 +43,9 @@ struct sc_video_buffer {
sc_thread thread;
sc_mutex mutex;
sc_cond queue_cond;
sc_cond wait_cond;
struct sc_clock clock;
struct sc_video_buffer_frame_queue queue;
bool stopped;
} b; // buffering