Commit 418a4940 authored by Nicolas Dufresne's avatar Nicolas Dufresne
Browse files

v4l2: Use a copy of videodev2.h header

With years the amount of ifdef have grown up and we are not even sure if the
old code path compiles. Each time we need to update the v4l2 framework to add
the new feature, we break compilation on older kernel. With exception of two
controls in the video orientation control, this patch get rid of all ifdef by
including the latest version of videodev2.h inside GStreamer.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=723446
parent 5d06735d
......@@ -498,73 +498,14 @@ AG_GST_CHECK_FEATURE(OSX_VIDEO, [OSX video], osxvideosink, [
]], [[return 0;]])],[HAVE_OSX_VIDEO="yes"],[HAVE_OSX_VIDEO="no"])
])
dnl *** Video 4 Linux 2 ***
dnl for information about the header/define, see sys/v4l2/gstv4l2element.h
dnl renamed to GST_V4L2 because of some conflict with kernel headers
translit(dnm, m, l) AM_CONDITIONAL(USE_GST_V4L2, true)
AG_GST_CHECK_FEATURE(GST_V4L2, [Video 4 Linux 2], v4l2src, [
AC_MSG_CHECKING([Checking for up to date v4l2 installation])
HAVE_V4L2_PLANE=no
AC_CHECK_TYPE(struct v4l2_plane,HAVE_V4L2_PLANE=yes,,[
#include <sys/types.h>
#ifdef __sun /* Solaris */
#include <sys/types.h>
#include <sys/videodev2.h>
#elif __FreeBSD__
#include <linux/videodev2.h>
#else /* Linux */
#include <linux/types.h>
#define _LINUX_TIME_H
#define __user
#include <linux/videodev2.h>
#endif
])
if [ test x$HAVE_V4L2_PLANE = xyes ]; then
HAVE_GST_V4L2="yes"
AC_MSG_RESULT(yes)
else
HAVE_GST_V4L2="no"
AC_MSG_RESULT(no)
HAVE_VIDEODEV=no
AC_CHECK_HEADER(linux/videodev2.h, [ HAVE_VIDEODEV=yes ],
[
AC_CHECK_HEADER(sys/videodev2.h, [ HAVE_VIDEODEV=yes ])
])
if test "x$HAVE_VIDEODEV" = "xyes"; then
AC_MSG_WARN([video4linux2 headers were found, but they're old.])
AC_MSG_WARN([Please update v4l2 to compile the v4l2 plugins])
else
AC_MSG_WARN([video4linux2 was not found])
fi
fi
if [ test x$HAVE_GST_V4L2 = xyes ]; then
dnl check for XOverlay libraries
AG_GST_CHECK_XV
fi
])
dnl check for XOverlay libraries
AG_GST_CHECK_XV
# Optional gudev for device probing
AC_ARG_WITH([gudev],
AS_HELP_STRING([--with-gudev],[device detection with gudev]),
[],
[with_gudev=check])
if test x$HAVE_GST_V4L2 = xyes; then
if test x$with_gudev != xno; then
PKG_CHECK_MODULES(GUDEV, [ gudev-1.0 >= 143 ],
[ have_gudev=yes
AC_DEFINE(HAVE_GUDEV, 1,
[Whether gudev is available for device detection])
AC_DEFINE([G_UDEV_API_IS_SUBJECT_TO_CHANGE], 1, [I know the API is subject to change.])
], [
have_gudev=no
])
else
have_gudev=no
fi
fi
AC_SUBST(GUDEV_CFLAGS)
AC_SUBST(GUDEV_LIBS)
......@@ -587,24 +528,6 @@ if test x$HAVE_GST_V4L2 = xyes; then
fi
fi
# Check if v4l2 support dmabuf
if test x$HAVE_GST_V4L2 = xyes; then
AC_CHECK_DECLS(V4L2_MEMORY_DMABUF,,,[
#include <sys/types.h>
#ifdef __sun /* Solaris */
#include <sys/types.h>
#include <sys/videodev2.h>
#elif __FreeBSD__
#include <linux/videodev2.h>
#else /* Linux */
#include <linux/types.h>
#define _LINUX_TIME_H
#define __user
#include <linux/videodev2.h>
#endif
])
fi
dnl Check for X11
translit(dnm, m, l) AM_CONDITIONAL(USE_X, true)
AG_GST_CHECK_FEATURE(X, [X libraries and plugins],
......@@ -1002,7 +925,6 @@ AM_CONDITIONAL(USE_DIRECTSOUND, false)
AM_CONDITIONAL(USE_DV1394, false)
AM_CONDITIONAL(USE_FLAC, false)
AM_CONDITIONAL(USE_GDK_PIXBUF, false)
AM_CONDITIONAL(USE_GST_V4L2, false)
AM_CONDITIONAL(USE_JACK, false)
AM_CONDITIONAL(USE_JPEG, false)
AM_CONDITIONAL(USE_LIBCACA, false)
......
......@@ -132,9 +132,7 @@ rm -rf $RPM_BUILD_ROOT
%{_libdir}/gstreamer-%{majorminor}/libgstvideofilter.so
%{_libdir}/gstreamer-%{majorminor}/libgstaudioparsers.so
%{_libdir}/gstreamer-%{majorminor}/libgstdtmf.so
# sys plugins
@USE_GST_V4L2_TRUE@%{_libdir}/gstreamer-%{majorminor}/libgstvideo4linux2.so
%{_libdir}/gstreamer-%{majorminor}/libgstvideo4linux2.so
# gstreamer-plugins with external dependencies but in the main package
@USE_LIBCACA_TRUE@%{_libdir}/gstreamer-%{majorminor}/libgstcacasink.so
......
......@@ -53,12 +53,6 @@ endif
# QCAM_DIR=
# endif
if USE_GST_V4L2
V4L2_DIR=v4l2
else
V4L2_DIR=
endif
# if USE_VCD
# VCD_DIR=vcd
# else
......@@ -83,7 +77,7 @@ else
XIMAGE_DIR=
endif
SUBDIRS=$(DIRECTSOUND_DIR) $(WAVEFORM_DIR) $(OSS_DIR) $(OSS4_DIR) $(OSX_AUDIO_DIR) $(OSX_VIDEO_DIR) $(SUNAUDIO_DIR) $(V4L2_DIR) $(XIMAGE_DIR)
SUBDIRS=$(DIRECTSOUND_DIR) $(WAVEFORM_DIR) $(OSS_DIR) $(OSS4_DIR) $(OSX_AUDIO_DIR) $(OSX_VIDEO_DIR) $(SUNAUDIO_DIR) $(XIMAGE_DIR)
DIST_SUBDIRS=directsound oss oss4 osxaudio osxvideo sunaudio v4l2 waveform ximage
......
/*
* include/linux/v4l2-common.h
*
* Common V4L2 and V4L2 subdev definitions.
*
* Users are advised to #include this file either through videodev2.h
* (V4L2) or through v4l2-subdev.h (V4L2 subdev) rather than to refer
* to this file directly.
*
* Copyright (C) 2012 Nokia Corporation
* Contact: Sakari Ailus <sakari.ailus@iki.fi>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA
*
*/
#ifndef __V4L2_COMMON__
#define __V4L2_COMMON__
/*
*
* Selection interface definitions
*
*/
/* Current cropping area */
#define V4L2_SEL_TGT_CROP 0x0000
/* Default cropping area */
#define V4L2_SEL_TGT_CROP_DEFAULT 0x0001
/* Cropping bounds */
#define V4L2_SEL_TGT_CROP_BOUNDS 0x0002
/* Current composing area */
#define V4L2_SEL_TGT_COMPOSE 0x0100
/* Default composing area */
#define V4L2_SEL_TGT_COMPOSE_DEFAULT 0x0101
/* Composing bounds */
#define V4L2_SEL_TGT_COMPOSE_BOUNDS 0x0102
/* Current composing area plus all padding pixels */
#define V4L2_SEL_TGT_COMPOSE_PADDED 0x0103
/* Backward compatibility target definitions --- to be removed. */
#define V4L2_SEL_TGT_CROP_ACTIVE V4L2_SEL_TGT_CROP
#define V4L2_SEL_TGT_COMPOSE_ACTIVE V4L2_SEL_TGT_COMPOSE
#define V4L2_SUBDEV_SEL_TGT_CROP_ACTUAL V4L2_SEL_TGT_CROP
#define V4L2_SUBDEV_SEL_TGT_COMPOSE_ACTUAL V4L2_SEL_TGT_COMPOSE
#define V4L2_SUBDEV_SEL_TGT_CROP_BOUNDS V4L2_SEL_TGT_CROP_BOUNDS
#define V4L2_SUBDEV_SEL_TGT_COMPOSE_BOUNDS V4L2_SEL_TGT_COMPOSE_BOUNDS
/* Selection flags */
#define V4L2_SEL_FLAG_GE (1 << 0)
#define V4L2_SEL_FLAG_LE (1 << 1)
#define V4L2_SEL_FLAG_KEEP_CONFIG (1 << 2)
/* Backward compatibility flag definitions --- to be removed. */
#define V4L2_SUBDEV_SEL_FLAG_SIZE_GE V4L2_SEL_FLAG_GE
#define V4L2_SUBDEV_SEL_FLAG_SIZE_LE V4L2_SEL_FLAG_LE
#define V4L2_SUBDEV_SEL_FLAG_KEEP_CONFIG V4L2_SEL_FLAG_KEEP_CONFIG
#endif /* __V4L2_COMMON__ */
This diff is collapsed.
This diff is collapsed.
......@@ -26,12 +26,10 @@
# include <config.h>
#endif
#if HAVE_DECL_V4L2_MEMORY_DMABUF
#ifndef _GNU_SOURCE
# define _GNU_SOURCE /* O_CLOEXEC */
#endif
#include <fcntl.h>
#endif
#include <sys/mman.h>
#include <string.h>
......@@ -48,14 +46,6 @@
#include "gst/gst-i18n-plugin.h"
#include <gst/glib-compat-private.h>
/* videodev2.h is not versioned and we can't easily check for the presence
* of enum values at compile time, but the V4L2_CAP_VIDEO_OUTPUT_OVERLAY define
* was added in the same commit as V4L2_FIELD_INTERLACED_{TB,BT} (b2787845) */
#ifndef V4L2_CAP_VIDEO_OUTPUT_OVERLAY
#define V4L2_FIELD_INTERLACED_TB 8
#define V4L2_FIELD_INTERLACED_BT 9
#endif
GST_DEBUG_CATEGORY_EXTERN (v4l2_debug);
#define GST_CAT_DEFAULT v4l2_debug
......@@ -167,7 +157,6 @@ gst_v4l2_buffer_pool_alloc_buffer (GstBufferPool * bpool, GstBuffer ** buffer,
case GST_V4L2_IO_MMAP:
case GST_V4L2_IO_DMABUF:
{
#ifdef VIDIOC_CREATE_BUFS
if (pool->num_allocated == pool->num_buffers) {
struct v4l2_create_buffers create_bufs;
......@@ -188,7 +177,7 @@ gst_v4l2_buffer_pool_alloc_buffer (GstBufferPool * bpool, GstBuffer ** buffer,
pool->buffers = g_renew (GstBuffer *, pool->buffers, pool->num_buffers);
pool->buffers[pool->num_buffers - 1] = NULL;
}
#endif
newbuf = gst_buffer_new ();
meta = GST_V4L2_META_ADD (newbuf);
......@@ -264,7 +253,7 @@ gst_v4l2_buffer_pool_alloc_buffer (GstBufferPool * bpool, GstBuffer ** buffer,
meta->vplanes[i].length, NULL, NULL));
}
}
#if HAVE_DECL_V4L2_MEMORY_DMABUF
if (obj->mode == GST_V4L2_IO_DMABUF) {
struct v4l2_exportbuffer expbuf;
......@@ -292,7 +281,7 @@ gst_v4l2_buffer_pool_alloc_buffer (GstBufferPool * bpool, GstBuffer ** buffer,
if (!V4L2_TYPE_IS_MULTIPLANAR (obj->type))
meta->vplanes[0].m.fd = meta->vbuffer.m.fd;
}
#endif
/* add metadata to raw video buffers */
if (pool->add_videometa && info->finfo) {
const GstVideoFormatInfo *finfo = info->finfo;
......@@ -365,7 +354,6 @@ gst_v4l2_buffer_pool_alloc_buffer (GstBufferPool * bpool, GstBuffer ** buffer,
return GST_FLOW_OK;
/* ERRORS */
#ifdef VIDIOC_CREATE_BUFS
g_fmt_failed:
{
gint errnosave = errno;
......@@ -382,7 +370,6 @@ create_bufs_failed:
errno = errnosave;
return GST_FLOW_ERROR;
}
#endif
querybuf_failed:
{
gint errnosave = errno;
......@@ -401,7 +388,6 @@ mmap_failed:
errno = errnosave;
return GST_FLOW_ERROR;
}
#if HAVE_DECL_V4L2_MEMORY_DMABUF
expbuf_failed:
{
gint errnosave = errno;
......@@ -411,7 +397,6 @@ expbuf_failed:
errno = errnosave;
return GST_FLOW_ERROR;
}
#endif
}
static gboolean
......@@ -895,11 +880,10 @@ gst_v4l2_buffer_pool_dqbuf (GstV4l2BufferPool * pool, GstBuffer ** buffer)
/* prepare the buffer */
memset (&vbuffer, 0x00, sizeof (vbuffer));
vbuffer.type = obj->type;
#if HAVE_DECL_V4L2_MEMORY_DMABUF
if (obj->mode == GST_V4L2_IO_DMABUF)
vbuffer.memory = V4L2_MEMORY_DMABUF;
else
#endif
vbuffer.memory = V4L2_MEMORY_MMAP;
/* prepare the planes of the buffer */
......@@ -1106,7 +1090,7 @@ gst_v4l2_buffer_pool_acquire_buffer (GstBufferPool * bpool, GstBuffer ** buffer,
/* start copying buffers when we are running low on buffers */
if (pool->num_queued < pool->copy_threshold) {
GstBuffer *copy;
#ifdef VIDIOC_CREATE_BUFS
if (pool->can_alloc) {
if (GST_BUFFER_POOL_CLASS (parent_class)->acquire_buffer (bpool,
&copy, params) == GST_FLOW_OK) {
......@@ -1116,7 +1100,6 @@ gst_v4l2_buffer_pool_acquire_buffer (GstBufferPool * bpool, GstBuffer ** buffer,
pool->can_alloc = FALSE;
}
}
#endif
/* copy the buffer */
copy = gst_buffer_copy_region (*buffer,
......
......@@ -47,33 +47,6 @@
#include <gst/video/video.h>
/* videodev2.h is not versioned and we can't easily check for the presence
* of enum values at compile time, but the V4L2_CAP_VIDEO_OUTPUT_OVERLAY define
* was added in the same commit as V4L2_FIELD_INTERLACED_{TB,BT} (b2787845) */
#ifndef V4L2_CAP_VIDEO_OUTPUT_OVERLAY
#define V4L2_FIELD_INTERLACED_TB 8
#define V4L2_FIELD_INTERLACED_BT 9
#endif
#ifndef V4L2_PIX_FMT_NV12M
#define V4L2_PIX_FMT_NV12M GST_MAKE_FOURCC ('N', 'M', '1', '2')
#endif
#ifndef V4L2_PIX_FMT_NV12MT
#define V4L2_PIX_FMT_NV12MT GST_MAKE_FOURCC ('T', 'M', '1', '2')
#endif
#ifndef V4L2_PIX_FMT_NV21M
#define V4L2_PIX_FMT_NV21M GST_MAKE_FOURCC ('N', 'M', '2', '1')
#endif
#ifndef V4L2_PIX_FMT_MPEG1
#define V4L2_PIX_FMT_MPEG1 GST_MAKE_FOURCC ('M', 'P', 'G', '1')
#endif
#ifndef V4L2_PIX_FMT_MPEG2
#define V4L2_PIX_FMT_MPEG2 GST_MAKE_FOURCC ('M', 'P', 'G', '2')
#endif
#ifndef V4L2_PIX_FMT_MPEG4
#define V4L2_PIX_FMT_MPEG4 GST_MAKE_FOURCC ('M', 'P', 'G', '4')
#endif
GST_DEBUG_CATEGORY_EXTERN (v4l2_debug);
GST_DEBUG_CATEGORY_EXTERN (GST_CAT_PERFORMANCE);
#define GST_CAT_DEFAULT v4l2_debug
......@@ -1022,48 +995,29 @@ static const GstV4L2FormatDesc gst_v4l2_formats[] = {
{V4L2_PIX_FMT_HI240, TRUE, GST_V4L2_RAW},
/* see http://www.siliconimaging.com/RGB%20Bayer.htm */
#ifdef V4L2_PIX_FMT_SBGGR8
{V4L2_PIX_FMT_SBGGR8, TRUE, GST_V4L2_CODEC},
#endif
/* compressed formats */
{V4L2_PIX_FMT_MJPEG, FALSE, GST_V4L2_CODEC},
{V4L2_PIX_FMT_JPEG, FALSE, GST_V4L2_CODEC},
#ifdef V4L2_PIX_FMT_PJPG
{V4L2_PIX_FMT_PJPG, FALSE, GST_V4L2_CODEC},
#endif
{V4L2_PIX_FMT_DV, FALSE, GST_V4L2_TRANSPORT},
{V4L2_PIX_FMT_MPEG, FALSE, GST_V4L2_TRANSPORT},
{V4L2_PIX_FMT_MPEG1, FALSE, GST_V4L2_CODEC},
{V4L2_PIX_FMT_MPEG2, FALSE, GST_V4L2_CODEC},
{V4L2_PIX_FMT_MPEG4, FALSE, GST_V4L2_CODEC},
#ifdef V4L2_PIX_FMT_H263
{V4L2_PIX_FMT_H263, FALSE, GST_V4L2_CODEC},
#endif
#ifdef V4L2_PIX_FMT_H264
{V4L2_PIX_FMT_H264, FALSE, GST_V4L2_CODEC},
#endif
#ifdef V4L2_PIX_FMT_VP8
/* VP8 not parseable */
{V4L2_PIX_FMT_VP8, FALSE, GST_V4L2_CODEC | GST_V4L2_NO_PARSE},
#endif
/* Vendor-specific formats */
{V4L2_PIX_FMT_WNVA, TRUE, GST_V4L2_CODEC},
#ifdef V4L2_PIX_FMT_SN9C10X
{V4L2_PIX_FMT_SN9C10X, TRUE, GST_V4L2_CODEC},
#endif
#ifdef V4L2_PIX_FMT_PWC1
{V4L2_PIX_FMT_PWC1, TRUE, GST_V4L2_CODEC},
#endif
#ifdef V4L2_PIX_FMT_PWC2
{V4L2_PIX_FMT_PWC2, TRUE, GST_V4L2_CODEC},
#endif
#ifdef V4L2_PIX_FMT_YVYU
{V4L2_PIX_FMT_YVYU, TRUE, GST_V4L2_RAW},
#endif
};
#define GST_V4L2_FORMAT_COUNT (G_N_ELEMENTS (gst_v4l2_formats))
......@@ -1086,16 +1040,10 @@ gst_v4l2_object_get_format_from_fourcc (GstV4l2Object * v4l2object,
return fmt;
/* special case for jpeg */
if (fmt->pixelformat == V4L2_PIX_FMT_MJPEG ||
fmt->pixelformat == V4L2_PIX_FMT_JPEG
#ifdef V4L2_PIX_FMT_PJPG
|| fmt->pixelformat == V4L2_PIX_FMT_PJPG
#endif
) {
if (fourcc == V4L2_PIX_FMT_JPEG || fourcc == V4L2_PIX_FMT_MJPEG
#ifdef V4L2_PIX_FMT_PJPG
|| fourcc == V4L2_PIX_FMT_PJPG
#endif
) {
fmt->pixelformat == V4L2_PIX_FMT_JPEG ||
fmt->pixelformat == V4L2_PIX_FMT_PJPG) {
if (fourcc == V4L2_PIX_FMT_JPEG || fourcc == V4L2_PIX_FMT_MJPEG ||
fourcc == V4L2_PIX_FMT_PJPG) {
return fmt;
}
}
......@@ -1121,13 +1069,6 @@ gst_v4l2_object_get_format_from_fourcc (GstV4l2Object * v4l2object,
#define GREY_BASE_RANK 5
#define PWC_BASE_RANK 1
/* This flag is already used by libv4l2 although
* it was added to the Linux kernel in 2.6.32
*/
#ifndef V4L2_FMT_FLAG_EMULATED
#define V4L2_FMT_FLAG_EMULATED 0x0002
#endif
static gint
gst_v4l2_object_format_get_rank (const struct v4l2_fmtdesc *fmt)
{
......@@ -1137,11 +1078,9 @@ gst_v4l2_object_format_get_rank (const struct v4l2_fmtdesc *fmt)
switch (fourcc) {
case V4L2_PIX_FMT_MJPEG:
#ifdef V4L2_PIX_FMT_PJPG
case V4L2_PIX_FMT_PJPG:
rank = JPEG_BASE_RANK;
break;
#endif
case V4L2_PIX_FMT_JPEG:
rank = JPEG_BASE_RANK + 1;
break;
......@@ -1217,28 +1156,20 @@ gst_v4l2_object_format_get_rank (const struct v4l2_fmtdesc *fmt)
rank = 0;
break;
#ifdef V4L2_PIX_FMT_SBGGR8
case V4L2_PIX_FMT_SBGGR8:
rank = BAYER_BASE_RANK;
break;
#endif
#ifdef V4L2_PIX_FMT_SN9C10X
case V4L2_PIX_FMT_SN9C10X:
rank = S910_BASE_RANK;
break;
#endif
#ifdef V4L2_PIX_FMT_PWC1
case V4L2_PIX_FMT_PWC1:
rank = PWC_BASE_RANK;
break;
#endif
#ifdef V4L2_PIX_FMT_PWC2
case V4L2_PIX_FMT_PWC2:
rank = PWC_BASE_RANK;
break;
#endif
default:
rank = 0;
......@@ -1445,11 +1376,9 @@ gst_v4l2_object_v4l2fourcc_to_video_format (guint32 fourcc)
case V4L2_PIX_FMT_YUV422P:
format = GST_VIDEO_FORMAT_Y42B;
break;
#ifdef V4L2_PIX_FMT_YVYU
case V4L2_PIX_FMT_YVYU:
format = GST_VIDEO_FORMAT_YVYU;
break;
#endif
default:
format = GST_VIDEO_FORMAT_UNKNOWN;
g_assert_not_reached ();
......@@ -1466,9 +1395,7 @@ gst_v4l2_object_v4l2fourcc_to_structure (guint32 fourcc)
switch (fourcc) {
case V4L2_PIX_FMT_MJPEG: /* Motion-JPEG */
#ifdef V4L2_PIX_FMT_PJPG
case V4L2_PIX_FMT_PJPG: /* Progressive-JPEG */
#endif
case V4L2_PIX_FMT_JPEG: /* JFIF JPEG */
structure = gst_structure_new_empty ("image/jpeg");
break;
......@@ -1489,24 +1416,18 @@ gst_v4l2_object_v4l2fourcc_to_structure (guint32 fourcc)
"mpegversion", G_TYPE_INT, 4, "systemstream",
G_TYPE_BOOLEAN, FALSE, NULL);
break;
#ifdef V4L2_PIX_FMT_H263
case V4L2_PIX_FMT_H263:
structure = gst_structure_new ("video/x-h263",
"variant", G_TYPE_STRING, "itu", NULL);
break;
#endif
#ifdef V4L2_PIX_FMT_H264
case V4L2_PIX_FMT_H264: /* H.264 */
structure = gst_structure_new ("video/x-h264",
"stream-format", G_TYPE_STRING, "byte-stream", "alignment",
G_TYPE_STRING, "au", NULL);
break;
#endif
#ifdef V4L2_PIX_FMT_VP8
case V4L2_PIX_FMT_VP8:
structure = gst_structure_new_empty ("video/x-vp8");
break;
#endif
case V4L2_PIX_FMT_RGB332:
case V4L2_PIX_FMT_RGB555X:
case V4L2_PIX_FMT_RGB565X:
......@@ -1534,9 +1455,7 @@ gst_v4l2_object_v4l2fourcc_to_structure (guint32 fourcc)
case V4L2_PIX_FMT_Y41P:
#endif
case V4L2_PIX_FMT_YUV422P:
#ifdef V4L2_PIX_FMT_YVYU
case V4L2_PIX_FMT_YVYU:
#endif
case V4L2_PIX_FMT_YUV411P:{
GstVideoFormat format;
format = gst_v4l2_object_v4l2fourcc_to_video_format (fourcc);
......@@ -1555,26 +1474,18 @@ gst_v4l2_object_v4l2fourcc_to_structure (guint32 fourcc)
break;
case V4L2_PIX_FMT_WNVA: /* Winnov hw compres */
break;
#ifdef V4L2_PIX_FMT_SBGGR8
case V4L2_PIX_FMT_SBGGR8:
structure = gst_structure_new_empty ("video/x-bayer");
break;
#endif
#ifdef V4L2_PIX_FMT_SN9C10X
case V4L2_PIX_FMT_SN9C10X:
structure = gst_structure_new_empty ("video/x-sonix");
break;
#endif
#ifdef V4L2_PIX_FMT_PWC1
case V4L2_PIX_FMT_PWC1:
structure = gst_structure_new_empty ("video/x-pwc1");
break;
#endif
#ifdef V4L2_PIX_FMT_PWC2
case V4L2_PIX_FMT_PWC2:
structure = gst_structure_new_empty ("video/x-pwc2");
break;
#endif
default:
GST_DEBUG ("Unknown fourcc 0x%08x %" GST_FOURCC_FORMAT,
fourcc, GST_FOURCC_ARGS (fourcc));
......@@ -1741,11 +1652,9 @@ gst_v4l2_object_get_caps_info (GstV4l2Object * v4l2object, GstCaps * caps,
gst_v4l2_object_choose_fourcc (v4l2object, V4L2_PIX_FMT_NV21,
V4L2_PIX_FMT_NV21M, &fourcc, &fourcc_alt);
break;
#ifdef V4L2_PIX_FMT_YVYU
case GST_VIDEO_FORMAT_YVYU:
fourcc = V4L2_PIX_FMT_YVYU;
break;
#endif
case GST_VIDEO_FORMAT_RGB15:
fourcc = V4L2_PIX_FMT_RGB555;
break;
......@@ -1795,35 +1704,21 @@ gst_v4l2_object_get_caps_info (GstV4l2Object * v4l2object, GstCaps * caps,
break;
}
}
#ifdef V4L2_PIX_FMT_H263
} else if (g_str_equal (mimetype, "video/x-h263")) {
fourcc = V4L2_PIX_FMT_H263;
#endif
#ifdef V4L2_PIX_FMT_H264
} else if (g_str_equal (mimetype, "video/x-h264")) {
fourcc = V4L2_PIX_FMT_H264;
#endif
#ifdef V4L2_PIX_FMT_VP8
} else if (g_str_equal (mimetype, "video/x-vp8")) {
fourcc = V4L2_PIX_FMT_VP8;
#endif
#ifdef V4L2_PIX_FMT_SBGGR8
} else if (g_str_equal (mimetype, "video/x-bayer")) {
fourcc = V4L2_PIX_FMT_SBGGR8;
#endif
#ifdef V4L2_PIX_FMT_SN9C10X
} else if (g_str_equal (mimetype, "video/x-sonix")) {
fourcc = V4L2_PIX_FMT_SN9C10X;
#endif
#ifdef V4L2_PIX_FMT_PWC1
} else if (g_str_equal (mimetype, "video/x-pwc1")) {
fourcc = V4L2_PIX_FMT_PWC1;
#endif
#ifdef V4L2_PIX_FMT_PWC2
} else if (g_str_equal (mimetype, "video/x-pwc2")) {
fourcc = V4L2_PIX_FMT_PWC2;
}
#endif
}
if (fourcc == 0)
......@@ -1907,7 +1802,6 @@ cropcap_failed:
/* The frame interval enumeration code first appeared in Linux 2.6.19. */
#ifdef VIDIOC_ENUM_FRAMEINTERVALS
static GstStructure *
gst_v4l2_object_probe_caps_for_format_and_size (GstV4l2Object * v4l2object,
guint32 pixelformat,
......@@ -2122,9 +2016,7 @@ unknown_type:
return NULL;
}
}
#endif /* defined VIDIOC_ENUM_FRAMEINTERVALS */
#ifdef VIDIOC_ENUM_FRAMESIZES
static gint
sort_by_frame_size (GstStructure * s1, GstStructure * s2)
{
......@@ -2138,7 +2030,6 @@ sort_by_frame_size (GstStructure * s1, GstStructure * s2)
/* I think it's safe to assume that this won't overflow for a while */