All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kamil Debski <k.debski@samsung.com>
To: 'randy' <lxr1234@hotmail.com>, linux-media@vger.kernel.org
Subject: RE: using MFC memory to memery encoder, start stream and queue order problem
Date: Wed, 08 Jan 2014 15:42:26 +0100	[thread overview]
Message-ID: <04b601cf0c7f$d9e531d0$8daf9570$%debski@samsung.com> (raw)
In-Reply-To: <BLU0-SMTP150C8C0DB0E9A3A9F4104F8ADCA0@phx.gbl>

Hi Randy,

> From: randy [mailto:lxr1234@hotmail.com]
> Sent: Friday, January 03, 2014 4:17 PM
> 
> I rewrite my program, it takes the order as below 1.request buffer.
> 2.mmap input buffer with OUTPUT
> 3.output buffer with CAPTURE.
> 4.filled input buffer with the first frame.
> 5.enqueue the first frame in the input buffer in OUTPUT side 6.enqueue
> the output buffer in CAPTURE side 7.start stream 8.dequeue CAPTURE
> buffer and make output buffer pointer to data of it.
> 9.get output data from output buffer
> /* the buffer get size is 22 below */
> 10.dequeue OUTPUT
> /* timed out, it will never end */
> Is there any problem with the order? I don't do any thing
> simultaneously below, it seems to difficult to me to understand and not
> easy to debug.
> I am not sure whether the mmap is correct, but I think it it as I don't
> get segment fault.

Please have a look at the V4L2_CID_MPEG_VIDEO_HEADER_MODE control.
>From your description it seems that it is in its default state - 
V4L2_MPEG_VIDEO_HEADER_MODE_SEPARATE. This means that the header for a
newly encoded stream is returned after init. Then in another buffer you will
find the encoded picture.

So after point 9 please enqueue the CAPTURE buffer again and see what
happens. I think that you should get the first frame encoded.

You can also try to set the V4L2_CID_MPEG_VIDEO_HEADER_MODE control to
V4L2_MPEG_VIDEO_HEADER_MODE_JOINED_WITH_1ST_FRAME and see if it works.
(instead of enqueueing the CAPTURE buffer again after receiving the header).

In addition I would recommend you to use more than one buffer per queue.
 
> 
> And the thing in the next is like this I think 11.filled input buffer
> with the next frame 12.enqueue the next frame in the input buffer in
> OUTPUT side 13.dequeue CAPTURE buffer and make output buffer pointer to
> data of it.
> 14.dequeue OUTPUT
> goto 11
> Is it correct
> 
> I doubt the REAME
> 5. Request CAPTURE and OUTPUT buffers. Due to hardware limitations of
> MFC on
>    some platforms it is recommended to use V4L2_MEMORY_MMAP buffers.
> 6. Enqueue CAPTURE buffers.
> 7. Enqueue OUTPUT buffer with first frame.
> 8. Start streaming (VIDIOC_STREAMON) on both ends.
> 9. Simultaneously:
> I don't need to dequeue the OUTPUT buffer which is with first frame?
>    - enqueue buffers with next frames,
>    - dequeue used OUTPUT buffers (blocking operation),
>    - dequeue buffers with encoded stream (blocking operation),
>    - enqueue free CAPTURE buffers.
> 
> 
> 							Thank you.

Best wishes,
Kamil


  reply	other threads:[~2014-01-08 14:42 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-02 11:35 using MFC memory to memery encoder, start stream and queue order problem randy
2014-01-02 12:29 ` Kamil Debski
     [not found]   ` <BLU0-SMTP266BE9BC66B254061740251ADCB0@phx.gbl>
     [not found]     ` <02c801cf07ba$8518f2f0$8f4ad8d0$%debski@samsung.com>
2014-01-02 14:03       ` randy
2014-01-03  8:15       ` randy
2014-01-03  8:15       ` randy
2014-01-03 15:16       ` randy
2014-01-08 14:42         ` Kamil Debski [this message]
2014-01-08 15:44           ` randy
     [not found]           ` <52CD725E.5060903@hotmail.com>
2014-01-10  9:15             ` randy
2014-01-10 11:13               ` Andrzej Hajda
2014-01-10 15:23                 ` randy
2014-01-13 10:15                   ` Andrzej Hajda
2014-01-13 11:18                     ` Andrzej Hajda
2014-01-13 15:44                       ` randy
2014-01-13 16:18                         ` Kamil Debski
2014-01-14  5:17                           ` randy
2014-01-14 10:29                             ` Andrzej Hajda
2014-01-14 16:50                               ` randy
2014-01-15  7:08                                 ` Andrzej Hajda
2014-01-15 15:50                                   ` randy
2014-01-16 12:37                                     ` Andrzej Hajda
2014-01-16 19:30                                       ` randy
2014-01-16 20:10                                       ` randy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='04b601cf0c7f$d9e531d0$8daf9570$%debski@samsung.com' \
    --to=k.debski@samsung.com \
    --cc=linux-media@vger.kernel.org \
    --cc=lxr1234@hotmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.