mirror of
https://github.com/Genymobile/scrcpy.git
synced 2026-04-21 01:33:36 +00:00
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:
parent
0ebbe4b268
commit
7de4b8bea7
2 changed files with 32 additions and 36 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue