From 353398b2161303052df7d9dc70a89dc7cffaf8fc Mon Sep 17 00:00:00 2001 From: Andrzej Hajda Date: Fri, 31 Aug 2012 11:38:58 +0200 Subject: Added detailed set format logging Signed-off-by: Andrzej Hajda --- v4l2-mfc-encoder/v4l_dev.c | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) (limited to 'v4l2-mfc-encoder') diff --git a/v4l2-mfc-encoder/v4l_dev.c b/v4l2-mfc-encoder/v4l_dev.c index 4aaa3ca..7a062f2 100644 --- a/v4l2-mfc-encoder/v4l_dev.c +++ b/v4l2-mfc-encoder/v4l_dev.c @@ -254,24 +254,41 @@ int v4l_deq_event(struct io_dev *dev) int v4l_copy_fmt(struct io_dev *src, enum io_dir sdir, struct io_dev *dst, enum io_dir ddir) { - struct v4l2_format fmt; + struct v4l2_format sfmt; + struct v4l2_format dfmt; int ret; - memzero(fmt); - fmt.type = io_dir_to_type(sdir); - ret = ioctl(src->fd, VIDIOC_G_FMT, &fmt); + memzero(sfmt); + sfmt.type = io_dir_to_type(sdir); + ret = ioctl(src->fd, VIDIOC_G_FMT, &sfmt); if (ret != 0) { err("Failed to get format"); return -1; } - fmt.type = io_dir_to_type(ddir); - ret = ioctl(dst->fd, VIDIOC_S_FMT, &fmt); + dfmt = sfmt; + dfmt.type = io_dir_to_type(ddir); + ret = ioctl(dst->fd, VIDIOC_S_FMT, &dfmt); if (ret != 0) { err("Failed to set format"); return -1; } + err("sfmt(type=%d,size=%dx%d,fmt=%.4s,npl=%d,sizes=%d,%d,bpls=%d,%d)", + sfmt.type, sfmt.fmt.pix_mp.width, sfmt.fmt.pix_mp.height, + (char *)&sfmt.fmt.pix_mp.pixelformat, sfmt.fmt.pix_mp.num_planes, + sfmt.fmt.pix_mp.plane_fmt[0].sizeimage, + sfmt.fmt.pix_mp.plane_fmt[1].sizeimage, + sfmt.fmt.pix_mp.plane_fmt[0].bytesperline, + sfmt.fmt.pix_mp.plane_fmt[1].bytesperline); + err("dfmt(type=%d,size=%dx%d,fmt=%.4s,npl=%d,sizes=%d,%d,bpls=%d,%d)", + dfmt.type, dfmt.fmt.pix_mp.width, dfmt.fmt.pix_mp.height, + (char *)&dfmt.fmt.pix_mp.pixelformat, dfmt.fmt.pix_mp.num_planes, + dfmt.fmt.pix_mp.plane_fmt[0].sizeimage, + dfmt.fmt.pix_mp.plane_fmt[1].sizeimage, + dfmt.fmt.pix_mp.plane_fmt[0].bytesperline, + dfmt.fmt.pix_mp.plane_fmt[1].bytesperline); + return 0; } -- cgit v1.2.3