Expose recorder as packet sink

Make recorder implement the packet sink trait.

This will allow the stream to push packets without depending on the
concrete sink type.
This commit is contained in:
Romain Vimont
2021-04-11 15:01:05 +02:00
parent fe8de893ca
commit 5980183a33
2 changed files with 32 additions and 0 deletions

View File

@@ -8,6 +8,7 @@
#include "coords.h"
#include "scrcpy.h"
#include "trait/packet_sink.h"
#include "util/queue.h"
#include "util/thread.h"
@@ -19,6 +20,8 @@ struct record_packet {
struct recorder_queue QUEUE(struct record_packet);
struct recorder {
struct sc_packet_sink packet_sink; // packet sink trait
char *filename;
enum sc_record_format format;
AVFormatContext *ctx;