Re: [PATCH 1/2] v4l: added V4L2_BUF_FLAG_EOS flag indicating the last frame in the stream

2012-06-18 Thread Mauro Carvalho Chehab
Em 18-06-2012 08:54, Andrzej Hajda escreveu:
> On Mon, 2012-06-18 at 08:24 -0300, Mauro Carvalho Chehab wrote:
>> Em 22-05-2012 12:33, Andrzej Hajda escreveu:
>>> Some devices requires indicator if the buffer is the last one in the stream.
>>> Applications and drivers can use this flag in such case.
>>>
>>> Signed-off-by: Andrzej Hajda 
>>> Signed-off-by: Kyungmin Park 
>>> ---
>>>Documentation/DocBook/media/v4l/io.xml  |7 +++
>>>Documentation/DocBook/media/v4l/vidioc-qbuf.xml |2 ++
>>>include/linux/videodev2.h   |1 +
>>>3 files changed, 10 insertions(+), 0 deletions(-)
>>>
>>> diff --git a/Documentation/DocBook/media/v4l/io.xml 
>>> b/Documentation/DocBook/media/v4l/io.xml
>>> index fd6aca2..dcbf1e0 100644
>>> --- a/Documentation/DocBook/media/v4l/io.xml
>>> +++ b/Documentation/DocBook/media/v4l/io.xml
>>> @@ -956,6 +956,13 @@ Typically applications shall use this flag for output 
>>> buffers if the data
>>>in this buffer has not been created by the CPU but by some DMA-capable 
>>> unit,
>>>in which case caches have not been used.
>>>   
>>> + 
>>> +   V4L2_BUF_FLAG_EOS
>>> +   0x2000
>>> +   Application should set this flag in the output buffer
>>> +in order to inform the driver about the last frame of the stream. Some
>>> +drivers may require it to properly finish processing the stream.
>>
>> This breaks backward compatibility, as applications written before this 
>> change
>> won't set this flag.
> 
> I am preparing a new patch which will use VIDIOC_ENCODER_CMD with
> command V4L2_ENC_CMD_STOP and a new flag
> V4L2_ENC_CMD_STOP_AFTER_NEXT_FRAME, according to suggestions by Hans
> Verkuil. Discussion is at thread started from the parent email (subject
> "[PATCH 0/2] s5p-mfc: added encoder support for end of stream
> handling").

So?

The point is: new changes should not break backward compatibility,
otherwise a regression is introduced, and such patch should be nacked.

So, newer functionality should carefully be introduced in a way that it
won't make older apps to break.

That means that you'll need to work on some design that an EOS flag will
be used only if the application is known to be compiled with EOS flag support.

Regards,
Mauro

>>
>>> + 
>>> 
>>>  
>>>
>>> diff --git a/Documentation/DocBook/media/v4l/vidioc-qbuf.xml 
>>> b/Documentation/DocBook/media/v4l/vidioc-qbuf.xml
>>> index 9caa49a..ad49f7d 100644
>>> --- a/Documentation/DocBook/media/v4l/vidioc-qbuf.xml
>>> +++ b/Documentation/DocBook/media/v4l/vidioc-qbuf.xml
>>> @@ -76,6 +76,8 @@ supports capturing from specific video inputs and you 
>>> want to specify a video
>>>input, then flags should be set to
>>>V4L2_BUF_FLAG_INPUT and the field
>>>input must be initialized to the desired 
>>> input.
>>> +Some drivers expects applications set 
>>> V4L2_BUF_FLAG_EOS
>>> +flag on the last buffer of the stream.
>>>The reserved field must be set to 0. When 
>>> using
>>>the multi-planar API, the
>>>m.planes field must contain a userspace 
>>> pointer
>>> diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
>>> index 370d111..e44a7cd 100644
>>> --- a/include/linux/videodev2.h
>>> +++ b/include/linux/videodev2.h
>>> @@ -676,6 +676,7 @@ struct v4l2_buffer {
>>>/* Cache handling flags */
>>>#define V4L2_BUF_FLAG_NO_CACHE_INVALIDATE0x0800
>>>#define V4L2_BUF_FLAG_NO_CACHE_CLEAN 0x1000
>>> +#define V4L2_BUF_FLAG_EOS  0x2000  /* The last buffer in the stream */
>>>
>>>/*
>>> *   O V E R L A Y   P R E V I E W
>>>
>>
>>
> Regards
> Andrzej
> 
> 


--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/2] v4l: added V4L2_BUF_FLAG_EOS flag indicating the last frame in the stream

2012-06-18 Thread Andrzej Hajda
On Mon, 2012-06-18 at 08:24 -0300, Mauro Carvalho Chehab wrote:
> Em 22-05-2012 12:33, Andrzej Hajda escreveu:
> > Some devices requires indicator if the buffer is the last one in the stream.
> > Applications and drivers can use this flag in such case.
> > 
> > Signed-off-by: Andrzej Hajda 
> > Signed-off-by: Kyungmin Park 
> > ---
> >   Documentation/DocBook/media/v4l/io.xml  |7 +++
> >   Documentation/DocBook/media/v4l/vidioc-qbuf.xml |2 ++
> >   include/linux/videodev2.h   |1 +
> >   3 files changed, 10 insertions(+), 0 deletions(-)
> > 
> > diff --git a/Documentation/DocBook/media/v4l/io.xml 
> > b/Documentation/DocBook/media/v4l/io.xml
> > index fd6aca2..dcbf1e0 100644
> > --- a/Documentation/DocBook/media/v4l/io.xml
> > +++ b/Documentation/DocBook/media/v4l/io.xml
> > @@ -956,6 +956,13 @@ Typically applications shall use this flag for output 
> > buffers if the data
> >   in this buffer has not been created by the CPU but by some DMA-capable 
> > unit,
> >   in which case caches have not been used.
> >   
> > + 
> > +   V4L2_BUF_FLAG_EOS
> > +   0x2000
> > +   Application should set this flag in the output buffer
> > +in order to inform the driver about the last frame of the stream. Some
> > +drivers may require it to properly finish processing the stream.
> 
> This breaks backward compatibility, as applications written before this change
> won't set this flag.

I am preparing a new patch which will use VIDIOC_ENCODER_CMD with
command V4L2_ENC_CMD_STOP and a new flag
V4L2_ENC_CMD_STOP_AFTER_NEXT_FRAME, according to suggestions by Hans
Verkuil. Discussion is at thread started from the parent email (subject
"[PATCH 0/2] s5p-mfc: added encoder support for end of stream
handling").
> 
> > + 
> > 
> > 
> >   
> > diff --git a/Documentation/DocBook/media/v4l/vidioc-qbuf.xml 
> > b/Documentation/DocBook/media/v4l/vidioc-qbuf.xml
> > index 9caa49a..ad49f7d 100644
> > --- a/Documentation/DocBook/media/v4l/vidioc-qbuf.xml
> > +++ b/Documentation/DocBook/media/v4l/vidioc-qbuf.xml
> > @@ -76,6 +76,8 @@ supports capturing from specific video inputs and you 
> > want to specify a video
> >   input, then flags should be set to
> >   V4L2_BUF_FLAG_INPUT and the field
> >   input must be initialized to the desired input.
> > +Some drivers expects applications set 
> > V4L2_BUF_FLAG_EOS
> > +flag on the last buffer of the stream.
> >   The reserved field must be set to 0. When using
> >   the multi-planar API, the
> >   m.planes field must contain a userspace pointer
> > diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
> > index 370d111..e44a7cd 100644
> > --- a/include/linux/videodev2.h
> > +++ b/include/linux/videodev2.h
> > @@ -676,6 +676,7 @@ struct v4l2_buffer {
> >   /* Cache handling flags */
> >   #define V4L2_BUF_FLAG_NO_CACHE_INVALIDATE 0x0800
> >   #define V4L2_BUF_FLAG_NO_CACHE_CLEAN  0x1000
> > +#define V4L2_BUF_FLAG_EOS  0x2000  /* The last buffer in the stream */
> >   
> >   /*
> >*O V E R L A Y   P R E V I E W
> > 
> 
> 
Regards
Andrzej


--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/2] v4l: added V4L2_BUF_FLAG_EOS flag indicating the last frame in the stream

2012-06-18 Thread Mauro Carvalho Chehab
Em 22-05-2012 12:33, Andrzej Hajda escreveu:
> Some devices requires indicator if the buffer is the last one in the stream.
> Applications and drivers can use this flag in such case.
> 
> Signed-off-by: Andrzej Hajda 
> Signed-off-by: Kyungmin Park 
> ---
>   Documentation/DocBook/media/v4l/io.xml  |7 +++
>   Documentation/DocBook/media/v4l/vidioc-qbuf.xml |2 ++
>   include/linux/videodev2.h   |1 +
>   3 files changed, 10 insertions(+), 0 deletions(-)
> 
> diff --git a/Documentation/DocBook/media/v4l/io.xml 
> b/Documentation/DocBook/media/v4l/io.xml
> index fd6aca2..dcbf1e0 100644
> --- a/Documentation/DocBook/media/v4l/io.xml
> +++ b/Documentation/DocBook/media/v4l/io.xml
> @@ -956,6 +956,13 @@ Typically applications shall use this flag for output 
> buffers if the data
>   in this buffer has not been created by the CPU but by some DMA-capable unit,
>   in which case caches have not been used.
> 
> +   
> + V4L2_BUF_FLAG_EOS
> + 0x2000
> + Application should set this flag in the output buffer
> +in order to inform the driver about the last frame of the stream. Some
> +drivers may require it to properly finish processing the stream.

This breaks backward compatibility, as applications written before this change
won't set this flag.

> +   
>   
> 
>   
> diff --git a/Documentation/DocBook/media/v4l/vidioc-qbuf.xml 
> b/Documentation/DocBook/media/v4l/vidioc-qbuf.xml
> index 9caa49a..ad49f7d 100644
> --- a/Documentation/DocBook/media/v4l/vidioc-qbuf.xml
> +++ b/Documentation/DocBook/media/v4l/vidioc-qbuf.xml
> @@ -76,6 +76,8 @@ supports capturing from specific video inputs and you want 
> to specify a video
>   input, then flags should be set to
>   V4L2_BUF_FLAG_INPUT and the field
>   input must be initialized to the desired input.
> +Some drivers expects applications set V4L2_BUF_FLAG_EOS
> +flag on the last buffer of the stream.
>   The reserved field must be set to 0. When using
>   the multi-planar API, the
>   m.planes field must contain a userspace pointer
> diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
> index 370d111..e44a7cd 100644
> --- a/include/linux/videodev2.h
> +++ b/include/linux/videodev2.h
> @@ -676,6 +676,7 @@ struct v4l2_buffer {
>   /* Cache handling flags */
>   #define V4L2_BUF_FLAG_NO_CACHE_INVALIDATE   0x0800
>   #define V4L2_BUF_FLAG_NO_CACHE_CLEAN0x1000
> +#define V4L2_BUF_FLAG_EOS0x2000  /* The last buffer in the stream */
>   
>   /*
>*  O V E R L A Y   P R E V I E W
> 


--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/2] v4l: added V4L2_BUF_FLAG_EOS flag indicating the last frame in the stream

2012-05-22 Thread Andrzej Hajda
Some devices requires indicator if the buffer is the last one in the stream.
Applications and drivers can use this flag in such case.

Signed-off-by: Andrzej Hajda 
Signed-off-by: Kyungmin Park 
---
 Documentation/DocBook/media/v4l/io.xml  |7 +++
 Documentation/DocBook/media/v4l/vidioc-qbuf.xml |2 ++
 include/linux/videodev2.h   |1 +
 3 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/Documentation/DocBook/media/v4l/io.xml 
b/Documentation/DocBook/media/v4l/io.xml
index fd6aca2..dcbf1e0 100644
--- a/Documentation/DocBook/media/v4l/io.xml
+++ b/Documentation/DocBook/media/v4l/io.xml
@@ -956,6 +956,13 @@ Typically applications shall use this flag for output 
buffers if the data
 in this buffer has not been created by the CPU but by some DMA-capable unit,
 in which case caches have not been used.
  
+ 
+   V4L2_BUF_FLAG_EOS
+   0x2000
+   Application should set this flag in the output buffer
+in order to inform the driver about the last frame of the stream. Some
+drivers may require it to properly finish processing the stream.
+ 

   
 
diff --git a/Documentation/DocBook/media/v4l/vidioc-qbuf.xml 
b/Documentation/DocBook/media/v4l/vidioc-qbuf.xml
index 9caa49a..ad49f7d 100644
--- a/Documentation/DocBook/media/v4l/vidioc-qbuf.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-qbuf.xml
@@ -76,6 +76,8 @@ supports capturing from specific video inputs and you want to 
specify a video
 input, then flags should be set to
 V4L2_BUF_FLAG_INPUT and the field
 input must be initialized to the desired input.
+Some drivers expects applications set V4L2_BUF_FLAG_EOS
+flag on the last buffer of the stream.
 The reserved field must be set to 0. When using
 the multi-planar API, the
 m.planes field must contain a userspace pointer
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
index 370d111..e44a7cd 100644
--- a/include/linux/videodev2.h
+++ b/include/linux/videodev2.h
@@ -676,6 +676,7 @@ struct v4l2_buffer {
 /* Cache handling flags */
 #define V4L2_BUF_FLAG_NO_CACHE_INVALIDATE  0x0800
 #define V4L2_BUF_FLAG_NO_CACHE_CLEAN   0x1000
+#define V4L2_BUF_FLAG_EOS  0x2000  /* The last buffer in the stream */
 
 /*
  * O V E R L A Y   P R E V I E W
-- 
1.7.0.4

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html