aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomi Valkeinen2017-10-02 03:55:52 -0500
committerTomi Valkeinen2017-10-03 04:33:14 -0500
commit2d26d172c477c2ea22c4603c6f6c5ba5027f8c80 (patch)
tree9759eed7a64c62c4e2bfb78dcc0711c5021e6b61
parentfab9bb700372008130e5026fa9fe5fd22ac6ec4e (diff)
downloadexternal-libkmsxx-2d26d172c477c2ea22c4603c6f6c5ba5027f8c80.tar.gz
external-libkmsxx-2d26d172c477c2ea22c4603c6f6c5ba5027f8c80.tar.xz
external-libkmsxx-2d26d172c477c2ea22c4603c6f6c5ba5027f8c80.zip
kmscapture: fix v4l buftype
-rw-r--r--utils/kmscapture.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/utils/kmscapture.cpp b/utils/kmscapture.cpp
index 43ef989..c72d38c 100644
--- a/utils/kmscapture.cpp
+++ b/utils/kmscapture.cpp
@@ -76,19 +76,15 @@ ExtFramebuffer* CameraPipeline::GetExtFrameBuffer(Card& card, uint32_t i, PixelF
76 r = buffer_export(m_fd, V4L2_BUF_TYPE_VIDEO_CAPTURE, i, &dmafd); 76 r = buffer_export(m_fd, V4L2_BUF_TYPE_VIDEO_CAPTURE, i, &dmafd);
77 ASSERT(r == 0); 77 ASSERT(r == 0);
78 78
79 uint32_t handle;
80 r = drmPrimeFDToHandle(card.fd(), dmafd, &handle);
81 ASSERT(r == 0);
82
83 const PixelFormatInfo& format_info = get_pixel_format_info(pixfmt); 79 const PixelFormatInfo& format_info = get_pixel_format_info(pixfmt);
84 ASSERT(format_info.num_planes == 1); 80 ASSERT(format_info.num_planes == 1);
85 81
86 vector<uint32_t> handles { handle }; 82 vector<int> fds { dmafd };
87 vector<uint32_t> pitches { m_in_width * (format_info.planes[0].bitspp / 8) }; 83 vector<uint32_t> pitches { m_in_width * (format_info.planes[0].bitspp / 8) };
88 vector<uint32_t> offsets { }; 84 vector<uint32_t> offsets { 0 };
89 85
90 return new ExtFramebuffer(card, m_in_width, m_in_height, pixfmt, 86 return new ExtFramebuffer(card, m_in_width, m_in_height, pixfmt,
91 handles, pitches, offsets); 87 fds, pitches, offsets);
92} 88}
93 89
94bool inline better_size(struct v4l2_frmsize_discrete* v4ldisc, 90bool inline better_size(struct v4l2_frmsize_discrete* v4ldisc,