This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

dm355 IPIPE previewer single mode

Hi, i try convert image from raw bayer ( from mt9p011 ccd sensor) to YcbCr using dm355 previewer (DVSKDK 3_10) .

My programm ( schematicaly ):

int XS = 640;
int YS = 480;
open( "/dev/davinci_previewer", O_RDWR);
int user_mode = IMP_MODE_SINGLE_SHOT;
ioctl(preview_fd, PREV_S_OPER_MODE, &user_mode) < 0 )
prev_chan_config.config = NULL; /* to set defaults in driver */
ioctl( preview_fd, PREV_S_CONFIG, &prev_chan_config )
fd = open ("/dev/video0" O_RDWR | O_NONBLOCK, 0);
ioctl( fd, VIDIOC_S_INPUT
ioctl (fd, VIDIOC_S_FMT
ioctl (fd, VIDIOC_REQBUFS
for (idx = 0; idx < 3
  ioctl (fd, VIDIOC_QUERYBUF,&buf)
  mmap (NULL, buf.length,PROT_READ | PROT_WRITE,MAP_SHARED, fd, buf.m.offset);
  // buf.m.offset for idx=0: 00000000h, idx=1:00096000h, idx=2: 0012c000h

struct imp_reqbufs param_req;
param_req.buf_type = IMP_BUF_OUT1;
param_req.size = XS * YS * 2 ;
param_req.count = 1;
ioctl(preview_fd, PREV_REQBUF, &param_req)
struct imp_buffer t_buff;
t_buff.index = i ;
t_buff.buf_type = IMP_BUF_OUT1;
ioctl(preview_fd, PREV_QUERYBUF, &t_buff)
pr_adrr = mmap( NULL, t_buff.size, PROT_READ|PROT_WRITE, MAP_SHARED, preview_fd, t_buff.offset);
static struct imp_convert convert;
convert.out_buff1 = t_buff;

ioctl (fd, VIDIOC_S_FMT
ioctl (fd, VIDIOC_STREAMON
select()
ioctl (fd, VIDIOC_DQBUF, &buf)
convert.in_buff.index = -1;
convert.in_buff.buf_type = IMP_BUF_IN;
convert.in_buff.offset = buf.m.offset; //00000000h
convert.in_buff.size = buf.length; //614400

ioctl(preview_fd, PREV_PREVIEW, &convert)

and here (on PREV_PREVIEW), i get "Operation not permitted",
dmesg log:
davinci_previewer davinci_previewer.2: Start of previewer ioctl
davinci_previewer davinci_previewer.2: PREV_PREVIEW:
davinci_previewer davinci_previewer.2: in_buff buf size or offset invalid
davinci_previewer davinci_previewer.2: End of previewer ioctl

buf.m.offset which i'm received in VIDIOC_DQBUF realy 0, and it 0 in VIDIOC_QUERYBUF for buf index 0, and i'm confused.

Questions:
Can I set convert.in_buff to buffer from VIDIOC_QUERYBUF?
What must be filled convert.in_buff.offset?
I'm set t_buff.buf_type = IMP_BUF_OUT1 on PREV_REQBUF, but want use previewer,not resizer - it's right?