mirror of
https://github.com/X11Libre/xf86-video-v4l.git
synced 2026-04-14 11:14:32 +00:00
Compare commits
16 Commits
xf86-video
...
tracking/x
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a0eaca36a7 | ||
|
|
eb1e55874c | ||
|
|
36ffdb5239 | ||
|
|
7899231c65 | ||
|
|
10e0e12fcf | ||
|
|
07871d6be3 | ||
|
|
6367e7e46d | ||
|
|
1f9068a1c8 | ||
|
|
c5235058aa | ||
|
|
cb3970480f | ||
|
|
a375e88f89 | ||
|
|
3df0a355f9 | ||
|
|
b3244827d9 | ||
|
|
3370b6b6a4 | ||
|
|
a020fda02f | ||
|
|
3f9022bdfe |
98
.gitlab-ci.yml
Normal file
98
.gitlab-ci.yml
Normal file
@@ -0,0 +1,98 @@
|
||||
# vim: set expandtab shiftwidth=2 tabstop=8 textwidth=0 filetype=yaml:
|
||||
#
|
||||
# This CI uses the freedesktop.org ci-templates.
|
||||
# Please see the ci-templates documentation for details:
|
||||
# https://freedesktop.pages.freedesktop.org/ci-templates/
|
||||
|
||||
.templates_sha: &template_sha 25e8e9f020880aa35fffe3d6b259b933f0f9449f # see https://docs.gitlab.com/ee/ci/yaml/#includefile
|
||||
|
||||
|
||||
include:
|
||||
# Arch container builder template
|
||||
- project: 'freedesktop/ci-templates'
|
||||
ref: *template_sha
|
||||
file: '/templates/arch.yml'
|
||||
- project: 'freedesktop/ci-templates'
|
||||
ref: *template_sha
|
||||
file: '/templates/ci-fairy.yml'
|
||||
- template: Security/SAST.gitlab-ci.yml
|
||||
|
||||
|
||||
stages:
|
||||
- prep # prep work like rebuilding the container images if there is a change
|
||||
- build # for actually building and testing things in a container
|
||||
- test
|
||||
- deploy
|
||||
|
||||
|
||||
variables:
|
||||
FDO_UPSTREAM_REPO: 'xorg/driver/xf86-video-v4l'
|
||||
# The tag should be updated each time the list of packages is updated.
|
||||
# Changing a tag forces the associated image to be rebuilt.
|
||||
# Note: the tag has no meaning, we use a date format purely for readability
|
||||
FDO_DISTRIBUTION_TAG: '2023-10-01.0'
|
||||
FDO_DISTRIBUTION_PACKAGES: 'git gcc pkgconf autoconf automake libtool make xorg-util-macros xorgproto xorg-server-devel pixman'
|
||||
|
||||
|
||||
#
|
||||
# Verify that commit messages are as expected
|
||||
#
|
||||
check-commits:
|
||||
extends:
|
||||
- .fdo.ci-fairy
|
||||
stage: prep
|
||||
script:
|
||||
- ci-fairy check-commits --junit-xml=results.xml
|
||||
except:
|
||||
- master@xorg/driver/xf86-video-v4l
|
||||
variables:
|
||||
GIT_DEPTH: 100
|
||||
artifacts:
|
||||
reports:
|
||||
junit: results.xml
|
||||
|
||||
#
|
||||
# Verify that the merge request has the allow-collaboration checkbox ticked
|
||||
#
|
||||
check-merge-request:
|
||||
extends:
|
||||
- .fdo.ci-fairy
|
||||
stage: deploy
|
||||
script:
|
||||
- ci-fairy check-merge-request --require-allow-collaboration --junit-xml=results.xml
|
||||
artifacts:
|
||||
when: on_failure
|
||||
reports:
|
||||
junit: results.xml
|
||||
allow_failure: true
|
||||
|
||||
|
||||
#
|
||||
# Build a container with the given tag and the packages pre-installed.
|
||||
# This only happens if the tag changes, otherwise the existing image is
|
||||
# re-used.
|
||||
#
|
||||
container-prep:
|
||||
extends:
|
||||
- .fdo.container-build@arch
|
||||
stage: prep
|
||||
variables:
|
||||
GIT_STRATEGY: none
|
||||
|
||||
|
||||
#
|
||||
# The default build, runs on the image built above.
|
||||
#
|
||||
build:
|
||||
stage: build
|
||||
extends:
|
||||
- .fdo.distribution-image@arch
|
||||
script:
|
||||
- autoreconf -ivf
|
||||
- mkdir _builddir
|
||||
- pushd _builddir > /dev/null
|
||||
- ../configure --disable-silent-rules
|
||||
- make
|
||||
- make check
|
||||
- make distcheck
|
||||
- popd > /dev/null
|
||||
12
configure.ac
12
configure.ac
@@ -24,14 +24,14 @@
|
||||
AC_PREREQ([2.60])
|
||||
AC_INIT([xf86-video-v4l],
|
||||
[0.3.0],
|
||||
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
|
||||
[https://gitlab.freedesktop.org/xorg/driver/xf86-video-v4l/issues],
|
||||
[xf86-video-v4l])
|
||||
AC_CONFIG_SRCDIR([Makefile.am])
|
||||
AC_CONFIG_HEADERS([config.h])
|
||||
AC_CONFIG_AUX_DIR(.)
|
||||
|
||||
# Initialize Automake
|
||||
AM_INIT_AUTOMAKE([foreign dist-bzip2])
|
||||
AM_INIT_AUTOMAKE([foreign dist-xz])
|
||||
AM_MAINTAINER_MODE
|
||||
|
||||
# Require X.Org macros 1.8 or later for MAN_SUBSTS set by XORG_MANPAGE_SECTIONS
|
||||
@@ -41,8 +41,7 @@ XORG_MACROS_VERSION(1.8)
|
||||
XORG_DEFAULT_OPTIONS
|
||||
|
||||
# Initialize libtool
|
||||
AC_DISABLE_STATIC
|
||||
AC_PROG_LIBTOOL
|
||||
LT_INIT([disable-static])
|
||||
|
||||
AH_TOP([#include "xorg-server.h"])
|
||||
|
||||
@@ -60,7 +59,10 @@ XORG_DRIVER_CHECK_EXT(XV, videoproto)
|
||||
# Obtain compiler/linker options for the driver dependencies
|
||||
PKG_CHECK_MODULES(XORG, [xorg-server >= 1.0.99.901 xproto $REQUIRED_MODULES])
|
||||
|
||||
# Checks for libraries.
|
||||
# Checks for library functions
|
||||
# We don't use strlcat or strlcpy, but check to quiet a -Wredundant-decls warning
|
||||
# from xorg/os.h which will otherwise redefine it.
|
||||
AC_CHECK_FUNCS([strlcat strlcpy])
|
||||
|
||||
AC_SUBST([moduledir])
|
||||
|
||||
|
||||
29
man/v4l.man
29
man/v4l.man
@@ -1,7 +1,6 @@
|
||||
.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/v4l/v4l.man,v 1.2 2001/01/27 18:20:55 dawes Exp $
|
||||
.\" shorthand for double quote that works everywhere.
|
||||
.ds q \N'34'
|
||||
.TH V4L __drivermansuffix__ __vendorversion__
|
||||
.TH V4L 4 2009-01-09 __vendorversion__
|
||||
.SH NAME
|
||||
v4l \- video4linux driver
|
||||
.SH SYNOPSIS
|
||||
@@ -12,11 +11,15 @@ v4l \- video4linux driver
|
||||
.B EndSection
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
.B v4l
|
||||
is an __xservername__ driver for video4linux cards. It provides a Xvideo
|
||||
extension port for video overlay. Just add the driver to the module
|
||||
list within the module section of your __xconfigfile__ file if you want
|
||||
to use it. There are no config options.
|
||||
.B v4l
|
||||
is an
|
||||
.B Xorg
|
||||
driver for video4linux cards.
|
||||
It provides a Xvideo extension port for video overlay.
|
||||
Just add the driver to the module list within the module section of your
|
||||
.B xorg.conf
|
||||
file if you want to use it.
|
||||
There are no config options.
|
||||
.P
|
||||
Note that the extmod module is also required for the Xvideo
|
||||
support (and lots of other extensions too).
|
||||
@@ -30,10 +33,14 @@ overlay.
|
||||
bt848/bt878-based TV cards are the most popular hardware these
|
||||
days.
|
||||
.SH CONFIGURATION DETAILS
|
||||
Please refer to __xconfigfile__(__filemansuffix__) for general configuration
|
||||
details. This section only covers configuration details specific to this
|
||||
driver.
|
||||
Please refer to
|
||||
.BR xorg.conf (5)
|
||||
for general configuration details.
|
||||
This section only covers configuration details specific to this driver.
|
||||
.SH "SEE ALSO"
|
||||
__xservername__(__appmansuffix__), __xconfigfile__(__filemansuffix__), Xserver(__appmansuffix__), X(__miscmansuffix__)
|
||||
.BR Xorg (1),
|
||||
.BR Xserver (1),
|
||||
.BR xorg.conf (5),
|
||||
.BR X (7)
|
||||
.SH AUTHORS
|
||||
Authors include: Gerd Knorr <kraxel@bytesex.org>
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
# -avoid-version prevents gratuitous .0.0.0 version numbers on the end
|
||||
# _ladir passes a dummy rpath to libtool so the thing will actually link
|
||||
# TODO: -nostdlib/-Bstatic/-lgcc platform magic, not installing the .a, etc.
|
||||
AM_CFLAGS = @XORG_CFLAGS@
|
||||
AM_CFLAGS = $(BASE_CFLAGS) $(XORG_CFLAGS)
|
||||
v4l_drv_la_LTLIBRARIES = v4l_drv.la
|
||||
v4l_drv_la_LDFLAGS = -module -avoid-version
|
||||
v4l_drv_ladir = @moduledir@/drivers
|
||||
|
||||
48
src/v4l.c
48
src/v4l.c
@@ -10,6 +10,10 @@
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#ifndef _GNU_SOURCE
|
||||
#define _GNU_SOURCE
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <ctype.h>
|
||||
@@ -86,7 +90,6 @@ _X_EXPORT XF86ModuleData v4lModuleData = { &v4lVersRec, v4lSetup, NULL };
|
||||
static pointer
|
||||
v4lSetup(pointer module, pointer opts, int *errmaj, int *errmin)
|
||||
{
|
||||
const char *osname;
|
||||
static Bool setupDone = FALSE;
|
||||
|
||||
if (setupDone) {
|
||||
@@ -110,7 +113,7 @@ v4lSetup(pointer module, pointer opts, int *errmaj, int *errmin)
|
||||
#define VIDEO_OFF 0 /* really off */
|
||||
#define VIDEO_RGB 1 /* rgb overlay (directly to fb) */
|
||||
#define VIDEO_YUV 2 /* yuv overlay (to offscreen memory + hw scaling) */
|
||||
#define VIDEO_RECLIP 3 /* temporarly off, window clipping changes */
|
||||
#define VIDEO_RECLIP 3 /* temporarily off, window clipping changes */
|
||||
|
||||
typedef struct _XvV4LCtrlRec {
|
||||
struct v4l2_queryctrl qctrl;
|
||||
@@ -189,7 +192,7 @@ static const XF86AttributeRec FreqAttr =
|
||||
static struct V4L_DEVICE {
|
||||
int fd;
|
||||
int useCount;
|
||||
char devName[16];
|
||||
char devName[18];
|
||||
} v4l_devices[MAX_V4L_DEVICES] = {
|
||||
{ -1 },
|
||||
{ -1 },
|
||||
@@ -770,12 +773,15 @@ V4lSetPortAttribute(ScrnInfoPtr pScrn,
|
||||
} else if (attribute == xvFreq) {
|
||||
struct v4l2_frequency freq;
|
||||
memset(&freq, 0, sizeof(freq));
|
||||
ioctl(V4L_FD, VIDIOC_G_FREQUENCY, &freq);
|
||||
freq.frequency = value;
|
||||
if (ioctl(V4L_FD, VIDIOC_S_FREQUENCY, &freq) == -1)
|
||||
xf86Msg(X_ERROR, "v4l: Error %d while setting frequency\n", errno);
|
||||
else
|
||||
ret = Success;
|
||||
if (ioctl(V4L_FD, VIDIOC_G_FREQUENCY, &freq) == -1) {
|
||||
xf86Msg(X_ERROR, "v4l: Error %d while getting frequency\n", errno);
|
||||
} else {
|
||||
freq.frequency = value;
|
||||
if (ioctl(V4L_FD, VIDIOC_S_FREQUENCY, &freq) == -1)
|
||||
xf86Msg(X_ERROR, "v4l: Error %d while setting frequency\n", errno);
|
||||
else
|
||||
ret = Success;
|
||||
}
|
||||
} else {
|
||||
for (i = 0; i < pPPriv->n_qctrl; i++)
|
||||
if (pPPriv->XvV4LCtrl[i].xv == attribute)
|
||||
@@ -906,16 +912,20 @@ static int
|
||||
AddV4LEnc(XF86VideoEncodingPtr enc, int entry,
|
||||
char *norm, char *input, int width, int height, int n, int d)
|
||||
{
|
||||
enc->id = entry;
|
||||
enc->name = malloc(strlen(norm) + strlen(input) + 2);
|
||||
if (!enc->name)
|
||||
char *name;
|
||||
|
||||
if (asprintf(&name, "%s-%s", norm, fixname(input)) < 0)
|
||||
name = NULL;
|
||||
|
||||
if (name == NULL)
|
||||
return -1;
|
||||
|
||||
enc->id = entry;
|
||||
enc->name = name;
|
||||
enc->width = width;
|
||||
enc->height = height;
|
||||
enc->rate.numerator = n;
|
||||
enc->rate.denominator = d * 2; /* Refresh rate is twice, due to interlace */
|
||||
sprintf(enc->name,"%s-%s",norm,fixname(input));
|
||||
|
||||
xf86Msg(X_INFO, "v4l: adding input %s, %dx%d %d fps\n",
|
||||
enc->name, enc->width, enc->height, (d + n - 1)/n);
|
||||
@@ -1121,6 +1131,7 @@ V4LInit(ScrnInfoPtr pScrn, XF86VideoAdaptorPtr **adaptors)
|
||||
XF86VideoAdaptorPtr *VAR = NULL;
|
||||
char dev[18];
|
||||
int fd,i,j,d;
|
||||
void *tmp;
|
||||
|
||||
for (i = 0, d = 0; d < MAX_V4L_DEVICES; d++) {
|
||||
sprintf(dev, "/dev/video%d", d);
|
||||
@@ -1158,13 +1169,18 @@ V4LInit(ScrnInfoPtr pScrn, XF86VideoAdaptorPtr **adaptors)
|
||||
}
|
||||
|
||||
xf86Msg(X_INFO, "v4l: enabling overlay mode for %s.\n", dev);
|
||||
strncpy(V4L_NAME, dev, 16);
|
||||
strncpy(V4L_NAME, dev, 18);
|
||||
V4L_NAME[17] = '\0';
|
||||
V4LBuildEncodings(pPPriv, fd);
|
||||
if (NULL == pPPriv->enc)
|
||||
return FALSE;
|
||||
|
||||
/* alloc VideoAdaptorRec */
|
||||
VAR = realloc(VAR,sizeof(XF86VideoAdaptorPtr)*(i+1));
|
||||
tmp = realloc(VAR,sizeof(XF86VideoAdaptorPtr)*(i+1));
|
||||
if (!tmp)
|
||||
return FALSE;
|
||||
VAR = tmp;
|
||||
|
||||
VAR[i] = malloc(sizeof(XF86VideoAdaptorRec));
|
||||
if (!VAR[i])
|
||||
return FALSE;
|
||||
@@ -1186,7 +1202,7 @@ V4LInit(ScrnInfoPtr pScrn, XF86VideoAdaptorPtr **adaptors)
|
||||
|
||||
/* Initialize yuv_format */
|
||||
if (0 != pPPriv->yuv_format) {
|
||||
/* pass throuth scaler attributes */
|
||||
/* pass through scaler attributes */
|
||||
for (j = 0; j < pPPriv->myfmt->num_attributes; j++) {
|
||||
v4l_add_attr(&VAR[i]->pAttributes, &VAR[i]->nAttributes,
|
||||
pPPriv->myfmt->attributes+j);
|
||||
|
||||
@@ -511,7 +511,7 @@ struct v4l2_jpegcompression {
|
||||
__u32 jpeg_markers; /* Which markers should go into the JPEG
|
||||
* output. Unless you exactly know what
|
||||
* you do, leave them untouched.
|
||||
* Inluding less markers will make the
|
||||
* Including less markers will make the
|
||||
* resulting code smaller, but there will
|
||||
* be fewer applications which can read it.
|
||||
* The presence of the APP and COM marker
|
||||
@@ -523,7 +523,7 @@ struct v4l2_jpegcompression {
|
||||
#define V4L2_JPEG_MARKER_DRI (1<<5) /* Define Restart Interval */
|
||||
#define V4L2_JPEG_MARKER_COM (1<<6) /* Comment segment */
|
||||
#define V4L2_JPEG_MARKER_APP (1<<7) /* App segment, driver will
|
||||
* allways use APP0 */
|
||||
* always use APP0 */
|
||||
};
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user