[PATCH 7/8] v4l: Add EBUSY error description for VIDIOC_STREAMON

2010-09-05 Thread Marek Szyprowski
From: Pawel Osciak 

VIDIOC_STREAMON should return EBUSY if streaming is already active.

Signed-off-by: Pawel Osciak 
Signed-off-by: Kyungmin Park 
Signed-off-by: Marek Szyprowski 
---
 Documentation/DocBook/v4l/vidioc-streamon.xml |7 +++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/Documentation/DocBook/v4l/vidioc-streamon.xml 
b/Documentation/DocBook/v4l/vidioc-streamon.xml
index e42bff1..fdbd8d8 100644
--- a/Documentation/DocBook/v4l/vidioc-streamon.xml
+++ b/Documentation/DocBook/v4l/vidioc-streamon.xml
@@ -93,6 +93,13 @@ synchronize with other events.
 been allocated (memory mapping) or enqueued (output) yet.

   
+  
+   EBUSY
+   
+ VIDIOC_STREAMON called, but
+ streaming I/O already active.
+   
+  
 
   
 
-- 
1.7.2.2

--
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 7/8] v4l: Add EBUSY error description for VIDIOC_STREAMON

2010-10-22 Thread Mauro Carvalho Chehab
Em 06-09-2010 03:53, Marek Szyprowski escreveu:
> From: Pawel Osciak 
> 
> VIDIOC_STREAMON should return EBUSY if streaming is already active.
> 
> Signed-off-by: Pawel Osciak 
> Signed-off-by: Kyungmin Park 
> Signed-off-by: Marek Szyprowski 
> ---
>  Documentation/DocBook/v4l/vidioc-streamon.xml |7 +++
>  1 files changed, 7 insertions(+), 0 deletions(-)
> 
> diff --git a/Documentation/DocBook/v4l/vidioc-streamon.xml 
> b/Documentation/DocBook/v4l/vidioc-streamon.xml
> index e42bff1..fdbd8d8 100644
> --- a/Documentation/DocBook/v4l/vidioc-streamon.xml
> +++ b/Documentation/DocBook/v4l/vidioc-streamon.xml
> @@ -93,6 +93,13 @@ synchronize with other events.
>  been allocated (memory mapping) or enqueued (output) yet.
>   
>
> +  
> + EBUSY
> + 
> +   VIDIOC_STREAMON called, but
> +   streaming I/O already active.
> + 
> +  
>  
>
>  

I'm in doubt about this patch. I don't see any problem on just return 0 if
stream is active.

Actually, I think that this patch may break some applications, as there are
some cases where stream may start even without streamon (like via read() 
method).

Cheers,
Mauro
--
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 7/8] v4l: Add EBUSY error description for VIDIOC_STREAMON

2010-10-24 Thread Pawel Osciak
On Fri, Oct 22, 2010 at 17:18, Mauro Carvalho Chehab  wrote:
> Em 06-09-2010 03:53, Marek Szyprowski escreveu:
>> From: Pawel Osciak 
>>
>> VIDIOC_STREAMON should return EBUSY if streaming is already active.
>>
>> Signed-off-by: Pawel Osciak 
>> Signed-off-by: Kyungmin Park 
>> Signed-off-by: Marek Szyprowski 
>> ---
>>  Documentation/DocBook/v4l/vidioc-streamon.xml |    7 +++
>>  1 files changed, 7 insertions(+), 0 deletions(-)
>>
>> diff --git a/Documentation/DocBook/v4l/vidioc-streamon.xml 
>> b/Documentation/DocBook/v4l/vidioc-streamon.xml
>> index e42bff1..fdbd8d8 100644
>> --- a/Documentation/DocBook/v4l/vidioc-streamon.xml
>> +++ b/Documentation/DocBook/v4l/vidioc-streamon.xml
>> @@ -93,6 +93,13 @@ synchronize with other events.
>>  been allocated (memory mapping) or enqueued (output) yet.
>>       
>>        
>> +      
>> +     EBUSY
>> +     
>> +       VIDIOC_STREAMON called, but
>> +       streaming I/O already active.
>> +     
>> +      
>>      
>>    
>>  
>
> I'm in doubt about this patch. I don't see any problem on just return 0 if
> stream is active.
>
> Actually, I think that this patch may break some applications, as there are
> some cases where stream may start even without streamon (like via read() 
> method).


