From patchwork Sat Jan 25 02:01:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ridley Combs X-Patchwork-Id: 17539 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 F16C8446CBF for ; Sat, 25 Jan 2020 04:10:45 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id D696C6880D6; Sat, 25 Jan 2020 04:10:45 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-yb1-f178.google.com (mail-yb1-f178.google.com [209.85.219.178]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id E32AA68809B for ; Sat, 25 Jan 2020 04:10:39 +0200 (EET) Received: by mail-yb1-f178.google.com with SMTP id k15so1949286ybd.10 for ; Fri, 24 Jan 2020 18:10:39 -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=WQL+/b8AizVdm4hG16WAsufJ+67/HaO6558oR247SBk=; b=kdD7aQjh3Itb4BggUCXDF66t8BBQUklWoMXlH/Hx+N/kzRhd1Qe0BGrcP57FxLbe5v bLLJCX5NMgE/bsk6/6n5pPC5jJ3H3Ds876rnNkOzVNXbJqSym4cmAXg5ko5pPwLSmFwG DEVS6pJ5+XjAGw2xEirqqfvEo+vsIrvHIwKOJZMs+624NmS/P0PCYu0eQ1AvlWL0V8b4 GYNbaTxTmsHosS/hzu34OrigMWNnu5T/Fak8Bi8lMwPLWoWn7fsIuMqyJ4NW2roXbZLi XZMLk9EoxbnmRcdqRJAWFfQtvzvrOONvmRqbPkqukgdJ7+3o/hLmRgsYRpH0Uy3KEJQv kKjg== X-Gm-Message-State: APjAAAU4k5lyKWRBDagiYMUoqdYCL0rSmwBBEP4VqB6gc3p2qfe2rO/D WynYXYWaZaf4BuAaqCuXhTF1j1+a48E= X-Google-Smtp-Source: APXvYqwyCc5mhVY6WD7z1WpwNufpmk3L6VugQF+gQn7gmGNzLemYXciAsA3YVf81+AuUdpqdzSWh/A== X-Received: by 2002:a81:4896:: with SMTP id v144mr4838065ywa.236.1579917765672; Fri, 24 Jan 2020 18:02:45 -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.44 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 24 Jan 2020 18:02:44 -0800 (PST) From: rcombs To: ffmpeg-devel@ffmpeg.org Date: Fri, 24 Jan 2020 20:01:57 -0600 Message-Id: <20200125020200.2049-10-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 10/13] lavc/movtextdec: 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/movtextdec.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/libavcodec/movtextdec.c b/libavcodec/movtextdec.c index c38c5edce6..0bb03fc141 100644 --- a/libavcodec/movtextdec.c +++ b/libavcodec/movtextdec.c @@ -86,6 +86,9 @@ typedef struct { } TextWrapBox; typedef struct { + AVClass *class; + int readorder; + FFASSHeaderOptions common; StyleBox **s; StyleBox *s_temp; HighlightBox h; @@ -99,7 +102,6 @@ typedef struct { uint64_t tracksize; int size_var; int count_s, count_f; - int readorder; } MovTextContext; typedef struct { @@ -453,7 +455,7 @@ static int mov_text_init(AVCodecContext *avctx) { m->d.underline, ASS_DEFAULT_BORDERSTYLE, m->d.alignment); } else - return ff_ass_subtitle_header_default(avctx); + return ff_ass_subtitle_header_from_opts(avctx, &m->common); } static int mov_text_decode_frame(AVCodecContext *avctx, @@ -567,6 +569,8 @@ static void mov_text_flush(AVCodecContext *avctx) m->readorder = 0; } +ASS_GENERIC_CLASS(mov_text, "3GPP Timed Text") + AVCodec ff_movtext_decoder = { .name = "mov_text", .long_name = NULL_IF_CONFIG_SMALL("3GPP Timed Text subtitle"), @@ -577,4 +581,5 @@ AVCodec ff_movtext_decoder = { .decode = mov_text_decode_frame, .close = mov_text_decode_close, .flush = mov_text_flush, + .priv_class = &mov_text_decoder_class, };