From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id C44B242451 for ; Sat, 21 May 2022 10:38:41 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 067A768B4C1; Sat, 21 May 2022 13:38:21 +0300 (EEST) Received: from conssluserg-01.nifty.com (conssluserg-01.nifty.com [210.131.2.80]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id CB9CE68B42E for ; Sat, 21 May 2022 13:38:11 +0300 (EEST) Received: from osamu-pc.kimura.local (M106073025034.v4.enabler.ne.jp [106.73.25.34]) (authenticated) by conssluserg-01.nifty.com with ESMTP id 24LAbdnY005140; Sat, 21 May 2022 19:37:46 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-01.nifty.com 24LAbdnY005140 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1653129466; bh=4QJgzUZgvWFTUES4hXNRzpXRnAnER2hXC45ff6jkkCw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=z62lUvGV8GQ8D+q+yuRi0hMdmqJDyoo/bOlrqQvbiAlBN28/1+iijlXvVuPkKsDld BesAOH93D11XbARe3GZdxqxNqdhsXHFHbrNleMqZ2thr2cg7hfUaCtzgX/6ctVKwhR ywUxstB5fRBJ20px5KmRRVu+q7zjOPztYqzb4w8eVdQbF6EpLAdfdXhuxGugGNrFHn Kv5KnaUJkIduilZD4iyfky6OjQ7ZTA68oXK/DWyuELIVTkvKQrDjCmtC2zBuIEsFCz PdTmyvQb3S43Zb9M1nDImmhJzqcsqjpjD8EVs1596NXgTU4RsnB/u76vqAKUzp6v6a uYbkUKWTOr5uw== X-Nifty-SrcIP: [106.73.25.34] From: TADANO Tokumei To: ffmpeg-devel@ffmpeg.org Date: Sat, 21 May 2022 19:37:11 +0900 Message-Id: <20220521103711.413481-6-aimingoff@pc.nifty.jp> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220521103711.413481-1-aimingoff@pc.nifty.jp> References: <20220521103711.413481-1-aimingoff@pc.nifty.jp> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 5/5] lavf/mpegts.c: set some properties for ARIB caption 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: TADANO Tokumei Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: Some additional properties are set for ARIB caption. * need_parsing = 0 ARIB caption doesn't require any decoder. This avoids "parser not found" warning message. * need_context_update = 1 When any profiles are changed, set this flag to notify. * codecpar->width / codecpar->height Find best video stream and set frame size for ARIB_PROFILE_A type of ARIB caption. Signed-off-by: TADANO Tokumei --- libavformat/mpegts.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c index 6e761c07f1..ead833c264 100644 --- a/libavformat/mpegts.c +++ b/libavformat/mpegts.c @@ -2145,6 +2145,7 @@ int ff_parse_mpeg2_descriptor(AVFormatContext *fc, AVStream *st, int stream_type // Vol. 3, Section 2, 4.2.8.1 int actual_component_tag = sti->stream_identifier - 1; int picked_profile = FF_PROFILE_UNKNOWN; + AVStream *v_st = NULL; int data_component_id = get16(pp, desc_end); if (data_component_id < 0) return AVERROR_INVALIDDATA; @@ -2155,7 +2156,12 @@ int ff_parse_mpeg2_descriptor(AVFormatContext *fc, AVStream *st, int stream_type // non-mobile captioning service ("profile A"). if (actual_component_tag >= 0x30 && actual_component_tag <= 0x37) { + int v_index; picked_profile = FF_PROFILE_ARIB_PROFILE_A; + v_index = av_find_best_stream(fc, AVMEDIA_TYPE_VIDEO, + -1, 1, NULL, 0); + if (v_index >= 0) + v_st = fc->streams[v_index]; } break; case 0x0012: @@ -2174,8 +2180,19 @@ int ff_parse_mpeg2_descriptor(AVFormatContext *fc, AVStream *st, int stream_type st->codecpar->codec_type = AVMEDIA_TYPE_SUBTITLE; st->codecpar->codec_id = AV_CODEC_ID_ARIB_CAPTION; - st->codecpar->profile = picked_profile; + if (st->codecpar->profile != picked_profile) { + st->codecpar->profile = picked_profile; + sti->need_context_update = 1; + } + if (v_st && + (st->codecpar->width != v_st->codecpar->width || + st->codecpar->height != v_st->codecpar->height)) { + st->codecpar->width = v_st->codecpar->width; + st->codecpar->height = v_st->codecpar->height; + sti->need_context_update = 1; + } sti->request_probe = 0; + sti->need_parsing = 0; } break; case 0xb0: /* DOVI video stream descriptor */ -- 2.30.2 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".