From patchwork Sat Jul 13 14:05:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Almer X-Patchwork-Id: 50522 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:612c:2298:b0:482:c625:d099 with SMTP id fp24csp1417471vqb; Sat, 13 Jul 2024 08:21:46 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXToxmxmWC2oNF5zMbaQNc2crx8vrgPRfxUUtoc3xHpw2+IFM6/he0Y5zMFUhTbzKOd20xEfTig6w0r8N4zbZ/ZnOVEV2zzDDnJmQ== X-Google-Smtp-Source: AGHT+IGZjRNeMt8Ol4CWuVIlgpDEfo3wrmmyj7IM9lQuJd1w/JnLbfE1OknnezHhc0IvHC1aImFb X-Received: by 2002:a05:6402:35d0:b0:58c:6edf:d5d1 with SMTP id 4fb4d7f45d1cf-594ba98f24fmr10944107a12.5.1720884105922; Sat, 13 Jul 2024 08:21:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1720884105; cv=none; d=google.com; s=arc-20160816; b=PF68NERAaIRaFFF0JJaP7txDZN4od7mh3yRH8TH6Z2ORxkQNe4Bn1jIj/kx72ahxOc v+eoZuoBY5Ip06d6qycoJgO3tny4mtBNB3krcLwx2Nvpr8s8cbd+2YPkGhd9R/HR1lck 4f7AL/AUqApzxTOTjpCMij2NE1U7s9afWvVq2cOerXn9jJPcACTTKp1Y3GUHvyExZKEJ yCtnn9HiE1/IyvOPknYaZiTXtCF1DuHYBuOP0P5h/8eagNv0lYdnoBg6AmC9Nh7EImN+ WxOipfAYQH9KfBr6Rv5YF3wnk/tUwBEh6QsTIVtYNcQvpsj3UqeSN+KlctP/St1l6dzY U5gw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:dkim-signature:delivered-to; bh=R263VWJLLd3pU5hyTSgNQaIH2GAr6/V8wYqZXefz1MI=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=GykpRfYGVTdNWlggGXrDKVcOU2K9YTPDgX8qcNmbwHo3t7W6tZeYfIA+K1HFyLyWsN 6dISicndnxMz1E3C0IwFYyPSH/RWhb2jcIhnHu8U00uQsBLxTbNvPLeF7rlcTx2iEbh3 DoV9RaGxbqiX8UOS30/mTN52oA2S0VvBHmzPLQrBV3c6iyIZscLA51cEIM37Af8KER2T byj9sloUj2q8TNsbyypAQ38nb9XyMXSWZaH7RuubZjLwTR04/nBQqZNNncOhzEVHnf/S 3ya0AeWCOnHWD2IoDacWbQj2vx3EoyC4O3cMYKK19eEhnWBsa8YxijPi2QNZ8sIKZgg5 zi2w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20230601 header.b=eRtAI141; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id 4fb4d7f45d1cf-59b27b0140csi665750a12.662.2024.07.13.08.21.45; Sat, 13 Jul 2024 08:21:45 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20230601 header.b=eRtAI141; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id BE62B68DB5F; Sat, 13 Jul 2024 17:05:56 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pf1-f170.google.com (mail-pf1-f170.google.com [209.85.210.170]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 5A8C468DB5F for ; Sat, 13 Jul 2024 17:05:49 +0300 (EEST) Received: by mail-pf1-f170.google.com with SMTP id d2e1a72fcca58-70afe18837cso2031583b3a.3 for ; Sat, 13 Jul 2024 07:05:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1720879546; x=1721484346; darn=ffmpeg.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=/SFVh2uRNdQt6bWFVDUYHd2BvPZY/J8YvdI4bSTtV5M=; b=eRtAI141rCFYehsyv0cnvbcX4UxG3KqLJHKS/kRpfgsrfQPAobr4e54O9cyJRVZGiG JujjsS7vgnetqJ6eET0ZLvJ3XaOXs1M9yoPdbSUf46hIEmpja6oDWz8FHWsJIkTX5mYp AJGXNgoooD78fdSPkRsjT4dFjIR2tvrVFzZcfUf1qWUr82kNqZ78SgSLRcJeKQat1soG qPlFJKDnv2wPoImPb/cq7Ti+hd0fr9ES5DyZ9LZdI47WUPeKDIX/UpUeVx3SZgxZYCCl Urd1QPjowrA9HEhVCjKYk73jDmuP16ilGDbwvVVSXaveJ6DsXPhuzmc5vnSL1TCthIS5 eOMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720879546; x=1721484346; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/SFVh2uRNdQt6bWFVDUYHd2BvPZY/J8YvdI4bSTtV5M=; b=WDR1AccPCLYIcNVw54EBM3eSjps3r04tPfOUGK8k+5i1uW2Firb4/FzHN981aIsotu 57QDgkm+klxKg5kdpeP235K3nqkPRtDV1ouIvcIhUJb8hGG/drIp4bRQmMYAsEKDl9Yf rqgwfYXlS2oZrXzE7SM5fHxR3JbJ604aZGdopHoDWjHe9H8qdhwVWgYbMAS+H9eJrwq9 BKkHn0k0sZuUC5B9FHOnLQTS+W3ae5dtiiDhEPfJCXu5Wjp3FqnptWQA4M8EeH2Zt6u1 ZL0IbWamh0X9EUMwxV0mNw0uWEbYZGL29T+hBB5tL+1ql3XxHsg1KuWgA4fbnJpYEcZ2 EiWw== X-Gm-Message-State: AOJu0YzwjsS5ArQ5O/Tftmdd9WAcdmqZypJoJK0EyO7dW9LokaueZ2bx xswLl3RAyeK4eLPY/S0yMeISW9ZxZGs//meAAXoZ9KEwuytI8PWi+lXeVA== X-Received: by 2002:a05:6a00:124a:b0:706:74b7:9d78 with SMTP id d2e1a72fcca58-70b43370ff6mr16250829b3a.0.1720879546033; Sat, 13 Jul 2024 07:05:46 -0700 (PDT) Received: from localhost.localdomain ([190.194.167.233]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-70b7eb9c86csm1257686b3a.28.2024.07.13.07.05.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 13 Jul 2024 07:05:45 -0700 (PDT) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Sat, 13 Jul 2024 11:05:35 -0300 Message-ID: <20240713140535.1314-1-jamrial@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <172087845360.21847.8260743025610001929@lain.khirnov.net> References: <172087845360.21847.8260743025610001929@lain.khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v2] avcodec/bsf/showinfo: print packet data checksum 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: VtwsFW32VCkt Signed-off-by: James Almer --- libavcodec/bsf/showinfo.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libavcodec/bsf/showinfo.c b/libavcodec/bsf/showinfo.c index 4e31e0b5cb..715b160b60 100644 --- a/libavcodec/bsf/showinfo.c +++ b/libavcodec/bsf/showinfo.c @@ -23,6 +23,7 @@ #include "bsf.h" #include "bsf_internal.h" +#include "libavutil/adler32.h" #include "libavutil/log.h" #include "libavutil/timestamp.h" @@ -33,23 +34,26 @@ typedef struct ShowinfoContext { static int showinfo_filter(AVBSFContext *ctx, AVPacket *pkt) { ShowinfoContext *priv = ctx->priv_data; + uint32_t crc; int ret; ret = ff_bsf_get_packet_ref(ctx, pkt); if (ret < 0) return ret; + crc = av_adler32_update(0, pkt->data, pkt->size); av_log(ctx, AV_LOG_INFO, "n:%7"PRIu64" " "size:%7d " "pts:%s pt:%s " "dts:%s dt:%s " "ds:%"PRId64" d:%s " + "adler32:0x%08"PRIx32 "\n", priv->nb_packets, pkt->size, av_ts2str(pkt->pts), av_ts2timestr(pkt->pts, &ctx->time_base_in), av_ts2str(pkt->dts), av_ts2timestr(pkt->dts, &ctx->time_base_in), - pkt->duration, av_ts2timestr(pkt->duration, &ctx->time_base_in)); + pkt->duration, av_ts2timestr(pkt->duration, &ctx->time_base_in), crc); priv->nb_packets++;