Use VecDeque in video_buffer

The packets queued for buffering were wrapped in a dynamically allocated
structure with a "next" field.

To avoid this additional layer of allocation and indirection, use a
VecDeque.
This commit is contained in:
Romain Vimont
2023-03-01 22:21:43 +01:00
parent 90f85d0d4c
commit 72fd315ef0
2 changed files with 32 additions and 36 deletions

View File

@@ -7,22 +7,21 @@
#include "clock.h"
#include "frame_buffer.h"
#include "util/queue.h"
#include "util/thread.h"
#include "util/tick.h"
#include "util/vecdeque.h"
// forward declarations
typedef struct AVFrame AVFrame;
struct sc_video_buffer_frame {
AVFrame *frame;
struct sc_video_buffer_frame *next;
#ifndef NDEBUG
sc_tick push_date;
#endif
};
struct sc_video_buffer_frame_queue SC_QUEUE(struct sc_video_buffer_frame);
struct sc_video_buffer_frame_queue SC_VECDEQUE(struct sc_video_buffer_frame);
struct sc_video_buffer {
struct sc_frame_buffer fb;