From patchwork Sun Apr 24 10:14:07 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: 35430 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:3b9e:b0:7d:cfb5:dc7c with SMTP id b30csp1335419pzh; Sun, 24 Apr 2022 03:15:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz+Pag1ObyRgh+hCpZ4DXBk9Wd0RR9xDcxuOrwLngatGpsOE8SoJtbD1EA6tPjNEhicZDPZ X-Received: by 2002:a17:906:6a25:b0:6f3:8c39:98ee with SMTP id qw37-20020a1709066a2500b006f38c3998eemr1835610ejc.425.1650795338647; Sun, 24 Apr 2022 03:15:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650795338; cv=none; d=google.com; s=arc-20160816; b=aA/+vIXyH1S6dxQwWx1eVzs3VHYW8ohMRQx+iP542UHWQ2AbXwARi1LDwHtQggejUY 9K+qQ+0EACXbvIOftC2wMF8Y2Pwxo75KXlsIsL0eKkn+8utSz7KtWj8YhcElTNJcys/E ytU0yx/Nn9T4Gn08Ey/YsHI6YfHgsKGuZVHQ9n6OBqJe/mbV7kkGmxoyf32tTc6g6U14 TVAm7dFBRWRbWyWuBHPLFGsX12nr0ILbRlPXV0+LjGrxV+n3XCyZAfKOGwJjQHADfrmO 3dOf/mUL/1uKSoydwx0+n9SQxyZJwp17cHYSO2yIM/49CX370nrQjVU3S42TWV/iYND1 K2Tg== 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:delivered-to; bh=KPAyyW7sc8N6Okz0yfGRdakhEWZ1XBHBwd8dLM4WgVM=; b=jW4KqUgJW/8yhTMlTlg5CmajMBOIJ4KekldI1guw9Iw2VPXaHkbTSU2i0FVOEgRAfZ bzG8HcZd4rJDxC5v8GefuR8ofh67MKcFEvweAit2E/7acxXfRIZauWSLlGWlm7lYCBTA qGwIClsBfdST8atRFzVOvT1+Kew8oVzrU09bTfpxPMyJGmglbmoMKBJRkXrtPaBS5rOZ yfb9BF/tZwzQ+k4ABcfv1UjhN+YvNZqoHvD8zrwvmYcTBV+GVf91ilGDSQWcxQj5il5v c8w6acKIWQyzpMLEGJZqTbGSvYVPcgs6h2Zba2pSCKQNC14zOWL2p1qX5rJowjzUNCxc JYrA== ARC-Authentication-Results: i=1; mx.google.com; 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 lo23-20020a170906fa1700b006df76385ebasi619354ejb.858.2022.04.24.03.15.38; Sun, 24 Apr 2022 03:15:38 -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; 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 69D6468B2DC; Sun, 24 Apr 2022 13:14:53 +0300 (EEST) 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 2816568B262 for ; Sun, 24 Apr 2022 13:14:52 +0300 (EEST) X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Zane van Iperen To: ffmpeg-devel@ffmpeg.org Date: Sun, 24 Apr 2022 20:14:07 +1000 Message-Id: <20220424101409.95486-6-zane@zanevaniperen.com> In-Reply-To: <20220424101409.95486-1-zane@zanevaniperen.com> References: <20220424101409.95486-1-zane@zanevaniperen.com> MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: cadance.vs49688.net Subject: [FFmpeg-devel] [PATCH v2 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: 24xKyW9oD7yS From: Pierre-Anthony Lemieux --- 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 7a6b54ab6f..b3105d6ccc 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" @@ -43,7 +44,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, }; @@ -1089,9 +1090,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)