[FFmpeg-devel] [EXT] Re: [PATCH v4 2/3] avcodec/v4l2_context: resume the decoding process after source change event received.

Ming Qian ming.qian at nxp.com
Mon Jan 10 10:57:04 EET 2022


> -----Original Message-----
> From: Andriy Gelman [mailto:andriy.gelman at gmail.com]
> Sent: Sunday, January 9, 2022 1:13 AM
> To: Ming Qian <ming.qian at nxp.com>
> Cc: FFmpeg development discussions and patches <ffmpeg-devel at ffmpeg.org>
> Subject: Re: [EXT] Re: [FFmpeg-devel] [PATCH v4 2/3] avcodec/v4l2_context:
> resume the decoding process after source change event received.
> 
> Caution: EXT Email
> 
> On Tue, 04. Jan 17:58, Andriy Gelman wrote:
> > On Tue, 04. Jan 17:48, Andriy Gelman wrote:
> > > Hi Ming,
> > >
> > > On Tue, 04. Jan 07:51, Ming Qian wrote:
> > > >
> > > > > -----Original Message-----
> > > > > From: Andriy Gelman [mailto:andriy.gelman at gmail.com]
> > > > > Sent: Monday, January 3, 2022 12:41 AM
> > > > > To: FFmpeg development discussions and patches
> > > > > <ffmpeg-devel at ffmpeg.org>
> > > > > Cc: Ming Qian <ming.qian at nxp.com>
> > > > > Subject: [EXT] Re: [FFmpeg-devel] [PATCH v4 2/3]
> avcodec/v4l2_context:
> > > > > resume the decoding process after source change event received.
> > > > >
> > > > > Caution: EXT Email
> > > > >
> > > > > On Thu, 19. Aug 16:55, Ming Qian wrote:
> > > > > > client need to resume the decoding process after it dequeues
> > > > > > the source change event.
> > > > > > no matter what's the return value of v4l2_resolution_changed().
> > > > > > if the client doesn't resume the decoding process, the decoder
> > > > > > may keep waiting
> > > > > >
> > > > > > in documentation of v4l2 stateful decoder, we can see the
> > > > > > following
> > > > > > description:
> > > > > >       The client must continue the sequence as described below to
> > > > > >       continue the decoding process.
> > > > > >       1.  Dequeue the source change event.
> > > > > >               Important
> > > > > >               A source change triggers an implicit decoder drain,
> > > > > >               similar to the explicit Drain sequence. The decoder is
> > > > > >               stopped after it completes. The decoding process
> must be
> > > > > >               resumed with either a pair of calls to
> > > > > >               VIDIOC_STREAMOFF() and VIDIOC_STREAMON() on
> the
> > > > > CAPTURE
> > > > > >               queue, or a call to VIDIOC_DECODER_CMD() with the
> > > > > >               V4L2_DEC_CMD_START command.
> > > > > >       2.  Continue with the Capture Setup sequence.
> > > > >
> > > > > Please also add that this fixes decoding of
> > > > > https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%
> > > > > 2Fstreams
> > > > > .videolan.org%2Fffmpeg%2Fincoming%2F720p60.mp4&data=04%
> 7C01%
> > > > >
> 7Cming.qian%40nxp.com%7Cea94a9c4cc0643b0a41f08d9ce0eadc5%7C686e
> > > > >
> a1d3bc2b4c6fa92cd99c5c301635%7C0%7C1%7C637767384703207931%7CU
> > > > >
> nknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI
> > > > > 6
> Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=X4rKQX19MQg1gO3ILiBCQ
> > > > > qSLIvqovZLA95KKiyoVNzI%3D&reserved=0 on RPi4.
> > > > >
> > >
> > > >
> > > > Hi Andriy,
> > > >     What's wrong with this stream? Everything is normal on my side
> when I play it using ffplay.
> > > >
> >
> > >
> > > I couldn't decode the file on the Raspberry Pi4. After enqueuing the
> > > first few packets there was a dynamic resolution change event, and
> > > the start decode command was not sent. This is fixed by your patch.
> 
> >
> > Also you may have to upgrade kernel to reproduce. It may have been
> > working fine before this commit:
> > https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgith
> >
> ub.com%2Fraspberrypi%2Flinux%2Fcommit%2Fb7e6b495eff31298ba4665f71
> b2414
> >
> cc9a8f99c2%23diff-93defb6da917ce9bb43cb195d0e61f81673c5183ac75d63
> 1f3e1
> >
> ee475a810dd6&data=04%7C01%7Cming.qian%40nxp.com%7Ce6b24805
> 32c6458d
> >
> 185b08d9d2ca2a81%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C1%7
> C63777258
> >
> 8014789133%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIj
> oiV2luMzI
> >
> iLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=RtRg%2Fu1ZggLSEf
> lGvxy
> > MutZv6Q%2B%2BX89O%2BE8DvXK0RHk%3D&reserved=0
> >
> 
> I confirmed the above.
> 
> I'll apply patches 1 and 3 from this series later tonight if no one objects.
> 
> --
> Andriy

Hi Andriy,

    What to do with the rest of the patches?

Ming


More information about the ffmpeg-devel mailing list