[v4l-utils/el6] Add missing media.h file
mchehab
mchehab at fedoraproject.org
Mon Nov 24 13:17:11 UTC 2014
commit 161ba07903bb9af38c96d3e84f015142c7d7a692
Author: Mauro Carvalho Chehab <mchehab at osg.samsung.com>
Date: Mon Nov 24 11:15:32 2014 -0200
Add missing media.h file
The media.h file found on RHEL6 is not enough to build the
media-ctl tools. So, keep it in sync with the updated Kernel's
one.
Signed-off-by: Mauro Carvalho Chehab <mchehab at osg.samsung.com>
0003-add-media-header.patch | 164 +++++++++++++++++++++++++++++++++++++++++++
v4l-utils.spec | 2 +
2 files changed, 166 insertions(+), 0 deletions(-)
---
diff --git a/0003-add-media-header.patch b/0003-add-media-header.patch
new file mode 100644
index 0000000..5ad7f17
--- /dev/null
+++ b/0003-add-media-header.patch
@@ -0,0 +1,164 @@
+commit 6d9ab872c7a936a3042b3872cf10560b6b2950e4
+Author: Mauro Carvalho Chehab <mchehab at osg.samsung.com>
+Date: Mon Nov 24 11:13:01 2014 -0200
+
+ sync-with-kernel: add include/linux/media.h
+
+ Without this, build breaks when compiling a package for RHEL6,
+ with uses an older media stack.
+
+ Signed-off-by: Mauro Carvalho Chehab <mchehab at osg.samsung.com>
+
+diff --git a/Makefile.am b/Makefile.am
+index 758d355..68c61a0 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -37,6 +37,7 @@ sync-with-kernel:
+ cp -a $(KERNEL_DIR)/usr/include/linux/v4l2-subdev.h $(top_srcdir)/include/linux
+ cp -a $(KERNEL_DIR)/usr/include/linux/v4l2-mediabus.h $(top_srcdir)/include/linux
+ cp -a $(KERNEL_DIR)/usr/include/linux/media-bus-format.h $(top_srcdir)/include/linux
++ cp -a $(KERNEL_DIR)/usr/include/linux/media.h $(top_srcdir)/include/linux
+ cp -a $(KERNEL_DIR)/usr/include/linux/ivtv.h $(top_srcdir)/include/linux
+ cp -a $(KERNEL_DIR)/usr/include/linux/dvb/frontend.h $(top_srcdir)/include/linux/dvb
+ cp -a $(KERNEL_DIR)/usr/include/linux/dvb/dmx.h $(top_srcdir)/include/linux/dvb
+diff --git a/include/linux/media.h b/include/linux/media.h
+new file mode 100644
+index 0000000..87a0e10
+--- /dev/null
++++ b/include/linux/media.h
+@@ -0,0 +1,135 @@
++/*
++ * Multimedia device API
++ *
++ * Copyright (C) 2010 Nokia Corporation
++ *
++ * Contacts: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
++ * Sakari Ailus <sakari.ailus at 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
++ */
++
++#ifndef __LINUX_MEDIA_H
++#define __LINUX_MEDIA_H
++
++#include <linux/ioctl.h>
++#include <linux/types.h>
++#include <linux/version.h>
++
++#define MEDIA_API_VERSION KERNEL_VERSION(0, 1, 0)
++
++struct media_device_info {
++ char driver[16];
++ char model[32];
++ char serial[40];
++ char bus_info[32];
++ __u32 media_version;
++ __u32 hw_revision;
++ __u32 driver_version;
++ __u32 reserved[31];
++};
++
++#define MEDIA_ENT_ID_FLAG_NEXT (1 << 31)
++
++#define MEDIA_ENT_TYPE_SHIFT 16
++#define MEDIA_ENT_TYPE_MASK 0x00ff0000
++#define MEDIA_ENT_SUBTYPE_MASK 0x0000ffff
++
++#define MEDIA_ENT_T_DEVNODE (1 << MEDIA_ENT_TYPE_SHIFT)
++#define MEDIA_ENT_T_DEVNODE_V4L (MEDIA_ENT_T_DEVNODE + 1)
++#define MEDIA_ENT_T_DEVNODE_FB (MEDIA_ENT_T_DEVNODE + 2)
++#define MEDIA_ENT_T_DEVNODE_ALSA (MEDIA_ENT_T_DEVNODE + 3)
++#define MEDIA_ENT_T_DEVNODE_DVB (MEDIA_ENT_T_DEVNODE + 4)
++
++#define MEDIA_ENT_T_V4L2_SUBDEV (2 << MEDIA_ENT_TYPE_SHIFT)
++#define MEDIA_ENT_T_V4L2_SUBDEV_SENSOR (MEDIA_ENT_T_V4L2_SUBDEV + 1)
++#define MEDIA_ENT_T_V4L2_SUBDEV_FLASH (MEDIA_ENT_T_V4L2_SUBDEV + 2)
++#define MEDIA_ENT_T_V4L2_SUBDEV_LENS (MEDIA_ENT_T_V4L2_SUBDEV + 3)
++/* A converter of analogue video to its digital representation. */
++#define MEDIA_ENT_T_V4L2_SUBDEV_DECODER (MEDIA_ENT_T_V4L2_SUBDEV + 4)
++
++#define MEDIA_ENT_FL_DEFAULT (1 << 0)
++
++struct media_entity_desc {
++ __u32 id;
++ char name[32];
++ __u32 type;
++ __u32 revision;
++ __u32 flags;
++ __u32 group_id;
++ __u16 pads;
++ __u16 links;
++
++ __u32 reserved[4];
++
++ union {
++ /* Node specifications */
++ struct {
++ __u32 major;
++ __u32 minor;
++ } v4l;
++ struct {
++ __u32 major;
++ __u32 minor;
++ } fb;
++ struct {
++ __u32 card;
++ __u32 device;
++ __u32 subdevice;
++ } alsa;
++ int dvb;
++
++ /* Sub-device specifications */
++ /* Nothing needed yet */
++ __u8 raw[184];
++ };
++};
++
++#define MEDIA_PAD_FL_SINK (1 << 0)
++#define MEDIA_PAD_FL_SOURCE (1 << 1)
++#define MEDIA_PAD_FL_MUST_CONNECT (1 << 2)
++
++struct media_pad_desc {
++ __u32 entity; /* entity ID */
++ __u16 index; /* pad index */
++ __u32 flags; /* pad flags */
++ __u32 reserved[2];
++};
++
++#define MEDIA_LNK_FL_ENABLED (1 << 0)
++#define MEDIA_LNK_FL_IMMUTABLE (1 << 1)
++#define MEDIA_LNK_FL_DYNAMIC (1 << 2)
++
++struct media_link_desc {
++ struct media_pad_desc source;
++ struct media_pad_desc sink;
++ __u32 flags;
++ __u32 reserved[2];
++};
++
++struct media_links_enum {
++ __u32 entity;
++ /* Should have enough room for pads elements */
++ struct media_pad_desc *pads;
++ /* Should have enough room for links elements */
++ struct media_link_desc *links;
++ __u32 reserved[4];
++};
++
++#define MEDIA_IOC_DEVICE_INFO _IOWR('|', 0x00, struct media_device_info)
++#define MEDIA_IOC_ENUM_ENTITIES _IOWR('|', 0x01, struct media_entity_desc)
++#define MEDIA_IOC_ENUM_LINKS _IOWR('|', 0x02, struct media_links_enum)
++#define MEDIA_IOC_SETUP_LINK _IOWR('|', 0x03, struct media_link_desc)
++
++#endif /* __LINUX_MEDIA_H */
diff --git a/v4l-utils.spec b/v4l-utils.spec
index 0c97dc1..33f49dc 100644
--- a/v4l-utils.spec
+++ b/v4l-utils.spec
@@ -9,6 +9,7 @@ URL: http://www.linuxtv.org/downloads/v4l-utils/
Source0: http://linuxtv.org/downloads/v4l-utils/v4l-utils-%{version}.tar.bz2
Patch1: 0001-media-headers-sync.patch
Patch2: 0002-use-etc-for-keymaps.patch
+Patch3: 0003-add-media-header.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: libjpeg-devel qt4-devel kernel-headers desktop-file-utils
BuildRequires: alsa-lib-devel doxygen
@@ -103,6 +104,7 @@ files for developing applications that use libdvbv5.
%setup -q
%patch1 -p1
%patch2 -p1
+%patch3 -p1
%build
More information about the scm-commits
mailing list