From patchwork Thu Jun 2 00:30:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre-Anthony Lemieux X-Patchwork-Id: 36041 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:6914:b0:82:6b11:2509 with SMTP id q20csp3739190pzj; Wed, 1 Jun 2022 17:31:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz3txdWznydmzqlnl6jlDpLCZeyI0A5IijPGJesx3jw38ipRIOF37do4e/G2YkwdcUvAOt4 X-Received: by 2002:a17:907:7b8c:b0:6fe:d41d:b6a3 with SMTP id ne12-20020a1709077b8c00b006fed41db6a3mr1969234ejc.92.1654129897466; Wed, 01 Jun 2022 17:31:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654129897; cv=none; d=google.com; s=arc-20160816; b=f1cYu37lYsSezn7v6siHPcMVpUJqGaRZ/Wz/frwePKCsitlm9Z2LiXHiQYnudbzQ4T ig1dEpnAYrPhBm6cdaSrJnNX5wlVnaC0SX/zhBPVAkWFtXd9WUnYDWyvWxU+uZ7oEySU tC7AdlOTkNlzdaBfpy5GKfMmmhLT8mlk3xYQ1opiQDDGeNZl3XHRgqLo5WsGRaCOx5RJ 0R+8Qj0zghmIIqpPoEQThTM5EdCpb0qF3rO52LJzlpc6XcILmba98EvLYfUBSoq/97IW PW9UygVdrXV5n80FF5jpsbRE9D3dCsB5nqrwhTC420IPES7G/8saqQvWM2T+mf0XwaCN TcQw== 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=BUyNQgO2x2aTk2Wyu7FZbsYN5s+GI4HJoV2gf1hmaI8=; b=D8L5vTgD/J7iny10EUnp0yLfqG8qPVtT6+KEJbaTbWOue/3EzwcSHrontuhDmxGhcB d1dZpU64orVnkRd56nG496QGhvvacQNKLSLDMlPp+EDudJUAtsiype4dEoE+Boqk6/kS hWw3T03UHJu4fPDqyy7L5D0XejJRu3wxHjc9vGFKANaRyw7C6x30M0/4ecj0cOzsvGKR q8aMw485eSHQ8P9iyyoWy8vfXfHJ4Sd5EsvFlZkhDwm9f/SrxPoCjAcRXRJWXh/6oZ0Z vT+zw5t+Pvd7Le2j1LOv0VZ7K4/77lLo2S5ERgo4tt+/BZZnczGt+L/zi9hGIY6D1rRh AvhA== 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 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id dd9-20020a1709069b8900b006fe6cfe74b7si2483441ejc.849.2022.06.01.17.31.37; Wed, 01 Jun 2022 17:31:37 -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 Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 27DB968B7BA; Thu, 2 Jun 2022 03:31:03 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pg1-f178.google.com (mail-pg1-f178.google.com [209.85.215.178]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id DD1EA68B7B9 for ; Thu, 2 Jun 2022 03:30:56 +0300 (EEST) Received: by mail-pg1-f178.google.com with SMTP id 137so3342727pgb.5 for ; Wed, 01 Jun 2022 17:30:56 -0700 (PDT) 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=qv+KORmniv2beaT7E14dtiGpnszzlT1hvThaongm3bE=; b=bs7Af5kgjJfVdRlXS4uGoFEIruxGnzBoFDiRG5p0mOayK8pomsmk+sPy9Bdt+orGjx Ze2GS543Hwr+zGEeueha4eFh29+Pj4XQp6678yDkXC0CwmOsTn6UZRhLmexyirb5S5NB ldGxCFYubRp0/J+oEf1LxutjX2d6An8SYGA5aPn5etgT4+JamEpd+UOuHfJ9fZ72Hu0n afOuGozYRF0VqOkv5EctmTxGQ3kQO2f9sivx/CaZ2gdVqnGL2dUqwcQvG4LUIryuZ6UN 8crxZ5S0SD8n9g2h1VHhX86duRmYtRUOpKc7L1lZgI7JLmq1aCKxYPQJkzEm4CKvH3jn lU4g== X-Gm-Message-State: AOAM531tmTYeud5MT5BOk1a/OiOMicC04NvmrYeAbhfkGCMVa7Q0HzN5 G30hC8ffdthLflLJi81ORMkC7YBMq5o= X-Received: by 2002:a63:e603:0:b0:3fb:c191:9b65 with SMTP id g3-20020a63e603000000b003fbc1919b65mr1779006pgh.12.1654129854848; Wed, 01 Jun 2022 17:30:54 -0700 (PDT) Received: from localhost (76-14-89-2.sf-cable.astound.net. [76.14.89.2]) by smtp.gmail.com with ESMTPSA id u1-20020a170902714100b0015e8d4eb1dfsm2149160plm.41.2022.06.01.17.30.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Jun 2022 17:30:54 -0700 (PDT) Received: by localhost (sSMTP sendmail emulation); Wed, 01 Jun 2022 17:30:49 -0700 From: pal@sandflow.com To: ffmpeg-devel@ffmpeg.org Date: Wed, 1 Jun 2022 17:30:36 -0700 Message-Id: <20220602003037.24597-5-pal@sandflow.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220602003037.24597-1-pal@sandflow.com> References: <20220602003037.24597-1-pal@sandflow.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v4 5/6] avformat/imf: 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: ORKd8TNShCpN From: Pierre-Anthony Lemieux --- libavformat/imf.h | 18 ++++--------- libavformat/imf_cpl.c | 60 +++++++++++++++-------------------------- libavformat/imfdec.c | 34 +++++++++++------------ libavformat/tests/imf.c | 18 ++++++------- 4 files changed, 52 insertions(+), 78 deletions(-) diff --git a/libavformat/imf.h b/libavformat/imf.h index 62c4468ce9..4271cd9582 100644 --- a/libavformat/imf.h +++ b/libavformat/imf.h @@ -58,17 +58,9 @@ #include "avformat.h" #include "libavformat/avio.h" #include "libavutil/rational.h" +#include "libavutil/uuid.h" #include -#define FF_IMF_UUID_FORMAT \ - "urn:uuid:%02hhx%02hhx%02hhx%02hhx-%02hhx%02hhx-" \ - "%02hhx%02hhx-%02hhx%02hhx-%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx" - -/** - * UUID as defined in IETF RFC 422 - */ -typedef uint8_t FFIMFUUID[16]; - /** * IMF Composition Playlist Base Resource */ @@ -84,7 +76,7 @@ typedef struct FFIMFBaseResource { */ typedef struct FFIMFTrackFileResource { FFIMFBaseResource base; - FFIMFUUID track_file_uuid; /**< TrackFileResourceType/TrackFileId */ + AVUUID track_file_uuid; /**< TrackFileResourceType/TrackFileId */ } FFIMFTrackFileResource; /** @@ -109,7 +101,7 @@ typedef struct FFIMFMarkerResource { * IMF Composition Playlist Virtual Track */ typedef struct FFIMFBaseVirtualTrack { - FFIMFUUID id_uuid; /**< TrackId associated with the Virtual Track */ + AVUUID id_uuid; /**< TrackId associated with the Virtual Track */ } FFIMFBaseVirtualTrack; /** @@ -135,7 +127,7 @@ typedef struct FFIMFMarkerVirtualTrack { * IMF Composition Playlist */ typedef struct FFIMFCPL { - FFIMFUUID id_uuid; /**< CompositionPlaylist/Id element */ + AVUUID id_uuid; /**< CompositionPlaylist/Id element */ xmlChar *content_title_utf8; /**< CompositionPlaylist/ContentTitle element */ AVRational edit_rate; /**< CompositionPlaylist/EditRate element */ FFIMFMarkerVirtualTrack *main_markers_track; /**< Main Marker Virtual Track */ @@ -196,7 +188,7 @@ int ff_imf_xml_read_rational(xmlNodePtr element, AVRational *rational); * Reads a UUID from an XML element * @return 0 on success, < 0 AVERROR code on error. */ -int ff_imf_xml_read_uuid(xmlNodePtr element, uint8_t uuid[16]); +int ff_imf_xml_read_uuid(xmlNodePtr element, AVUUID uuid); /** * Returns the first child element with the specified local name diff --git a/libavformat/imf_cpl.c b/libavformat/imf_cpl.c index 102a6b4549..4acc20feee 100644 --- a/libavformat/imf_cpl.c +++ b/libavformat/imf_cpl.c @@ -70,32 +70,14 @@ xmlNodePtr ff_imf_xml_get_child_element_by_name(xmlNodePtr parent, const char *n return NULL; } -int ff_imf_xml_read_uuid(xmlNodePtr element, uint8_t uuid[16]) +int ff_imf_xml_read_uuid(xmlNodePtr element, AVUUID uuid) { xmlChar *element_text = NULL; - int scanf_ret; int ret = 0; element_text = xmlNodeListGetString(element->doc, element->xmlChildrenNode, 1); - scanf_ret = sscanf(element_text, - FF_IMF_UUID_FORMAT, - &uuid[0], - &uuid[1], - &uuid[2], - &uuid[3], - &uuid[4], - &uuid[5], - &uuid[6], - &uuid[7], - &uuid[8], - &uuid[9], - &uuid[10], - &uuid[11], - &uuid[12], - &uuid[13], - &uuid[14], - &uuid[15]); - if (scanf_ret != 16) { + ret = av_uuid_urn_parse(element_text, uuid); + if (ret) { av_log(NULL, AV_LOG_ERROR, "Invalid UUID\n"); ret = AVERROR_INVALIDDATA; } @@ -370,7 +352,7 @@ static int fill_marker_resource(xmlNodePtr marker_resource_elem, static int push_marker_sequence(xmlNodePtr marker_sequence_elem, FFIMFCPL *cpl) { int ret = 0; - uint8_t uuid[16]; + AVUUID uuid; xmlNodePtr resource_list_elem = NULL; xmlNodePtr resource_elem = NULL; xmlNodePtr track_id_elem = NULL; @@ -388,8 +370,8 @@ static int push_marker_sequence(xmlNodePtr marker_sequence_elem, FFIMFCPL *cpl) } av_log(NULL, AV_LOG_DEBUG, - "Processing IMF CPL Marker Sequence for Virtual Track " FF_IMF_UUID_FORMAT "\n", - UID_ARG(uuid)); + "Processing IMF CPL Marker Sequence for Virtual Track " AV_PRI_UUID "\n", + AV_UUID_ARG(uuid)); /* create main marker virtual track if it does not exist */ if (!cpl->main_markers_track) { @@ -397,9 +379,9 @@ static int push_marker_sequence(xmlNodePtr marker_sequence_elem, FFIMFCPL *cpl) if (!cpl->main_markers_track) return AVERROR(ENOMEM); imf_marker_virtual_track_init(cpl->main_markers_track); - memcpy(cpl->main_markers_track->base.id_uuid, uuid, sizeof(uuid)); + av_uuid_copy(cpl->main_markers_track->base.id_uuid, uuid); - } else if (memcmp(cpl->main_markers_track->base.id_uuid, uuid, sizeof(uuid)) != 0) { + } else if (!av_uuid_equal(cpl->main_markers_track->base.id_uuid, uuid)) { av_log(NULL, AV_LOG_ERROR, "Multiple marker virtual tracks were found\n"); return AVERROR_INVALIDDATA; } @@ -457,7 +439,7 @@ static int has_stereo_resources(xmlNodePtr element) static int push_main_audio_sequence(xmlNodePtr audio_sequence_elem, FFIMFCPL *cpl) { int ret = 0; - uint8_t uuid[16]; + AVUUID uuid; xmlNodePtr resource_list_elem = NULL; xmlNodePtr resource_elem = NULL; xmlNodePtr track_id_elem = NULL; @@ -476,12 +458,12 @@ static int push_main_audio_sequence(xmlNodePtr audio_sequence_elem, FFIMFCPL *cp } av_log(NULL, AV_LOG_DEBUG, - "Processing IMF CPL Audio Sequence for Virtual Track " FF_IMF_UUID_FORMAT "\n", - UID_ARG(uuid)); + "Processing IMF CPL Audio Sequence for Virtual Track " AV_PRI_UUID "\n", + AV_UUID_ARG(uuid)); /* get the main audio virtual track corresponding to the sequence */ for (uint32_t i = 0; i < cpl->main_audio_track_count; i++) { - if (memcmp(cpl->main_audio_tracks[i].base.id_uuid, uuid, sizeof(uuid)) == 0) { + if (av_uuid_equal(cpl->main_audio_tracks[i].base.id_uuid, uuid)) { vt = &cpl->main_audio_tracks[i]; break; } @@ -501,7 +483,7 @@ static int push_main_audio_sequence(xmlNodePtr audio_sequence_elem, FFIMFCPL *cp vt = &cpl->main_audio_tracks[cpl->main_audio_track_count]; imf_trackfile_virtual_track_init(vt); cpl->main_audio_track_count++; - memcpy(vt->base.id_uuid, uuid, sizeof(uuid)); + av_uuid_copy(vt->base.id_uuid, uuid); } /* process resources */ @@ -544,7 +526,7 @@ static int push_main_audio_sequence(xmlNodePtr audio_sequence_elem, FFIMFCPL *cp static int push_main_image_2d_sequence(xmlNodePtr image_sequence_elem, FFIMFCPL *cpl) { int ret = 0; - uint8_t uuid[16]; + AVUUID uuid; xmlNodePtr resource_list_elem = NULL; xmlNodePtr resource_elem = NULL; xmlNodePtr track_id_elem = NULL; @@ -573,16 +555,16 @@ static int push_main_image_2d_sequence(xmlNodePtr image_sequence_elem, FFIMFCPL if (!cpl->main_image_2d_track) return AVERROR(ENOMEM); imf_trackfile_virtual_track_init(cpl->main_image_2d_track); - memcpy(cpl->main_image_2d_track->base.id_uuid, uuid, sizeof(uuid)); + av_uuid_copy(cpl->main_image_2d_track->base.id_uuid, uuid); - } else if (memcmp(cpl->main_image_2d_track->base.id_uuid, uuid, sizeof(uuid)) != 0) { + } else if (!av_uuid_equal(cpl->main_image_2d_track->base.id_uuid, uuid)) { av_log(NULL, AV_LOG_ERROR, "Multiple MainImage virtual tracks found\n"); return AVERROR_INVALIDDATA; } av_log(NULL, AV_LOG_DEBUG, - "Processing IMF CPL Main Image Sequence for Virtual Track " FF_IMF_UUID_FORMAT "\n", - UID_ARG(uuid)); + "Processing IMF CPL Main Image Sequence for Virtual Track " AV_PRI_UUID "\n", + AV_UUID_ARG(uuid)); /* process resources */ resource_list_elem = ff_imf_xml_get_child_element_by_name(image_sequence_elem, "ResourceList"); @@ -746,7 +728,7 @@ static void imf_trackfile_virtual_track_free(FFIMFTrackFileVirtualTrack *vt) static void imf_cpl_init(FFIMFCPL *cpl) { - memset(cpl->id_uuid, 0, sizeof(cpl->id_uuid)); + av_uuid_nil(cpl->id_uuid); cpl->content_title_utf8 = NULL; cpl->edit_rate = av_make_q(0, 1); cpl->main_markers_track = NULL; @@ -828,8 +810,8 @@ int ff_imf_parse_cpl(AVIOContext *in, FFIMFCPL **cpl) (*cpl)->content_title_utf8); av_log(NULL, AV_LOG_INFO, - "IMF CPL Id: " FF_IMF_UUID_FORMAT "\n", - UID_ARG((*cpl)->id_uuid)); + "IMF CPL Id: " AV_PRI_UUID "\n", + AV_UUID_ARG((*cpl)->id_uuid)); } xmlFreeDoc(doc); diff --git a/libavformat/imfdec.c b/libavformat/imfdec.c index 4019249f3e..71dfb26958 100644 --- a/libavformat/imfdec.c +++ b/libavformat/imfdec.c @@ -82,7 +82,7 @@ * IMF Asset locator */ typedef struct IMFAssetLocator { - FFIMFUUID uuid; + AVUUID uuid; char *absolute_uri; } IMFAssetLocator; @@ -238,7 +238,7 @@ static int parse_imf_asset_map_from_xml_dom(AVFormatContext *s, return AVERROR_INVALIDDATA; } - av_log(s, AV_LOG_DEBUG, "Found asset id: " FF_IMF_UUID_FORMAT "\n", UID_ARG(asset->uuid)); + av_log(s, AV_LOG_DEBUG, "Found asset id: " AV_PRI_URN_UUID "\n", AV_UUID_ARG(asset->uuid)); if (!(node = ff_imf_xml_get_child_element_by_name(asset_element, "ChunkList"))) { av_log(s, AV_LOG_ERROR, "Unable to parse asset map XML - missing ChunkList node\n"); @@ -343,7 +343,7 @@ clean_up: return ret; } -static IMFAssetLocator *find_asset_map_locator(IMFAssetLocatorMap *asset_map, FFIMFUUID uuid) +static IMFAssetLocator *find_asset_map_locator(IMFAssetLocatorMap *asset_map, AVUUID uuid) { for (uint32_t i = 0; i < asset_map->asset_count; i++) { if (memcmp(asset_map->assets[i].uuid, uuid, 16) == 0) @@ -453,15 +453,15 @@ static int open_track_file_resource(AVFormatContext *s, asset_locator = find_asset_map_locator(&c->asset_locator_map, track_file_resource->track_file_uuid); if (!asset_locator) { - av_log(s, AV_LOG_ERROR, "Could not find asset locator for UUID: " FF_IMF_UUID_FORMAT "\n", - UID_ARG(track_file_resource->track_file_uuid)); + av_log(s, AV_LOG_ERROR, "Could not find asset locator for UUID: " AV_PRI_URN_UUID "\n", + AV_UUID_ARG(track_file_resource->track_file_uuid)); return AVERROR_INVALIDDATA; } av_log(s, AV_LOG_DEBUG, - "Found locator for " FF_IMF_UUID_FORMAT ": %s\n", - UID_ARG(asset_locator->uuid), + "Found locator for " AV_PRI_URN_UUID ": %s\n", + AV_UUID_ARG(asset_locator->uuid), asset_locator->absolute_uri); if (track->resource_count > INT32_MAX - track_file_resource->base.repeat_count @@ -523,14 +523,14 @@ static int open_virtual_track(AVFormatContext *s, for (uint32_t i = 0; i < virtual_track->resource_count; i++) { av_log(s, AV_LOG_DEBUG, - "Open stream from file " FF_IMF_UUID_FORMAT ", stream %d\n", - UID_ARG(virtual_track->resources[i].track_file_uuid), + "Open stream from file " AV_PRI_URN_UUID ", stream %d\n", + AV_UUID_ARG(virtual_track->resources[i].track_file_uuid), i); if ((ret = open_track_file_resource(s, &virtual_track->resources[i], track)) != 0) { av_log(s, AV_LOG_ERROR, - "Could not open image track resource " FF_IMF_UUID_FORMAT "\n", - UID_ARG(virtual_track->resources[i].track_file_uuid)); + "Could not open image track resource " AV_PRI_URN_UUID "\n", + AV_UUID_ARG(virtual_track->resources[i].track_file_uuid)); goto clean_up; } } @@ -604,16 +604,16 @@ static int open_cpl_tracks(AVFormatContext *s) if (c->cpl->main_image_2d_track) { if ((ret = open_virtual_track(s, c->cpl->main_image_2d_track, track_index++)) != 0) { - av_log(s, AV_LOG_ERROR, "Could not open image track " FF_IMF_UUID_FORMAT "\n", - UID_ARG(c->cpl->main_image_2d_track->base.id_uuid)); + av_log(s, AV_LOG_ERROR, "Could not open image track " AV_PRI_URN_UUID "\n", + AV_UUID_ARG(c->cpl->main_image_2d_track->base.id_uuid)); return ret; } } for (uint32_t i = 0; i < c->cpl->main_audio_track_count; i++) { if ((ret = open_virtual_track(s, &c->cpl->main_audio_tracks[i], track_index++)) != 0) { - av_log(s, AV_LOG_ERROR, "Could not open audio track " FF_IMF_UUID_FORMAT "\n", - UID_ARG(c->cpl->main_audio_tracks[i].base.id_uuid)); + av_log(s, AV_LOG_ERROR, "Could not open audio track " AV_PRI_URN_UUID "\n", + AV_UUID_ARG(c->cpl->main_audio_tracks[i].base.id_uuid)); return ret; } } @@ -647,8 +647,8 @@ static int imf_read_header(AVFormatContext *s) av_log(s, AV_LOG_DEBUG, - "parsed IMF CPL: " FF_IMF_UUID_FORMAT "\n", - UID_ARG(c->cpl->id_uuid)); + "parsed IMF CPL: " AV_PRI_URN_UUID "\n", + AV_UUID_ARG(c->cpl->id_uuid)); if (!c->asset_map_paths) { c->asset_map_paths = av_append_path_component(c->base_url, "ASSETMAP.xml"); diff --git a/libavformat/tests/imf.c b/libavformat/tests/imf.c index 142aa04261..e65629ccbc 100644 --- a/libavformat/tests/imf.c +++ b/libavformat/tests/imf.c @@ -304,7 +304,7 @@ static int test_cpl_parsing(void) } printf("%s\n", cpl->content_title_utf8); - printf(FF_IMF_UUID_FORMAT "\n", UID_ARG(cpl->id_uuid)); + printf(AV_PRI_URN_UUID "\n", AV_UUID_ARG(cpl->id_uuid)); printf("%i %i\n", cpl->edit_rate.num, cpl->edit_rate.den); printf("Marker resource count: %" PRIu32 "\n", cpl->main_markers_track->resource_count); @@ -320,7 +320,7 @@ static int test_cpl_parsing(void) printf("Main image resource count: %" PRIu32 "\n", cpl->main_image_2d_track->resource_count); for (uint32_t i = 0; i < cpl->main_image_2d_track->resource_count; i++) { printf("Track file resource %" PRIu32 "\n", i); - printf(" " FF_IMF_UUID_FORMAT "\n", UID_ARG(cpl->main_image_2d_track->resources[i].track_file_uuid)); + printf(" " AV_PRI_URN_UUID "\n", AV_UUID_ARG(cpl->main_image_2d_track->resources[i].track_file_uuid)); } printf("Main audio track count: %" PRIu32 "\n", cpl->main_audio_track_count); @@ -329,7 +329,7 @@ static int test_cpl_parsing(void) printf(" Main audio resource count: %" PRIu32 "\n", cpl->main_audio_tracks[i].resource_count); for (uint32_t j = 0; j < cpl->main_audio_tracks[i].resource_count; j++) { printf(" Track file resource %" PRIu32 "\n", j); - printf(" " FF_IMF_UUID_FORMAT "\n", UID_ARG(cpl->main_audio_tracks[i].resources[j].track_file_uuid)); + printf(" " AV_PRI_URN_UUID "\n", AV_UUID_ARG(cpl->main_audio_tracks[i].resources[j].track_file_uuid)); } } @@ -363,15 +363,15 @@ static int test_bad_cpl_parsing(void) static int check_asset_locator_attributes(IMFAssetLocator *asset, IMFAssetLocator *expected_asset) { - printf("\tCompare " FF_IMF_UUID_FORMAT " to " FF_IMF_UUID_FORMAT ".\n", - UID_ARG(asset->uuid), - UID_ARG(expected_asset->uuid)); + printf("\tCompare " AV_PRI_URN_UUID " to " AV_PRI_URN_UUID ".\n", + AV_UUID_ARG(asset->uuid), + AV_UUID_ARG(expected_asset->uuid)); for (uint32_t i = 0; i < 16; ++i) { if (asset->uuid[i] != expected_asset->uuid[i]) { - printf("Invalid asset locator UUID: found " FF_IMF_UUID_FORMAT " instead of " FF_IMF_UUID_FORMAT " expected.\n", - UID_ARG(asset->uuid), - UID_ARG(expected_asset->uuid)); + printf("Invalid asset locator UUID: found " AV_PRI_URN_UUID " instead of " AV_PRI_URN_UUID " expected.\n", + AV_UUID_ARG(asset->uuid), + AV_UUID_ARG(expected_asset->uuid)); return 1; } }