From patchwork Thu May 31 00:05:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marton Balint X-Patchwork-Id: 9168 Delivered-To: ffmpegpatchwork@gmail.com Received: by 2002:a02:11c:0:0:0:0:0 with SMTP id c28-v6csp4929307jad; Wed, 30 May 2018 17:05:51 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJpyjoJgTIW6HLhuDjy1Lcw121Uka4oqHss/y32jVsZ3ANh3bX7KGZucZxK0ndn4fAcyh+B X-Received: by 2002:a1c:b20d:: with SMTP id b13-v6mr2803038wmf.130.1527725151621; Wed, 30 May 2018 17:05:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527725151; cv=none; d=google.com; s=arc-20160816; b=xXxSmC7IyI4naR2Vdm2Kdfmw3de8+jQht7EBbVtaYajRRjQSJGO5DKcb4j5JGhwu/a fLWksSTdhguff2oy84/3BRPCf830jJ3JsZPyRWrj3EL5qbOfmPVR5ZS9VH1y3Ew2TC2C af1ocWak71UUDQzDA7JCG+L14KE4VU95Tu0BFDu84pk2uQC5ptM7VN4EGCGeU3cVLr1+ wkueqN/Qqb3nciu/mNSYSR/1O6tVO+98nIQke2Ih/XMA3z1Ujz8jxML1Viig9Nc6euBH YKOW+7JfQqVGX6+9X5FfF7n1mLXl8JzyP6YWkBvip5Jyafy9AxMFNEAG7TfMohTFaRZ8 u7ew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:message-id:date:to:from:delivered-to :arc-authentication-results; bh=ui1sX6AfInkrlDDBq6CI42mXEeYQhfqcnclnAE215mk=; b=nxaRd+SNJ7h4Obb3ylhLsK/vWAyTIzpGfBGr8LOFRy6jF3k2clvT0JeAn5vIuNuZXl a37qVqO3BYiMgcNnVg+UwtUpHwnQntTfHjC4ThdNVMbSiM8FKbzesFHAm5kI93RPtzul VjHbcij1qM/nZrarT5WTsroFzVLjinueSeM5dsKr5ePyI9r6GylzHC8PfuFDh0GQQQYa LP7+TEy5KsiG1OzABbncjzFcw4SVWUCq+ZvHxviX4LLdYTNA44r7FnHtwCUHxhWnad3Z /+pxvPrEWdAI+o6cAdENotnjv6c8Voswp9IlInzeRFqSSOTvR+RxH9gKXoHs+8aHZ0Cq I6hQ== 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 m1-v6si14141993wrp.99.2018.05.30.17.05.50; Wed, 30 May 2018 17:05:51 -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 B5FDB68A42A; Thu, 31 May 2018 03:05:04 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from iq.passwd.hu (iq.passwd.hu [217.27.212.140]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 5BBB168A180 for ; Thu, 31 May 2018 03:04:58 +0300 (EEST) Received: from localhost (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 2BB24E1155; Thu, 31 May 2018 02:05:43 +0200 (CEST) X-Virus-Scanned: amavisd-new at passwd.hu Received: from iq.passwd.hu ([127.0.0.1]) by localhost (iq.passwd.hu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ZB6dyWUPd1-b; Thu, 31 May 2018 02:05:41 +0200 (CEST) Received: from bluegene.passwd.hu (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id D37F1E06EA; Thu, 31 May 2018 02:05:40 +0200 (CEST) From: Marton Balint To: ffmpeg-devel@ffmpeg.org Date: Thu, 31 May 2018 02:05:31 +0200 Message-Id: <20180531000536.11482-1-cus@passwd.hu> X-Mailer: git-send-email 2.16.3 Subject: [FFmpeg-devel] [PATCH 1/6] avformat/mxfdec: use MXFCodecUL struct to store essence description for data_essence_container_uls X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 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: Marton Balint MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Signed-off-by: Marton Balint --- libavformat/mxf.h | 1 + libavformat/mxfdec.c | 16 ++++------------ 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/libavformat/mxf.h b/libavformat/mxf.h index ffcc429a8b..19f8d8a9f5 100644 --- a/libavformat/mxf.h +++ b/libavformat/mxf.h @@ -68,6 +68,7 @@ typedef struct MXFCodecUL { UID uid; unsigned matching_len; int id; + const char *desc; } MXFCodecUL; typedef struct { diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c index bd46572e48..1099616174 100644 --- a/libavformat/mxfdec.c +++ b/libavformat/mxfdec.c @@ -1278,14 +1278,10 @@ static const MXFCodecUL mxf_sound_essence_container_uls[] = { }; static const MXFCodecUL mxf_data_essence_container_uls[] = { - { { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x09,0x0d,0x01,0x03,0x01,0x02,0x0e,0x00,0x00 }, 16, 0 }, + { { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x09,0x0d,0x01,0x03,0x01,0x02,0x0e,0x00,0x00 }, 16, AV_CODEC_ID_NONE, "vbi_vanc_smpte_436M" }, { { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, 0, AV_CODEC_ID_NONE }, }; -static const char * const mxf_data_essence_descriptor[] = { - "vbi_vanc_smpte_436M", -}; - static int mxf_get_sorted_table_segments(MXFContext *mxf, int *nb_sorted_segments, MXFIndexTableSegment ***sorted_segments) { int i, j, nb_segments = 0; @@ -2354,13 +2350,9 @@ static int mxf_parse_structural_metadata(MXFContext *mxf) st->need_parsing = AVSTREAM_PARSE_FULL; } } else if (st->codecpar->codec_type == AVMEDIA_TYPE_DATA) { - int codec_id = mxf_get_codec_ul(mxf_data_essence_container_uls, - essence_container_ul)->id; - if (codec_id >= 0 && - codec_id < FF_ARRAY_ELEMS(mxf_data_essence_descriptor)) { - av_dict_set(&st->metadata, "data_type", - mxf_data_essence_descriptor[codec_id], 0); - } + container_ul = mxf_get_codec_ul(mxf_data_essence_container_uls, essence_container_ul); + if (container_ul->desc) + av_dict_set(&st->metadata, "data_type", container_ul->desc, 0); } if (descriptor->extradata) { if (!ff_alloc_extradata(st->codecpar, descriptor->extradata_size)) {