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 A3F6F40ED6 for ; Sat, 1 Jan 2022 04:17:11 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id A8F1068B0A8; Sat, 1 Jan 2022 06:16:35 +0200 (EET) Received: from mail-ed1-f54.google.com (mail-ed1-f54.google.com [209.85.208.54]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id AE06668B0AE for ; Sat, 1 Jan 2022 06:16:26 +0200 (EET) Received: by mail-ed1-f54.google.com with SMTP id bm14so114553109edb.5 for ; Fri, 31 Dec 2021 20:16:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=t18oN08m/ZUIztIXRhz+vMmx7LZSaDSOY8dAKJ1AW3Q=; b=FVSfImwidVMF2Y0xO84652jhEav2tkpLICco/J7Y5UomhWaIOCu4UKk0dn+1RikUQ6 PxZAfCBdTvnfy4HePp79Fvl2SapnAuv6keHRRM+vY1zmPN6Ioyigfq3I7lU1QafDSWGp c3s7d8JiVH1X6SAbesQjS0zJILxsYvzwXX7IrTIsAYwaJTl+FfcrnsH8YyAx8bwkI7QS K3c+mYeVVXY1D6edPslnu1Dg+WL3TzS7wq3jGj4w/NCP42UDZ6MJrAjqSOredx2TgDjm Forh7301vYuqT7M4UQ+IHVknMPPhLJBbDyirN2KpECYytJnXurx+bmU50R9pXx1Zj2tx d4fw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=t18oN08m/ZUIztIXRhz+vMmx7LZSaDSOY8dAKJ1AW3Q=; b=7JYjLeFGdXYTtdqWkg/QBiwYLPIX8j5LXCVtxTj9v3Bbnmk+1Up0MjUuKrDF8wrDK3 /BH9txA5J9ix9sLXi7PlsaVdx0SBvVaSip1TdIC+wTIUEm71KQOozK86nxH9X1oJ4luw UM5mmBe6HcmcRTKVxerutwzFsaDUA4x9q+M0NIoM7sq0I9Yoy17+puxVhGtYAjpsl2j3 BI5pmklLx8YGo1KpBEWXDG1LNFGqsXT682WBLp4JNuNuKQd+KUiT4jpTscFu3IDBKU2i YhwGwepf5y/3tedbnCBngR0YatGcz4cy0zuDnq88TsySo9dLeo+clel+c+1mKos0sM2V Ofww== X-Gm-Message-State: AOAM531TYHt2+55X1soknbyW5jybhOLhgb57DoPXprx/VZ/bnVW38Ca4 aQ/MsyBFukl0J9GWv7WbQwhmQJ+xFJ3Vbw== X-Google-Smtp-Source: ABdhPJwoJZzDnLlBphDayyABslQpvNZHT0ryuUOJsVAH6docVmZWBeIFwCi14DBUvKvYsJSqsTImZg== X-Received: by 2002:aa7:d0d2:: with SMTP id u18mr35611750edo.14.1641010586084; Fri, 31 Dec 2021 20:16:26 -0800 (PST) Received: from nark.. ([2a01:4f8:162:73cc::2]) by smtp.gmail.com with ESMTPSA id z18sm11272075edc.76.2021.12.31.20.16.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 Dec 2021 20:16:25 -0800 (PST) From: quietvoid X-Google-Original-From: quietvoid To: ffmpeg-devel@ffmpeg.org Date: Sat, 1 Jan 2022 05:16:20 +0100 Message-Id: <20220101041621.427012-5-tcChlisop0@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220101041621.427012-1-tcChlisop0@gmail.com> References: <20220101041621.427012-1-tcChlisop0@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v11 4/5] avformat/movenc: Refactor mov_write_dvcc_dvvc_tag to use ff_isom_put_dvcc_dvvc 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 Cc: quietvoid 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: Improves code legibility by not using bit shifts. Also avoids duplicating the dvcC/dvvC ISOM box writing code. Signed-off-by: quietvoid --- libavformat/movenc.c | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/libavformat/movenc.c b/libavformat/movenc.c index 0f912dd012..f1fe43a79f 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -27,6 +27,7 @@ #include "movenc.h" #include "avformat.h" #include "avio_internal.h" +#include "dovi_isom.h" #include "riff.h" #include "avio.h" #include "isom.h" @@ -1911,6 +1912,8 @@ static int mov_write_sv3d_tag(AVFormatContext *s, AVIOContext *pb, AVSphericalMa static int mov_write_dvcc_dvvc_tag(AVFormatContext *s, AVIOContext *pb, AVDOVIDecoderConfigurationRecord *dovi) { + uint8_t buf[ISOM_DVCC_DVVC_SIZE]; + avio_wb32(pb, 32); /* size = 8 + 24 */ if (dovi->dv_profile > 10) ffio_wfourcc(pb, "dvwC"); @@ -1918,23 +1921,10 @@ static int mov_write_dvcc_dvvc_tag(AVFormatContext *s, AVIOContext *pb, AVDOVIDe ffio_wfourcc(pb, "dvvC"); else ffio_wfourcc(pb, "dvcC"); - avio_w8(pb, dovi->dv_version_major); - avio_w8(pb, dovi->dv_version_minor); - avio_wb16(pb, (dovi->dv_profile << 9) | (dovi->dv_level << 3) | - (dovi->rpu_present_flag << 2) | (dovi->el_present_flag << 1) | - dovi->bl_present_flag); - avio_wb32(pb, (dovi->dv_bl_signal_compatibility_id << 28) | 0); - - ffio_fill(pb, 0, 4 * 4); /* reserved */ - av_log(s, AV_LOG_DEBUG, "DOVI in %s box, version: %d.%d, profile: %d, level: %d, " - "rpu flag: %d, el flag: %d, bl flag: %d, compatibility id: %d\n", - dovi->dv_profile > 10 ? "dvwC" : (dovi->dv_profile > 7 ? "dvvC" : "dvcC"), - dovi->dv_version_major, dovi->dv_version_minor, - dovi->dv_profile, dovi->dv_level, - dovi->rpu_present_flag, - dovi->el_present_flag, - dovi->bl_present_flag, - dovi->dv_bl_signal_compatibility_id); + + ff_isom_put_dvcc_dvvc(s, buf, dovi); + avio_write(pb, buf, sizeof(buf)); + return 32; /* 8 + 24 */ } -- 2.34.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".