mirror of
https://github.com/Genymobile/scrcpy.git
synced 2025-08-03 06:39:39 +00:00
Fix build with ffmpeg 5.0
Signed-off-by: Bernhard Rosenkränzer <bero@lindev.ch>
This commit is contained in:
parent
25a4135935
commit
77876dc411
6 changed files with 9 additions and 6 deletions
|
@ -16,7 +16,7 @@ struct decoder {
|
||||||
struct sc_frame_sink *sinks[DECODER_MAX_SINKS];
|
struct sc_frame_sink *sinks[DECODER_MAX_SINKS];
|
||||||
unsigned sink_count;
|
unsigned sink_count;
|
||||||
|
|
||||||
AVCodecContext *codec_ctx;
|
struct AVCodecContext *codec_ctx;
|
||||||
AVFrame *frame;
|
AVFrame *frame;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -91,7 +91,7 @@ decode_image(const char *path) {
|
||||||
goto close_input;
|
goto close_input;
|
||||||
}
|
}
|
||||||
|
|
||||||
AVCodecContext *codec_ctx = avcodec_alloc_context3(codec);
|
struct AVCodecContext *codec_ctx = avcodec_alloc_context3(codec);
|
||||||
if (!codec_ctx) {
|
if (!codec_ctx) {
|
||||||
LOG_OOM();
|
LOG_OOM();
|
||||||
goto close_input;
|
goto close_input;
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <libavformat/avformat.h>
|
#include <libavformat/avformat.h>
|
||||||
|
#include <libavcodec/avcodec.h>
|
||||||
#include <libavutil/time.h>
|
#include <libavutil/time.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
|
@ -192,7 +193,7 @@ static int
|
||||||
run_stream(void *data) {
|
run_stream(void *data) {
|
||||||
struct stream *stream = data;
|
struct stream *stream = data;
|
||||||
|
|
||||||
AVCodec *codec = avcodec_find_decoder(AV_CODEC_ID_H264);
|
const AVCodec *codec = avcodec_find_decoder(AV_CODEC_ID_H264);
|
||||||
if (!codec) {
|
if (!codec) {
|
||||||
LOGE("H.264 decoder not found");
|
LOGE("H.264 decoder not found");
|
||||||
goto end;
|
goto end;
|
||||||
|
|
|
@ -20,8 +20,8 @@ struct stream {
|
||||||
struct sc_packet_sink *sinks[STREAM_MAX_SINKS];
|
struct sc_packet_sink *sinks[STREAM_MAX_SINKS];
|
||||||
unsigned sink_count;
|
unsigned sink_count;
|
||||||
|
|
||||||
AVCodecContext *codec_ctx;
|
struct AVCodecContext *codec_ctx;
|
||||||
AVCodecParserContext *parser;
|
struct AVCodecParserContext *parser;
|
||||||
// successive packets may need to be concatenated, until a non-config
|
// successive packets may need to be concatenated, until a non-config
|
||||||
// packet is available
|
// packet is available
|
||||||
AVPacket *pending;
|
AVPacket *pending;
|
||||||
|
|
|
@ -5,6 +5,8 @@
|
||||||
#include "util/log.h"
|
#include "util/log.h"
|
||||||
#include "util/str.h"
|
#include "util/str.h"
|
||||||
|
|
||||||
|
#include <libavcodec/avcodec.h>
|
||||||
|
|
||||||
/** Downcast frame_sink to sc_v4l2_sink */
|
/** Downcast frame_sink to sc_v4l2_sink */
|
||||||
#define DOWNCAST(SINK) container_of(SINK, struct sc_v4l2_sink, frame_sink)
|
#define DOWNCAST(SINK) container_of(SINK, struct sc_v4l2_sink, frame_sink)
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@ struct sc_v4l2_sink {
|
||||||
|
|
||||||
struct sc_video_buffer vb;
|
struct sc_video_buffer vb;
|
||||||
AVFormatContext *format_ctx;
|
AVFormatContext *format_ctx;
|
||||||
AVCodecContext *encoder_ctx;
|
struct AVCodecContext *encoder_ctx;
|
||||||
|
|
||||||
char *device_name;
|
char *device_name;
|
||||||
struct sc_size frame_size;
|
struct sc_size frame_size;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue