From: Benoit Parrot Date: Mon, 24 Jul 2017 19:23:06 +0000 (+0000) Subject: vpe: Remove unnecessary G_FMT call X-Git-Url: https://git.ti.com/gitweb?p=glsdk%2Fomapdrmtest.git;a=commitdiff_plain;h=037900a2fd1004dbb3841f58c4a4e9bbeefd76b2 vpe: Remove unnecessary G_FMT call Remove superfluous G_FMT call prior to calling S_FMT as it would force to manually zero out returned parameter value we don't need. Using S_FMT and specifying only what we need should yield acceptable default values for the part we don't care about. This is standard v4l2 behavior. Signed-off-by: Benoit Parrot --- diff --git a/capturevpedisplay.c b/capturevpedisplay.c index cadea10..576bf8f 100644 --- a/capturevpedisplay.c +++ b/capturevpedisplay.c @@ -88,11 +88,6 @@ int vip_set_format(int width, int height, int fourcc) memset(&fmt, 0, sizeof fmt); fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; - - ret = ioctl(vipfd, VIDIOC_G_FMT, &fmt); - if (ret < 0) - pexit( "vip: G_FMT failed: %s\n", strerror(errno)); - fmt.fmt.pix.width = width; fmt.fmt.pix.height = height; fmt.fmt.pix.pixelformat = fourcc; diff --git a/util/vpe-common.c b/util/vpe-common.c index cf6ec0d..b7806ba 100755 --- a/util/vpe-common.c +++ b/util/vpe-common.c @@ -298,11 +298,6 @@ int vpe_input_init(struct vpe *vpe) memset(&fmt, 0, sizeof fmt); fmt.type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE; - - ret = ioctl(vpe->fd, VIDIOC_G_FMT, &fmt); - if (ret < 0) - pexit( "vpe i/p: G_FMT_1 failed: %s\n", strerror(errno)); - fmt.fmt.pix_mp.width = vpe->src.width; fmt.fmt.pix_mp.height = vpe->src.height; fmt.fmt.pix_mp.pixelformat = vpe->src.fourcc; @@ -371,11 +366,6 @@ int vpe_output_init(struct vpe *vpe) memset(&fmt, 0, sizeof fmt); fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE; - - ret = ioctl(vpe->fd, VIDIOC_G_FMT, &fmt); - if (ret < 0) - pexit( "vpe o/p: G_FMT_1 failed: %s\n", strerror(errno)); - fmt.fmt.pix_mp.width = vpe->dst.width; fmt.fmt.pix_mp.height = vpe->dst.height; fmt.fmt.pix_mp.pixelformat = vpe->dst.fourcc;