Commit 32470dbd authored by Jakob Bornecrantz's avatar Jakob Bornecrantz

MEGA WIP

parent 1ed6ad3f
Pipeline #47873 failed with stages
in 45 seconds
......@@ -88,6 +88,8 @@ endif()
if(BUILD_WITH_JPEG)
add_definitions(-DXRT_HAVE_JPEG)
set(BUILD_DRIVER_V4L2 TRUE)
endif()
if(BUILD_WITH_LIBUVC)
......
......@@ -75,3 +75,17 @@ if(BUILD_DRIVER_PSVR)
PRIVATE ${HIDAPI_INCLUDE_DIRS}
)
endif()
if(BUILD_DRIVER_V4L2)
set(V4L2_SOURCE_FILES
v4l2/v4l2_driver.c
)
# Use OBJECT to not create a archive, since it just gets in the way.
add_library(drv_v4l2 OBJECT ${V4L2_SOURCE_FILES})
set_property(TARGET drv_v4l2 PROPERTY POSITION_INDEPENDENT_CODE ON)
target_include_directories(drv_v4l2 SYSTEM
PRIVATE ${HIDAPI_INCLUDE_DIRS}
)
endif()
This diff is collapsed.
// Copyright 2019, Collabora, Ltd.
// SPDX-License-Identifier: BSL-1.0
/*!
* @file
* @brief Header
* @author Pete Black <pblack@collabora.com>
* @author Jakob Bornecrantz <jakob@collabora.com>
* @ingroup drv_v4l2
*/
#pragma once
#include "xrt/xrt_frameserver.h"
#ifdef __cplusplus
extern "C" {
#endif
/*!
* @defgroup drv_v4l2 V4L2 frameserver driver
* @ingroup drv
*
* @brief Frameserver using the Video 4 Linux 2 framework.
*/
/*!
* Descriptor of a v4l2 source.
*
* @ingroup drv_v4l2
*/
struct v4l2_source_descriptor
{
char device_path[256]; // TODO: might not be enough
char name[128];
char model[128];
uint64_t source_id;
enum xrt_fs_frame_format format;
uint32_t stream_format;
enum xrt_fs_sampling sampling;
uint32_t width;
uint32_t height;
uint32_t rate;
uint8_t extended_format;
uint32_t crop_scanline_bytes_start; // byte offset - special case for
// ps4 camera
uint32_t crop_width; // pixels - special case for ps4 camera
};
/*!
* Create a v4l2 frameserver
*
* @ingroup drv_v4l2
*/
struct xrt_fs*
v4l2_fs_create();
#ifdef __cplusplus
}
#endif
......@@ -158,7 +158,7 @@ struct xrt_fs_capture_parameters
/*!
* Capture frameserver type.
*
* @TODO Depricate/Remove?
* @TODO Deprecate/Remove?
* @ingroup xrt_iface
*/
enum xrt_fs_type
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment