From patchwork Tue Feb 22 13:01:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zane van Iperen X-Patchwork-Id: 34448 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6838:d078:0:0:0:0 with SMTP id x24csp4327981nkx; Tue, 22 Feb 2022 05:03:38 -0800 (PST) X-Google-Smtp-Source: ABdhPJxyq8o/CLrTRDIlOW4WrshByl++MLJ9GEg4Cz7lq4tokYA1HtVpd1Ec3lxX2lKkCGZzqMJK X-Received: by 2002:a17:906:414e:b0:6b9:7068:1983 with SMTP id l14-20020a170906414e00b006b970681983mr19643603ejk.752.1645535018117; Tue, 22 Feb 2022 05:03:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645535018; cv=none; d=google.com; s=arc-20160816; b=MjjnwhFC0nLXaqgTfflFRPKG5x6TDs6i+eSJkmE3wulHNJlDFLRDqy5tfx66nyLrO4 ig0NTw8Wadc3vadDX/6n+egp4fzfTRn+j1vMQkTJjsAtkzIA+7kjfQQIJ7lmpagShEEc WSe8tQt94O+bY2guNAH+4/+yvTU8UbPO4iqU6Zz/JBf1zjdHC6+aGFxejcTcPzN9PKMd U/zrk7UWSBjmEDMAeE4VNrTzW/k1XNEU9fXLhLu0PEVs6TFfExbQEOSPRj2kb4dAWe9F zAMMGsYX73qIVvb6iVUWKkeisTXZCSlWiQrJlD0ZirCr56cS2FyKbk5Lib4nt6T4fb5K ExCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc: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=bpkoWTYl5FQriOH5a0ASUrT+5gsqBej5CwccTnCJgrs=; b=DUykm5MbOna9JJVjzcHh1oxH9MS3XOv+UYlhVCkr/FDNi/k/wIxEXFwoc+hLCCx4jt +DYnL373EwTjAwUUjJb7Gg0/yMNil2njGr/iw+6YiQSMYavx+sVHuhx71ZyrTTQUPZ9W xAGbSUzfvzjAwJc/is8iHIkIt/Mrc8j7mlLgL9j85T2a3uexlkR+aZZNzSYTp8ncvMNC prB6rsBczmCY4AnBydYf/IceAlAvBkj4xf3Khi6Ua7Kwq41I6Vrsr/V6UZOoOLguLy09 mxTVsZLNeMo1IyEkHjpOte0dldARNMw5mojFyUtbu9hWoM0uZ0LLQMYllVGM7UMVKrCg KYWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@zanevaniperen.com header.s=key1 header.b="kUTxm/Nc"; 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=NONE dis=NONE) header.from=zanevaniperen.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id x22si12813988edr.185.2022.02.22.05.03.27; Tue, 22 Feb 2022 05:03:38 -0800 (PST) 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=@zanevaniperen.com header.s=key1 header.b="kUTxm/Nc"; 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=NONE dis=NONE) header.from=zanevaniperen.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 1605568B155; Tue, 22 Feb 2022 15:02:34 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from out1.migadu.com (out1.migadu.com [91.121.223.63]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id B331868B13C for ; Tue, 22 Feb 2022 15:02:27 +0200 (EET) X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zanevaniperen.com; s=key1; t=1645534947; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Xa4ZdAMCbEIzxY88+jrRkTidqVYNOq7pHCB5ksCKYYI=; b=kUTxm/NckSgxy3mHHLAgBlQiJJBJIilD2daMGSQ86Qgij3U9yD6LDlkAcrKbowYOOC2MzY imgdEoOpgxzOkbiH7j3Jt2x6dHDG1Po9PPBX0OuZLl1cgaGRyGQ8OQ9Ww0azerrlbI1r71 TWUZDdJxq/MQpB2hO6nMxrjZGtmJfcjq5HR33PWmaizX4rxSD5pqakVe3L+mnRMN13AJRR HKzC/twe/A2WMdRdHaJvbfhoe1LvZGP6NVp1JN/jcCkMcF0T7Gw/0jh1Ng3bmSiTiwEhiH 4XTqGtamv4Ciaw0aTmd35c8akLC/gabjpwM4u+V+70gaPfjw5yXMRjdvrQcWZg== From: Zane van Iperen To: ffmpeg-devel@ffmpeg.org Date: Tue, 22 Feb 2022 23:01:51 +1000 Message-Id: <20220222130153.289215-6-zane@zanevaniperen.com> In-Reply-To: <20220222130153.289215-1-zane@zanevaniperen.com> References: <20220222130153.289215-1-zane@zanevaniperen.com> MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: zanevaniperen.com Subject: [FFmpeg-devel] [PATCH 5/7] avcodec/cbs_sei: refactor to use avutil/uuid 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: Pierre-Anthony Lemieux Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: 4CMYf+q5mQCN From: Pierre-Anthony Lemieux Signed-off-by: Pierre-Anthony Lemieux Signed-off-by: Zane van Iperen --- libavcodec/cbs_sei.h | 3 ++- libavcodec/vaapi_encode_h264.c | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/libavcodec/cbs_sei.h b/libavcodec/cbs_sei.h index c7a7a95be0..67c6e6cbbd 100644 --- a/libavcodec/cbs_sei.h +++ b/libavcodec/cbs_sei.h @@ -23,6 +23,7 @@ #include #include "libavutil/buffer.h" +#include "libavutil/uuid.h" #include "cbs.h" #include "sei.h" @@ -41,7 +42,7 @@ typedef struct SEIRawUserDataRegistered { } SEIRawUserDataRegistered; typedef struct SEIRawUserDataUnregistered { - uint8_t uuid_iso_iec_11578[16]; + AVUUID uuid_iso_iec_11578; uint8_t *data; AVBufferRef *data_ref; size_t data_length; diff --git a/libavcodec/vaapi_encode_h264.c b/libavcodec/vaapi_encode_h264.c index ff37de1f7e..8d216b2595 100644 --- a/libavcodec/vaapi_encode_h264.c +++ b/libavcodec/vaapi_encode_h264.c @@ -25,6 +25,7 @@ #include "libavutil/common.h" #include "libavutil/internal.h" #include "libavutil/opt.h" +#include "libavutil/uuid.h" #include "avcodec.h" #include "cbs.h" @@ -42,7 +43,7 @@ enum { }; // Random (version 4) ISO 11578 UUID. -static const uint8_t vaapi_encode_h264_sei_identifier_uuid[16] = { +static const AVUUID vaapi_encode_h264_sei_identifier_uuid = { 0x59, 0x94, 0x8b, 0x28, 0x11, 0xec, 0x45, 0xaf, 0x96, 0x75, 0x19, 0xd4, 0x1f, 0xea, 0xa9, 0x4d, }; @@ -1088,9 +1089,8 @@ static av_cold int vaapi_encode_h264_configure(AVCodecContext *avctx) const char *driver; int len; - memcpy(priv->sei_identifier.uuid_iso_iec_11578, - vaapi_encode_h264_sei_identifier_uuid, - sizeof(priv->sei_identifier.uuid_iso_iec_11578)); + av_uuid_copy(priv->sei_identifier.uuid_iso_iec_11578, + vaapi_encode_h264_sei_identifier_uuid); driver = vaQueryVendorString(ctx->hwctx->display); if (!driver)