From patchwork Thu May 31 00:05:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marton Balint X-Patchwork-Id: 9169 Delivered-To: ffmpegpatchwork@gmail.com Received: by 2002:a02:11c:0:0:0:0:0 with SMTP id c28-v6csp4929817jad; Wed, 30 May 2018 17:06:32 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIEc2MeB7qVnJxGKZ2bRC0caEiRVSbbCN7YGFS0JQkt41jeZX0XxAheNW1ukK9RiaSYRQHD X-Received: by 2002:adf:ebc3:: with SMTP id v3-v6mr3540365wrn.33.1527725192589; Wed, 30 May 2018 17:06:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527725192; cv=none; d=google.com; s=arc-20160816; b=y1EzapekijV2opGTd3+FIF+X0UGevKc/x8345aZQq4JDdroNEn0jSN0TP8q8ZtFpQ6 T6gTg1RNp5moe0YNzT+mM8LOrc1LHaoVjU8iPNvMPFY1WjPpRZrOfYaIzx6g4y4HdGSQ IOz+zSmRsQE9OjHdOTb46njwG25E/yjliKTbhviAr7RJ5pIJhlNYbOjjRAga98S6M/zc 2qNBJ+Lw0gJByN2UbOhsnvHKXeOKir9MBX7j/RgAxCJBLgsRiFPk5CuLSSqVjK7Q7iVt ekg2c57XCEg6iyqanU/VAQORoA4+TA9He0+xomleYvqkRwTOlYK6/7tleh6kfDVcTvZF 6X/Q== 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:references:in-reply-to:message-id:date :to:from:delivered-to:arc-authentication-results; bh=I7p7Y7xlGrqE7ZqGy90sok6zC6KeNmRF0YRaIwCc6sA=; b=g4NPC9M72lhpJ1fVRMoLxTwNchJEcT7C09G58DgdBdNHmc0eEEQl8jpoOHsW91UvqB yinkhYj/PhPr0zSJppdSs4SQlyO4MQI1kNPQiNtwAL9OftnCn39J7fr0cNBHhbdtvE4n AAoqZAaPpqAWbJre+T8FW3ovR0LmYAshLPLURRII9kQcBdZXEDuHlrQex8Op5CuCX172 U4tcXFbviSlzPaoMZTWzWHmfBjRxRyxExd15ga6etX63UqBEEwvJEr8f2sAIQ6HCF3xv uUUlKSuHYEdZydXKA2EiH/tczdoobocoaK4nyqa3vU5WZXV9s62+c2T4TFkdsciFsqD0 ka5A== 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 z22-v6si16202513wrb.264.2018.05.30.17.06.32; Wed, 30 May 2018 17:06:32 -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 AA28568A466; Thu, 31 May 2018 03:05:19 +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 97B6068A45E for ; Thu, 31 May 2018 03:05:13 +0300 (EEST) Received: from localhost (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 695CAE1155; Thu, 31 May 2018 02:05:58 +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 KvpvBIG92Wh0; Thu, 31 May 2018 02:05:56 +0200 (CEST) Received: from bluegene.passwd.hu (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id A9FDCE1160; Thu, 31 May 2018 02:05:56 +0200 (CEST) From: Marton Balint To: ffmpeg-devel@ffmpeg.org Date: Thu, 31 May 2018 02:05:36 +0200 Message-Id: <20180531000536.11482-6-cus@passwd.hu> X-Mailer: git-send-email 2.16.3 In-Reply-To: <20180531000536.11482-1-cus@passwd.hu> References: <20180531000536.11482-1-cus@passwd.hu> Subject: [FFmpeg-devel] [PATCH 6/6] avformat/mxfdec: add support for recognizing timed text streams 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/mxfdec.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c index cf1cd71987..d9ce09cc75 100644 --- a/libavformat/mxfdec.c +++ b/libavformat/mxfdec.c @@ -1280,6 +1280,7 @@ 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,0x0d,0x00,0x00 }, 16, AV_CODEC_ID_NONE, "vbi_smpte_436M" }, { { 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" }, + { { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x09,0x0d,0x01,0x03,0x01,0x02,0x13,0x01,0x01 }, 16, AV_CODEC_ID_TIMED_TEXT_MARKUP }, { { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, 0, AV_CODEC_ID_NONE }, }; @@ -2351,7 +2352,13 @@ static int mxf_parse_structural_metadata(MXFContext *mxf) st->need_parsing = AVSTREAM_PARSE_FULL; } } else if (st->codecpar->codec_type == AVMEDIA_TYPE_DATA) { + enum AVMediaType type; container_ul = mxf_get_codec_ul(mxf_data_essence_container_uls, essence_container_ul); + if (st->codecpar->codec_id == AV_CODEC_ID_NONE) + st->codecpar->codec_id = container_ul->id; + type = avcodec_get_type(st->codecpar->codec_id); + if (type == AVMEDIA_TYPE_SUBTITLE) + st->codecpar->codec_type = type; if (container_ul->desc) av_dict_set(&st->metadata, "data_type", container_ul->desc, 0); } @@ -2501,6 +2508,7 @@ static const MXFMetadataReadTableEntry mxf_metadata_read_table[] = { { { 0x06,0x0e,0x2b,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x5b,0x00 }, mxf_read_generic_descriptor, sizeof(MXFDescriptor), Descriptor }, /* VBI - SMPTE 436M */ { { 0x06,0x0e,0x2b,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x5c,0x00 }, mxf_read_generic_descriptor, sizeof(MXFDescriptor), Descriptor }, /* VANC/VBI - SMPTE 436M */ { { 0x06,0x0e,0x2b,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x5e,0x00 }, mxf_read_generic_descriptor, sizeof(MXFDescriptor), Descriptor }, /* MPEG2AudioDescriptor */ + { { 0x06,0x0e,0x2b,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x64,0x00 }, mxf_read_generic_descriptor, sizeof(MXFDescriptor), Descriptor }, /* DC Timed Text Descriptor */ { { 0x06,0x0e,0x2b,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x3A,0x00 }, mxf_read_track, sizeof(MXFTrack), Track }, /* Static Track */ { { 0x06,0x0e,0x2b,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x3B,0x00 }, mxf_read_track, sizeof(MXFTrack), Track }, /* Generic Track */ { { 0x06,0x0e,0x2b,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x14,0x00 }, mxf_read_timecode_component, sizeof(MXFTimecodeComponent), TimecodeComponent },