From patchwork Sat Jun 12 09:30:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: zheng qian X-Patchwork-Id: 28249 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a5e:c91a:0:0:0:0:0 with SMTP id z26csp1186856iol; Sat, 12 Jun 2021 02:59:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzkXvkYNwKtuji9epyxS6M+hsSWm4mtBx5JY5UIK0EhucDl1qP0SliQVQunPqbTvhQprqw6 X-Received: by 2002:a17:906:d0c9:: with SMTP id bq9mr7231928ejb.313.1623491955689; Sat, 12 Jun 2021 02:59:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623491955; cv=none; d=google.com; s=arc-20160816; b=lkjpII5zEQIekZqedulN1uab1yu+9cPtDD6IfqNpZ8fXz5M4dpgR2Wg6lUUgOmShHw 58MD3UbKHNEW51uTpYDEyAcRnEU61gXqsO96Mf8jR1PJg1Nn4AIqoR9+8T2d4ru7TlJ3 MIyJb8EZsamVoMYCZZjrv3Sv3rLDT46hHD73uLo8lU/njSn/g69Z7FkZx+MrGFblSC1x q2YOqJytdYahrTx/bII9OiQYCnqK3xGOrSdM8wjbb9sxtRVBjOXi55QWMD5XilyVA2zi r+QFtqbSC0KhlojPez2L8A9UXPv32MmJzkS+zzgsp6yEXqcZc4g0J68dBbfPvHya679X Y4TQ== 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:message-id:date:to:from :dkim-signature:delivered-to; bh=+q8vZfc4bTzHyZekY4QlFsG3kkrEniMehpigomcrVwc=; b=gfQoy4o+HehpVivrLcADi+9cHvhvj0N7shHr44//JCcTkRcW8CJk0QZCu2KQf9Cyth x7m9+Xv93iItEE8ptmoaehkxGaCpsoXufPf7+CxIqbQAIykPaef5YXeAYMtNfdve5Krr Zzsm59Pmo8owiflARX0kZbuatSuGK2q3k51oJzu2HPYK9N3wepB1lnZb7XpKuSOeuh1C 3taE6BJFYvu/7o/j183MjTDqvLugZsR+ldwJuUCQDpDHCR8RqMytk3G71s3bAiUtqx+d laVahkkRHFp/ixF8CNSeKJuNQcirpy2zg6eTrF14UVSXC9ISSWoHNw8sw3qig15fP8dG U3cw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@xqq-im.20150623.gappssmtp.com header.s=20150623 header.b=QXV6EtJd; 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 y3si6818321edo.435.2021.06.12.02.59.15; Sat, 12 Jun 2021 02:59:15 -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; dkim=neutral (body hash did not verify) header.i=@xqq-im.20150623.gappssmtp.com header.s=20150623 header.b=QXV6EtJd; 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 D4D45689986; Sat, 12 Jun 2021 12:59:11 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-oi1-f175.google.com (mail-oi1-f175.google.com [209.85.167.175]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 3C22A680860 for ; Sat, 12 Jun 2021 12:59:05 +0300 (EEST) Received: by mail-oi1-f175.google.com with SMTP id t140so8691175oih.0 for ; Sat, 12 Jun 2021 02:59:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xqq-im.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=RgDs9qFWBP8l8gaXRY78QtgfINUAp+xSJoZbXJb4mM4=; b=QXV6EtJdTMx+x5t124mqcY5PMmZLotTU/njZ8kFlx4sKLmLidYeqDhJ/m5hxIOplBn Up+gTkYp4nyCEiOIRnre5K+oMbo6novbQeGFkh/fQr5PzMxiEM1IR3FJ5t3XKx7BIWXc nANyMcHzO61zmOlX/TQ+0WZXt0cmUP1fjZa1V2hezPWZ1afmA2/+MP0KKLIhT107Ogbo kzVlJJKRGK98VWhzpQyRfKJ0JTU5wlanZrPsaSb4vPiyPqnpzPFYk/qY3IB4TraqzqCS 7SVw1/fTuWVPG2rME63TpZjpcoY3KLu6yzZh/2UDrHqfaxTMNtSPLTQNm7lSCaRpy8Hj cVQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=RgDs9qFWBP8l8gaXRY78QtgfINUAp+xSJoZbXJb4mM4=; b=DD/q9iG9AQ21Kcl5rXqqAOyfldtMb+s2ntfWe7pby2gRutSh/lEiKw5MCDGO6/u1e+ 0UtK3xTi5VkY6eCTCjLFTu1ykCAhrvZ/a1ldqApneZKLHZ34ZlpwQq0BMACWez4F+c7f e++oTbfBPvDSz/sS+btqBV/DehM6wrguCzc6Bm18eR9HmYB0mfI4FfR5Y+/odDKMLYu4 Q41JRcLFHMCoOwCrofdgzCEgJKOAYr9tzn7JWCfnQT2Qbg9I8YqZAVPcIFjI2xtRQzrl dIDgGtZrnAvLLcCoc5QYU0FQkyqRxQ/uPYDv3j6yLMlTChPZ1/qj5vZykgD+BNwAdxJA ROBA== X-Gm-Message-State: AOAM530Ztg5NYHmXOE/y/tAEw8vDzKjk01fsAEKrL1caaUY/RgFCJvIA G1IHWppJcxESFcDrU8vYA1n1ANMimseppg== X-Received: by 2002:a17:90b:1808:: with SMTP id lw8mr8601524pjb.30.1623490252860; Sat, 12 Jun 2021 02:30:52 -0700 (PDT) Received: from zhengqian-xps.lan (ngn-nat1.v4.open.ad.jp. [202.222.12.138]) by smtp.gmail.com with ESMTPSA id z3sm487719pfb.127.2021.06.12.02.30.51 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 12 Jun 2021 02:30:52 -0700 (PDT) From: zheng qian To: ffmpeg-devel@ffmpeg.org Date: Sat, 12 Jun 2021 18:30:28 +0900 Message-Id: <20210612093032.64034-1-xqq@xqq.im> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 1/5] avcodec/codec: Add arib_superimpose subtitle codec 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: zheng qian Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: x5WTJe5J8Q0r This patchset introduces ARIB STD-B24 superimpose support. ARIB superimpose is almost same as ARIB caption but has a silent difference. ARIB superimpose is utilized to transmit emergency alert and newsflash in Japan DTV. Since superimpose is designed to be displayed once received by the television, ARIB superimpose utilizes mpegts private_stream_2 stream rather than the private_stream_1 that is used by arib_caption, which means superimpose packet doesn't have PTS (AV_NOPTS_VALUE). Purpose of introducing arib_superimpose codec is mainly: 1) Let mpegtsenc to be able to remux ARIB superimpose stream correctly 2) Let ffmpeg-based player to be able to recognize ARIB superimpose stream then extract binary data and render it onto screen Signed-off-by: zheng qian --- libavcodec/codec_desc.c | 8 ++++++++ libavcodec/codec_id.h | 1 + libavcodec/version.h | 4 ++-- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/libavcodec/codec_desc.c b/libavcodec/codec_desc.c index 35527dcc37..afb22756a3 100644 --- a/libavcodec/codec_desc.c +++ b/libavcodec/codec_desc.c @@ -3407,6 +3407,14 @@ static const AVCodecDescriptor codec_descriptors[] = { .props = AV_CODEC_PROP_TEXT_SUB, .profiles = NULL_IF_CONFIG_SMALL(ff_arib_caption_profiles), }, + { + .id = AV_CODEC_ID_ARIB_SUPERIMPOSE, + .type = AVMEDIA_TYPE_SUBTITLE, + .name = "arib_superimpose", + .long_name = NULL_IF_CONFIG_SMALL("ARIB STD-B24 superimpose"), + .props = AV_CODEC_PROP_TEXT_SUB, + .profiles = NULL_IF_CONFIG_SMALL(ff_arib_caption_profiles), + }, /* other kind of codecs and pseudo-codecs */ { diff --git a/libavcodec/codec_id.h b/libavcodec/codec_id.h index d49f9af36c..839ffd3861 100644 --- a/libavcodec/codec_id.h +++ b/libavcodec/codec_id.h @@ -543,6 +543,7 @@ enum AVCodecID { AV_CODEC_ID_HDMV_TEXT_SUBTITLE, AV_CODEC_ID_TTML, AV_CODEC_ID_ARIB_CAPTION, + AV_CODEC_ID_ARIB_SUPERIMPOSE, /* other specific kind of codecs (generally used for attachments) */ AV_CODEC_ID_FIRST_UNKNOWN = 0x18000, ///< A dummy ID pointing at the start of various fake codecs. diff --git a/libavcodec/version.h b/libavcodec/version.h index 5b1e9e77f3..1288cecebe 100644 --- a/libavcodec/version.h +++ b/libavcodec/version.h @@ -28,8 +28,8 @@ #include "libavutil/version.h" #define LIBAVCODEC_VERSION_MAJOR 59 -#define LIBAVCODEC_VERSION_MINOR 1 -#define LIBAVCODEC_VERSION_MICRO 101 +#define LIBAVCODEC_VERSION_MINOR 2 +#define LIBAVCODEC_VERSION_MICRO 100 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ LIBAVCODEC_VERSION_MINOR, \ From patchwork Sat Jun 12 09:30:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: zheng qian X-Patchwork-Id: 28248 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a5e:c91a:0:0:0:0:0 with SMTP id z26csp1187653iol; Sat, 12 Jun 2021 03:00:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwKfrsmpBndgqosIDDy8hAWLkR4TZYPDCq3XkLF1w8nxqQtSqd+bTBmY39jmPGZutR7glsf X-Received: by 2002:a17:906:390f:: with SMTP id f15mr7444910eje.270.1623492047455; Sat, 12 Jun 2021 03:00:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623492047; cv=none; d=google.com; s=arc-20160816; b=0L/ow2kMsqrGFJSpVXx09+Sus0aNMoj6CvcsSlxc7zfH5h22Rpx4E38Zn1YtsIkfts khhJJjfCSzqBX6xKqQRJFUECZ2qhjk/SCeiwxk8tqGWgMPAFLxjVt1x+Wo2GGEnMevF/ X3LBFgwAtTudbJSVYuUYzon92hd9m7Tlg95V9wwmv2z0EP73HucqZc/lNr0Sb/yOHA8m Pr9mNoElprznoUTZz3iSECGZkTlkE46QjCKQEpOWvje7KmUhJsXlD6IU2gZDwWLCndnT xV+oGt6U6sCBSyJxUr0hrjyTthqr/SmwYnDkA++tQWCZtdNImtS+p51SLBSTopPoi6M2 cWGA== 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:dkim-signature:delivered-to; bh=4tfsUzd0gr3vvo85G+p9m26VxWsl0XKcX/HrP7JDias=; b=JXJGtFPKhy6Ce41rwcVWUfCEyDUTHBUqmLyRTXC4cjTFvNH/2pJrZ4+EIIicy7Ik9C BVAxmGkGHceNiQrnlWgKGyK0FG3GAAoKXVRmCGavgBNG3DS8Ie4EX1qm5N1NJo+wgcy4 DPtvSnXFk9QoA4t+PtJW2a8rcpScXjeTpYvB7IqeCMTfb1JcHdixg+I5jvYM3vsAeVU7 B4u79esHbJNzzgRie9/jw0PevvEuQZowp1HFXJZRPR2C3ImuuH2ZltDOfwLKp7P8NLBs UW7JLPjAqTkB2n/3rdP+2CUSJk9WH/Bv0wPs5HG3rlWSvpv+6dyBLZJZDid98C52Lrzw p1uQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@xqq-im.20150623.gappssmtp.com header.s=20150623 header.b=UIng4oly; 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 s17si7292982ejm.137.2021.06.12.03.00.47; Sat, 12 Jun 2021 03:00:47 -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; dkim=neutral (body hash did not verify) header.i=@xqq-im.20150623.gappssmtp.com header.s=20150623 header.b=UIng4oly; 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 0C4CD6899A7; Sat, 12 Jun 2021 13:00:45 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pg1-f182.google.com (mail-pg1-f182.google.com [209.85.215.182]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 06396680BD5 for ; Sat, 12 Jun 2021 13:00:39 +0300 (EEST) Received: by mail-pg1-f182.google.com with SMTP id e20so4559186pgg.0 for ; Sat, 12 Jun 2021 03:00:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xqq-im.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=o+1r1V56J6xCdphLJ05BwnZUesiOBtYJMZKasUx2Olk=; b=UIng4oly/n6eBvTtnEDZEZ34Magk7g4H53QhErPOv5NpJrU/6eSrFCnV/pcgDoqszv +exD0vF6aRXXhCQDUHNbL2l0gJTm+YdVMh+gtL3YrXtJKzDXlYXxjA5a8/UUTB0jeHUT CXGvha1arj3T0muK9/4zhaDHgDu4X+JvmOQI036By14Ft8pxhASvXgybyy/XslW56RJN g9hbTfS3ZQJhoPA1j5ejjdyBTtcBp8J8qhNAJMxibC/Ce53fr6XuPT/6VhbtpGt/U3op glVPC7kkYZk+giHqMZAP50RPQv8Uma5d/LwC1Hfi8+j9Iu5McIvpL/RVmuHn2ws/Q6I5 DxbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=o+1r1V56J6xCdphLJ05BwnZUesiOBtYJMZKasUx2Olk=; b=RHYXPMaGXZCG5slXCJ0Ye91fijcJiq8fwNKo9IZUjvLpzhrULEhNKY6iO9f6ES57uG EBjaJ/l3PdE0RaMh/s0fg5GSS+4C2j/tg1cm6jT8RnAsiT/Hui2PBy5AB4jtxSNbTRpl q0nuTEnz/hKx9Q4u029aJQ6uWb/uOJm54ekhgXKpcvr4l/hAG8jTsXIB4wBmWKXeSHiJ 8yQ8rTxWu4O2OZwRPcgTCq/l6q8Cbw/OfwSXS9ncEjQXBjDmuRb0UVl88gDs3D5n0NpV 8Q5X3Zn+bgPAbjUKuBL0E+2nIUEtDQtS+U1LV7tzYA3alal86/vF7V3tUKm5ekH1BI+h VMcA== X-Gm-Message-State: AOAM530qL5/N1i+xRRu8JL3ABwTaxNn7b9y5Bzdwd84B85eU1wHvx+wC ekRrLQ2FVItifeNpoIP1csUVNVe8KVyLSg== X-Received: by 2002:a63:690:: with SMTP id 138mr7766112pgg.33.1623490268785; Sat, 12 Jun 2021 02:31:08 -0700 (PDT) Received: from zhengqian-xps.lan (ngn-nat1.v4.open.ad.jp. [202.222.12.138]) by smtp.gmail.com with ESMTPSA id z3sm487719pfb.127.2021.06.12.02.31.07 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 12 Jun 2021 02:31:08 -0700 (PDT) From: zheng qian To: ffmpeg-devel@ffmpeg.org Date: Sat, 12 Jun 2021 18:30:29 +0900 Message-Id: <20210612093032.64034-2-xqq@xqq.im> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210612093032.64034-1-xqq@xqq.im> References: <20210612093032.64034-1-xqq@xqq.im> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 2/5] avformat/mpegts: Recognize arib_superimpose by ARIB data coding descriptor 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: zheng qian Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: WovA8mwc+1bI Signed-off-by: zheng qian --- libavformat/mpegts.c | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c index a02965bacf..6c5fb53c51 100644 --- a/libavformat/mpegts.c +++ b/libavformat/mpegts.c @@ -2106,8 +2106,8 @@ int ff_parse_mpeg2_descriptor(AVFormatContext *fc, AVStream *st, int stream_type } break; case 0xfd: /* ARIB data coding type descriptor */ - // STD-B24, fascicle 3, chapter 4 defines private_stream_1 - // for captions + // STD-B24, fascicle 3, chapter 4 defines + // private_stream_1 for captions, and private_stream_2 for superimpose if (stream_type == STREAM_TYPE_PRIVATE_DATA) { // This structure is defined in STD-B10, part 1, listing 5.4 and // part 2, 6.2.20). @@ -2115,6 +2115,7 @@ int ff_parse_mpeg2_descriptor(AVFormatContext *fc, AVStream *st, int stream_type // Component tag limits are documented in TR-B14, fascicle 2, // Vol. 3, Section 2, 4.2.8.1 int actual_component_tag = st->internal->stream_identifier - 1; + enum AVCodecID arib_codec_id = AV_CODEC_ID_NONE; int picked_profile = FF_PROFILE_UNKNOWN; int data_component_id = get16(pp, desc_end); if (data_component_id < 0) @@ -2122,17 +2123,30 @@ int ff_parse_mpeg2_descriptor(AVFormatContext *fc, AVStream *st, int stream_type switch (data_component_id) { case 0x0008: - // [0x30..0x37] are component tags utilized for + // [0x30..0x37] and [0x38..0x3F] are component tags utilized for // non-mobile captioning service ("profile A"). if (actual_component_tag >= 0x30 && actual_component_tag <= 0x37) { + // caption (Profile A) + arib_codec_id = AV_CODEC_ID_ARIB_CAPTION; + picked_profile = FF_PROFILE_ARIB_PROFILE_A; + } else if (actual_component_tag >= 0x38 && + actual_component_tag <= 0x3F) { + // superimpose (Profile A) + arib_codec_id = AV_CODEC_ID_ARIB_SUPERIMPOSE; picked_profile = FF_PROFILE_ARIB_PROFILE_A; } break; case 0x0012: - // component tag 0x87 signifies a mobile/partial reception + // component tag 0x87 and 0x88 signifies a mobile/partial reception // (1seg) captioning service ("profile C"). if (actual_component_tag == 0x87) { + // caption (Profile C) + arib_codec_id = AV_CODEC_ID_ARIB_CAPTION; + picked_profile = FF_PROFILE_ARIB_PROFILE_C; + } else if (actual_component_tag == 0x88) { + // superimpose (Profile C) + arib_codec_id = AV_CODEC_ID_ARIB_SUPERIMPOSE; picked_profile = FF_PROFILE_ARIB_PROFILE_C; } break; @@ -2140,11 +2154,11 @@ int ff_parse_mpeg2_descriptor(AVFormatContext *fc, AVStream *st, int stream_type break; } - if (picked_profile == FF_PROFILE_UNKNOWN) + if (arib_codec_id == AV_CODEC_ID_NONE || picked_profile == FF_PROFILE_UNKNOWN) break; st->codecpar->codec_type = AVMEDIA_TYPE_SUBTITLE; - st->codecpar->codec_id = AV_CODEC_ID_ARIB_CAPTION; + st->codecpar->codec_id = arib_codec_id; st->codecpar->profile = picked_profile; st->internal->request_probe = 0; } From patchwork Sat Jun 12 09:30:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: zheng qian X-Patchwork-Id: 28247 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a5e:c91a:0:0:0:0:0 with SMTP id z26csp1178089iol; Sat, 12 Jun 2021 02:39:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxAebEHIMIOjmXJ/E7xBz6gxbZCDSiCBDbZJkNAaVcEXgegqtYpyCSHrCTjKmay00HZRCM7 X-Received: by 2002:a17:906:a0d3:: with SMTP id bh19mr7389793ejb.205.1623490798765; Sat, 12 Jun 2021 02:39:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623490798; cv=none; d=google.com; s=arc-20160816; b=E/JB1XLUx4YWO//fUnFtayUklOFlGowJX7Z6n3eAVeYf3x6rYpT2FpgRgv32zJGzFL SDd/9SO+E87OsFIAaGl/od9SiVOf5mRUkX51I810Qhvkk9yzWulgM7Dagt/1C48XSVI4 AjkxvfCjUZX/RYduoRVnBAu32r136pgN68euahWydTfxtUO2LGzqMA+pUTSYAap2bCCj EqLRWcsljBaFvE3hUZx94Aeya4VRSZ0yjZyMdHOAsks+rSJrxxnl4sAJ1uAKb1+sOaaJ 5ypnLTf2fnxDpLnMAEt6A0TWjJuvkvnyBwTyzpSscA5en66L2FsZI9thADzd3jQLKWBI uCgA== 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:dkim-signature:delivered-to; bh=MOJ//ZsqHc+5dEAQXO57iT4tZm3/95fszPpNaAfRvF4=; b=rawmf1yk4SRjHxNGsULBh6F1FoUqKAERTOrAqsIx3FLsMBCEtWcNL5AomqbpbpsMDK kduGG7ErXub/7hVJu4bF1XxgXBsRoQTZ7ohFegu1mHWtkk6b4jsvELjbAIPIxm/GaKop sWPaG8h6fP9pJeuXWiDNlsTZOT+m3WzR/aO0OAP2YngdrFvBvL35mHciLk5oUHs+dZ8s 6Li5CvmzETMhIF2+ZEpzoqFOFJVZ0Y2cBgNwkiDaX7nYkMoTjEVzeIRUEkuISTL2cHPm pS0dPiwhw0wtylbeSdt4qhWHNo+XDdrLbauM68qzJu8TCn8UGBE6IvqjVuYiEnP9h3ht ip6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@xqq-im.20150623.gappssmtp.com header.s=20150623 header.b=ySBCCvJl; 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 h3si1096616ejo.7.2021.06.12.02.39.57; Sat, 12 Jun 2021 02:39:58 -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; dkim=neutral (body hash did not verify) header.i=@xqq-im.20150623.gappssmtp.com header.s=20150623 header.b=ySBCCvJl; 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 6A1926800F2; Sat, 12 Jun 2021 12:39:55 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pg1-f173.google.com (mail-pg1-f173.google.com [209.85.215.173]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 218326800F2 for ; Sat, 12 Jun 2021 12:39:49 +0300 (EEST) Received: by mail-pg1-f173.google.com with SMTP id o9so4509972pgd.2 for ; Sat, 12 Jun 2021 02:39:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xqq-im.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ftN8uwtv3JhokMQEroQYggvVitKaCLk0eyYneD9wf+M=; b=ySBCCvJlfN/JF9NvpAnqg20h70CxCVc/ITqjrrn3tJk7dzMBFRgSh3BzwEh6NOaQ5o xHEpkM7t2Xb7tKZcjrKAeYw1fOrQwk/FnRInCLsJ+XqXXjxLfK3aYcr+YhoaFDJ/2kWx PdYeFa2mSk/5WirlfvwlTIEtHeVLG1FaD8k0HqwCOxSkMfEICS3HGbKtcQDhk3u7NAxV sGeE6qv/pTiAcW32zwlS1wamUGfZTP6F/JsqNSqgXJ1HoMnTIYn2Al9qhFcKt/ipgyHS B9mx00IWz0pGwP/iiLcqivofbObq4bJG8omUha4OXwSj5tYqyU0fVTy1vLzSNZ47GmBL wOsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ftN8uwtv3JhokMQEroQYggvVitKaCLk0eyYneD9wf+M=; b=CHpaGAQTtqS49hSJz08H4ITkr5RRmWXezOnl6exYVl16Gwguz4VM+wtuHbV/VILnRD ykB+yX7py19ryzrHg8CKjePaC705hxVrRn1d2DK7Fd61bYq3USd1l0yTvrmUoCvUTE+e or97IpclFfeOXgskm79ELbgyheHBWhy1hEqmKZZwwErrUbVJKDiCE5hNLj4hV9949YHQ kXRVcdecCxybyHPRogxdUSDKS+TEjX0ImFQ/5XqGj0X1zpdgKkJF36cdbe9XfLMPwRb2 u42NaUFQF96KAQLKoprc+YchMWA63qUclhC1iFxStEkeVH5FFkP0lvWhY1iKvWPPqBru +qiA== X-Gm-Message-State: AOAM533uxCLPw/y1Ydb6iW4+EairvGl5zUtyNlW/ccVYWFrcZgIgT9bE ykB0KHQ3IqmMvS2EYgGqg0Qzw5ehcjTsmQ== X-Received: by 2002:aa7:978a:0:b029:2f6:c116:e5f5 with SMTP id o10-20020aa7978a0000b02902f6c116e5f5mr6702201pfp.21.1623490282906; Sat, 12 Jun 2021 02:31:22 -0700 (PDT) Received: from zhengqian-xps.lan (ngn-nat1.v4.open.ad.jp. [202.222.12.138]) by smtp.gmail.com with ESMTPSA id z3sm487719pfb.127.2021.06.12.02.31.21 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 12 Jun 2021 02:31:22 -0700 (PDT) From: zheng qian To: ffmpeg-devel@ffmpeg.org Date: Sat, 12 Jun 2021 18:30:30 +0900 Message-Id: <20210612093032.64034-3-xqq@xqq.im> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210612093032.64034-1-xqq@xqq.im> References: <20210612093032.64034-1-xqq@xqq.im> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 3/5] avformat/mpegtsenc: Add muxing support for arib_superimpose 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: zheng qian Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: MEJNT9mgeLR7 Signed-off-by: zheng qian --- libavformat/mpegtsenc.c | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c index 98dac17994..68f69d5df8 100644 --- a/libavformat/mpegtsenc.c +++ b/libavformat/mpegtsenc.c @@ -287,7 +287,7 @@ static void putbuf(uint8_t **q_ptr, const uint8_t *buf, size_t len) *q_ptr += len; } -static int put_arib_caption_descriptor(AVFormatContext *s, uint8_t **q_ptr, +static int put_arib_descriptor(AVFormatContext *s, uint8_t **q_ptr, AVCodecParameters *codecpar) { uint8_t stream_identifier; @@ -296,11 +296,19 @@ static int put_arib_caption_descriptor(AVFormatContext *s, uint8_t **q_ptr, switch (codecpar->profile) { case FF_PROFILE_ARIB_PROFILE_A: - stream_identifier = 0x30; + if (codecpar->codec_id == AV_CODEC_ID_ARIB_CAPTION) { + stream_identifier = 0x30; + } else { // AV_CODEC_ID_ARIB_SUPERIMPOSE + stream_identifier = 0x38; + } data_component_id = 0x0008; break; case FF_PROFILE_ARIB_PROFILE_C: - stream_identifier = 0x87; + if (codecpar->codec_id == AV_CODEC_ID_ARIB_CAPTION) { + stream_identifier = 0x87; + } else { // AV_CODEC_ID_ARIB_SUPERIMPOSE + stream_identifier = 0x88; + } data_component_id = 0x0012; break; default: @@ -320,11 +328,15 @@ static int put_arib_caption_descriptor(AVFormatContext *s, uint8_t **q_ptr, *q++ = 3; // descriptor_length put16(&q, data_component_id); // data_component_id // additional_arib_caption_info: defined in ARIB STD-B24, fascicle 1, Part 3, 9.6.1 - // Here we utilize a pre-defined set of values defined in ARIB TR-B14, + // Here we utilize pre-defined sets of values defined in ARIB TR-B14, // Fascicle 2, 4.2.8.5 for PMT usage, with the reserved bits in the middle // set to 1 (as that is what every broadcaster seems to be doing in // production). - *q++ = 0x3D; // DMF('0011'), Reserved('11'), Timing('01') + if (codecpar->codec_id == AV_CODEC_ID_ARIB_CAPTION) { + *q++ = 0x3D; // DMF('0011'), Reserved('11'), Timing('01') + } else { // AV_CODEC_ID_ARIB_SUPERIMPOSE + *q++ = 0x3C; // DMF('0011'), Reserved('11'), Timing('00') + } *q_ptr = q; @@ -414,6 +426,7 @@ static int get_dvb_stream_type(AVFormatContext *s, AVStream *st) case AV_CODEC_ID_DVB_SUBTITLE: case AV_CODEC_ID_DVB_TELETEXT: case AV_CODEC_ID_ARIB_CAPTION: + case AV_CODEC_ID_ARIB_SUPERIMPOSE: stream_type = STREAM_TYPE_PRIVATE_DATA; break; case AV_CODEC_ID_SMPTE_KLV: @@ -771,8 +784,8 @@ static int mpegts_write_pmt(AVFormatContext *s, MpegTSService *service) } *len_ptr = q - len_ptr - 1; - } else if (codec_id == AV_CODEC_ID_ARIB_CAPTION) { - if (put_arib_caption_descriptor(s, &q, st->codecpar) < 0) + } else if (codec_id == AV_CODEC_ID_ARIB_CAPTION || codec_id == AV_CODEC_ID_ARIB_SUPERIMPOSE) { + if (put_arib_descriptor(s, &q, st->codecpar) < 0) break; } break; @@ -1444,6 +1457,9 @@ static int get_pes_stream_id(AVFormatContext *s, AVStream *st, int stream_id, in if (stream_id == STREAM_ID_PRIVATE_STREAM_1) /* asynchronous KLV */ *async = 1; return stream_id != -1 ? stream_id : STREAM_ID_METADATA_STREAM; + } else if (st->codecpar->codec_type == AVMEDIA_TYPE_SUBTITLE && + st->codecpar->codec_id == AV_CODEC_ID_ARIB_SUPERIMPOSE) { + return STREAM_ID_PRIVATE_STREAM_2; } else { return STREAM_ID_PRIVATE_STREAM_1; } From patchwork Sat Jun 12 09:30:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: zheng qian X-Patchwork-Id: 28246 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a5e:c91a:0:0:0:0:0 with SMTP id z26csp1174218iol; Sat, 12 Jun 2021 02:31:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzBgjzVGjoxKT11JLKDO6cOgd2NoPl29SITFRRIEruFgVWTpXIog1gFNHVdC3lCD1q32lRI X-Received: by 2002:a17:906:988a:: with SMTP id zc10mr7028441ejb.62.1623490308313; Sat, 12 Jun 2021 02:31:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623490308; cv=none; d=google.com; s=arc-20160816; b=Y4hkigUZ5paSjMj+ZZFcTsr5T0fkjKJXkQQxGTnNFkQudiq4UON8KayQLM7jE85OP9 cNlsqSY6UV7oID5mMsfSxXXA+kiM5C2X6TeqFIpQIAVYJfvKGr40kIjw2kxAQyPLI9U/ EMsxZwWy6+zzArJ6azYNSssl9iFmYGcQgSXuD2MN+fep4ztWGLENSJrRLOuTYjHQv0zr dnFMYMPn3cWZyywiDCgFjvEGCI8+LynOOGLRq/n6b3rzS6Ve8ztbxfT00elwpvaSn3WX C/avWRt3EOQ6c5S4ERaGiF6x14yQABwiAZJFrxkuuwnP4DRwUpP7oi0g355byZYJwQDA esZw== 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:dkim-signature:delivered-to; bh=k7EHtyiXVciuGxtzc9xqjgTcWiq3EmI0Cv2cJi25vdg=; b=r5o0Dym45gQivFHAoeDvGMWdptK8QdpLjt1D8D1YWLhscc0ZLWVtPXF+cESiHnoS4H lFnStoI5CKSgzKSJ1EZXhc/ruG5Wuv6Dl/x2rsPnbyPnufsSqraQ2tTmYKK6ox50Hqhg XOoCnLQ0eg08GpN5cYgeSunKb3iesuY1JdA39xvrvJHWoCNQNU0mF08H91YiFIkTtypH xG26I1SYNZQMUFwognFTXHNMsiIgP7H+V4r4Ng8K1hagRC1LgaW0ikmoiTiFmbDfZ1vk qABaTwSdzGKLi3jTX1fpN6cPIHQLIutBzmqqMuVwAtDmmHUEgi3FJT5RkCKbRXB6rtZJ yYLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@xqq-im.20150623.gappssmtp.com header.s=20150623 header.b=lHf82+Ca; 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 r2si6799549edp.606.2021.06.12.02.31.47; Sat, 12 Jun 2021 02:31:48 -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; dkim=neutral (body hash did not verify) header.i=@xqq-im.20150623.gappssmtp.com header.s=20150623 header.b=lHf82+Ca; 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 8898A689905; Sat, 12 Jun 2021 12:31:43 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pl1-f172.google.com (mail-pl1-f172.google.com [209.85.214.172]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 38404688133 for ; Sat, 12 Jun 2021 12:31:37 +0300 (EEST) Received: by mail-pl1-f172.google.com with SMTP id h1so4051804plt.1 for ; Sat, 12 Jun 2021 02:31:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xqq-im.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=3T1rwOMItf3bAf9ts2P/rBCt/QGUXMSVQmaLVdg5DGc=; b=lHf82+CaV1RMB3Hwju2+jQjKQ+Me/HEbt6wRwBG9XecO2Bg8fsXY5R2N5rxjWzecgJ An2fXKez39/OdR/SP9UCD691cwE+Lt/GiLH+VvTJ2oN2SGaGsysfWb/wtj2mrAQyYFxo 5M9+wM8ltQZtY3LjgtK/vJrMLiqpp4ZB2FqTyjD6v5xifjxisQgPZcjTZTv0t4X2xKvQ IdRLGfLMBAr3MnU2+lYXFwEqO89PXbVgLPhLquJ2sYJwhkDIxUSg5BwsMSsVg0dSxLKA 2zLYg4A1G6EMNO7bpgJksy+Zvgh3PIqkIbe1QbUeVs+lICB5osE4DCSfdjUETk/B1Wjl RqiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=3T1rwOMItf3bAf9ts2P/rBCt/QGUXMSVQmaLVdg5DGc=; b=XMmlI1uFXMwEATRmy8RQTjSCkodffi6aXFX6eJIPKo0m3qySqwgvOlKaBiz+DQ8qBP jPO22gspCZB/oEGRUe7JszcuWO0738mWW8dRQgmmc475qLEpPKeOi5MLPjzZ2k71gn8r P8FzV9t3iRQtfWMt35lJjHS+jVjek9/ckGda3gmKbFwCzRwYXcut667aTRts1ThHljFC PWlLoDMbqkhc6TaeRHpCXnUyurL9e9V6xzkf3mig7OEKNCJraltRmbJgX2MkfEar2r2M R0rK8QvgSN/wLPFxFiZ0pQEwf9OZFVVS7+yphHXBslcGis74K7VvZbHm1A64FYs08J4n rWqQ== X-Gm-Message-State: AOAM5311Mx88ATsOBuoArJI7csXC1RV1f3JNFpbJtez3f7+/GKqDnuXD OZCvftn+bKY1boQwPyQsTrvhGo97df0fuA== X-Received: by 2002:a17:90a:ad85:: with SMTP id s5mr8906763pjq.230.1623490295032; Sat, 12 Jun 2021 02:31:35 -0700 (PDT) Received: from zhengqian-xps.lan (ngn-nat1.v4.open.ad.jp. [202.222.12.138]) by smtp.gmail.com with ESMTPSA id z3sm487719pfb.127.2021.06.12.02.31.33 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 12 Jun 2021 02:31:34 -0700 (PDT) From: zheng qian To: ffmpeg-devel@ffmpeg.org Date: Sat, 12 Jun 2021 18:30:31 +0900 Message-Id: <20210612093032.64034-4-xqq@xqq.im> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210612093032.64034-1-xqq@xqq.im> References: <20210612093032.64034-1-xqq@xqq.im> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 4/5] fftools/ffmpeg: Ignore PTS checking for arib_superimpose 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: zheng qian Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: qvWvsuFnTBSR arib_superimpose codec doesn't has PTS (AV_NOPTS_VALUE) Signed-off-by: zheng qian --- fftools/ffmpeg.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c index e97d879cb3..d60ab49533 100644 --- a/fftools/ffmpeg.c +++ b/fftools/ffmpeg.c @@ -824,7 +824,8 @@ static void write_packet(OutputFile *of, AVPacket *pkt, OutputStream *ost, int u if ((st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO || st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO || st->codecpar->codec_type == AVMEDIA_TYPE_SUBTITLE) && pkt->dts != AV_NOPTS_VALUE && !(st->codecpar->codec_id == AV_CODEC_ID_VP9 && ost->stream_copy) && - ost->last_mux_dts != AV_NOPTS_VALUE) { + ost->last_mux_dts != AV_NOPTS_VALUE && + st->codecpar->codec_id != AV_CODEC_ID_ARIB_SUPERIMPOSE) { int64_t max = ost->last_mux_dts + !(s->oformat->flags & AVFMT_TS_NONSTRICT); if (pkt->dts < max) { int loglevel = max - pkt->dts > 2 || st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO ? AV_LOG_WARNING : AV_LOG_DEBUG; From patchwork Sat Jun 12 09:30:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: zheng qian X-Patchwork-Id: 28245 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a5e:c91a:0:0:0:0:0 with SMTP id z26csp1178005iol; Sat, 12 Jun 2021 02:39:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwAfum9UUhyMRiRpyYlCKLsREij8aFflMSYDTqAMnr2ci7e+Y8nyktQpD1o/KpXey5ROnUJ X-Received: by 2002:a05:6402:152:: with SMTP id s18mr7715521edu.221.1623490787159; Sat, 12 Jun 2021 02:39:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623490787; cv=none; d=google.com; s=arc-20160816; b=KdagaSy3nlg1DFoOHFDpi8MB6o4pZ+JvCJlLalKcXe+6l55U5bBRSls/iR0kY+fCID mk5njQUDN+Xrllu/oblBu5M3supT9tJJQrOBO1oR9t7uqbnGwfWnMAM6+6ZkuGLeZyCi pX5t4anzLpDCymixEv1GrmqCysV2Ykn5jTiFz7dju+1epEXWygRrXv0jnlA0FEaAwuYR zf94Mlc6RVkChubh1asgCBBFcUSbxZe9D8ERwlFBNFKPl6dSHp0qMZ6eLFXGBkc0mL0e +Ygd4AxXwy1a5G5AJ1Ydgf4zPN8Bv9qJ7Ml2j+sfbSbqauQ6CZ0fs0ooRwL0XAm3kSlE IsYg== 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:dkim-signature:delivered-to; bh=zUT5OMVn9w7jE1KUTFqMIxawiBgJUAZ7+2zJzfF9tu0=; b=fgHRh0HZ8RQNvEhIzbPeM6PwP4V1s77S9fYlZEpiI0YEqEZ+vmKOd4T6ApPIxFwtcv 6Ta4b0gJKB+Yeh+xjmFlB5DKjMWFJwuTOiLivpzNrNH6/pPIVjKj1Ob6fVrywEnoDgrQ xBLIsl/scIBbaNYBJ5YhsvUHOGErwQANgKwy84+QaE5YT+tnrYBk8Vd54nVV3L3crs8U bHVUDu16ERFFbxz1rRoajgdKWI9eWpkC3Sje5qTmvdHHT+bOovLYosphL5skxtxtmyqZ onoTBJfyi9g1KSDf4KlKLmP9gb0tGvrm1Qw5aYm4Zw/DOvldxL3kWhjtM8McvxUY5PLN EtqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@xqq-im.20150623.gappssmtp.com header.s=20150623 header.b=zSIwcWWu; 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 a1si7285555eje.497.2021.06.12.02.39.38; Sat, 12 Jun 2021 02:39:47 -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; dkim=neutral (body hash did not verify) header.i=@xqq-im.20150623.gappssmtp.com header.s=20150623 header.b=zSIwcWWu; 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 5671C68995F; Sat, 12 Jun 2021 12:39:35 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pf1-f169.google.com (mail-pf1-f169.google.com [209.85.210.169]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 53C21687FB2 for ; Sat, 12 Jun 2021 12:39:29 +0300 (EEST) Received: by mail-pf1-f169.google.com with SMTP id x73so6460372pfc.8 for ; Sat, 12 Jun 2021 02:39:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xqq-im.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=tukXzTKcBi5JMQAZ2kVgzyFGHDgQEV+1UkhFmQLLtbA=; b=zSIwcWWuQFaUyUYyAEm34R3S1rttBK8LXRsDAIxOyXLSNnqjLXSC7XV2YY1wAajWhm 1QPHINB85G61hYE1OVRaDP1cAqnHHeZRtJ3ejwogs97uz9vej+lZlnIkvFG3zx1+Zal4 +YOUxLSNCscEub1mHFXm6EeXoN40wAIT3QwqfHmKJEa4k66Oig16qbAAl6Rv/ctMGiMY /XeAGvKIr3EwZDCNTlHocMJTMjtfeDwVY4tHzDHmln7tal1gC7qK1tg6+pAnl3bupwgx IzDKVz4Q4KmbIEcV8N9U9PNQXw6usUhBGh4C3l1a/Y4QXwOi1TwIGlzjyZmyJ7JQ/9dB r7qg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=tukXzTKcBi5JMQAZ2kVgzyFGHDgQEV+1UkhFmQLLtbA=; b=UDCp1gC5ZKvFZZt2k7DuBH0ErB33o0hZ0d3CT8DW+redTYPGSArzGjKXCgNBKUEgEt +NJkg2S46qrL73A5HrZlbQ+2KVM4h/+1VzEanqPgCFiG2ua+lgmsbD+WqSk1l+HAH5Se fS56WG0hc4BqXlNMgDrDjRMPNQvc5rmIvg/wpCwJk79n8CSgjkvK3/u6PxKpeYl4TkY6 CWZso+KQvb/ncV6+y5TZ5sHCKODD+X90lNxT0XrCh9X3XnfksSf0NKPVh9Wod15crIKQ Ihpg1/YTUy3ML83lwurYNAiTw329ohublcWBizgRDrvf744F+7DR0Nxggszs3iu/mw/u SS6w== X-Gm-Message-State: AOAM530bikCDU4E0enkDU/aRPcC9wSUNqCLmfJ3PuiKbps+6/4Q+rrTR x46i9z6TwtDxJF0KlksmSjfZ5YilSCjr8g== X-Received: by 2002:a17:902:d4c8:b029:102:715b:e3a5 with SMTP id o8-20020a170902d4c8b0290102715be3a5mr7774504plg.83.1623490306590; Sat, 12 Jun 2021 02:31:46 -0700 (PDT) Received: from zhengqian-xps.lan (ngn-nat1.v4.open.ad.jp. [202.222.12.138]) by smtp.gmail.com with ESMTPSA id z3sm487719pfb.127.2021.06.12.02.31.45 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 12 Jun 2021 02:31:46 -0700 (PDT) From: zheng qian To: ffmpeg-devel@ffmpeg.org Date: Sat, 12 Jun 2021 18:30:32 +0900 Message-Id: <20210612093032.64034-5-xqq@xqq.im> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210612093032.64034-1-xqq@xqq.im> References: <20210612093032.64034-1-xqq@xqq.im> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 5/5] avcodec/libaribb24: Enable decoding support for arib_superimpose 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: zheng qian Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: 47ASWJo+AvXo ARIB superimpose packet could also be decoded by libaribb24 Signed-off-by: zheng qian --- libavcodec/allcodecs.c | 1 + libavcodec/libaribb24.c | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c index 623db2a9fa..5d5b536e97 100644 --- a/libavcodec/allcodecs.c +++ b/libavcodec/allcodecs.c @@ -722,6 +722,7 @@ extern const AVCodec ff_qdmc_at_decoder; extern const AVCodec ff_qdm2_at_decoder; extern AVCodec ff_libaom_av1_encoder; extern const AVCodec ff_libaribb24_decoder; +extern const AVCodec ff_libaribb24_superimpose_decoder; extern const AVCodec ff_libcelt_decoder; extern const AVCodec ff_libcodec2_encoder; extern const AVCodec ff_libcodec2_decoder; diff --git a/libavcodec/libaribb24.c b/libavcodec/libaribb24.c index 0766c0079d..afa43f8f50 100644 --- a/libavcodec/libaribb24.c +++ b/libavcodec/libaribb24.c @@ -393,3 +393,17 @@ const AVCodec ff_libaribb24_decoder = { .priv_class= &aribb24_class, .wrapper_name = "libaribb24", }; + +const AVCodec ff_libaribb24_superimpose_decoder = { + .name = "libaribb24_superimpose", + .long_name = NULL_IF_CONFIG_SMALL("libaribb24 ARIB STD-B24 superimpose decoder"), + .type = AVMEDIA_TYPE_SUBTITLE, + .id = AV_CODEC_ID_ARIB_SUPERIMPOSE, + .priv_data_size = sizeof(Libaribb24Context), + .init = libaribb24_init, + .close = libaribb24_close, + .decode = libaribb24_decode, + .flush = libaribb24_flush, + .priv_class= &aribb24_class, + .wrapper_name = "libaribb24_superimpose", +};