linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* How can I feed more data to a stream after I stream on?
@ 2014-03-18 23:18 m silverstri
  2014-03-19  7:22 ` Hans Verkuil
  0 siblings, 1 reply; 3+ messages in thread
From: m silverstri @ 2014-03-18 23:18 UTC (permalink / raw)
  To: linux-media

I am using v4l2 m2m framework to develop a resize driver. I have an
image , pass it to the driver and it generated a resize output image.

My v4l2 sequence is
1. qbuf OUTPUT, CAPTURE
2. stream on OUTPUT, CAPTURE
3. dqbuf OUTPUT, CAPTURE
4. stream off OUTPUT, CAPTURE

this works if i have a full frame of image before i start streaming.

But what I only have partial buffers when I start streaming, how can I
qbuf more buffer after I 'stream on' OUTPUT,

I try this, but this fail
1. qbuf OUTPUT, CAPTURE (I qbuf only partial OUTPUT)
2. stream on OUTPUT, CAPTURE

// do this in a loop:
3. dqbuf OUTPUT (I want to queue more OUTPUT as they become available)
4. qbuf OUTPUT

// now I am done, I want to dqbuf my output
5. dqbuf CAPTURE
6. stream off OUTPUT, CAPTURE

I try to do dqbuf/qbuf OUTPUT in step #3, #4 above, but it just stuck
in dqbuf OUTPUT.

How can I queue more of my input data after I stream on?

Thank you.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: How can I feed more data to a stream after I stream on?
  2014-03-18 23:18 How can I feed more data to a stream after I stream on? m silverstri
@ 2014-03-19  7:22 ` Hans Verkuil
  2014-03-19 16:06   ` m silverstri
  0 siblings, 1 reply; 3+ messages in thread
From: Hans Verkuil @ 2014-03-19  7:22 UTC (permalink / raw)
  To: m silverstri, linux-media

On 03/19/2014 12:18 AM, m silverstri wrote:
> I am using v4l2 m2m framework to develop a resize driver. I have an
> image , pass it to the driver and it generated a resize output image.
> 
> My v4l2 sequence is
> 1. qbuf OUTPUT, CAPTURE
> 2. stream on OUTPUT, CAPTURE
> 3. dqbuf OUTPUT, CAPTURE
> 4. stream off OUTPUT, CAPTURE
> 
> this works if i have a full frame of image before i start streaming.
> 
> But what I only have partial buffers when I start streaming, how can I
> qbuf more buffer after I 'stream on' OUTPUT,

You can't. Each buffer passed to the driver must contain a full image.
So your application needs some logic to keep filling a buffer until it
is complete and only then do you issue the QBUF.

Regards,

	Hans

> 
> I try this, but this fail
> 1. qbuf OUTPUT, CAPTURE (I qbuf only partial OUTPUT)
> 2. stream on OUTPUT, CAPTURE
> 
> // do this in a loop:
> 3. dqbuf OUTPUT (I want to queue more OUTPUT as they become available)
> 4. qbuf OUTPUT
> 
> // now I am done, I want to dqbuf my output
> 5. dqbuf CAPTURE
> 6. stream off OUTPUT, CAPTURE
> 
> I try to do dqbuf/qbuf OUTPUT in step #3, #4 above, but it just stuck
> in dqbuf OUTPUT.
> 
> How can I queue more of my input data after I stream on?
> 
> Thank you.
> --
> To unsubscribe from this list: send the line "unsubscribe linux-media" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: How can I feed more data to a stream after I stream on?
  2014-03-19  7:22 ` Hans Verkuil
@ 2014-03-19 16:06   ` m silverstri
  0 siblings, 0 replies; 3+ messages in thread
From: m silverstri @ 2014-03-19 16:06 UTC (permalink / raw)
  To: Hans Verkuil; +Cc: linux-media

Thank you.

If I am working on both the user side and the driver itself, why the
buffer must contain a full image? Is that a limitation of v4l2 m2m
framework?



On Wed, Mar 19, 2014 at 12:22 AM, Hans Verkuil <hverkuil@xs4all.nl> wrote:
> On 03/19/2014 12:18 AM, m silverstri wrote:
>> I am using v4l2 m2m framework to develop a resize driver. I have an
>> image , pass it to the driver and it generated a resize output image.
>>
>> My v4l2 sequence is
>> 1. qbuf OUTPUT, CAPTURE
>> 2. stream on OUTPUT, CAPTURE
>> 3. dqbuf OUTPUT, CAPTURE
>> 4. stream off OUTPUT, CAPTURE
>>
>> this works if i have a full frame of image before i start streaming.
>>
>> But what I only have partial buffers when I start streaming, how can I
>> qbuf more buffer after I 'stream on' OUTPUT,
>
> You can't. Each buffer passed to the driver must contain a full image.
> So your application needs some logic to keep filling a buffer until it
> is complete and only then do you issue the QBUF.
>
> Regards,
>
>         Hans
>
>>
>> I try this, but this fail
>> 1. qbuf OUTPUT, CAPTURE (I qbuf only partial OUTPUT)
>> 2. stream on OUTPUT, CAPTURE
>>
>> // do this in a loop:
>> 3. dqbuf OUTPUT (I want to queue more OUTPUT as they become available)
>> 4. qbuf OUTPUT
>>
>> // now I am done, I want to dqbuf my output
>> 5. dqbuf CAPTURE
>> 6. stream off OUTPUT, CAPTURE
>>
>> I try to do dqbuf/qbuf OUTPUT in step #3, #4 above, but it just stuck
>> in dqbuf OUTPUT.
>>
>> How can I queue more of my input data after I stream on?
>>
>> Thank you.
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-media" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>>
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-03-19 16:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-18 23:18 How can I feed more data to a stream after I stream on? m silverstri
2014-03-19  7:22 ` Hans Verkuil
2014-03-19 16:06   ` m silverstri

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).