From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 64D9743036 for ; Wed, 18 May 2022 18:05:22 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 5008B68B48A; Wed, 18 May 2022 21:05:12 +0300 (EEST) Received: from mail-lj1-f180.google.com (mail-lj1-f180.google.com [209.85.208.180]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 4699668B42E for ; Wed, 18 May 2022 21:05:04 +0300 (EEST) Received: by mail-lj1-f180.google.com with SMTP id u7so2746625ljd.11 for ; Wed, 18 May 2022 11:05:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=83Dfu2pX4QzTDgXpX9d7VPQiHQgbb+Oum9LximPxcG8=; b=nFW86DYQqfB4Rn+9w4VmNEgnnpkWay8gSf+Wpc2VsmaDoAme9AABJ+qViLace8njb7 kIxRwznrvvQj/HldtW4F9n4x761eJhAyQAv37frtDKqwyBaAik6Tv7Ab8+lSL9ntKiQF TR+Td1hFHo5xgU7+RGI2a+z50886gFplOhNl6hyu+s/V1UwBB2v3z8A2jmsq0T7RwrYE vOnR10wHGbMhah9OlxOvu4VVB0sMz9+3SodeYP1+kv+a78J+HQh43k6LXw5pQVb1MKoC b42awkFYj4kAuiaC4mg5qohZOzbe0LzHncfsNSGKinauwN1GS6tIx1LxD96tlIi/XQHw qEjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=83Dfu2pX4QzTDgXpX9d7VPQiHQgbb+Oum9LximPxcG8=; b=NFm9nc9O5EThMYcXjDUvzxGWyT+0MW7m9GuPZl9Gv3856z373FrqpPT4HzhFZU9F3L fm4lhlOHC9X7Z6MpLEINIpBp6m9luC2X5eKLxZjmBnfTnn9OkfqhPYLTqDGZNYBFujo8 J77aYZFn4qpB2JcPTbNLc41IHnKkbbIghyIgtZBtu8SNe/HPupkVxTAgUXcRaroETQQi kgopFEmIRWdIUB65bfqOkVhhynXnMFRxm5P/YHz9w8K947kRYIkwCc+3JGqZpz5Hmx0a H/au22kmc5SYlyGkVH6laogn9TaDM213UYr9fCpSo7k7Qa8lIBggQRXdqyVq2Q4j+8g1 cqkg== X-Gm-Message-State: AOAM530Iiy3Uu+28lriLorMZcMNLQ3W3bQBH7muPwHivA6Wth56BuNt3 oIYZKLk47cAGgIbr33AqGTzWc4EhHhc= X-Google-Smtp-Source: ABdhPJwKe84Kkb3Wb7ynYGjKvSBUkcFl1AhHshB2l2w+NRXvnbbhfiTZgVXZfNUOvFW/wcxmOK1SAw== X-Received: by 2002:a2e:3219:0:b0:250:664c:900d with SMTP id y25-20020a2e3219000000b00250664c900dmr346450ljy.105.1652897103573; Wed, 18 May 2022 11:05:03 -0700 (PDT) Received: from localhost.localdomain (91-153-198-187.elisa-laajakaista.fi. [91.153.198.187]) by smtp.gmail.com with ESMTPSA id f14-20020ac24e4e000000b0047255d2115esm14878lfr.141.2022.05.18.11.05.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 May 2022 11:05:03 -0700 (PDT) From: =?UTF-8?q?Jan=20Ekstr=C3=B6m?= To: ffmpeg-devel@ffmpeg.org Date: Wed, 18 May 2022 21:04:54 +0300 Message-Id: <20220518180454.53301-2-jeebjp@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220518180454.53301-1-jeebjp@gmail.com> References: <20220518180454.53301-1-jeebjp@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 2/2] ffmpeg: deprecate display rotation override with a metadata key X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: Now that we have proper options for defining display matrix overrides, this should no longer be required. fftools does not have its own versioning, so for now the define is just set to 1 and disables the functionality if set to zero. --- fftools/ffmpeg.c | 2 ++ fftools/ffmpeg.h | 6 ++++++ fftools/ffmpeg_opt.c | 10 ++++++++++ 3 files changed, 18 insertions(+) diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c index a85ed18b08..5ccf3778ce 100644 --- a/fftools/ffmpeg.c +++ b/fftools/ffmpeg.c @@ -2837,12 +2837,14 @@ static int init_output_stream_streamcopy(OutputStream *ost) } } +#if FFMPEG_ROTATION_METADATA if (ost->rotate_overridden) { uint8_t *sd = av_stream_new_side_data(ost->st, AV_PKT_DATA_DISPLAYMATRIX, sizeof(int32_t) * 9); if (sd) av_display_rotation_set((int32_t *)sd, -ost->rotate_override_value); } +#endif switch (par_dst->codec_type) { case AVMEDIA_TYPE_AUDIO: diff --git a/fftools/ffmpeg.h b/fftools/ffmpeg.h index 0da01b0668..58d3aaa987 100644 --- a/fftools/ffmpeg.h +++ b/fftools/ffmpeg.h @@ -47,6 +47,8 @@ #include "libswresample/swresample.h" +#define FFMPEG_ROTATION_METADATA 1 + enum VideoSyncMethod { VSYNC_AUTO = -1, VSYNC_PASSTHROUGH, @@ -497,10 +499,14 @@ typedef struct OutputStream { int is_cfr; int force_fps; int top_field_first; +#if FFMPEG_ROTATION_METADATA int rotate_overridden; +#endif int autoscale; int bits_per_raw_sample; +#if FFMPEG_ROTATION_METADATA double rotate_override_value; +#endif AVRational frame_aspect_ratio; diff --git a/fftools/ffmpeg_opt.c b/fftools/ffmpeg_opt.c index 0d1c84d6df..5a00886e05 100644 --- a/fftools/ffmpeg_opt.c +++ b/fftools/ffmpeg_opt.c @@ -2916,6 +2916,7 @@ loop_end: for (j = 0; j < oc->nb_streams; j++) { ost = output_streams[nb_output_streams - oc->nb_streams + j]; if ((ret = check_stream_specifier(oc, oc->streams[j], stream_spec)) > 0) { +#if FFMPEG_ROTATION_METADATA if (!strcmp(o->metadata[i].u.str, "rotate")) { char *tail; double theta = av_strtod(val, &tail); @@ -2923,9 +2924,18 @@ loop_end: ost->rotate_overridden = 1; ost->rotate_override_value = theta; } + + av_log(NULL, AV_LOG_WARNING, + "Conversion of a 'rotate' metadata key to a " + "proper display matrix rotation is deprecated. " + "See -display_rotation for setting rotation " + "instead."); } else { +#endif av_dict_set(&oc->streams[j]->metadata, o->metadata[i].u.str, *val ? val : NULL, 0); +#if FFMPEG_ROTATION_METADATA } +#endif } else if (ret < 0) exit_program(1); } -- 2.36.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".