Hello community,

here is the log from the commit of package vdr for openSUSE:Factory checked in 
at 2012-11-28 17:08:18
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/vdr (Old)
 and      /work/SRC/openSUSE:Factory/.vdr.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "vdr", Maintainer is "[email protected]"

Changes:
--------
--- /work/SRC/openSUSE:Factory/vdr/vdr.changes  2012-06-26 20:04:14.000000000 
+0200
+++ /work/SRC/openSUSE:Factory/.vdr.new/vdr.changes     2012-11-28 
17:08:22.000000000 +0100
@@ -1,0 +2,8 @@
+Mon Nov 19 12:41:34 UTC 2012 - [email protected]
+
+- add vdr-1.6.0-bnc786040-use-v4l2.patch (bnc#786040), based on
+  http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/
+         media-video/vdr/files/vdr-1.6.0-use-v4l2.patch
+- this obsoletes vdr-v4l-2.6.38.patch
+
+-------------------------------------------------------------------

Old:
----
  vdr-v4l-2.6.38.patch

New:
----
  vdr-1.6.0-bnc786040-use-v4l2.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ vdr.spec ++++++
--- /var/tmp/diff_new_pack.gZmPZu/_old  2012-11-28 17:08:37.000000000 +0100
+++ /var/tmp/diff_new_pack.gZmPZu/_new  2012-11-28 17:08:37.000000000 +0100
@@ -27,9 +27,6 @@
 %else
 BuildRequires:  libcap
 %endif
-%if %suse_version >= 1210
-BuildRequires:  libv4l-devel >= 0.8.4
-%endif
 #
 %define vdrname         vdr
 %define vdr_apiversion  1.6.0
@@ -71,12 +68,12 @@
 Patch22:        vdr-1.6.0-const.diff
 # PATCH-FIX-UPSTREAM vdr-1.6.0-gcc46.patch [email protected] -- Fix compilation 
with gcc 4.6
 Patch23:        vdr-1.6.0-gcc46.patch
-# PATCH-FIX-OPENSUSE vdr-v4l-2.6.38.patch [email protected] -- Use new v4l 
interface
-Patch24:        vdr-v4l-2.6.38.patch
 # PATCH-FIX-UPSTREAM vdr-gcc47.patch [email protected] -- Fix build with 
gcc 4.7.
 Patch25:        vdr-gcc47.patch
 # UPSTREAM 72c5ec3 to make it work with fontconfig-2.9
 Patch26:        vdr-FcFontSort-72c5ec3.diff
+# PATCH-FIX-Upstream vdr-1.6.0-bnc786040-use-v4l2.patch 
[email protected] -- use v4l2.
+Patch27:        vdr-1.6.0-bnc786040-use-v4l2.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 Provides:       vdr-devel
 Provides:       vdr(abi) = %vdr_apiversion
@@ -182,11 +179,9 @@
 %patch21 -p1
 %patch22 -p1
 %patch23
-%if 0%{?suse_version} >= 1210
-%patch24
-%endif
 %patch25 -p1
 %patch26 -p1
+%patch27 -p1
 
 %build
 #cp %{SOURCE5} README.SuSE

++++++ vdr-1.6.0-bnc786040-use-v4l2.patch ++++++

    from Version 1.7.3
    - Changed cDvbDevice::GrabImage() to use V4L2 (thanks to Marco Schl��ler).

Index: b/dvbdevice.c
===================================================================
--- a/dvbdevice.c
+++ b/dvbdevice.c
@@ -9,11 +9,11 @@
 
 #include <errno.h>
 #include <limits.h>
 #include <stdint.h>
 #include "dvbdevice.h"
-#include <linux/videodev.h>
+#include <linux/videodev2.h>
 #include <linux/dvb/audio.h>
 #include <linux/dvb/dmx.h>
 #include <linux/dvb/frontend.h>
 #include <linux/dvb/video.h>
 #include <sys/ioctl.h>
@@ -520,73 +520,107 @@ uchar *cDvbDevice::GrabImage(int &Size,
   char buffer[PATH_MAX];
   snprintf(buffer, sizeof(buffer), "%s%d", DEV_VIDEO, devVideoIndex);
   int videoDev = open(buffer, O_RDWR);
   if (videoDev >= 0) {
      uchar *result = NULL;
-     struct video_mbuf mbuf;
-     if (ioctl(videoDev, VIDIOCGMBUF, &mbuf) == 0) {
-        int msize = mbuf.size;
-        unsigned char *mem = (unsigned char *)mmap(0, msize, PROT_READ | 
PROT_WRITE, MAP_SHARED, videoDev, 0);
-        if (mem && mem != (unsigned char *)-1) {
-           // set up the size and RGB
-           struct video_capability vc;
-           if (ioctl(videoDev, VIDIOCGCAP, &vc) == 0) {
-              struct video_mmap vm;
-              vm.frame = 0;
-              if ((SizeX > 0) && (SizeX <= vc.maxwidth) &&
-                  (SizeY > 0) && (SizeY <= vc.maxheight)) {
-                 vm.width = SizeX;
-                 vm.height = SizeY;
-                 }
-              else {
-                 vm.width = vc.maxwidth;
-                 vm.height = vc.maxheight;
-                 }
-              vm.format = VIDEO_PALETTE_RGB24;
-              if (ioctl(videoDev, VIDIOCMCAPTURE, &vm) == 0 && ioctl(videoDev, 
VIDIOCSYNC, &vm.frame) == 0) {
-                 // make RGB out of BGR:
-                 int memsize = vm.width * vm.height;
-                 unsigned char *mem1 = mem;
-                 for (int i = 0; i < memsize; i++) {
-                     unsigned char tmp = mem1[2];
-                     mem1[2] = mem1[0];
-                     mem1[0] = tmp;
-                     mem1 += 3;
-                     }
-
-                 if (Quality < 0)
-                    Quality = 100;
-
-                 dsyslog("grabbing to %s %d %d %d", Jpeg ? "JPEG" : "PNM", 
Quality, vm.width, vm.height);
-                 if (Jpeg) {
-                    // convert to JPEG:
-                    result = RgbToJpeg(mem, vm.width, vm.height, Size, 
Quality);
-                    if (!result)
-                       esyslog("ERROR: failed to convert image to JPEG");
-                    }
-                 else {
-                    // convert to PNM:
-                    char buf[32];
-                    snprintf(buf, sizeof(buf), "P6\n%d\n%d\n255\n", vm.width, 
vm.height);
-                    int l = strlen(buf);
-                    int bytes = memsize * 3;
-                    Size = l + bytes;
-                    result = MALLOC(uchar, Size);
-                    if (result) {
-                       memcpy(result, buf, l);
-                       memcpy(result + l, mem, bytes);
+     // set up the size and RGB
+     v4l2_format fmt;
+     memset(&fmt, 0, sizeof(fmt));
+     fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+     fmt.fmt.pix.width = SizeX;
+     fmt.fmt.pix.height = SizeY;
+     fmt.fmt.pix.pixelformat = V4L2_PIX_FMT_BGR24;
+     fmt.fmt.pix.field = V4L2_FIELD_ANY;
+     if (ioctl(videoDev, VIDIOC_S_FMT, &fmt) == 0) {
+        v4l2_requestbuffers reqBuf;
+        memset(&reqBuf, 0, sizeof(reqBuf));
+        reqBuf.count = 2;
+        reqBuf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+        reqBuf.memory = V4L2_MEMORY_MMAP;
+        if (ioctl(videoDev, VIDIOC_REQBUFS, &reqBuf) >= 0) {
+           v4l2_buffer mbuf;
+           memset(&mbuf, 0, sizeof(mbuf));
+           mbuf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+           mbuf.memory = V4L2_MEMORY_MMAP;
+           if (ioctl(videoDev, VIDIOC_QUERYBUF, &mbuf) == 0) {
+              int msize = mbuf.length;
+              unsigned char *mem = (unsigned char *)mmap(0, msize, PROT_READ | 
PROT_WRITE, MAP_SHARED, videoDev, 0);
+              if (mem && mem != (unsigned char *)-1) {
+                 v4l2_buffer buf;
+                 memset(&buf, 0, sizeof(buf));
+                 buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+                 buf.memory = V4L2_MEMORY_MMAP;
+                 buf.index = 0;
+                 if (ioctl(videoDev, VIDIOC_QBUF, &buf) == 0) {
+                    v4l2_buf_type type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+                    if (ioctl (videoDev, VIDIOC_STREAMON, &type) == 0) {
+                       memset(&buf, 0, sizeof(buf));
+                       buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+                       buf.memory = V4L2_MEMORY_MMAP;
+                       buf.index = 0;
+                       if (ioctl(videoDev, VIDIOC_DQBUF, &buf) == 0) {
+                          if (ioctl(videoDev, VIDIOC_STREAMOFF, &type) == 0) {
+                             // make RGB out of BGR:
+                             int memsize = fmt.fmt.pix.width * 
fmt.fmt.pix.height;
+                             unsigned char *mem1 = mem;
+                             for (int i = 0; i < memsize; i++) {
+                                 unsigned char tmp = mem1[2];
+                                 mem1[2] = mem1[0];
+                                 mem1[0] = tmp;
+                                 mem1 += 3;
+                                 }
+
+                             if (Quality < 0)
+                                Quality = 100;
+
+                             dsyslog("grabbing to %s %d %d %d", Jpeg ? "JPEG" 
: "PNM", Quality, fmt.fmt.pix.width, fmt.fmt.pix.height);
+                             if (Jpeg) {
+                                // convert to JPEG:
+                                result = RgbToJpeg(mem, fmt.fmt.pix.width, 
fmt.fmt.pix.height, Size, Quality);
+                                if (!result)
+                                   esyslog("ERROR: failed to convert image to 
JPEG");
+                                }
+                             else {
+                                // convert to PNM:
+                                char buf[32];
+                                snprintf(buf, sizeof(buf), 
"P6\n%d\n%d\n255\n", fmt.fmt.pix.width, fmt.fmt.pix.height);
+                                int l = strlen(buf);
+                                int bytes = memsize * 3;
+                                Size = l + bytes;
+                                result = MALLOC(uchar, Size);
+                                if (result) {
+                                   memcpy(result, buf, l);
+                                   memcpy(result + l, mem, bytes);
+                                   }
+                                else
+                                   esyslog("ERROR: failed to convert image to 
PNM");
+                                }
+                             }
+                          else
+                             esyslog("ERROR: video device VIDIOC_STREAMOFF 
failed");
+                          }
+                       else
+                          esyslog("ERROR: video device VIDIOC_DQBUF failed");
                        }
                     else
-                       esyslog("ERROR: failed to convert image to PNM");
+                       esyslog("ERROR: video device VIDIOC_STREAMON failed");
                     }
+                 else
+                    esyslog("ERROR: video device VIDIOC_QBUF failed");
+                 munmap(mem, msize);
                  }
+              else
+                 esyslog("ERROR: failed to memmap video device");
               }
-           munmap(mem, msize);
+           else
+              esyslog("ERROR: video device VIDIOC_QUERYBUF failed");
            }
         else
-           esyslog("ERROR: failed to memmap video device");
+           esyslog("ERROR: video device VIDIOC_REQBUFS failed");
         }
+     else
+        esyslog("ERROR: video device VIDIOC_S_FMT failed");
      close(videoDev);
      return result;
      }
   else
      LOG_ERROR_STR(buffer);
-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to