From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id C6820428B8 for ; Tue, 5 Apr 2022 15:35:07 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 47CBD68B183; Tue, 5 Apr 2022 18:35:05 +0300 (EEST) Received: from mail-yb1-f173.google.com (mail-yb1-f173.google.com [209.85.219.173]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 1379E680BBE for ; Tue, 5 Apr 2022 18:34:59 +0300 (EEST) Received: by mail-yb1-f173.google.com with SMTP id g9so24027524ybf.1 for ; Tue, 05 Apr 2022 08:34:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=iakvq8DorydWVqpRbLIjw1l/DJZA8ykoDzG5QG26ZHM=; b=Cfq/RBoWzPU7tVIadGZPSvM58RKSqjYh8EtFZerWXfrHSKROmKaeYR1DCyu0WABZku JgvCGnlZ6Y1uKESTuqTZdPuLN+lW49mmiB64KGHu1ShbLW+m/KdMSmgI2W4DtrCDQe5T vnms4KxLRmnjBDPEPiSVQq3+jUuKpiyTx69uUbzGmLfa4lxnEMGeDOMeiTyGdtQJ9cRb VvIQxmdGYm6H/BPCU/phFqvmACn7ePNk+AMHiC2S6EPu3dDDlvOIiQblUkhp66w38BX9 OU/5PNwk4GEK8hFOhzX1WVhKct9kr7Ux3uJCSJpG82SE+lM2L9+t1ZpVYvHnVUU0EXDe HsVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=iakvq8DorydWVqpRbLIjw1l/DJZA8ykoDzG5QG26ZHM=; b=HjwDDQSJ4HcHrjyjK6FYHwkEBFKD8TW+8LOaiDoeShmmB/Mo5RU/FURyCQrMzU9uwU msk8Yyjqz2pzIuh/RyL+ZsVF8uNe9BHDt2mLUT1oT2l5BL/aVav2k6DHJ0hkPAgrahni 2nOGIJY/HPhv7C6QATJsixF6fU3a/VKrv8Yx09Cu3+4PpIesUXwaMPt1V3ch+vJnNz+L r1nzwbgEV6UvMaHNNDVYLeePEUZ/VYtKHOc/2AHBx1ilKqSGjpu51H6WWR2TGhQo2P6k JcN6Q5LmCz43fSJzLPc1mvG/PUkeFaZIPKBbjKOMVJiNyJJL5XOiW0DaCJOp3aXiL8CD 6lGA== X-Gm-Message-State: AOAM532cqlWdwkUcqzHK+bxtxARUXAyh5Hwv+wmWbqwPRxppOD9cCIOp K/oI3i4EzaJ72x8OOE/qjmsZulhL51a0MRBAUUBhR660 X-Google-Smtp-Source: ABdhPJzjc33JEyDB6E4AI3svVJ7ZvkjJzQ0mSfggE0TvjkunxhnCHf9m21YX7LLmZ+0aiezoH692dyrIUx8w3zlDYiw= X-Received: by 2002:a25:84c7:0:b0:63d:b97e:2acb with SMTP id x7-20020a2584c7000000b0063db97e2acbmr2997953ybm.49.1649172897354; Tue, 05 Apr 2022 08:34:57 -0700 (PDT) MIME-Version: 1.0 References: <20220402120623.142534-1-onemda@gmail.com> <20220402120623.142534-2-onemda@gmail.com> In-Reply-To: From: Paul B Mahol Date: Tue, 5 Apr 2022 17:37:09 +0200 Message-ID: To: FFmpeg development discussions and patches X-Content-Filtered-By: Mailman/MimeDel 2.1.29 Subject: Re: [FFmpeg-devel] [PATCH 2/2] avfilter/src_movie: add option to set decoding thread type 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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On Tue, Apr 5, 2022 at 4:29 PM Andreas Rheinhardt < andreas.rheinhardt@outlook.com> wrote: > Paul B Mahol: > > Signed-off-by: Paul B Mahol > > --- > > doc/filters.texi | 3 +++ > > libavfilter/src_movie.c | 11 +++++++++-- > > 2 files changed, 12 insertions(+), 2 deletions(-) > > > > diff --git a/doc/filters.texi b/doc/filters.texi > > index 636c80dbff..a13977edd8 100644 > > --- a/doc/filters.texi > > +++ b/doc/filters.texi > > @@ -29317,6 +29317,9 @@ timestamps. > > @item dec_threads > > Specifies the number of threads for decoding > > > > +@item dec_thread_type > > +Specifies the thread type for decoding. > > + > > @item format_opts > > Specify format options for the opened file. Format options can be > specified > > as a list of @var{key}=@var{value} pairs separated by ':'. The > following example > > diff --git a/libavfilter/src_movie.c b/libavfilter/src_movie.c > > index bc7b0d37af..08cba437bf 100644 > > --- a/libavfilter/src_movie.c > > +++ b/libavfilter/src_movie.c > > @@ -72,6 +72,7 @@ typedef struct MovieContext { > > int64_t discontinuity_threshold; > > int64_t ts_offset; > > int dec_threads; > > + int thread_type; > > int got_eagain; > > int got_wanted; > > > > @@ -99,6 +100,10 @@ static const AVOption movie_options[]= { > > { "loop", "set loop count", OFFSET(loop_count), > AV_OPT_TYPE_INT, {.i64 = 1}, 0, INT_MAX, FLAGS }, > > { "discontinuity", "set discontinuity threshold", > OFFSET(discontinuity_threshold), AV_OPT_TYPE_DURATION, {.i64 = 0}, 0, > INT64_MAX, FLAGS }, > > { "dec_threads", "set the number of threads for decoding", > OFFSET(dec_threads), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, FLAGS }, > > + { "dec_thread_type","set the type of threads for decoding", > OFFSET(thread_type), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 2, FLAGS, .unit = > "thread_type" }, > > + { "auto", "auto", 0, > AV_OPT_TYPE_CONST, {.i64 = 0}, 0, 0, FLAGS, .unit = "thread_type" }, > > + { "frame", "more than one frame at once", 0, > AV_OPT_TYPE_CONST, {.i64 = 1}, 0, 0, FLAGS, .unit = "thread_type" }, > > + { "slice", "more than one part of single frame at once", 0, > AV_OPT_TYPE_CONST, {.i64 = 2}, 0, 0, FLAGS, .unit = "thread_type" }, > > { "format_opts", "set format options for the opened file", > OFFSET(format_opts), AV_OPT_TYPE_DICT, {.str = NULL}, 0, 0, FLAGS}, > > { NULL }, > > }; > > @@ -159,7 +164,7 @@ static AVStream *find_stream(void *log, > AVFormatContext *avf, const char *spec) > > return found; > > } > > > > -static int open_stream(AVFilterContext *ctx, MovieStream *st, int > dec_threads) > > +static int open_stream(AVFilterContext *ctx, MovieStream *st, int > dec_threads, int thread_type) > > { > > const AVCodec *codec; > > int ret; > > @@ -181,6 +186,8 @@ static int open_stream(AVFilterContext *ctx, > MovieStream *st, int dec_threads) > > if (!dec_threads) > > dec_threads = ff_filter_get_nb_threads(ctx); > > st->codec_ctx->thread_count = dec_threads; > > + if (thread_type) > > + st->codec_ctx->thread_type = thread_type; > > > > if ((ret = avcodec_open2(st->codec_ctx, codec, NULL)) < 0) { > > av_log(ctx, AV_LOG_ERROR, "Failed to open codec\n"); > > @@ -325,7 +332,7 @@ static av_cold int movie_common_init(AVFilterContext > *ctx) > > if (ret < 0) > > return ret; > > } > > - ret = open_stream(ctx, &movie->st[i], movie->dec_threads); > > + ret = open_stream(ctx, &movie->st[i], movie->dec_threads, > movie->thread_type); > > if (ret < 0) > > return ret; > > } > > Why do you want to add an option for only this instead of a generic > AV_OPT_TYPE_DICT option for a dict that will be passed to avcodec_open2()? > I think there is conflict if same option name is used. > > - Andreas > _______________________________________________ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > https://ffmpeg.org/mailman/listinfo/ffmpeg-devel > > To unsubscribe, visit link above, or email > ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe". > _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".