mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-04-18 22:01:29 +03:00
Revert vcpkg ffmpeg (#8751)
* Revert "fix linux ffmpeg link, still link ffmpeg in hwcodec (#8747)" This reverts commit48464835f5. * Revert "fix linux armv7 ffmpeg arch, linux x64 sciter add hwcodec feature (#8744)" This reverts commitb68d7a3054. * Revert "arm linux remove cuda-llvm option (#8735)" This reverts commitbc672b3367. * Reapply "try fix arm64 linux ci and publish error log (#8730)" (#8732) This reverts commite283d33f28. * Revert "try fix arm64 linux ci and publish error log (#8730)" This reverts commita4565bf0da. * Revert "F-Droid: enable hwcodec for future builds (#8726)" This reverts commit188f85b042. * Revert "remove unused vcpkg ffmpeg code (#8725)" This reverts commit72c96f22b6. * Revert "install ffmpeg lib with vcpkg (#8724)" This reverts commit0143eaf601. * update hwcodec to reverted Signed-off-by: 21pages <sunboeasy@gmail.com> --------- Signed-off-by: 21pages <sunboeasy@gmail.com>
This commit is contained in:
@@ -1,71 +0,0 @@
|
||||
From 4d0d20d96ad458cfec0444b9be0182ca6085ee0c Mon Sep 17 00:00:00 2001
|
||||
From: 21pages <pages21@163.com>
|
||||
Date: Sat, 24 Feb 2024 16:02:44 +0800
|
||||
Subject: [PATCH 2/2] libavcodec/amfenc: reconfig when bitrate change
|
||||
|
||||
Signed-off-by: 21pages <pages21@163.com>
|
||||
---
|
||||
libavcodec/amfenc.c | 20 ++++++++++++++++++++
|
||||
libavcodec/amfenc.h | 1 +
|
||||
2 files changed, 21 insertions(+)
|
||||
|
||||
diff --git a/libavcodec/amfenc.c b/libavcodec/amfenc.c
|
||||
index a033e1220e..3eab01a903 100644
|
||||
--- a/libavcodec/amfenc.c
|
||||
+++ b/libavcodec/amfenc.c
|
||||
@@ -222,6 +222,7 @@ static int amf_init_context(AVCodecContext *avctx)
|
||||
|
||||
ctx->hwsurfaces_in_queue = 0;
|
||||
ctx->hwsurfaces_in_queue_max = 16;
|
||||
+ ctx->av_bitrate = avctx->bit_rate;
|
||||
|
||||
// configure AMF logger
|
||||
// the return of these functions indicates old state and do not affect behaviour
|
||||
@@ -575,6 +576,23 @@ static void amf_release_buffer_with_frame_ref(AMFBuffer *frame_ref_storage_buffe
|
||||
frame_ref_storage_buffer->pVtbl->Release(frame_ref_storage_buffer);
|
||||
}
|
||||
|
||||
+static int reconfig_encoder(AVCodecContext *avctx)
|
||||
+{
|
||||
+ AmfContext *ctx = avctx->priv_data;
|
||||
+ AMF_RESULT res = AMF_OK;
|
||||
+
|
||||
+ if (ctx->av_bitrate != avctx->bit_rate) {
|
||||
+ av_log(ctx, AV_LOG_INFO, "change bitrate from %d to %d\n", ctx->av_bitrate, avctx->bit_rate);
|
||||
+ ctx->av_bitrate = avctx->bit_rate;
|
||||
+ if (avctx->codec->id == AV_CODEC_ID_H264) {
|
||||
+ AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_TARGET_BITRATE, avctx->bit_rate);
|
||||
+ } else if (avctx->codec->id == AV_CODEC_ID_HEVC) {
|
||||
+ AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_HEVC_TARGET_BITRATE, avctx->bit_rate);
|
||||
+ }
|
||||
+ }
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
int ff_amf_receive_packet(AVCodecContext *avctx, AVPacket *avpkt)
|
||||
{
|
||||
AmfContext *ctx = avctx->priv_data;
|
||||
@@ -586,6 +604,8 @@ int ff_amf_receive_packet(AVCodecContext *avctx, AVPacket *avpkt)
|
||||
AVFrame *frame = ctx->delayed_frame;
|
||||
int block_and_wait;
|
||||
|
||||
+ reconfig_encoder(avctx);
|
||||
+
|
||||
if (!ctx->encoder)
|
||||
return AVERROR(EINVAL);
|
||||
|
||||
diff --git a/libavcodec/amfenc.h b/libavcodec/amfenc.h
|
||||
index e92120ea39..31172645f2 100644
|
||||
--- a/libavcodec/amfenc.h
|
||||
+++ b/libavcodec/amfenc.h
|
||||
@@ -107,6 +107,7 @@ typedef struct AmfContext {
|
||||
int me_half_pel;
|
||||
int me_quarter_pel;
|
||||
int aud;
|
||||
+ int64_t av_bitrate;
|
||||
|
||||
// HEVC - specific options
|
||||
|
||||
--
|
||||
2.43.0.windows.1
|
||||
|
||||
Reference in New Issue
Block a user