Hi, > From: Philipp Zabel [mailto:p.zabel@xxxxxxxxxxxxxx] > Sent: Monday, April 20, 2015 10:28 AM > To: Kamil Debski > Cc: 'Pawel Osciak'; 'LMML'; 'Hans Verkuil'; 'Laurent Pinchart'; > 'Nicolas Dufresne'; 'Sakari Ailus'; kernel@xxxxxxxxxxxxxx > Subject: Re: [PATCH v4 2/4] [media] videobuf2: return -EPIPE from DQBUF > after the last buffer > > Am Donnerstag, den 16.04.2015, 10:23 +0200 schrieb Kamil Debski: > [...] > > > > But, in general, in what kind of scenario would the driver want > to > > > > call this function, as opposed to vb2 clearing this flag by > itself on > > > > STREAMOFF? > > > > > > There is VIDIOC_DECODER_CMD / V4L2_DEC_CMD_START. > > > I'd expect this timeline for decoder draining and restart: > > > > > > - userspace calls VIDIOC_DECODER_CMD, cmd=V4L2_DEC_CMD_STOP > > > after queueing the last output buffer to be decoded > > > - the driver processes remaining output buffers into capture > buffers > > > and sets the V4L2_BUF_FLAG_LAST set on the last capture Buffet > > > > I would like to confirm that it will work with MFC. Am I right that > the > > below will work? Did you take that into account? > > I see no reason why it wouldn't. The only difference is that userspace > has to be able to handle the empty frame. I just checked the notes from the codec meeting in Dusseldorf. When we talked about the draining flow, we agreed to mention in the documentation that a buffer with the V4L2_BUF_FLAG_LAST can be empty. Thus the userspace applications should check the size of last frame. Could you please add that the last buffer can be empty (zero size) in the DocBook patch? > > > So in MFC's case the V4L2_BUF_FLAG_LAST will be set on the one buffer > after > > the last one and the bytesused of that buffer would be set to 0. > > > > The problem of MFC is that it will signal that the last frame was > decoded > > after it was decoded. To particularize: > > - a frame is decoded, an irq is sent by MFC - we have a new decoded > picture > > - next an irq is sent with an internal MFC flag that the buffer is > empty > > (last picture was already decoded) > > Doesn't MFC userspace currently stop on the empty frame? That empty > frame will still be dequeued as before, the only difference is the > added > V4L2_BUF_FLAG_LAST on it, and that subsequent calls to DQBUF would > return -EPIPE. Ok, I see this. > regards > Philipp Best wishes, -- Kamil Debski Samsung R&D Institute Poland -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html