diff mbox series

[FFmpeg-devel,1/3] avcodec/v4l2_context: return EAGAIN to signal full buffers

Message ID 20200717020918.385084-1-andriy.gelman@gmail.com
State Accepted
Commit 5df9724e42a99e1bde673f109f41c466ee834f09
Headers show
Series [FFmpeg-devel,1/3] avcodec/v4l2_context: return EAGAIN to signal full buffers
Related show

Checks

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

Commit Message

Andriy Gelman July 17, 2020, 2:09 a.m. UTC
From: Andriy Gelman <andriy.gelman@gmail.com>

Return proper error when a frame buffers are full. This path is
triggered on the DragonBoard 410c since the encoding API change in
commit 827d6fe73d2f5472c1c2.

Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
---
 libavcodec/v4l2_context.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Andriy Gelman July 24, 2020, 7:49 p.m. UTC | #1
On Thu, 16. Jul 22:09, Andriy Gelman wrote:
> From: Andriy Gelman <andriy.gelman@gmail.com>
> 
> Return proper error when a frame buffers are full. This path is
> triggered on the DragonBoard 410c since the encoding API change in
> commit 827d6fe73d2f5472c1c2.
> 
> Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
> ---
>  libavcodec/v4l2_context.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavcodec/v4l2_context.c b/libavcodec/v4l2_context.c
> index 29b144ed73e..ff1ea8e57b0 100644
> --- a/libavcodec/v4l2_context.c
> +++ b/libavcodec/v4l2_context.c
> @@ -599,7 +599,7 @@ int ff_v4l2_context_enqueue_frame(V4L2Context* ctx, const AVFrame* frame)
>  
>      avbuf = v4l2_getfree_v4l2buf(ctx);
>      if (!avbuf)
> -        return AVERROR(ENOMEM);
> +        return AVERROR(EAGAIN);
>  
>      ret = ff_v4l2_buffer_avframe_to_buf(frame, avbuf);
>      if (ret)

ping

--
Andriy
Andriy Gelman Aug. 15, 2020, 8:32 p.m. UTC | #2
On Fri, 24. Jul 15:49, Andriy Gelman wrote:
> On Thu, 16. Jul 22:09, Andriy Gelman wrote:
> > From: Andriy Gelman <andriy.gelman@gmail.com>
> > 
> > Return proper error when a frame buffers are full. This path is
> > triggered on the DragonBoard 410c since the encoding API change in
> > commit 827d6fe73d2f5472c1c2.
> > 
> > Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
> > ---
> >  libavcodec/v4l2_context.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/libavcodec/v4l2_context.c b/libavcodec/v4l2_context.c
> > index 29b144ed73e..ff1ea8e57b0 100644
> > --- a/libavcodec/v4l2_context.c
> > +++ b/libavcodec/v4l2_context.c
> > @@ -599,7 +599,7 @@ int ff_v4l2_context_enqueue_frame(V4L2Context* ctx, const AVFrame* frame)
> >  
> >      avbuf = v4l2_getfree_v4l2buf(ctx);
> >      if (!avbuf)
> > -        return AVERROR(ENOMEM);
> > +        return AVERROR(EAGAIN);
> >  
> >      ret = ff_v4l2_buffer_avframe_to_buf(frame, avbuf);
> >      if (ret)
> 
> ping
> 

ping
Will apply this soon if no one objects.
Mark Thompson Aug. 15, 2020, 9:34 p.m. UTC | #3
On 17/07/2020 03:09, Andriy Gelman wrote:
> From: Andriy Gelman <andriy.gelman@gmail.com>
> 
> Return proper error when a frame buffers are full. This path is
> triggered on the DragonBoard 410c since the encoding API change in
> commit 827d6fe73d2f5472c1c2.
> 
> Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
> ---
>   libavcodec/v4l2_context.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavcodec/v4l2_context.c b/libavcodec/v4l2_context.c
> index 29b144ed73e..ff1ea8e57b0 100644
> --- a/libavcodec/v4l2_context.c
> +++ b/libavcodec/v4l2_context.c
> @@ -599,7 +599,7 @@ int ff_v4l2_context_enqueue_frame(V4L2Context* ctx, const AVFrame* frame)
>   
>       avbuf = v4l2_getfree_v4l2buf(ctx);
>       if (!avbuf)
> -        return AVERROR(ENOMEM);
> +        return AVERROR(EAGAIN);
>   
>       ret = ff_v4l2_buffer_avframe_to_buf(frame, avbuf);
>       if (ret)
> 