A quick grep over the media directory reveals that many drivers
(including videobuf_streamon) return EBUSY for some cases. This patch
was not intended to introduce something new to the API. I just wanted
to document an undocumented return value. How should the EBUSY return
be interpreted? Or should we get rid of it?

-- 
Best regards,
Pawel Osciak
--
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 7/8] v4l: Add EBUSY error description for VIDIOC_STREAMON

2010-10-24 Thread Laurent Pinchart
On Sunday 24 October 2010 18:52:09 Pawel Osciak wrote:
> On Fri, Oct 22, 2010 at 17:18, Mauro Carvalho Chehab  
wrote:
> > Em 06-09-2010 03:53, Marek Szyprowski escreveu:
> >> From: Pawel Osciak 
> >> 
> >> VIDIOC_STREAMON should return EBUSY if streaming is already active.
> >> 
> >> Signed-off-by: Pawel Osciak 
> >> Signed-off-by: Kyungmin Park 
> >> Signed-off-by: Marek Szyprowski 
> >> ---
> >>  Documentation/DocBook/v4l/vidioc-streamon.xml |7 +++
> >>  1 files changed, 7 insertions(+), 0 deletions(-)
> >> 
> >> diff --git a/Documentation/DocBook/v4l/vidioc-streamon.xml
> >> b/Documentation/DocBook/v4l/vidioc-streamon.xml index e42bff1..fdbd8d8
> >> 100644
> >> --- a/Documentation/DocBook/v4l/vidioc-streamon.xml
> >> +++ b/Documentation/DocBook/v4l/vidioc-streamon.xml
> >> @@ -93,6 +93,13 @@ synchronize with other events.
> >>  been allocated (memory mapping) or enqueued (output) yet.
> >>   
> >>
> >> +  
> >> + EBUSY
> >> + 
> >> +   VIDIOC_STREAMON called, but
> >> +   streaming I/O already active.
> >> + 
> >> +  
> >>  
> >>
> >>  
> > 
> > I'm in doubt about this patch. I don't see any problem on just return 0
> > if stream is active.
> > 
> > Actually, I think that this patch may break some applications, as there
> > are some cases where stream may start even without streamon (like via
> > read() method).
> 
> A quick grep over the media directory reveals that many drivers
> (including videobuf_streamon) return EBUSY for some cases. This patch
> was not intended to introduce something new to the API. I just wanted
> to document an undocumented return value. How should the EBUSY return
> be interpreted? Or should we get rid of it?

I think the patch makes sense. As you mention many drivers already implement 
this behaviour, so this mostly clarifies the API. Calling VIDIOC_STREAMON on 
an already streaming file handle isn't something applications should do in the 
first place anyway.

-- 
Regards,

Laurent Pinchart
--
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 7/8] v4l: Add EBUSY error description for VIDIOC_STREAMON

2010-10-24 Thread Devin Heitmueller
On Sun, Oct 24, 2010 at 3:50 PM, Laurent Pinchart
 wrote:
> I think the patch makes sense. As you mention many drivers already implement
> this behaviour, so this mostly clarifies the API. Calling VIDIOC_STREAMON on
> an already streaming file handle isn't something applications should do in the
> first place anyway.

I don't disagree with this behavior in principle, but Pawel should
really try this out with some of the common applications to ensure it
doesn't cause breakage (e.g. tvtime, xawtv, mythtv).

Despite the fact that some drivers already do this, that doesn't mean
that those drivers are necessarily the ones commonly used with these
applications.

Devin

-- 
Devin J. Heitmueller - Kernel Labs
http://www.kernellabs.com
--
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