[FFmpeg-devel] [PATCH 5/7] avcodec/cbs_sei: refactor to use avutil/uuid
Zane van Iperen
zane at zanevaniperen.com
Tue Feb 22 15:01:51 EET 2022
From: Pierre-Anthony Lemieux <pal at palemieux.com>
Signed-off-by: Pierre-Anthony Lemieux <pal at palemieux.com>
Signed-off-by: Zane van Iperen <zane at zanevaniperen.com>
---
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 <stdint.h>
#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)
--
2.35.1
More information about the ffmpeg-devel
mailing list