From patchwork Sat Feb 9 12:58:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carl Eugen Hoyos X-Patchwork-Id: 12004 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 E0559448036 for ; Sat, 9 Feb 2019 14:58:14 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id BA93468AA42; Sat, 9 Feb 2019 14:58:14 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-it1-f178.google.com (mail-it1-f178.google.com [209.85.166.178]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 78F0468A87A for ; Sat, 9 Feb 2019 14:58:08 +0200 (EET) Received: by mail-it1-f178.google.com with SMTP id z7so15752948iti.0 for ; Sat, 09 Feb 2019 04:58:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=ZXSJ7wVxgNgcJCMDgkelITEKDK49RxK3L38CMD68m0k=; b=Ae2iomy0RPk8yMvbLHWn5KBcXAzQeP0iy/wfFqkj7MjBnOEMQlzW6d8zc9NsyGZ4d2 s7FmkP4Y+G6nycQaUMbRIdEglFsmQa8GcaiOopzyefL1FxHb5El47ClY7ZXMQwJIpKeW TwEZRLoH282etE2m/JZHm/HCB3V6gGB4Bme/zlFMK0UW5QTAnwuSfI3mvcyTynLFDIE0 rHPHVWM7eWEgeAsm6uRnjqbGYrRUhkJMROCCzaoLoEVc418efTP3xt2pe9BuAoSB5iho ifWmlTCHNqobktiMRWdMPyP7X2fvvvkfiAEFCNKgWS0fXbUGGa8ihIEJUZHmFCc4CQlG j+Kw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=ZXSJ7wVxgNgcJCMDgkelITEKDK49RxK3L38CMD68m0k=; b=HEZlm06NfC6saznpunoyKPRcSjWZ0pH3ffvlnW0Y1h4jPeT+Hx4O/xg5Uf1cXcuRz3 e/of/f/jhoYKUKZwEik4VjrrL3eGwGr1AsyvopoteBpDvwoB6UknDNKzGhgWlubOVM93 UQaGCwmqtVON27WhtDBrFexVPQSvml0VKW8T8TEfQkvBNcMliiXlaBWpari4B0d1f71D cn2TMATG4d5km87iOg0xrlkv4r46q9RCEMGZitwzzB0g2Nbu4tg6olFTvb3C7GT0PiSn NO2AhEoyX4mm8Ktjb1f8PzED4JsDMaPNHjyI5Seyy2NiULUU/c3cwp5C7VJ564YEcrCz onHg== X-Gm-Message-State: AHQUAuYUTa2UQU+bSXZ6Qr/Lt9STeeiBrSm0XuvtJ0p2uHGcQV0Cr566 CIprg9IPEEAJGO1Nh9ZQ++Bdem55tndMu5OO7bfe4w== X-Google-Smtp-Source: AHgI3IYtKF1fW4A3TNGrWvrApjqm0ivoIT5MgHMVkma/4xpTyIpMdmy7MgyJeSx2sUmVmQ2u8mdJjmA+axGzrs1GYpo= X-Received: by 2002:a5e:9707:: with SMTP id w7mr16158419ioj.49.1549717087142; Sat, 09 Feb 2019 04:58:07 -0800 (PST) MIME-Version: 1.0 Received: by 2002:a02:c890:0:0:0:0:0 with HTTP; Sat, 9 Feb 2019 04:58:06 -0800 (PST) From: Carl Eugen Hoyos Date: Sat, 9 Feb 2019 13:58:06 +0100 Message-ID: To: FFmpeg development discussions and patches Subject: [FFmpeg-devel] [PATCH]lavf/img2dec: Split img2 and img2pipe options 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" Hi! Currently if the "loop" option gets specified for -f image2pipe, there is no indication for the user that the option will not work, patch attached. Please comment, Carl Eugen From 21b11da9af5166e4bda7398a471a1e1a49352ac3 Mon Sep 17 00:00:00 2001 From: Carl Eugen Hoyos Date: Sat, 9 Feb 2019 13:49:51 +0100 Subject: [PATCH] lavf/img2dec: Split img2 and img2pipe options. --- libavformat/img2dec.c | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/libavformat/img2dec.c b/libavformat/img2dec.c index e82b1df..c1568c1 100644 --- a/libavformat/img2dec.c +++ b/libavformat/img2dec.c @@ -564,29 +564,29 @@ static int img_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp #define OFFSET(x) offsetof(VideoDemuxData, x) #define DEC AV_OPT_FLAG_DECODING_PARAM +#define COMMON_OPTIONS \ + { "framerate", "set the video framerate", OFFSET(framerate), AV_OPT_TYPE_VIDEO_RATE, {.str = "25"}, 0, INT_MAX, DEC }, \ + { "pixel_format", "set video pixel format", OFFSET(pixel_format), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, DEC }, \ + { "video_size", "set video size", OFFSET(width), AV_OPT_TYPE_IMAGE_SIZE, {.str = NULL}, 0, 0, DEC }, \ + { "ts_from_file", "set frame timestamp from file's one", OFFSET(ts_from_file), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 2, DEC, "ts_type" }, \ + { "none", "none", 0, AV_OPT_TYPE_CONST, {.i64 = 0 }, 0, 2, DEC, "ts_type" }, \ + { "sec", "second precision", 0, AV_OPT_TYPE_CONST, {.i64 = 1 }, 0, 2, DEC, "ts_type" }, \ + { "ns", "nano second precision", 0, AV_OPT_TYPE_CONST, {.i64 = 2 }, 0, 2, DEC, "ts_type" }, + +#if CONFIG_IMAGE2_DEMUXER const AVOption ff_img_options[] = { - { "framerate", "set the video framerate", OFFSET(framerate), AV_OPT_TYPE_VIDEO_RATE, {.str = "25"}, 0, INT_MAX, DEC }, + COMMON_OPTIONS { "loop", "force loop over input file sequence", OFFSET(loop), AV_OPT_TYPE_BOOL, {.i64 = 0 }, 0, 1, DEC }, - { "pattern_type", "set pattern type", OFFSET(pattern_type), AV_OPT_TYPE_INT, {.i64=PT_DEFAULT}, 0, INT_MAX, DEC, "pattern_type"}, { "glob_sequence","select glob/sequence pattern type", 0, AV_OPT_TYPE_CONST, {.i64=PT_GLOB_SEQUENCE}, INT_MIN, INT_MAX, DEC, "pattern_type" }, { "glob", "select glob pattern type", 0, AV_OPT_TYPE_CONST, {.i64=PT_GLOB }, INT_MIN, INT_MAX, DEC, "pattern_type" }, { "sequence", "select sequence pattern type", 0, AV_OPT_TYPE_CONST, {.i64=PT_SEQUENCE }, INT_MIN, INT_MAX, DEC, "pattern_type" }, { "none", "disable pattern matching", 0, AV_OPT_TYPE_CONST, {.i64=PT_NONE }, INT_MIN, INT_MAX, DEC, "pattern_type" }, - - { "pixel_format", "set video pixel format", OFFSET(pixel_format), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, DEC }, { "start_number", "set first number in the sequence", OFFSET(start_number), AV_OPT_TYPE_INT, {.i64 = 0 }, INT_MIN, INT_MAX, DEC }, { "start_number_range", "set range for looking at the first sequence number", OFFSET(start_number_range), AV_OPT_TYPE_INT, {.i64 = 5}, 1, INT_MAX, DEC }, - { "video_size", "set video size", OFFSET(width), AV_OPT_TYPE_IMAGE_SIZE, {.str = NULL}, 0, 0, DEC }, - { "frame_size", "force frame size in bytes", OFFSET(frame_size), AV_OPT_TYPE_INT, {.i64 = 0 }, 0, INT_MAX, DEC }, - { "ts_from_file", "set frame timestamp from file's one", OFFSET(ts_from_file), AV_OPT_TYPE_INT, {.i64 = 0 }, 0, 2, DEC, "ts_type" }, - { "none", "none", 0, AV_OPT_TYPE_CONST, {.i64 = 0 }, 0, 2, DEC, "ts_type" }, - { "sec", "second precision", 0, AV_OPT_TYPE_CONST, {.i64 = 1 }, 0, 2, DEC, "ts_type" }, - { "ns", "nano second precision", 0, AV_OPT_TYPE_CONST, {.i64 = 2 }, 0, 2, DEC, "ts_type" }, { NULL }, }; -#if CONFIG_IMAGE2_DEMUXER static const AVClass img2_class = { .class_name = "image2 demuxer", .item_name = av_default_item_name, @@ -606,11 +606,18 @@ AVInputFormat ff_image2_demuxer = { .priv_class = &img2_class, }; #endif + +const AVOption ff_img2pipe_options[] = { + COMMON_OPTIONS + { "frame_size", "force frame size in bytes", OFFSET(frame_size), AV_OPT_TYPE_INT, {.i64 = 0 }, 0, INT_MAX, DEC }, + { NULL }, +}; + #if CONFIG_IMAGE2PIPE_DEMUXER static const AVClass img2pipe_class = { .class_name = "image2pipe demuxer", .item_name = av_default_item_name, - .option = ff_img_options, + .option = ff_img2pipe_options, .version = LIBAVUTIL_VERSION_INT, }; AVInputFormat ff_image2pipe_demuxer = { @@ -1023,7 +1030,7 @@ static int gif_probe(AVProbeData *p) static const AVClass imgname ## _class = {\ .class_name = AV_STRINGIFY(imgname) " demuxer",\ .item_name = av_default_item_name,\ - .option = ff_img_options,\ + .option = ff_img2pipe_options,\ .version = LIBAVUTIL_VERSION_INT,\ };\ AVInputFormat ff_image_ ## imgname ## _pipe_demuxer = {\ -- 1.7.10.4