]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - glsdk/omapdrmtest.git/commitdiff
capturevpedisplay: Request interlaced capture and pass field ids
authorNikhil Devshatwar <nikhil.nd@ti.com>
Wed, 5 Nov 2014 09:30:48 +0000 (15:00 +0530)
committerNikhil Devshatwar <nikhil.nd@ti.com>
Fri, 14 Nov 2014 11:33:11 +0000 (17:03 +0530)
Currently the VIP S_FMT ioctl does not specify the field type of
the capture. Request for alternate field type.
Also, the field type of captured buffer is returned by the driver.
Pass this field type when queuing buffers for the VPE source.

Signed-off-by: Nikhil Devshatwar <nikhil.nd@ti.com>
capturevpedisplay.c
util/vpe-common.c

index 15a308887b874ac963046d5090a52b9833e06c43..0b86d3b19923268769e671e5c18ae2adbc7aac1d 100644 (file)
@@ -96,6 +96,7 @@ int vip_set_format(int width, int height, int fourcc)
        fmt.fmt.pix.width = width;
        fmt.fmt.pix.height = height;
        fmt.fmt.pix.pixelformat = fourcc;
+       fmt.fmt.pix.field = V4L2_FIELD_ALTERNATE;
 
        ret = ioctl(vipfd, VIDIOC_S_FMT, &fmt);
        if (ret < 0)
@@ -203,7 +204,7 @@ int vip_qbuf(struct vpe *vpe, int index)
  * @return: buf.index int 
  *****************************************************************************
 */
-int vip_dqbuf()
+int vip_dqbuf(struct vpe * vpe)
 {
        int ret;
        struct v4l2_buffer buf;
@@ -218,7 +219,9 @@ int vip_dqbuf()
        if (ret < 0)
                pexit("vip: DQBUF failed: %s\n", strerror(errno));
 
-       dprintf("vip: DQBUF index = %d\n", buf.index);
+       dprintf("vip: DQBUF idx = %d, field = %s\n", buf.index,
+               buf.field == V4L2_FIELD_TOP? "Top" : "Bottom");
+       vpe->field = buf.field;
 
        return buf.index;
 }
@@ -299,7 +302,7 @@ int main(int argc, char *argv[])
        vpe->field = V4L2_FIELD_ANY;
        while (1)
        {
-               index = vip_dqbuf();
+               index = vip_dqbuf(vpe);
 
                vpe_input_qbuf(vpe, index);
 
@@ -308,7 +311,7 @@ int main(int argc, char *argv[])
                        for (i = 1; i <= NUMBUF; i++) {
                                /** To star deinterlace, minimum 3 frames needed */
                                if (vpe->deint && count != 3) {
-                                       index = vip_dqbuf();
+                                       index = vip_dqbuf(vpe);
                                        vpe_input_qbuf(vpe, index);
                                } else {
                                        stream_ON(vpe->fd, V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE);
index c3f6e4eb48ebee09f9c58fed670f17c6e93cb15a..576addf194bf579ad5815efb47b7adea5db32db3 100755 (executable)
@@ -474,7 +474,8 @@ int vpe_input_qbuf(struct vpe *vpe, int index)
        struct v4l2_buffer buf;
        struct v4l2_plane planes[2];
 
-       dprintf("vpe input buffer queue\n");
+       dprintf("vpe: src QBUF (%d):%s field", vpe->field,
+               vpe->field==V4L2_FIELD_TOP?"top":"bottom");
 
        memset(&buf, 0, sizeof buf);
        memset(&planes, 0, sizeof planes);