Add support for v4l2loopback
It allows to send the video stream to /dev/videoN, so that it can be captured (like a webcam) by any v4l2-capable tool. PR #2232 <https://github.com/Genymobile/scrcpy/pull/2232> PR #2233 <https://github.com/Genymobile/scrcpy/pull/2233> PR #2268 <https://github.com/Genymobile/scrcpy/pull/2268> Co-authored-by: Romain Vimont <rom@rom1v.com>
This commit is contained in:
committed by
Romain Vimont
parent
5af9d0ee0f
commit
d39161f753
39
app/src/v4l2_sink.h
Normal file
39
app/src/v4l2_sink.h
Normal file
@@ -0,0 +1,39 @@
|
||||
#ifndef SC_V4L2_SINK_H
|
||||
#define SC_V4L2_SINK_H
|
||||
|
||||
#include "common.h"
|
||||
|
||||
#include "coords.h"
|
||||
#include "trait/frame_sink.h"
|
||||
#include "video_buffer.h"
|
||||
|
||||
#include <libavformat/avformat.h>
|
||||
|
||||
struct sc_v4l2_sink {
|
||||
struct sc_frame_sink frame_sink; // frame sink trait
|
||||
|
||||
struct video_buffer vb;
|
||||
AVFormatContext *format_ctx;
|
||||
AVCodecContext *encoder_ctx;
|
||||
|
||||
char *device_name;
|
||||
struct size frame_size;
|
||||
|
||||
sc_thread thread;
|
||||
sc_mutex mutex;
|
||||
sc_cond cond;
|
||||
bool stopped;
|
||||
bool header_written;
|
||||
|
||||
AVFrame *frame;
|
||||
AVPacket packet;
|
||||
};
|
||||
|
||||
bool
|
||||
sc_v4l2_sink_init(struct sc_v4l2_sink *vs, const char *device_name,
|
||||
struct size frame_size);
|
||||
|
||||
void
|
||||
sc_v4l2_sink_destroy(struct sc_v4l2_sink *vs);
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user