]> git.pld-linux.org Git - packages/XIMEA.git/commitdiff
- up for 4.01.09 (filename and Source0 URL unchanged)
authorJakub Bogusz <qboosh@pld-linux.org>
Tue, 11 Feb 2014 19:14:21 +0000 (20:14 +0100)
committerJakub Bogusz <qboosh@pld-linux.org>
Tue, 11 Feb 2014 19:14:21 +0000 (20:14 +0100)
- removed obsolete gcc,glib patches
- added va patch (adapt to current VA API)

XIMEA-gcc.patch [deleted file]
XIMEA-glib.patch [deleted file]
XIMEA-va.patch [new file with mode: 0644]
XIMEA.spec

diff --git a/XIMEA-gcc.patch b/XIMEA-gcc.patch
deleted file mode 100644 (file)
index bd42ee0..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
---- XIMEA-1.04/examples/vaViewer/acquisition.cpp.orig  2011-11-29 22:53:23.000000000 +0100
-+++ XIMEA-1.04/examples/vaViewer/acquisition.cpp       2012-02-01 18:16:03.439775467 +0100
-@@ -204,23 +204,24 @@
-                       char * byte_data = surface_p+surface_image.offsets[0]+i*surface_image.pitches[0];
-                       int bitshift = lps->sgf.curBPP - 8;
-                       int cnt = (lps->sgf.curCX * sizeof(WORD)) / 32;
--                      _asm{
--                              mov                     esi,            [data]                          ;
--                              mov                     edi,            [byte_data]                     ;
--                              movd            xmm2,           [bitshift]                      ;
--t00:
--                              movdqa          xmm0,           [esi]           ;
--                              movdqa          xmm1,           [esi+16]        ;
--                              psrlw           xmm0,           xmm2                            ;
--                              psrlw           xmm1,           xmm2                            ;
--                              packuswb        xmm0,           xmm1                            ;
--                              movntdq         [edi],          xmm0                            ;
--                              add                     edi,            16                                      ;
--                              add                     esi,            32                                      ;
--
--                              sub                     [cnt],          1                                       ;
--                              ja                      t00                                                             ;
--                      }
-+                      __asm__(
-+                              "movl (%1), %%esi\n"            // mov esi, [data]
-+                              "movl (%2), %%edi\n"            // mov edi, [byte_data]
-+                              "movd (%3), %%xmm2\n"           // movd xmm2, [bitshift]
-+                      "1:      movdqa (%%esi), %%xmm0\n"      // movdqa xmm0, [esi]
-+                              "movdqa $16(%%esi), %%xmm1\n"   // movdqa xmm1, [esi+16]
-+                              "psrlw %%xmm2, %%xmm0\n"        // psrlw xmm0, xmm2
-+                              "psrlw %%xmm2, %%xmm1\n"        // psrlw xmm1, xmm2
-+                              "packuswb %%xmm1, %%xmm0\n"     // packuswb xmm0, xmm1
-+                              "movntdq %%xmm0, (%%edi)\n"     // movntdq [edi], xmm0
-+                              "addl $16, %%edi\n"             // add edi, 16
-+                              "addl $32, %%esi\n"             // add esi, 32
-+                              "sub $1, (%0)\n"                // sub [cnt], 1
-+                              "ja 1b\n"
-+                              : "=&r"(cnt)
-+                              : "mr"(data), "mr"(byte_data), "mr"(bitshift)
-+                              : "memory", "cc", "esi", "edi"
-+                             );
-               } else {
-                       memcpy(surface_p+surface_image.offsets[0]+i*surface_image.pitches[0], (char*)lps->sgf.bp+i*surface_width, surface_width);
-               }
diff --git a/XIMEA-glib.patch b/XIMEA-glib.patch
deleted file mode 100644 (file)
index 98bca39..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
---- XIMEA-1.04/examples/vaViewer/main.cpp.orig 2011-11-29 22:53:23.000000000 +0100
-+++ XIMEA-1.04/examples/vaViewer/main.cpp      2012-02-01 18:36:06.409815747 +0100
-@@ -390,7 +390,7 @@
-                       return TRUE;
-               }
-               startLive();
--              g_signal_handlers_block_matched(ctrl->mode, G_SIGNAL_MATCH_FUNC, 0, 0, 0, G_CALLBACK(update_mode),0);
-+              g_signal_handlers_block_matched(ctrl->mode, G_SIGNAL_MATCH_FUNC, 0, 0, 0, (gpointer)(update_mode),0);
-               while(gtk_combo_box_get_active_text(GTK_COMBO_BOX(ctrl->mode))) {
-                       gtk_combo_box_remove_text(GTK_COMBO_BOX(ctrl->mode), 0);
-                       gtk_combo_box_set_active(GTK_COMBO_BOX(ctrl->mode), 0);
-@@ -402,7 +402,7 @@
-                       gtk_combo_box_append_text(GTK_COMBO_BOX(ctrl->mode), szMode);
-               }
-               gtk_combo_box_set_active(GTK_COMBO_BOX(ctrl->mode), 0);
--              g_signal_handlers_unblock_matched(ctrl->mode, G_SIGNAL_MATCH_FUNC, 0, 0, 0, G_CALLBACK(update_mode),0);
-+              g_signal_handlers_unblock_matched(ctrl->mode, G_SIGNAL_MATCH_FUNC, 0, 0, 0, (gpointer)(update_mode),0);
-       } else {
-               stopLive();
-       }
diff --git a/XIMEA-va.patch b/XIMEA-va.patch
new file mode 100644 (file)
index 0000000..74c76ce
--- /dev/null
@@ -0,0 +1,20 @@
+--- XIMEA-4.01.09/package/examples/vaViewer/main.cpp.orig      2013-11-15 15:09:58.000000000 +0100
++++ XIMEA-4.01.09/package/examples/vaViewer/main.cpp   2014-02-11 19:47:05.065480623 +0100
+@@ -218,7 +218,7 @@
+                               surface_width = lps->color ? lps->sbmp.w : lps->sgf.curCX;
+                               surface_height = lps->color ? lps->sbmp.h : lps->sgf.curCY;
+                               printf("Image size changed to %dx%d\n", surface_width, surface_height);
+-                              va_status = vaCreateSurfaces(va_dpy, surface_width, surface_height, VA_RT_FORMAT_YUV420, 1, &surface_id);
++                              va_status = vaCreateSurfaces(va_dpy, VA_RT_FORMAT_YUV420, surface_width, surface_height, &surface_id, 1, NULL, 0);
+                               CHECK_VASTATUS(va_status, "vaCreateSurfaces", lps->show=0;surface_id=VA_INVALID_SURFACE);
+                               if(max_height > 0 || max_width > 0) {
+                                       if(max_height <= 0 || max_width > 0 && surface_width * max_height > surface_height * max_width) {
+@@ -262,7 +262,7 @@
+                               if (lps->dwNframes) lps->fFPS_sum = lps->fFPS_sum*tau + lps->fFPS*(1.-tau);
+                               else                  lps->fFPS_sum = lps->fFPS;
+                               lps->dwTime++;
+-                              snprintf(&win_name[0], 256, "Video FPS: %.1f; Acquisition: frm %lu skip %lu fps %.1f", lps->frame_num*1000.0/(float)lps->putsurface_time, lps->dwNframes, lps->dwLframes, (float)lps->fFPS_sum);
++                              snprintf(&win_name[0], 256, "Video FPS: %.1f; Acquisition: frm %u skip %u fps %.1f", lps->frame_num*1000.0/(float)lps->putsurface_time, lps->dwNframes, lps->dwLframes, (float)lps->fFPS_sum);
+                               lps->putsurface_time = 0;
+                               lps->frame_num = 0;
+                               XmbTextListToTextProperty(x11_display, &pwin_name, 1, XStringStyle, &winname);
index b4989849495ddf20bd1fe7c7b0a409eceb95d959..5225f67a3f9ae4fad8e1bd98ec7c098cc71828d5 100644 (file)
@@ -1,27 +1,43 @@
+# TODO: build kernel module (src/currera_acq_module)
+#
+# Conditional build:
+%bcond_without opencl  # OpenCL support in vaViewer
+#
 Summary:       XIMEA API Software Package for Linux
 Summary(pl.UTF-8):     Pakiet XIMEA API dla Linuksa
 Name:          XIMEA
 # see version_LINUX_SP.txt
-Version:       1.04
+Version:       4.01.09
 Release:       1
-# probably non-distributable: contains some mix of binaries and sources with no licensing information;
-# there is also binary .ko module (probably for some particular Ubuntu kernel) with license=GPL
-# and no sources included
+# some mix of binaries and sources with no licensing information (except for GPL kernel module)
 License:       unknown
 Group:         Libraries
 Source0:       http://www.ximea.com/support/attachments/271/XIMEA_Linux_SP.tgz
-# NoSource0-md5:       2dabc84fe3a9bd5d31f5882c9d0aff21
+# NoSource0-md5:       fe4a4f4ec44a46da5f4fcd643b70cf46
 NoSource:      0
-Patch0:                %{name}-gcc.patch
-Patch1:                %{name}-glib.patch
-URL:           http://www.ximea.com/support/wiki/currera/XIMEA_Linux_Software_Package
+Patch0:                %{name}-va.patch
+URL:           http://www.ximea.com/support/wiki/apis/XIMEA_Linux_Software_Package
+%{?with_opencl:BuildRequires:  OpenCL-devel}
+BuildRequires: gstreamer0.10-devel
+BuildRequires: gstreamer0.10-plugins-base-devel
 BuildRequires: gtk+2-devel
-BuildRequires: libva-devel
 BuildRequires: libstdc++-devel
+BuildRequires: libva-devel
 BuildRequires: pkgconfig
-BuildArch:     %{ix86}
+BuildRequires: xorg-lib-libX11-devel
+Requires:      libraw1394 >= 2.1.0
+Requires:      libusb >= 1.0.9
+ExclusiveArch: %{ix86} %{x8664}
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
+%ifarch        %{ix86}
+%define        abi     X32
+%else
+%ifarch %{x8664}
+%define        abi     X64
+%endif
+%endif
+
 %description
 XIMEA Linux Software Package contains of
  * Kernel Driver of CURRERA-R cameras for Ubuntu 10.04
@@ -66,22 +82,36 @@ Narzędzie vaViewer dla urządzeń XIMEA.
 %prep
 %setup -q -c
 %patch0 -p1
-%patch1 -p1
 
-%build
-cd examples/vaViewer
+ln -s ../../include package/examples/streamViewer/m3api
 
-CXXFLAGS="%{rpmcxxflags} %{rpmcppflags} $(pkg-config --cflags libva libva-x11 gtk+-2.0) -I ../../include"
-%{__cxx} $CXXFLAGS -c acquisition.cpp
-%{__cxx} $CXXFLAGS -c main.cpp
-%{__cxx} %{rpmldflags} %{rpmcxxflags} -o vaViewer acquisition.o main.o $(pkg-config --libs libva libva-x11 gtk+-2.0) -L../../api -lm3api
+%build
+cd package
+%{__make} -C examples/streamViewer streamViewer.o \
+       CXX="%{__cxx}" \
+       CFLAGS="%{rpmcxxflags} %{rpmcppflags} -I."
+%{__cxx} %{rpmldflags} %{rpmcxxflags} -o examples/streamViewer/streamViewer \
+       examples/streamViewer/*.o \
+       $(pkg-config --libs gtk+-2.0 gstreamer-0.10 gstreamer-app-0.10 gstreamer-interfaces-0.10) \
+       -Lapi/%{abi} -lm3api
+
+%{__make} -C examples/vaViewer acquisition.o main.o \
+       CXX="%{__cxx}" \
+       CFLAGS="%{rpmcxxflags} %{rpmcppflags} %{?with_opencl:-DOPENCL}"
+%{__cxx} %{rpmldflags} %{rpmcxxflags} -o examples/vaViewer/vaViewer \
+       examples/vaViewer/*.o \
+       $(pkg-config --libs libva libva-x11 gtk+-2.0) %{?with_opencl:-lOpenCL} -lX11 -lpthread \
+       -Lapi/%{abi} -lm3api
 
 %install
 rm -rf $RPM_BUILD_ROOT
 install -d $RPM_BUILD_ROOT{%{_libdir},%{_bindir},%{_includedir}/ximea}
 
+cd package
 cp -p include/*.h $RPM_BUILD_ROOT%{_includedir}/ximea
-install api/libm3api.so $RPM_BUILD_ROOT%{_libdir}
+install api/%{abi}/libm3api.so $RPM_BUILD_ROOT%{_libdir}
+install libs/gentl/%{abi}/libXIMEA_GenTL.so $RPM_BUILD_ROOT%{_libdir}
+install examples/streamViewer/streamViewer $RPM_BUILD_ROOT%{_bindir}
 install examples/vaViewer/vaViewer $RPM_BUILD_ROOT%{_bindir}
 
 %clean
@@ -92,7 +122,8 @@ rm -rf $RPM_BUILD_ROOT
 
 %files
 %defattr(644,root,root,755)
-%doc README
+%doc package/README
+%attr(755,root,root) %{_libdir}/libXIMEA_GenTL.so
 %attr(755,root,root) %{_libdir}/libm3api.so
 
 %files devel
@@ -101,4 +132,5 @@ rm -rf $RPM_BUILD_ROOT
 
 %files viewer
 %defattr(644,root,root,755)
+%attr(755,root,root) %{_bindir}/streamViewer
 %attr(755,root,root) %{_bindir}/vaViewer
This page took 0.073419 seconds and 4 git commands to generate.