From patchwork Sat Jan 25 02:01:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: rcombs X-Patchwork-Id: 17537 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id C64A344759B for ; Sat, 25 Jan 2020 04:08:28 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 9F1F468B149; Sat, 25 Jan 2020 04:08:28 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-yb1-f193.google.com (mail-yb1-f193.google.com [209.85.219.193]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 6BC8868A60C for ; Sat, 25 Jan 2020 04:08:22 +0200 (EET) Received: by mail-yb1-f193.google.com with SMTP id o199so1962652ybc.4 for ; Fri, 24 Jan 2020 18:08:22 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=S/lpS60vAcahP7HwnyCmnSsj2H8E4PsAEr9qVvV9f6Q=; b=qH1DjQkWpAFBwsyq9cBQ506g7gUyks9sZWg60O8WTtPgEDfENkxB+ZWTYPQIGRK5aL UDMKuoWc6SUO/NFObBqB7ZGiEavM8PayaOvvjZ5mXx41Dg4qqDtIR0DjGsWL+xwiCMWd aH37cm3MG6r44hZ7CnGDvYJGAMZ59FuYx011P8axKmEnbXmnNRylrruiEGbKoTRJ4eJM +J6uj6SDhjBE4fudp8cWgXV4o/5W++il40bIwFmGH0jPX/0xbHyYkrP5EMlT1VbE5ZRX LLnVS6dHxjFRKJ1UJzLxVRXAH6IkJwwOzca6sUhz/wJM4C55UVso90r6hQYHXeysHxGV uZYA== X-Gm-Message-State: APjAAAVJ7NyBnQnG9VQgZnlWeBhNrWLkH/C3lKwQvVWtFxHDhX4R2jUp geIIbtDX3tyrV01VZjmEFsP2R1QJlqU= X-Google-Smtp-Source: APXvYqyt1r+/JT/Jok2mZlXFUn8NL4lqYFdDBYxw/7tM64Zfqga1k9sOv02OFxL3oFiXRpct74uzmw== X-Received: by 2002:a81:8603:: with SMTP id w3mr4379155ywf.316.1579917767989; Fri, 24 Jan 2020 18:02:47 -0800 (PST) Received: from MacBook-Pro.localdomain ([24.14.135.13]) by smtp.gmail.com with ESMTPSA id h184sm3181072ywa.70.2020.01.24.18.02.46 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 24 Jan 2020 18:02:47 -0800 (PST) From: rcombs To: ffmpeg-devel@ffmpeg.org Date: Fri, 24 Jan 2020 20:01:59 -0600 Message-Id: <20200125020200.2049-12-rcombs@rcombs.me> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200125020200.2049-1-rcombs@rcombs.me> References: <20200125020200.2049-1-rcombs@rcombs.me> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 12/13] lavc/libzvbi-teletextdec: add support for configuring default style via AVOptions 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" --- libavcodec/libzvbi-teletextdec.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libavcodec/libzvbi-teletextdec.c b/libavcodec/libzvbi-teletextdec.c index 3515f33924..018b350511 100644 --- a/libavcodec/libzvbi-teletextdec.c +++ b/libavcodec/libzvbi-teletextdec.c @@ -78,11 +78,14 @@ typedef struct TeletextContext int last_pgno; int last_p5; int last_ass_alignment; + + FFASSHeaderOptions common; } TeletextContext; static int my_ass_subtitle_header(AVCodecContext *avctx) { - int ret = ff_ass_subtitle_header_default(avctx); + TeletextContext *ctx = avctx->priv_data; + int ret = ff_ass_subtitle_header_from_opts(avctx, &ctx->common); char *new_header; uint8_t *event_pos; @@ -756,7 +759,7 @@ static int teletext_init_decoder(AVCodecContext *avctx) case 0: return 0; case 1: - return ff_ass_subtitle_header_default(avctx); + return ff_ass_subtitle_header_from_opts(avctx, &ctx->common); case 2: return my_ass_subtitle_header(avctx); } @@ -803,6 +806,7 @@ static const AVOption options[] = { {"txt_duration", "display duration of teletext pages in msecs", OFFSET(sub_duration), AV_OPT_TYPE_INT, {.i64 = -1}, -1, 86400000, SD}, {"txt_transparent", "force transparent background of the teletext", OFFSET(transparent_bg), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, SD}, {"txt_opacity", "set opacity of the transparent background", OFFSET(opacity), AV_OPT_TYPE_INT, {.i64 = -1}, -1, 255, SD}, + ASS_HEADER_AVOPTIONS(TeletextContext, common) { NULL }, };