diff options
Diffstat (limited to 'tests/kmscapture.cpp')
-rw-r--r-- | tests/kmscapture.cpp | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/tests/kmscapture.cpp b/tests/kmscapture.cpp index bf2b613..8bd1fa9 100644 --- a/tests/kmscapture.cpp +++ b/tests/kmscapture.cpp @@ -28,7 +28,7 @@ class Camera public: Camera(int camera_id, Card& card, Plane* plane, uint32_t x, uint32_t y, uint32_t iw, uint32_t ih, PixelFormat pixfmt, - BufferProvider buffer_type); + BufferProvider buffer_provider); ~Camera(); Camera(const Camera& other) = delete; @@ -40,7 +40,7 @@ private: ExtFramebuffer* GetExtFrameBuffer(Card& card, int i, PixelFormat pixfmt); int m_fd; /* camera file descriptor */ Plane* m_plane; - BufferProvider m_buffer_type; + BufferProvider m_buffer_provider; vector<DumbFramebuffer*> m_fb; /* framebuffers for DRM buffers */ vector<ExtFramebuffer*> m_extfb; /* framebuffers for V4L2 buffers */ int m_prev_fb_index; @@ -102,7 +102,7 @@ bool inline better_size(struct v4l2_frmsize_discrete* v4ldisc, Camera::Camera(int camera_id, Card& card, Plane* plane, uint32_t x, uint32_t y, uint32_t iw, uint32_t ih, PixelFormat pixfmt, - BufferProvider buffer_type) + BufferProvider buffer_provider) { char dev_name[20]; int r, i; @@ -110,8 +110,8 @@ Camera::Camera(int camera_id, Card& card, Plane* plane, uint32_t x, uint32_t y, uint32_t best_h = 240; uint32_t v4l_mem; - m_buffer_type = buffer_type; - if (m_buffer_type == BufferProvider::V4L2) + m_buffer_provider = buffer_provider; + if (m_buffer_provider == BufferProvider::V4L2) v4l_mem = V4L2_MEMORY_MMAP; else v4l_mem = V4L2_MEMORY_DMABUF; @@ -170,19 +170,19 @@ Camera::Camera(int camera_id, Card& card, Plane* plane, uint32_t x, uint32_t y, DumbFramebuffer *fb = NULL; ExtFramebuffer *extfb = NULL; - if (m_buffer_type == BufferProvider::V4L2) + if (m_buffer_provider == BufferProvider::V4L2) extfb = GetExtFrameBuffer(card, i, pixfmt); else fb = new DumbFramebuffer(card, m_in_width, m_in_height, pixfmt); v4lbuf.index = i; - if (m_buffer_type == BufferProvider::DRM) + if (m_buffer_provider == BufferProvider::DRM) v4lbuf.m.fd = fb->prime_fd(0); r = ioctl(m_fd, VIDIOC_QBUF, &v4lbuf); ASSERT(r == 0); - if (m_buffer_type == BufferProvider::V4L2) + if (m_buffer_provider == BufferProvider::V4L2) m_extfb.push_back(extfb); else m_fb.push_back(fb); @@ -214,7 +214,7 @@ void Camera::show_next_frame(Crtc* crtc) int fb_index; uint32_t v4l_mem; - if (m_buffer_type == BufferProvider::V4L2) + if (m_buffer_provider == BufferProvider::V4L2) v4l_mem = V4L2_MEMORY_MMAP; else v4l_mem = V4L2_MEMORY_DMABUF; @@ -229,7 +229,7 @@ void Camera::show_next_frame(Crtc* crtc) } fb_index = v4l2buf.index; - if (m_buffer_type == BufferProvider::V4L2) + if (m_buffer_provider == BufferProvider::V4L2) r = crtc->set_plane(m_plane, *m_extfb[fb_index], m_out_x, m_out_y, m_out_width, m_out_height, 0, 0, m_in_width, m_in_height); @@ -245,7 +245,7 @@ void Camera::show_next_frame(Crtc* crtc) v4l2buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; v4l2buf.memory = v4l_mem; v4l2buf.index = m_prev_fb_index; - if (m_buffer_type == BufferProvider::DRM) + if (m_buffer_provider == BufferProvider::DRM) v4l2buf.m.fd = m_fb[m_prev_fb_index]->prime_fd(0); r = ioctl(m_fd, VIDIOC_QBUF, &v4l2buf); ASSERT(r == 0); @@ -298,7 +298,7 @@ static const char* usage_str = int main(int argc, char** argv) { uint32_t w; - BufferProvider buffer_type = BufferProvider::DRM; + BufferProvider buffer_provider = BufferProvider::DRM; int i; auto camera_idx = count_cameras(); @@ -314,7 +314,7 @@ int main(int argc, char** argv) Option("|buffer-type=", [&](string s) { if (!s.compare("v4l")) - buffer_type = BufferProvider::V4L2; + buffer_provider = BufferProvider::V4L2; else if (s.compare("drm")) printf("invalid buffer-type: %s\n", s.c_str()); }), @@ -340,7 +340,7 @@ int main(int argc, char** argv) auto crtc = conn->get_current_crtc(); printf("Display: %dx%d\n", crtc->width(), crtc->height()); printf("Buffer provider: %s\n", - buffer_type == BufferProvider::V4L2? "V4L" : "DRM"); + buffer_provider == BufferProvider::V4L2? "V4L" : "DRM"); w = crtc->width() / nr_cameras; vector<Camera*> cameras; @@ -353,7 +353,7 @@ int main(int argc, char** argv) continue; auto cam = new Camera(camera_idx[i], card, p, i * w, 0, - w, crtc->height(), pixfmt, buffer_type); + w, crtc->height(), pixfmt, buffer_provider); cameras.push_back(cam); if (++i == nr_cameras) break; |