Changeset 30735


Ignore:
Timestamp:
2012-02-27T05:27:28+01:00 (6 years ago)
Author:
swalker
Message:

[packages] libv4l: update to 0.8.6, add v4l-utils package

Location:
packages/libs/libv4l
Files:
2 added
2 edited

Legend:

Unmodified
Added
Removed
  • packages/libs/libv4l/Makefile

    r28749 r30735  
    1 #  
    2 # Copyright (C) 2009-2011 OpenWrt.org 
     1# 
     2# Copyright (C) 2009-2012 OpenWrt.org 
    33# Copyright (C) 2009 David Cooper <dave@kupesoft.com> 
    44# 
     
    99include $(TOPDIR)/rules.mk 
    1010 
    11 PKG_NAME:=libv4l 
    12 PKG_VERSION:=0.6.1 
     11PKG_NAME:=v4l-utils 
     12PKG_VERSION:=0.8.6 
    1313PKG_RELEASE:=1 
    1414 
    15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz 
    16 PKG_SOURCE_URL:=http://people.atrpms.net/~hdegoede/ 
    17 PKG_MD5SUM:=0d0d96d77c98871d2e5466c10cb30a0a 
     15PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 
     16PKG_SOURCE_URL:=http://www.linuxtv.org/downloads/v4l-utils 
     17PKG_MD5SUM:=80062780ae90e5955473b09b31e9828a 
     18 
     19PKG_BUILD_DEPENDS:=argp-standalone 
    1820 
    1921include $(INCLUDE_DIR)/package.mk 
    2022 
    21 # XXX: v4l1 support has been removed in 2.6.38 
    22 define Package/libv4l 
    23   SECTION:=libs 
    24   CATEGORY:=Libraries 
    25   TITLE:=Video 4 Linux wrapper libraries 
    26   URL:=http://people.atrpms.net/~hdegoede/ 
    27   DEPENDS:=+libpthread @(LINUX_2_6_30||LINUX_2_6_31||LINUX_2_6_32||LINUX_2_6_33||LINUX_2_6_34||LINUX_2_6_35||LINUX_2_6_36||LINUX_2_6_37) 
     23define Package/libv4l/Default 
     24  TITLE:=Video 4 Linux 
     25  URL:=http://www.linuxtv.org/ 
     26  DEPENDS:=+libpthread 
    2827endef 
    2928 
    30 define Package/libv4l/description 
     29define Package/libv4l/Default/description 
    3130  libv4l is a collection of libraries which adds a thin abstraction layer on 
    3231  top of video4linux2 devices. The purpose of this (thin) layer is to make it 
     
    4342endef 
    4443 
     44define Package/libv4l 
     45  $(call Package/libv4l/Default) 
     46  SECTION:=libs 
     47  CATEGORY:=Libraries 
     48  TITLE+= wrapper libraries 
     49endef 
     50 
     51define Package/libv4l/description 
     52  $(call Package/libv4l/Default/description) 
     53endef 
     54 
     55define Package/v4l-utils 
     56  $(call Package/libv4l/Default) 
     57  SECTION:=utils 
     58  CATEGORY:=Utilities 
     59  TITLE+= utilities 
     60  DEPENDS+= +librt +libv4l +uclibcxx 
     61endef 
     62 
     63define Package/v4l-utils/description 
     64  $(call Package/libv4l/Default/description) 
     65  This package contains the video4linux utilities. 
     66endef 
     67 
    4568TARGET_CFLAGS += $(FPIC) 
     69TARGET_CXX = $(STAGING_DIR)/host/bin/g++-uc 
    4670 
    4771define Build/Compile 
    4872        $(MAKE) -C $(PKG_BUILD_DIR) \ 
    4973                DESTDIR="$(PKG_INSTALL_DIR)" PREFIX="/usr" \ 
     74                DISABLE_LIBJPEG="1" \ 
    5075                $(CONFIGURE_VARS) \ 
    5176                all install 
    5277        $(MAKE) -C $(PKG_BUILD_DIR) \ 
    5378                DESTDIR="$(PKG_INSTALL_DIR)" PREFIX="/usr" \ 
     79                DISABLE_LIBJPEG="1" \ 
    5480                $(CONFIGURE_VARS) \ 
    5581                LINKTYPE="static" \ 
     
    5985define Build/InstallDev 
    6086        $(INSTALL_DIR) $(1)/usr/include 
    61         $(CP) $(PKG_INSTALL_DIR)/usr/include/libv4l{1,2,convert}.h $(1)/usr/include/ 
     87        $(CP) $(PKG_INSTALL_DIR)/usr/include/*.h $(1)/usr/include/ 
    6288        $(INSTALL_DIR) $(1)/usr/lib 
    6389        $(CP) $(PKG_INSTALL_DIR)/usr/lib/libv4l{1,2,convert}.{a,so*} $(1)/usr/lib/ 
     
    7096        $(CP) $(PKG_INSTALL_DIR)/usr/lib/libv4l{1,2,convert}.so.* $(1)/usr/lib/ 
    7197        $(INSTALL_DIR) $(1)/usr/lib/libv4l 
    72         $(CP) $(PKG_INSTALL_DIR)/usr/lib/libv4l/v4l{1compat,2convert}.so $(1)/usr/lib/libv4l 
     98        $(CP) $(PKG_INSTALL_DIR)/usr/lib/libv4l/v4l{1compat,2convert}.so $(1)/usr/lib/libv4l/ 
     99endef 
     100 
     101define Package/v4l-utils/install 
     102        $(INSTALL_DIR) $(1)/etc 
     103        $(CP) $(PKG_INSTALL_DIR)/etc/rc_maps.cfg $(1)/etc/ 
     104        $(CP) $(PKG_INSTALL_DIR)/etc/rc_keymaps $(1)/etc/ 
     105        $(INSTALL_DIR) $(1)/usr/bin 
     106        $(CP) $(PKG_INSTALL_DIR)/usr/bin/{cx18,ivtv}-ctl $(1)/usr/bin/ 
     107        $(CP) $(PKG_INSTALL_DIR)/usr/bin/decode_tm6000 $(1)/usr/bin/ 
     108        $(CP) $(PKG_INSTALL_DIR)/usr/bin/ir-keytable $(1)/usr/bin/ 
     109        $(CP) $(PKG_INSTALL_DIR)/usr/bin/v4l2-{compliance,ctl,sysfs-path} $(1)/usr/bin/ 
    73110endef 
    74111 
    75112$(eval $(call BuildPackage,libv4l)) 
    76  
     113$(eval $(call BuildPackage,v4l-utils)) 
  • packages/libs/libv4l/patches/001-no-shm_open-fix.patch

    r17921 r30735  
    1 --- a/libv4lconvert/control/libv4lcontrol.c 
    2 +++ b/libv4lconvert/control/libv4lcontrol.c 
    3 @@ -338,7 +338,7 @@ static void v4lcontrol_init_flags(struct 
     1--- a/lib/libv4lconvert/control/libv4lcontrol.c 
     2+++ b/lib/libv4lconvert/control/libv4lcontrol.c 
     3@@ -525,7 +525,7 @@ static void v4lcontrol_get_flags_from_db 
    44  
    55 struct v4lcontrol_data *v4lcontrol_create(int fd, int always_needs_conversion) 
    66 { 
    7 -  int shm_fd; 
    8 +  int shm_fd, fdflags; 
    9    int i, rc, init = 0; 
    10    char *s, shm_name[256], pwd_buf[1024]; 
    11    struct v4l2_capability cap; 
    12 @@ -392,25 +392,31 @@ struct v4lcontrol_data *v4lcontrol_creat 
    13    } 
     7-       int shm_fd; 
     8+       int shm_fd, fdflags; 
     9        int i, rc, got_usb_info, speed, init = 0; 
     10        char *s, shm_name[256], pwd_buf[1024]; 
     11        struct v4l2_capability cap; 
     12@@ -638,33 +638,38 @@ struct v4lcontrol_data *v4lcontrol_creat 
    1413  
    15    if (getpwuid_r(geteuid(), &pwd, pwd_buf, sizeof(pwd_buf), &pwd_p) == 0) { 
    16 -    snprintf(shm_name, 256, "/libv4l-%s:%s:%s", pwd.pw_name, 
    17 +    snprintf(shm_name, 256, "/dev/shm/libv4l-%s:%s:%s", pwd.pw_name, 
    18              cap.bus_info, cap.card); 
    19    } else { 
    20      perror("libv4lcontrol: error getting username using uid instead"); 
    21 -    snprintf(shm_name, 256, "/libv4l-%lu:%s:%s", (unsigned long)geteuid(), 
    22 +    snprintf(shm_name, 256, "/dev/shm/libv4l-%lu:%s:%s", (unsigned long)geteuid(), 
    23              cap.bus_info, cap.card); 
    24    } 
     14        if (getpwuid_r(geteuid(), &pwd, pwd_buf, sizeof(pwd_buf), &pwd_p) == 0) { 
     15                if (got_usb_info) 
     16-                       snprintf(shm_name, 256, "/libv4l-%s:%s:%04x:%04x:%s", pwd.pw_name, 
     17+                       snprintf(shm_name, 256, "/dev/shm/libv4l-%s:%s:%04x:%04x:%s", pwd.pw_name, 
     18                                        cap.bus_info, (int)vendor_id, (int)product_id, cap.card); 
     19                else 
     20-                       snprintf(shm_name, 256, "/libv4l-%s:%s:%s", pwd.pw_name, 
     21+                       snprintf(shm_name, 256, "/dev/shm/libv4l-%s:%s:%s", pwd.pw_name, 
     22                                        cap.bus_info, cap.card); 
     23        } else { 
     24                perror("libv4lcontrol: error getting username using uid instead"); 
     25                if (got_usb_info) 
     26-                       snprintf(shm_name, 256, "/libv4l-%lu:%s:%04x:%04x:%s", 
     27+                       snprintf(shm_name, 256, "/dev/shm/libv4l-%lu:%s:%04x:%04x:%s", 
     28                                        (unsigned long)geteuid(), cap.bus_info, 
     29                                        (int)vendor_id, (int)product_id, cap.card); 
     30                else 
     31-                       snprintf(shm_name, 256, "/libv4l-%lu:%s:%s", (unsigned long)geteuid(), 
     32+                       snprintf(shm_name, 256, "/dev/shm/libv4l-%lu:%s:%s", (unsigned long)geteuid(), 
     33                                        cap.bus_info, cap.card); 
     34        } 
    2535  
    26    /* / is not allowed inside shm names */ 
    27 -  for (i = 1; shm_name[i]; i++) 
    28 +  for (i = 9; shm_name[i]; i++) /* start after "/dev/shm", i = 9 */ 
    29      if (shm_name[i] == '/') 
    30        shm_name[i] = '-'; 
     36        /* / is not allowed inside shm names */ 
     37-       for (i = 1; shm_name[i]; i++) 
     38+       for (i = 9; shm_name[i]; i++) /* start after "/dev/shm", i = 9 */ 
     39                if (shm_name[i] == '/') 
     40                        shm_name[i] = '-'; 
    3141  
    32    /* Open the shared memory object identified by shm_name */ 
    33 -  if ((shm_fd = shm_open(shm_name, (O_CREAT | O_EXCL | O_RDWR), 
    34 +  if ((shm_fd = open(shm_name, (O_CREAT | O_EXCL | O_RDWR), 
    35                          (S_IREAD | S_IWRITE))) >= 0) 
    36      init = 1; 
    37    else 
    38 -    shm_fd = shm_open(shm_name, O_RDWR, (S_IREAD | S_IWRITE)); 
    39 +    shm_fd = open(shm_name, O_RDWR, (S_IREAD | S_IWRITE)); 
     42        /* Open the shared memory object identified by shm_name */ 
     43-       shm_fd = shm_open(shm_name, (O_CREAT | O_EXCL | O_RDWR), (S_IREAD | S_IWRITE)); 
     44+       shm_fd = open(shm_name, (O_CREAT | O_EXCL | O_RDWR), (S_IREAD | S_IWRITE)); 
     45        if (shm_fd >= 0) 
     46                init = 1; 
     47        else 
     48-               shm_fd = shm_open(shm_name, O_RDWR, (S_IREAD | S_IWRITE)); 
     49+               shm_fd = open(shm_name, O_RDWR, (S_IREAD | S_IWRITE)); 
    4050+ 
    41 +  /* This is all uClibc > 0.9.30 seems to do for shm_open() in librt/shm.c */ 
    42 +  fdflags = fcntl(shm_fd, F_GETFD, 0); 
    43  
    44 +  if (fdflags >= 0) 
    45 +    fdflags = fcntl(fd, F_SETFD, fdflags | FD_CLOEXEC); 
     51+       /* This is all uClibc > 0.9.30 seems to do for shm_open() in librt/shm.c */ 
     52+       fdflags = fcntl(shm_fd, F_GETFD, 0); 
     53+       if (fdflags >= 0) 
     54+               fdflags = fcntl(fd, F_SETFD, fdflags | FD_CLOEXEC); 
    4655  
    47    if (shm_fd >= 0) { 
    48      /* Set the shared memory size */ 
     56        if (shm_fd >= 0) { 
     57                /* Set the shared memory size */ 
Note: See TracChangeset for help on using the changeset viewer.