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 B49EA407C0 for ; Sat, 2 Apr 2022 10:57:46 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 42DE968B255; Sat, 2 Apr 2022 13:57:34 +0300 (EEST) Received: from mail-ej1-f54.google.com (mail-ej1-f54.google.com [209.85.218.54]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 51E9568AF88 for ; Sat, 2 Apr 2022 13:57:27 +0300 (EEST) Received: by mail-ej1-f54.google.com with SMTP id dr20so10683165ejc.6 for ; Sat, 02 Apr 2022 03:57:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=YCRbE7418aryVQT1MiaBjChq0n03U5oz5A0VrAhfz+Y=; b=RS5bQ0wNXZRZUOohQtmj7x9cufhAqeyCH5VDeB6ZaxWGbC0x5M/TqWseArx/6T7iG3 SBnLQv6n4H197/0M4vBtm5EWA9aoNCG0I8vFQmfBZy/h2K+ghLf80W1qgFZSKFdFw65o UarhYZ2MNtwEjav7H2A4XkmTbNTsWUmmLlWT7HSbREf/0dSvb5GytibYLn4+3VhRdIKu 2D5RCbmEfh7gKAVpY+5eKwaWqU8G5hipYCrzCWKqYYQt7w03toVUMccSnpj6an3Xh/8/ N/JR35uvRjJi3QOD4942VOCLY/aTB32FXCrj2KEf+/JOsdQImT4/GJsmEe1Vq8yjN8xE UDtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=YCRbE7418aryVQT1MiaBjChq0n03U5oz5A0VrAhfz+Y=; b=kLFF1hdr3Xfeb6cNQ9jsRd58Ony0fHBLdA9TbR6IltHDLMC1ErfJBaADnkGVsIPoMJ 3mAvqjERlTZsaqe8YoQEdMVMeFRhIvE6LutavyyEJQLbkpGL8+j8ZSaGx7y+WmXllwcO fR7Djs2F5XqJofK8utOeT8CVgxvJC1CEnnhBnVz1RYvs6tyMedUBtt929FP+K2+wULI8 pXCXZHO4ajK5R09DO9WTx1r6CahLdDxDK+Z2KeSTesbPvH04/332CF3plhGy2hUoE4Yy OJ63iievaSYZGZMfN0b8uijNOVpfHBZ940K7qu4O+QXDVjKt5KR4es11F12+qyNbjdFC Eq2Q== X-Gm-Message-State: AOAM531TEZN/Ji3STgZKeAy2CoAIW5rK7IInTPauN9iM0TE7Dm+jTzXW SyMgQq77JjkzdoKx7P41IVvGXixXq14= X-Google-Smtp-Source: ABdhPJydfmMGS3Yi7WfMeP6rvAwY6QeyQtmEGe8Z4AI7I+0+eOHB6oFC3Om7V/csEVjMIRE0bDzsEg== X-Received: by 2002:a17:907:7289:b0:6df:9746:e7c4 with SMTP id dt9-20020a170907728900b006df9746e7c4mr3406977ejc.497.1648897046773; Sat, 02 Apr 2022 03:57:26 -0700 (PDT) Received: from localhost.localdomain ([95.168.118.51]) by smtp.gmail.com with ESMTPSA id u10-20020a170906b10a00b006e1004406easm1988886ejy.93.2022.04.02.03.57.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Apr 2022 03:57:26 -0700 (PDT) From: Paul B Mahol To: ffmpeg-devel@ffmpeg.org Date: Sat, 2 Apr 2022 12:59:34 +0200 Message-Id: <20220402105934.134893-2-onemda@gmail.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220402105934.134893-1-onemda@gmail.com> References: <20220402105934.134893-1-onemda@gmail.com> MIME-Version: 1.0 Subject: [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: 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 1d56d24819..af332041e8 100644 --- a/doc/filters.texi +++ b/doc/filters.texi @@ -28790,6 +28790,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 8c7ea5686a..b4592d0390 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; } -- 2.35.1 _______________________________________________ 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".