Move video_buffer to screen

The video buffer is now an internal detail of the screen component.

Since the screen is plugged to the decoder via the frame sink trait, the
decoder does not access to the video buffer anymore.
This commit is contained in:
Romain Vimont
2021-04-11 15:01:05 +02:00
parent 6f5ad21f57
commit e91acdb0c4
3 changed files with 18 additions and 25 deletions

View File

@@ -25,14 +25,12 @@
#include "server.h"
#include "stream.h"
#include "tiny_xpm.h"
#include "video_buffer.h"
#include "util/log.h"
#include "util/net.h"
static struct server server;
static struct screen screen;
static struct fps_counter fps_counter;
static struct video_buffer video_buffer;
static struct stream stream;
static struct decoder decoder;
static struct recorder recorder;
@@ -247,7 +245,6 @@ scrcpy(const struct scrcpy_options *options) {
bool server_started = false;
bool fps_counter_initialized = false;
bool video_buffer_initialized = false;
bool file_handler_initialized = false;
bool recorder_initialized = false;
bool stream_started = false;
@@ -305,11 +302,6 @@ scrcpy(const struct scrcpy_options *options) {
}
fps_counter_initialized = true;
if (!video_buffer_init(&video_buffer)) {
goto end;
}
video_buffer_initialized = true;
if (options->control) {
if (!file_handler_init(&file_handler, server.serial,
options->push_target)) {
@@ -376,8 +368,7 @@ scrcpy(const struct scrcpy_options *options) {
.fullscreen = options->fullscreen,
};
if (!screen_init(&screen, &video_buffer, &fps_counter,
&screen_params)) {
if (!screen_init(&screen, &fps_counter, &screen_params)) {
goto end;
}
screen_initialized = true;
@@ -453,10 +444,6 @@ end:
file_handler_destroy(&file_handler);
}
if (video_buffer_initialized) {
video_buffer_destroy(&video_buffer);
}
if (fps_counter_initialized) {
fps_counter_join(&fps_counter);
fps_counter_destroy(&fps_counter);