From patchwork Tue May 31 03:13:34 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: 35999 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:6914:b0:82:6b11:2509 with SMTP id q20csp2607220pzj; Mon, 30 May 2022 20:15:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJynf+Eg5aoFJS59rccmU5Af/fU0Ub75g+BPyXnIdJB24yM8CGMBH3lPqKoYCZI8iDPvs+Yz X-Received: by 2002:a17:907:8a0a:b0:6fe:cede:95d8 with SMTP id sc10-20020a1709078a0a00b006fecede95d8mr38521620ejc.59.1653966919631; Mon, 30 May 2022 20:15:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653966919; cv=none; d=google.com; s=arc-20160816; b=lSQq1OhKauzGplGm7zR6lqbOg/nLEe2rFHkhe1CUzlrT8AtY8QAaYZ+Z5GgX5kB//+ fDPdEi1y8tMfPwUAbpYBv8gtDPIqCu/gOn5hYrQ7IMjdyrkAVasUu53jMUw6Y/2LqYBD hEd6/BUOAxJqQikz3MhyM/tdd/8vVFU+kwdmOmnEobuoesPte7MB+mNXMueajtXE7QEH zK/eu0dYUlh3uGsaJfWFyC4YKgLXNsGC3T/Tp+spBkxfaBi/fn0Efe9EaL+7HkNhDV3R PzqODbPEZt+EatXMKBWHyCcAswNTRFaEJIBVdwctcM73uMDylqmEVqOiugex/3Wx85zt Rg0g== 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=EhMlWaxEaVI/OpJgij59dQBx459Hm8j1AGLmY8dy/skkUtbfFlSQww+eY7x4Jgb7iJ FknMF/lW2T9qeMWnCYgXCa9z5aXPx/4RbJTIy55KZbkE9tusC/2egM9V0XUHpgXs/X6l q1W1bGk7BhUb2pySjIhb8mHKEbQqdFkiiL9EmL0C6QIWBgC4x/Pm4+PFX9uHXydP2w80 gdbQ09SOMrghjJHa67IcoF8zrT9XAU9XfBgumgdIyEA6d5ZP1M3ShcEDxkY+cTBO2kwv ONFMy6XREJr4wiQZj0PdJPZNWxGDEsDi4SfyYpm39793CQHaHJhQlacxNKnmj5a1ItuM 6hkQ== 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 cb25-20020a0564020b7900b0042dd562305asi3207872edb.589.2022.05.30.20.15.19; Mon, 30 May 2022 20:15:19 -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 597E668B654; Tue, 31 May 2022 06:14:46 +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 8A71468B64B for ; Tue, 31 May 2022 06:14:40 +0300 (EEST) Received: by mail-pg1-f178.google.com with SMTP id q123so6586309pgq.6 for ; Mon, 30 May 2022 20:14:40 -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=QCNuP6V29Xc69qs1je6AHrBBOICne1rD5MmPlqK02SidJiT8vBzxmei0zhKWfdwr98 KMGnue68HGlKIKt5R9ktVvvDnwkmEDcHBGZ3iUKEUmmWeqbZ1tYrZa87zBwqZ4Eom3Wu Eq0fWSgVMMgae+HYg8L4NO6t6pwxYHw9sAIbokmVZs78f8IemR7jTnMQ5JW97SbqoEk/ lAd95iAtqAH2lwfF5ybbgHijSV7Lh1oTdB8MoEO4PEBO7Fe3tOVu/e0JQaDt4kDhcBUF GT+jK5XlI9klZURWmjR6dAIwTjTnjg7WudyG/PVZnl+lDGfBpyEhFby1ZwYJzerX159o eLow== X-Gm-Message-State: AOAM5303ox2szeaOCIInDjWJu6r6NhSqE/pDby1KuYVwXy5mqxb81ZsQ V14L2AqEZPbufkcjvlUGq6l4YfLwnWs= X-Received: by 2002:a63:90ca:0:b0:3fa:3e63:15f4 with SMTP id a193-20020a6390ca000000b003fa3e6315f4mr36122370pge.362.1653966878354; Mon, 30 May 2022 20:14:38 -0700 (PDT) Received: from localhost (76-14-89-2.sf-cable.astound.net. [76.14.89.2]) by smtp.gmail.com with ESMTPSA id z6-20020a170903018600b0015e8d4eb25bsm10034835plg.165.2022.05.30.20.14.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 May 2022 20:14:37 -0700 (PDT) Received: by localhost (sSMTP sendmail emulation); Mon, 30 May 2022 20:14:34 -0700 From: pal@sandflow.com To: ffmpeg-devel@ffmpeg.org Date: Mon, 30 May 2022 20:13:34 -0700 Message-Id: <20220531031334.19488-5-pal@sandflow.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220531031334.19488-1-pal@sandflow.com> References: <20220531031334.19488-1-pal@sandflow.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v3 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: 5LTR0/V1Ebm5 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; } }