163 lines
6.3 KiB
Diff
163 lines
6.3 KiB
Diff
From: Martin Storsjö <martin@martin.st>
|
|
Date: Tue, 17 Oct 2023 11:27:17 +0000 (+0300)
|
|
Subject: aarch64: Reindent all assembly to 8/24 column indentation
|
|
X-Git-Tag: n6.1~77
|
|
X-Git-Url: http://git.ffmpeg.org/gitweb/ffmpeg.git/commitdiff_plain/a76b409dd030a461b0c5dd1ead8b22d1be560afd?hp=86ed68420d3b60439d0b7767c53d0fdc1deb7277
|
|
|
|
aarch64: Reindent all assembly to 8/24 column indentation
|
|
|
|
libavcodec/aarch64/vc1dsp_neon.S is skipped here, as it intentionally
|
|
uses a layered indentation style to visually show how different
|
|
unrolled/interleaved phases fit together.
|
|
|
|
Signed-off-by: Martin Storsjö <martin@martin.st>
|
|
---
|
|
|
|
diff --git a/configure b/configure
|
|
index edbd8bf021..953104150f 100755
|
|
--- a/configure
|
|
+++ b/configure
|
|
@@ -6786,7 +6786,7 @@ enabled libpulse && require_pkg_config libpulse libpulse pulse/pulseaud
|
|
enabled librabbitmq && require_pkg_config librabbitmq "librabbitmq >= 0.7.1" amqp.h amqp_new_connection
|
|
enabled librav1e && require_pkg_config librav1e "rav1e >= 0.5.0" rav1e.h rav1e_context_new
|
|
enabled librist && require_pkg_config librist "librist >= 0.2.7" librist/librist.h rist_receiver_create
|
|
-enabled librsvg && require_pkg_config librsvg librsvg-2.0 librsvg-2.0/librsvg/rsvg.h rsvg_handle_new_from_data
|
|
+enabled librsvg && require_pkg_config librsvg librsvg-2.0 librsvg-2.0/librsvg/rsvg.h rsvg_handle_render_cairo
|
|
enabled librtmp && require_pkg_config librtmp librtmp librtmp/rtmp.h RTMP_Socket
|
|
enabled librubberband && require_pkg_config librubberband "rubberband >= 1.8.1" rubberband/rubberband-c.h rubberband_new -lstdc++ && append librubberband_extralibs "-lstdc++"
|
|
enabled libshaderc && require_pkg_config spirv_compiler "shaderc >= 2019.1" shaderc/shaderc.h shaderc_compiler_initialize
|
|
diff --git a/libavcodec/librsvgdec.c b/libavcodec/librsvgdec.c
|
|
index c328fbc774..2f160edcdf 100644
|
|
--- a/libavcodec/librsvgdec.c
|
|
+++ b/libavcodec/librsvgdec.c
|
|
@@ -38,75 +38,48 @@ static int librsvg_decode_frame(AVCodecContext *avctx, AVFrame *frame,
|
|
{
|
|
int ret;
|
|
LibRSVGContext *s = avctx->priv_data;
|
|
- RsvgHandle *handle = NULL;
|
|
- RsvgDimensionData dimensions;
|
|
-#if LIBRSVG_MAJOR_VERSION > 2 || LIBRSVG_MAJOR_VERSION == 2 && LIBRSVG_MINOR_VERSION >= 52
|
|
- RsvgRectangle viewport = { 0 };
|
|
-#else
|
|
- RsvgDimensionData unscaled_dimensions;
|
|
-#endif
|
|
- cairo_surface_t *image = NULL;
|
|
+
|
|
+ RsvgHandle *handle;
|
|
+ RsvgDimensionData unscaled_dimensions, dimensions;
|
|
+ cairo_surface_t *image;
|
|
cairo_t *crender = NULL;
|
|
GError *error = NULL;
|
|
- gboolean gret;
|
|
|
|
*got_frame = 0;
|
|
|
|
handle = rsvg_handle_new_from_data(pkt->data, pkt->size, &error);
|
|
if (error) {
|
|
- av_log(avctx, AV_LOG_ERROR, "Error parsing svg: %s\n", error->message);
|
|
- ret = AVERROR_INVALIDDATA;
|
|
- goto end;
|
|
+ av_log(avctx, AV_LOG_ERROR, "Error parsing svg!\n");
|
|
+ g_error_free(error);
|
|
+ return AVERROR_INVALIDDATA;
|
|
}
|
|
|
|
-#if LIBRSVG_MAJOR_VERSION > 2 || LIBRSVG_MAJOR_VERSION == 2 && LIBRSVG_MINOR_VERSION >= 52
|
|
- gret = rsvg_handle_get_intrinsic_size_in_pixels(handle, &viewport.width, &viewport.height);
|
|
- if (!gret) {
|
|
- viewport.width = s->width ? s->width : 100;
|
|
- viewport.height = s->height ? s->height : 100;
|
|
- }
|
|
- dimensions.width = (int)viewport.width;
|
|
- dimensions.height = (int)viewport.height;
|
|
-#else
|
|
rsvg_handle_get_dimensions(handle, &dimensions);
|
|
rsvg_handle_get_dimensions(handle, &unscaled_dimensions);
|
|
-#endif
|
|
dimensions.width = s->width ? s->width : dimensions.width;
|
|
dimensions.height = s->height ? s->height : dimensions.height;
|
|
if (s->keep_ar && (s->width || s->height)) {
|
|
-#if LIBRSVG_MAJOR_VERSION > 2 || LIBRSVG_MAJOR_VERSION == 2 && LIBRSVG_MINOR_VERSION >= 52
|
|
- double default_ar = viewport.width / viewport.height;
|
|
-#else
|
|
double default_ar = unscaled_dimensions.width/(double)unscaled_dimensions.height;
|
|
-#endif
|
|
if (!s->width)
|
|
dimensions.width = lrintf(dimensions.height * default_ar);
|
|
else
|
|
dimensions.height = lrintf(dimensions.width / default_ar);
|
|
}
|
|
|
|
- ret = ff_set_dimensions(avctx, dimensions.width, dimensions.height);
|
|
- if (ret < 0)
|
|
- goto end;
|
|
-
|
|
+ if ((ret = ff_set_dimensions(avctx, dimensions.width, dimensions.height)))
|
|
+ return ret;
|
|
avctx->pix_fmt = AV_PIX_FMT_RGB32;
|
|
- viewport.width = dimensions.width;
|
|
- viewport.height = dimensions.height;
|
|
-
|
|
- ret = ff_get_buffer(avctx, frame, 0);
|
|
- if (ret < 0)
|
|
- goto end;
|
|
|
|
+ if ((ret = ff_get_buffer(avctx, frame, 0)))
|
|
+ return ret;
|
|
frame->pict_type = AV_PICTURE_TYPE_I;
|
|
frame->flags |= AV_FRAME_FLAG_KEY;
|
|
|
|
image = cairo_image_surface_create_for_data(frame->data[0], CAIRO_FORMAT_ARGB32,
|
|
frame->width, frame->height,
|
|
frame->linesize[0]);
|
|
- if (cairo_surface_status(image) != CAIRO_STATUS_SUCCESS) {
|
|
- ret = AVERROR_EXTERNAL;
|
|
- goto end;
|
|
- }
|
|
+ if (cairo_surface_status(image) != CAIRO_STATUS_SUCCESS)
|
|
+ return AVERROR_INVALIDDATA;
|
|
|
|
crender = cairo_create(image);
|
|
|
|
@@ -115,34 +88,18 @@ static int librsvg_decode_frame(AVCodecContext *avctx, AVFrame *frame,
|
|
cairo_paint(crender);
|
|
cairo_restore(crender);
|
|
|
|
-#if LIBRSVG_MAJOR_VERSION > 2 || LIBRSVG_MAJOR_VERSION == 2 && LIBRSVG_MINOR_VERSION >= 52
|
|
- gret = rsvg_handle_render_document(handle, crender, &viewport, &error);
|
|
-#else
|
|
cairo_scale(crender, dimensions.width / (double)unscaled_dimensions.width,
|
|
dimensions.height / (double)unscaled_dimensions.height);
|
|
- gret = rsvg_handle_render_cairo(handle, crender);
|
|
-#endif
|
|
|
|
- if (!gret) {
|
|
- av_log(avctx, AV_LOG_ERROR, "Error rendering svg: %s\n", error ? error->message : "unknown error");
|
|
- ret = AVERROR_EXTERNAL;
|
|
- goto end;
|
|
- }
|
|
+ rsvg_handle_render_cairo(handle, crender);
|
|
+
|
|
+ cairo_destroy(crender);
|
|
+ cairo_surface_destroy(image);
|
|
+ g_object_unref(handle);
|
|
|
|
*got_frame = 1;
|
|
- ret = 0;
|
|
|
|
-end:
|
|
- if (error)
|
|
- g_error_free(error);
|
|
- if (handle)
|
|
- g_object_unref(handle);
|
|
- if (crender)
|
|
- cairo_destroy(crender);
|
|
- if (image)
|
|
- cairo_surface_destroy(image);
|
|
-
|
|
- return ret;
|
|
+ return 0;
|
|
}
|
|
|
|
#define OFFSET(x) offsetof(LibRSVGContext, x)
|