tiscamera: Init at 0.9.1 (#41738)

authored by jraygauthier and committed by xeji 1ef6d3fe 01e165d0

+148
+48
pkgs/os-specific/linux/tiscamera/allow-pipeline-stop-in-trigger-mode.patch
··· 1 + diff --git a/src/gstreamer-1.0/gsttcamsrc.cpp b/src/gstreamer-1.0/gsttcamsrc.cpp 2 + index d482e1e..e36afd8 100644 3 + --- a/src/gstreamer-1.0/gsttcamsrc.cpp 4 + +++ b/src/gstreamer-1.0/gsttcamsrc.cpp 5 + @@ -1112,6 +1112,7 @@ bool gst_tcam_src_init_camera (GstTcamSrc* self) 6 + 7 + static void gst_tcam_src_close_camera (GstTcamSrc* self) 8 + { 9 + + GST_INFO("Closing device"); 10 + if (self->device != NULL) 11 + { 12 + self->device->dev->stop_stream(); 13 + @@ -1156,7 +1157,7 @@ static gboolean gst_tcam_src_stop (GstBaseSrc* src) 14 + 15 + self->device->dev->stop_stream(); 16 + gst_element_send_event(GST_ELEMENT(self), gst_event_new_eos()); 17 + - GST_DEBUG_OBJECT (self, "Stopped acquisition"); 18 + + GST_DEBUG("Stopped acquisition"); 19 + 20 + return TRUE; 21 + } 22 + @@ -1556,6 +1557,18 @@ static void gst_tcam_src_get_property (GObject* object, 23 + } 24 + 25 + 26 + +static gboolean gst_tcam_src_unlock (GstBaseSrc* src) 27 + +{ 28 + + GstTcamSrc* self = GST_TCAM_SRC(src); 29 + + 30 + + self->is_running = FALSE; 31 + + 32 + + self->cv.notify_all(); 33 + + 34 + + return TRUE; 35 + +} 36 + + 37 + + 38 + static void gst_tcam_src_class_init (GstTcamSrcClass* klass) 39 + { 40 + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); 41 + @@ -1616,6 +1629,7 @@ static void gst_tcam_src_class_init (GstTcamSrcClass* klass) 42 + gstbasesrc_class->fixate = gst_tcam_src_fixate_caps; 43 + gstbasesrc_class->start = gst_tcam_src_start; 44 + gstbasesrc_class->stop = gst_tcam_src_stop; 45 + + gstbasesrc_class->unlock = gst_tcam_src_unlock; 46 + gstbasesrc_class->negotiate = gst_tcam_src_negotiate; 47 + gstbasesrc_class->get_times = gst_tcam_src_get_times; 48 +
+98
pkgs/os-specific/linux/tiscamera/default.nix
··· 1 + { lib 2 + , stdenv 3 + , fetchFromGitHub 4 + , cmake 5 + , pkgconfig 6 + , pcre 7 + , tinyxml 8 + , libusb1 9 + , libzip 10 + , glib 11 + , gobjectIntrospection 12 + , gst_all_1 13 + , libwebcam 14 + }: 15 + 16 + stdenv.mkDerivation rec { 17 + pname = "tiscamera"; 18 + version = "0.9.1"; 19 + name = "${pname}-${version}"; 20 + 21 + src = fetchFromGitHub { 22 + owner = "TheImagingSource"; 23 + repo = pname; 24 + rev = "v-${name}"; 25 + sha256 = "143yp6bpzj3rqfnrcnlrcwggay37fg6rkphh4w9y9v7v4wllzf87"; 26 + }; 27 + 28 + nativeBuildInputs = [ 29 + cmake 30 + pkgconfig 31 + ]; 32 + 33 + buildInputs = [ 34 + pcre 35 + tinyxml 36 + libusb1 37 + libzip 38 + glib 39 + gobjectIntrospection 40 + gst_all_1.gstreamer 41 + gst_all_1.gst-plugins-base 42 + libwebcam 43 + ]; 44 + 45 + 46 + cmakeFlags = [ 47 + "-DBUILD_ARAVIS=OFF" # For GigE support. Won't need it as our camera is usb. 48 + "-DBUILD_GST_1_0=ON" 49 + "-DBUILD_TOOLS=ON" 50 + "-DBUILD_V4L2=ON" 51 + "-DBUILD_LIBUSB=ON" 52 + ]; 53 + 54 + 55 + patches = [ 56 + ./allow-pipeline-stop-in-trigger-mode.patch # To be removed next release. 57 + ]; 58 + 59 + postPatch = '' 60 + substituteInPlace ./data/udev/80-theimagingsource-cameras.rules \ 61 + --replace "/usr/bin/uvcdynctrl" "${libwebcam}/bin/uvcdynctrl" \ 62 + --replace "/path/to/tiscamera/uvc-extensions" "$out/share/uvcdynctrl/data/199e" 63 + 64 + substituteInPlace ./src/BackendLoader.cpp \ 65 + --replace '"libtcam-v4l2.so"' "\"$out/lib/tcam-0/libtcam-v4l2.so\"" \ 66 + --replace '"libtcam-aravis.so"' "\"$out/lib/tcam-0/libtcam-aravis.so\"" \ 67 + --replace '"libtcam-libusb.so"' "\"$out/lib/tcam-0/libtcam-libusb.so\"" 68 + ''; 69 + 70 + preConfigure = '' 71 + cmakeFlagsArray=( 72 + $cmakeFlagsArray 73 + "-DCMAKE_INSTALL_PREFIX=$out" 74 + "-DTCAM_INSTALL_UDEV=$out/lib/udev/rules.d" 75 + "-DTCAM_INSTALL_UVCDYNCTRL=$out/share/uvcdynctrl/data/199e" 76 + "-DTCAM_INSTALL_GST_1_0=$out/lib/gstreamer-1.0" 77 + "-DTCAM_INSTALL_GIR=$out/share/gir-1.0" 78 + "-DTCAM_INSTALL_TYPELIB=$out/lib/girepository-1.0" 79 + "-DTCAM_INSTALL_SYSTEMD=$out/etc/systemd/system" 80 + ) 81 + ''; 82 + 83 + 84 + # There are gobject introspection commands launched as part of the build. Those have a runtime 85 + # dependency on `libtcam` (which itself is built as part of this build). In order to allow 86 + # that, we set the dynamic linker's path to point on the build time location of the library. 87 + preBuild = '' 88 + export LD_LIBRARY_PATH=$PWD/src:$LD_LIBRARY_PATH 89 + ''; 90 + 91 + meta = with lib; { 92 + description = "The Linux sources and UVC firmwares for The Imaging Source cameras"; 93 + homepage = https://github.com/TheImagingSource/tiscamera; 94 + license = with licenses; [ asl20 ]; 95 + platforms = platforms.linux; 96 + maintainers = with maintainers; [ jraygauthier ]; 97 + }; 98 + }
+2
pkgs/top-level/all-packages.nix
··· 11824 11824 11825 11825 tinyxml-2 = callPackage ../development/libraries/tinyxml-2 { }; 11826 11826 11827 + tiscamera = callPackage ../os-specific/linux/tiscamera { }; 11828 + 11827 11829 tivodecode = callPackage ../applications/video/tivodecode { }; 11828 11830 11829 11831 tix = callPackage ../development/libraries/tix { };