mirror of
https://github.com/Genymobile/scrcpy.git
synced 2024-09-19 05:31:21 +02:00
f6320c7e31
The goal is to expose a consistent API for system tools, and paves the way to make the "core" independant of SDL in the future.
42 lines
821 B
C
42 lines
821 B
C
#ifndef STREAM_H
|
|
#define STREAM_H
|
|
|
|
#include "common.h"
|
|
|
|
#include <stdbool.h>
|
|
#include <stdint.h>
|
|
#include <libavformat/avformat.h>
|
|
#include <SDL2/SDL_atomic.h>
|
|
|
|
#include "util/net.h"
|
|
#include "util/thread.h"
|
|
|
|
struct video_buffer;
|
|
|
|
struct stream {
|
|
socket_t socket;
|
|
sc_thread thread;
|
|
struct decoder *decoder;
|
|
struct recorder *recorder;
|
|
AVCodecContext *codec_ctx;
|
|
AVCodecParserContext *parser;
|
|
// successive packets may need to be concatenated, until a non-config
|
|
// packet is available
|
|
bool has_pending;
|
|
AVPacket pending;
|
|
};
|
|
|
|
void
|
|
stream_init(struct stream *stream, socket_t socket,
|
|
struct decoder *decoder, struct recorder *recorder);
|
|
|
|
bool
|
|
stream_start(struct stream *stream);
|
|
|
|
void
|
|
stream_stop(struct stream *stream);
|
|
|
|
void
|
|
stream_join(struct stream *stream);
|
|
|
|
#endif
|