diff mbox

[FFmpeg-devel,V1,2/2] doc/writing_filters: Use ff_filter_get_nb_threads() get number of threads

Message ID 1558490138-15867-2-git-send-email-mypopydev@gmail.com
State Accepted
Commit 82ccb9cba9a7bd530ba2070c90f03d0fde9af1bd
Headers show

Commit Message

Jun Zhao May 22, 2019, 1:55 a.m. UTC
From: Jun Zhao <barryjzhao@tencent.com>

ff_filter_get_nb_threads() respect AVFilterContext.nb_threads and
graph->nb_threads both, in most case, we perfer this API than using
ctx->graph->nb_threads directly.
---
 doc/writing_filters.txt |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Comments

Paul B Mahol May 22, 2019, 8:14 a.m. UTC | #1
On 5/22/19, Jun Zhao <mypopydev@gmail.com> wrote:
> From: Jun Zhao <barryjzhao@tencent.com>
>
> ff_filter_get_nb_threads() respect AVFilterContext.nb_threads and
> graph->nb_threads both, in most case, we perfer this API than using
> ctx->graph->nb_threads directly.
> ---
>  doc/writing_filters.txt |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/doc/writing_filters.txt b/doc/writing_filters.txt
> index 98b9c6f..2e25cbe 100644
> --- a/doc/writing_filters.txt
> +++ b/doc/writing_filters.txt
> @@ -389,7 +389,7 @@ distributor with something like this:
>
>      td.in  = in;
>      td.out = out;
> -    ctx->internal->execute(ctx, filter_slice, &td, NULL, FFMIN(outlink->h,
> ctx->graph->nb_threads));
> +    ctx->internal->execute(ctx, filter_slice, &td, NULL, FFMIN(outlink->h,
> ff_filter_get_nb_threads(ctx)));
>
>      // ...
>

lgtm

> --
> 1.7.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".
mypopy@gmail.com May 22, 2019, 10:06 a.m. UTC | #2
On Wed, May 22, 2019 at 4:14 PM Paul B Mahol <onemda@gmail.com> wrote:
>
> On 5/22/19, Jun Zhao <mypopydev@gmail.com> wrote:
> > From: Jun Zhao <barryjzhao@tencent.com>
> >
> > ff_filter_get_nb_threads() respect AVFilterContext.nb_threads and
> > graph->nb_threads both, in most case, we perfer this API than using
> > ctx->graph->nb_threads directly.
> > ---
> >  doc/writing_filters.txt |    2 +-
> >  1 files changed, 1 insertions(+), 1 deletions(-)
> >
> > diff --git a/doc/writing_filters.txt b/doc/writing_filters.txt
> > index 98b9c6f..2e25cbe 100644
> > --- a/doc/writing_filters.txt
> > +++ b/doc/writing_filters.txt
> > @@ -389,7 +389,7 @@ distributor with something like this:
> >
> >      td.in  = in;
> >      td.out = out;
> > -    ctx->internal->execute(ctx, filter_slice, &td, NULL, FFMIN(outlink->h,
> > ctx->graph->nb_threads));
> > +    ctx->internal->execute(ctx, filter_slice, &td, NULL, FFMIN(outlink->h,
> > ff_filter_get_nb_threads(ctx)));
> >
> >      // ...
> >
>
> lgtm
>
Pushed, Thanks.
diff mbox

Patch

diff --git a/doc/writing_filters.txt b/doc/writing_filters.txt
index 98b9c6f..2e25cbe 100644
--- a/doc/writing_filters.txt
+++ b/doc/writing_filters.txt
@@ -389,7 +389,7 @@  distributor with something like this:
 
     td.in  = in;
     td.out = out;
-    ctx->internal->execute(ctx, filter_slice, &td, NULL, FFMIN(outlink->h, ctx->graph->nb_threads));
+    ctx->internal->execute(ctx, filter_slice, &td, NULL, FFMIN(outlink->h, ff_filter_get_nb_threads(ctx)));
 
     // ...