diff mbox series

[FFmpeg-devel] libavcodec: v4l2m2m: allow lower minimum buffer values

Message ID 20200507161834.845759-1-lorusak@gmail.com
State Accepted
Commit 0d7c452d84e7ed228601b0285152f158ee2308fd
Headers show
Series [FFmpeg-devel] libavcodec: v4l2m2m: allow lower minimum buffer values | expand

Checks

Context Check Description
andriy/default pending
andriy/make success Make finished
andriy/make_fate success Make fate finished

Commit Message

Lukas Rusak May 7, 2020, 4:18 p.m. UTC
There is no reason to enforce a high minimum. In the context
of streaming only a few output buffers and capture buffers
are even needed for continuous playback. This also helps
alleviate memory pressure when decoding 4K media.
---
 libavcodec/v4l2_m2m.h     | 2 +-
 libavcodec/v4l2_m2m_dec.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Comments

Andriy Gelman May 9, 2020, 4:17 a.m. UTC | #1
On Thu, 07. May 09:18, Lukas Rusak wrote:
> There is no reason to enforce a high minimum. In the context
> of streaming only a few output buffers and capture buffers
> are even needed for continuous playback. This also helps
> alleviate memory pressure when decoding 4K media.
> ---
>  libavcodec/v4l2_m2m.h     | 2 +-
>  libavcodec/v4l2_m2m_dec.c | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/libavcodec/v4l2_m2m.h b/libavcodec/v4l2_m2m.h
> index 61cb919771..feeb162812 100644
> --- a/libavcodec/v4l2_m2m.h
> +++ b/libavcodec/v4l2_m2m.h
> @@ -38,7 +38,7 @@
>  
>  #define V4L_M2M_DEFAULT_OPTS \
>      { "num_output_buffers", "Number of buffers in the output context",\
> -        OFFSET(num_output_buffers), AV_OPT_TYPE_INT, { .i64 = 16 }, 6, INT_MAX, FLAGS }
> +        OFFSET(num_output_buffers), AV_OPT_TYPE_INT, { .i64 = 16 }, 2, INT_MAX, FLAGS }
>  
>  typedef struct V4L2m2mContext {
>      char devname[PATH_MAX];
> diff --git a/libavcodec/v4l2_m2m_dec.c b/libavcodec/v4l2_m2m_dec.c
> index c6b865fde8..b9725be377 100644
> --- a/libavcodec/v4l2_m2m_dec.c
> +++ b/libavcodec/v4l2_m2m_dec.c
> @@ -262,7 +262,7 @@ static av_cold int v4l2_decode_close(AVCodecContext *avctx)
>  static const AVOption options[] = {
>      V4L_M2M_DEFAULT_OPTS,
>      { "num_capture_buffers", "Number of buffers in the capture context",
> -        OFFSET(num_capture_buffers), AV_OPT_TYPE_INT, {.i64 = 20}, 20, INT_MAX, FLAGS },
> +        OFFSET(num_capture_buffers), AV_OPT_TYPE_INT, {.i64 = 20}, 2, INT_MAX, FLAGS },
>      { NULL},
>  };


nit:
the patch subject prefix should be changed to avcodec/v4l2_m2m: 

otherwise lgtm

Thanks,
Aman Karmani Jan. 9, 2023, 8:06 p.m. UTC | #2
On Fri, May 8, 2020 at 11:08 PM Andriy Gelman <andriy.gelman@gmail.com>
wrote:

> On Thu, 07. May 09:18, Lukas Rusak wrote:
> > There is no reason to enforce a high minimum. In the context
> > of streaming only a few output buffers and capture buffers
> > are even needed for continuous playback. This also helps
> > alleviate memory pressure when decoding 4K media.
> > ---
> >  libavcodec/v4l2_m2m.h     | 2 +-
> >  libavcodec/v4l2_m2m_dec.c | 2 +-
> >  2 files changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/libavcodec/v4l2_m2m.h b/libavcodec/v4l2_m2m.h
> > index 61cb919771..feeb162812 100644
> > --- a/libavcodec/v4l2_m2m.h
> > +++ b/libavcodec/v4l2_m2m.h
> > @@ -38,7 +38,7 @@
> >
> >  #define V4L_M2M_DEFAULT_OPTS \
> >      { "num_output_buffers", "Number of buffers in the output context",\
> > -        OFFSET(num_output_buffers), AV_OPT_TYPE_INT, { .i64 = 16 }, 6,
> INT_MAX, FLAGS }
> > +        OFFSET(num_output_buffers), AV_OPT_TYPE_INT, { .i64 = 16 }, 2,
> INT_MAX, FLAGS }
> >
> >  typedef struct V4L2m2mContext {
> >      char devname[PATH_MAX];
> > diff --git a/libavcodec/v4l2_m2m_dec.c b/libavcodec/v4l2_m2m_dec.c
> > index c6b865fde8..b9725be377 100644
> > --- a/libavcodec/v4l2_m2m_dec.c
> > +++ b/libavcodec/v4l2_m2m_dec.c
> > @@ -262,7 +262,7 @@ static av_cold int v4l2_decode_close(AVCodecContext
> *avctx)
> >  static const AVOption options[] = {
> >      V4L_M2M_DEFAULT_OPTS,
> >      { "num_capture_buffers", "Number of buffers in the capture context",
> > -        OFFSET(num_capture_buffers), AV_OPT_TYPE_INT, {.i64 = 20}, 20,
> INT_MAX, FLAGS },
> > +        OFFSET(num_capture_buffers), AV_OPT_TYPE_INT, {.i64 = 20}, 2,
> INT_MAX, FLAGS },
> >      { NULL},
> >  };
>
>
LGTM


>
> nit:
> the patch subject prefix should be changed to avcodec/v4l2_m2m:


I will fixup the commit message and apply this patch if no one objects.

Thanks,
Aman


>
>
> otherwise lgtm
>
> Thanks,
> --
> Andriy
> _______________________________________________
> 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".
diff mbox series

Patch

diff --git a/libavcodec/v4l2_m2m.h b/libavcodec/v4l2_m2m.h
index 61cb919771..feeb162812 100644
--- a/libavcodec/v4l2_m2m.h
+++ b/libavcodec/v4l2_m2m.h
@@ -38,7 +38,7 @@ 
 
 #define V4L_M2M_DEFAULT_OPTS \
     { "num_output_buffers", "Number of buffers in the output context",\
-        OFFSET(num_output_buffers), AV_OPT_TYPE_INT, { .i64 = 16 }, 6, INT_MAX, FLAGS }
+        OFFSET(num_output_buffers), AV_OPT_TYPE_INT, { .i64 = 16 }, 2, INT_MAX, FLAGS }
 
 typedef struct V4L2m2mContext {
     char devname[PATH_MAX];
diff --git a/libavcodec/v4l2_m2m_dec.c b/libavcodec/v4l2_m2m_dec.c
index c6b865fde8..b9725be377 100644
--- a/libavcodec/v4l2_m2m_dec.c
+++ b/libavcodec/v4l2_m2m_dec.c
@@ -262,7 +262,7 @@  static av_cold int v4l2_decode_close(AVCodecContext *avctx)
 static const AVOption options[] = {
     V4L_M2M_DEFAULT_OPTS,
     { "num_capture_buffers", "Number of buffers in the capture context",
-        OFFSET(num_capture_buffers), AV_OPT_TYPE_INT, {.i64 = 20}, 20, INT_MAX, FLAGS },
+        OFFSET(num_capture_buffers), AV_OPT_TYPE_INT, {.i64 = 20}, 2, INT_MAX, FLAGS },
     { NULL},
 };