From patchwork Thu Jun 6 02:07:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jun Zhao X-Patchwork-Id: 13426 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 94E834496D5 for ; Thu, 6 Jun 2019 05:07:50 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 7FDC368A6C5; Thu, 6 Jun 2019 05:07:50 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pl1-f174.google.com (mail-pl1-f174.google.com [209.85.214.174]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 21A9A68A6B2 for ; Thu, 6 Jun 2019 05:07:44 +0300 (EEST) Received: by mail-pl1-f174.google.com with SMTP id go2so252775plb.9 for ; Wed, 05 Jun 2019 19:07:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=lFZD5G9qXjr7Gms3Iuk9uoFI+gZai4dJyF3i14Ir7h0=; b=gJ0RFExy11JmZdHpbU0ciCOKOpKpxbC69EOznXfX5ieHrKT3S5YR6enAaKO0NxbVo7 53AuWdpfYAPdVviCR3tVgWHQCRMuAUc4/zV1gVPah0AVWTYqEZ/XFMMn/MLvi/g3ychR UNBopiIEowcmQAEGfhQryqnS51DMgLpzkjsaPFOYv2NrPTNkiRZBaBSLsCWETHrVjPGx tX4DakVY8I1S3TVh7aiaEaipRNfnLVwpoNUfJ2Kmalp5GeWDHFb3WN3RnbAWStLZVCO5 ZlSMtz/cm/BDe/Lvz9KXfLiA9RDdp6wPO6rgd511e+yqnfXspy8L+vSMVHkbYJDIYXT2 kMTg== 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; bh=lFZD5G9qXjr7Gms3Iuk9uoFI+gZai4dJyF3i14Ir7h0=; b=EQBBj+hQFKgOEzXxuJYNeYIEs8BvlgpT+znbnPifrJZqnqguDUnlYqJEpzoJIfNlAF DxiUjvlJ8c+XOmAjX6NLVKulKOazS3SDgrDOF8uxOsxgU11/ji7avH8L9ixSbuacsOnF 2XY2Wy+kxEnjzRFs9oPj2EIlJytEA83BfQxfca9V7tw6hpU5kuW/kcRase25P5ecUMVr amTKEJqngxWtwAcFEl2VXJXLoPtaALprMtQuNowDAwqhgd7grS+q0iRITKNPqb47+DP4 eEIEaQCt2Hgm7asKWnzcz1n92xHfhAnJfy1l5PwKYTGQ+d8xT53cebprj/utRH4zo4OK 0fmQ== X-Gm-Message-State: APjAAAXuEKbnAlaC2krgWT929bjoZXgdzBOzYIG4APX3FXkDwu7l9nxQ ikNrLe21PBt3vhZ0i7+/TrnR2bfP X-Google-Smtp-Source: APXvYqyhr3dz80NVO4sRENG0UIuToO8AKGQrOiJyMf033B9KZUXBZfPDsVhWJ+wk7b1iYJqsdH+qrA== X-Received: by 2002:a17:902:7d8b:: with SMTP id a11mr11603490plm.96.1559786862408; Wed, 05 Jun 2019 19:07:42 -0700 (PDT) Received: from localhost.localdomain ([47.90.47.25]) by smtp.gmail.com with ESMTPSA id m11sm233220pjv.21.2019.06.05.19.07.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Jun 2019 19:07:42 -0700 (PDT) From: Jun Zhao To: ffmpeg-devel@ffmpeg.org Date: Thu, 6 Jun 2019 10:07:26 +0800 Message-Id: <1559786846-30859-5-git-send-email-mypopydev@gmail.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1559786846-30859-1-git-send-email-mypopydev@gmail.com> References: <1559786846-30859-1-git-send-email-mypopydev@gmail.com> Subject: [FFmpeg-devel] [PATCH V2 4/4] lavc/webvttenc: fix ffmpeg -h full can't display webvtt encoder 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: Jun Zhao MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" From: Jun Zhao fix ffmpeg -h full can't display webvtt encoder Signed-off-by: Jun Zhao --- libavcodec/webvttenc.c | 14 ++++++++++++++ 1 files changed, 14 insertions(+), 0 deletions(-) diff --git a/libavcodec/webvttenc.c b/libavcodec/webvttenc.c index c84bbf4..21e7d92 100644 --- a/libavcodec/webvttenc.c +++ b/libavcodec/webvttenc.c @@ -24,11 +24,13 @@ #include "avcodec.h" #include "libavutil/avstring.h" #include "libavutil/bprint.h" +#include "libavutil/opt.h" #include "ass_split.h" #include "ass.h" #define WEBVTT_STACK_SIZE 64 typedef struct { + const AVClass *class; AVCodecContext *avctx; ASSSplitContext *ass_ctx; AVBPrint buffer; @@ -224,6 +226,17 @@ static av_cold int webvtt_encode_init(AVCodecContext *avctx) return s->ass_ctx ? 0 : AVERROR_INVALIDDATA; } +static const AVOption options[] = { + { NULL }, +}; + +static const AVClass webvtt_encoder_class = { + .class_name = "WebVTT encoder", + .item_name = av_default_item_name, + .option = options, + .version = LIBAVUTIL_VERSION_INT, +}; + AVCodec ff_webvtt_encoder = { .name = "webvtt", .long_name = NULL_IF_CONFIG_SMALL("WebVTT subtitle"), @@ -233,4 +246,5 @@ AVCodec ff_webvtt_encoder = { .init = webvtt_encode_init, .encode_sub = webvtt_encode_frame, .close = webvtt_encode_close, + .priv_class = &webvtt_encoder_class, };