Yep, LGTM.  (And, importantly, it now matches the corresponding enqueue_packet behaviour in the function immediately below.)

Thanks,

- Mark
Andriy Gelman Aug. 16, 2020, 9:42 p.m. UTC | #4
On Sat, 15. Aug 22:34, Mark Thompson wrote:
> On 17/07/2020 03:09, Andriy Gelman wrote:
> > From: Andriy Gelman <andriy.gelman@gmail.com>
> > 
> > Return proper error when a frame buffers are full. This path is
> > triggered on the DragonBoard 410c since the encoding API change in
> > commit 827d6fe73d2f5472c1c2.
> > 
> > Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
> > ---
> >   libavcodec/v4l2_context.c | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/libavcodec/v4l2_context.c b/libavcodec/v4l2_context.c
> > index 29b144ed73e..ff1ea8e57b0 100644
> > --- a/libavcodec/v4l2_context.c
> > +++ b/libavcodec/v4l2_context.c
> > @@ -599,7 +599,7 @@ int ff_v4l2_context_enqueue_frame(V4L2Context* ctx, const AVFrame* frame)
> >       avbuf = v4l2_getfree_v4l2buf(ctx);
> >       if (!avbuf)
> > -        return AVERROR(ENOMEM);
> > +        return AVERROR(EAGAIN);
> >       ret = ff_v4l2_buffer_avframe_to_buf(frame, avbuf);
> >       if (ret)
> > 
> 
> Yep, LGTM.  (And, importantly, it now matches the corresponding enqueue_packet behaviour in the function immediately below.)
> 

Thanks, applied the commit. 
Will apply the rest of the series in the next few days.
Andriy Gelman Aug. 23, 2020, 5:47 p.m. UTC | #5
On Sun, 16. Aug 17:42, Andriy Gelman wrote:
> On Sat, 15. Aug 22:34, Mark Thompson wrote:
> > On 17/07/2020 03:09, Andriy Gelman wrote:
> > > From: Andriy Gelman <andriy.gelman@gmail.com>
> > > 
> > > Return proper error when a frame buffers are full. This path is
> > > triggered on the DragonBoard 410c since the encoding API change in
> > > commit 827d6fe73d2f5472c1c2.
> > > 
> > > Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
> > > ---
> > >   libavcodec/v4l2_context.c | 2 +-
> > >   1 file changed, 1 insertion(+), 1 deletion(-)
> > > 
> > > diff --git a/libavcodec/v4l2_context.c b/libavcodec/v4l2_context.c
> > > index 29b144ed73e..ff1ea8e57b0 100644
> > > --- a/libavcodec/v4l2_context.c
> > > +++ b/libavcodec/v4l2_context.c
> > > @@ -599,7 +599,7 @@ int ff_v4l2_context_enqueue_frame(V4L2Context* ctx, const AVFrame* frame)
> > >       avbuf = v4l2_getfree_v4l2buf(ctx);
> > >       if (!avbuf)
> > > -        return AVERROR(ENOMEM);
> > > +        return AVERROR(EAGAIN);
> > >       ret = ff_v4l2_buffer_avframe_to_buf(frame, avbuf);
> > >       if (ret)
> > > 
> > 
> > Yep, LGTM.  (And, importantly, it now matches the corresponding enqueue_packet behaviour in the function immediately below.)
> > 
> 
> Thanks, applied the commit. 
> Will apply the rest of the series in the next few days. 
> 

Applied.
diff mbox series

Patch

diff --git a/libavcodec/v4l2_context.c b/libavcodec/v4l2_context.c
index 29b144ed73e..ff1ea8e57b0 100644
--- a/libavcodec/v4l2_context.c
+++ b/libavcodec/v4l2_context.c
@@ -599,7 +599,7 @@  int ff_v4l2_context_enqueue_frame(V4L2Context* ctx, const AVFrame* frame)
 
     avbuf = v4l2_getfree_v4l2buf(ctx);
     if (!avbuf)
-        return AVERROR(ENOMEM);
+        return AVERROR(EAGAIN);
 
     ret = ff_v4l2_buffer_avframe_to_buf(frame, avbuf);
     if (ret)