summaryrefslogtreecommitdiffstats
path: root/multimedia/cheese3/files
diff options
context:
space:
mode:
authorkwm <kwm@df743ca5-7f9a-e211-a948-0013205c9059>2012-06-13 18:34:15 +0800
committerkwm <kwm@df743ca5-7f9a-e211-a948-0013205c9059>2012-06-13 18:34:15 +0800
commit2632a3daa294734c867bdde45c92de476fd4dae7 (patch)
treee7488c9e84de5ba7371a0d061361b02c23e81ef0 /multimedia/cheese3/files
parent253808d39d3b7d2cfa91dbc0ff1ea66f558028bf (diff)
downloadmarcuscom-ports-2632a3daa294734c867bdde45c92de476fd4dae7.tar.gz
marcuscom-ports-2632a3daa294734c867bdde45c92de476fd4dae7.tar.zst
marcuscom-ports-2632a3daa294734c867bdde45c92de476fd4dae7.zip
Update to 3.4.2.
git-svn-id: svn://creme-brulee.marcuscom.com/ports/trunk@16903 df743ca5-7f9a-e211-a948-0013205c9059
Diffstat (limited to 'multimedia/cheese3/files')
-rw-r--r--multimedia/cheese3/files/patch-configure410
-rw-r--r--multimedia/cheese3/files/patch-libcheese_cheese-camera-device-monitor.c403
2 files changed, 346 insertions, 467 deletions
diff --git a/multimedia/cheese3/files/patch-configure b/multimedia/cheese3/files/patch-configure
index 71f744d0e..5dce1420b 100644
--- a/multimedia/cheese3/files/patch-configure
+++ b/multimedia/cheese3/files/patch-configure
@@ -1,284 +1,186 @@
---- configure.bak 2011-11-14 18:55:17.000000000 +0100
-+++ configure 2011-11-19 11:51:40.000000000 +0100
-@@ -724,7 +724,10 @@
- HAVE_XTEST_FALSE
- HAVE_XTEST_TRUE
- XTEST_LIBS
-+OS_FREEBSD
- OS_LINUX
-+HAL_LIBS
-+HAL_CFLAGS
- UDEV_LIBS
- UDEV_CFLAGS
- PKG_CONFIG_LIBDIR
-@@ -917,6 +920,8 @@
- PKG_CONFIG_LIBDIR
- UDEV_CFLAGS
- UDEV_LIBS
-+HAL_CFLAGS
-+HAL_LIBS
- CHEESE_CFLAGS
- CHEESE_LIBS
- CHEESE_GTK_CFLAGS
-@@ -1595,6 +1600,8 @@
- path overriding pkg-config's built-in search path
- UDEV_CFLAGS C compiler flags for UDEV, overriding pkg-config
- UDEV_LIBS linker flags for UDEV, overriding pkg-config
-+ HAL_CFLAGS C compiler flags for HAL, overriding pkg-config
-+ HAL_LIBS linker flags for HAL, overriding pkg-config
- CHEESE_CFLAGS
- C compiler flags for CHEESE, overriding pkg-config
- CHEESE_LIBS linker flags for CHEESE, overriding pkg-config
-@@ -12182,8 +12189,7 @@
-
-
-
--CFLAGS="${CFLAGS} -Wall"
--CFLAGS+=" -DGSEAL_ENABLE"
-+CFLAGS="${CFLAGS} -Wall -DGSEAL_ENABLE"
-
-
-
-@@ -13128,6 +13134,80 @@
- UDEV_PKG=gudev-1.0
+--- configure 2012-06-13 10:35:21.000000000 +0200
++++ configure 2012-06-13 10:31:28.000000000 +0200
+@@ -12661,6 +12661,10 @@
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: Linux" >&5
+ $as_echo "Linux" >&6; }
+ UDEV_REQUIRED="gudev-1.0" ;; #(
++ *freebsd*) :
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: FreeBSD" >&5
++$as_echo "FreeBSD" >&6; }
++ HAL_REQUIRED="hal" ;; #(
+ *) :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported operating system" >&5
+ $as_echo "unsupported operating system" >&6; } ;;
+@@ -12688,6 +12692,28 @@
+ $as_echo "not needed" >&6; }
fi
-+HAL_PKG=
-+
-+pkg_failed=no
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for HAL" >&5
-+$as_echo_n "checking for HAL... " >&6; }
-+
-+if test -n "$HAL_CFLAGS"; then
-+ pkg_cv_HAL_CFLAGS="$HAL_CFLAGS"
-+ elif test -n "$PKG_CONFIG"; then
-+ if test -n "$PKG_CONFIG" && \
-+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"hal\""; } >&5
-+ ($PKG_CONFIG --exists --print-errors "hal") 2>&5
-+ ac_status=$?
-+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-+ test $ac_status = 0; }; then
-+ pkg_cv_HAL_CFLAGS=`$PKG_CONFIG --cflags "hal" 2>/dev/null`
-+else
-+ pkg_failed=yes
-+fi
-+ else
-+ pkg_failed=untried
-+fi
-+if test -n "$HAL_LIBS"; then
-+ pkg_cv_HAL_LIBS="$HAL_LIBS"
-+ elif test -n "$PKG_CONFIG"; then
-+ if test -n "$PKG_CONFIG" && \
-+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"hal\""; } >&5
-+ ($PKG_CONFIG --exists --print-errors "hal") 2>&5
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for hal" >&5
++$as_echo_n "checking for hal... " >&6; }
++if test -n "$HAL_REQUIRED"; then :
++ if test -n "$PKG_CONFIG" && \
++ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$HAL_REQUIRED\""; } >&5
++ ($PKG_CONFIG --exists --print-errors "$HAL_REQUIRED") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
-+ pkg_cv_HAL_LIBS=`$PKG_CONFIG --libs "hal" 2>/dev/null`
-+else
-+ pkg_failed=yes
-+fi
-+ else
-+ pkg_failed=untried
-+fi
-+
-+
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5
++$as_echo "found" >&6; }
+
-+if test $pkg_failed = yes; then
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-+$as_echo "no" >&6; }
++$as_echo "#define HAVE_HAL /**/" >>confdefs.h
+
-+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
-+ _pkg_short_errors_supported=yes
+else
-+ _pkg_short_errors_supported=no
++ as_fn_error $? "$HAL_REQUIRED not found" "$LINENO" 5
+fi
-+ if test $_pkg_short_errors_supported = yes; then
-+ HAL_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "hal" 2>&1`
-+ else
-+ HAL_PKG_ERRORS=`$PKG_CONFIG --print-errors "hal" 2>&1`
-+ fi
-+ # Put the nasty error message in config.log where it belongs
-+ echo "$HAL_PKG_ERRORS" >&5
-+
-+ HAL_PKG=
-+elif test $pkg_failed = untried; then
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-+$as_echo "no" >&6; }
-+ HAL_PKG=
+else
-+ HAL_CFLAGS=$pkg_cv_HAL_CFLAGS
-+ HAL_LIBS=$pkg_cv_HAL_LIBS
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-+$as_echo "yes" >&6; }
-+
-+$as_echo "#define HAVE_HAL 1" >>confdefs.h
-+
-+ HAL_PKG=hal
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: not needed" >&5
++$as_echo "not needed" >&6; }
+fi
+
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking operating system" >&5
- $as_echo_n "checking operating system... " >&6; }
- case $host in
-@@ -13142,6 +13222,17 @@
- as_fn_error $? "libgudev is required under Linux and not installed" "$LINENO" 5
- fi
- ;;
-+ *-freebsd*)
-+
-+$as_echo "#define OS_FREEBSD /**/" >>confdefs.h
-+
-+
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: FreeBSD" >&5
-+$as_echo "FreeBSD" >&6; }
-+ if test x$HAL_PKG = "x" ; then
-+ as_fn_error $? "hal is required under FreeBSD and not installed" "$LINENO" 5
-+ fi
-+ ;;
- *)
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported operating system" >&5
- $as_echo "unsupported operating system" >&6; }
-@@ -13246,6 +13337,7 @@
- clutter-gst-1.0 >= \$CLUTTERGST_REQUIRED \\
- mx-1.0 \\
- \$UDEV_PKG
-+ \$HAL_PKG
- \""; } >&5
- ($PKG_CONFIG --exists --print-errors "\
- glib-2.0 >= $GLIB_REQUIRED \
-@@ -13261,6 +13353,7 @@
- clutter-gst-1.0 >= $CLUTTERGST_REQUIRED \
- mx-1.0 \
- $UDEV_PKG
-+ $HAL_PKG
- ") 2>&5
+ for ac_header in sys/videoio.h
+ do :
+ ac_fn_c_check_header_mongrel "$LINENO" "sys/videoio.h" "ac_cv_header_sys_videoio_h" "$ac_includes_default"
+@@ -12776,6 +12802,7 @@
+ \$CLUTTER_REQUIRED
+ \$CLUTTERGST_REQUIRED
+ \$MX_REQUIRED
++ \$HAL_REQUIRED
+ \$UDEV_REQUIRED\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "$GLIB_REQUIRED
+ $GIO_REQUIRED
+@@ -12788,6 +12815,7 @@
+ $CLUTTER_REQUIRED
+ $CLUTTERGST_REQUIRED
+ $MX_REQUIRED
++ $HAL_REQUIRED
+ $UDEV_REQUIRED") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-@@ -13279,6 +13372,7 @@
- clutter-gst-1.0 >= $CLUTTERGST_REQUIRED \
- mx-1.0 \
- $UDEV_PKG
-+ $HAL_PKG
- " 2>/dev/null`
+@@ -12803,6 +12831,7 @@
+ $CLUTTER_REQUIRED
+ $CLUTTERGST_REQUIRED
+ $MX_REQUIRED
++ $HAL_REQUIRED
+ $UDEV_REQUIRED" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
else
- pkg_failed=yes
-@@ -13304,6 +13398,7 @@
- clutter-gst-1.0 >= \$CLUTTERGST_REQUIRED \\
- mx-1.0 \\
- \$UDEV_PKG
-+ \$HAL_PKG
- \""; } >&5
- ($PKG_CONFIG --exists --print-errors "\
- glib-2.0 >= $GLIB_REQUIRED \
-@@ -13319,6 +13414,7 @@
- clutter-gst-1.0 >= $CLUTTERGST_REQUIRED \
- mx-1.0 \
- $UDEV_PKG
-+ $HAL_PKG
- ") 2>&5
+@@ -12826,6 +12855,7 @@
+ \$CLUTTER_REQUIRED
+ \$CLUTTERGST_REQUIRED
+ \$MX_REQUIRED
++ \$HAL_REQUIRED
+ \$UDEV_REQUIRED\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "$GLIB_REQUIRED
+ $GIO_REQUIRED
+@@ -12838,6 +12868,7 @@
+ $CLUTTER_REQUIRED
+ $CLUTTERGST_REQUIRED
+ $MX_REQUIRED
++ $HAL_REQUIRED
+ $UDEV_REQUIRED") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-@@ -13337,6 +13433,7 @@
- clutter-gst-1.0 >= $CLUTTERGST_REQUIRED \
- mx-1.0 \
- $UDEV_PKG
-+ $HAL_PKG
- " 2>/dev/null`
+@@ -12853,6 +12884,7 @@
+ $CLUTTER_REQUIRED
+ $CLUTTERGST_REQUIRED
+ $MX_REQUIRED
++ $HAL_REQUIRED
+ $UDEV_REQUIRED" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
else
- pkg_failed=yes
-@@ -13371,6 +13468,7 @@
- clutter-gst-1.0 >= $CLUTTERGST_REQUIRED \
- mx-1.0 \
- $UDEV_PKG
-+ $HAL_PKG
- " 2>&1`
+@@ -12885,6 +12917,7 @@
+ $CLUTTER_REQUIRED
+ $CLUTTERGST_REQUIRED
+ $MX_REQUIRED
++ $HAL_REQUIRED
+ $UDEV_REQUIRED" 2>&1`
else
- CHEESE_PKG_ERRORS=`$PKG_CONFIG --print-errors "\
-@@ -13387,6 +13485,7 @@
- clutter-gst-1.0 >= $CLUTTERGST_REQUIRED \
- mx-1.0 \
- $UDEV_PKG
-+ $HAL_PKG
- " 2>&1`
+ CHEESE_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$GLIB_REQUIRED
+@@ -12898,6 +12931,7 @@
+ $CLUTTER_REQUIRED
+ $CLUTTERGST_REQUIRED
+ $MX_REQUIRED
++ $HAL_REQUIRED
+ $UDEV_REQUIRED" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
-@@ -13406,6 +13505,7 @@
- clutter-gst-1.0 >= $CLUTTERGST_REQUIRED \
- mx-1.0 \
- $UDEV_PKG
-+ $HAL_PKG
- ) were not met:
+@@ -12914,6 +12948,7 @@
+ $CLUTTER_REQUIRED
+ $CLUTTERGST_REQUIRED
+ $MX_REQUIRED
++ $HAL_REQUIRED
+ $UDEV_REQUIRED) were not met:
$CHEESE_PKG_ERRORS
-@@ -13463,6 +13563,7 @@
- gee-1.0 >= \$GEE_REQUIRED \\
- libcanberra-gtk3 >= \$LIBCANBERRA_REQUIRED \\
- \$UDEV_PKG \\
-+ \$HAL_PKG \\
- gnome-video-effects
- \""; } >&5
- ($PKG_CONFIG --exists --print-errors "\
-@@ -13475,6 +13576,7 @@
- gee-1.0 >= $GEE_REQUIRED \
- libcanberra-gtk3 >= $LIBCANBERRA_REQUIRED \
- $UDEV_PKG \
-+ $HAL_PKG \
- gnome-video-effects
- ") 2>&5
+@@ -12966,6 +13001,7 @@
+ \$GEE_REQUIRED
+ \$LIBCANBERRA_REQUIRED
+ \$UDEV_REQUIRED
++ \$HAL_REQUIRED
+ \$GNOME_VIDEO_EFFECTS_REQUIRED\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "$GIO_REQUIRED
+ $GTK_REQUIRED
+@@ -12976,6 +13012,7 @@
+ $GEE_REQUIRED
+ $LIBCANBERRA_REQUIRED
+ $UDEV_REQUIRED
++ $HAL_REQUIRED
+ $GNOME_VIDEO_EFFECTS_REQUIRED") 2>&5
ac_status=$?
-@@ -13490,6 +13592,7 @@
- gee-1.0 >= $GEE_REQUIRED \
- libcanberra-gtk3 >= $LIBCANBERRA_REQUIRED \
- $UDEV_PKG \
-+ $HAL_PKG \
- gnome-video-effects
- " 2>/dev/null`
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+@@ -12989,6 +13026,7 @@
+ $GEE_REQUIRED
+ $LIBCANBERRA_REQUIRED
+ $UDEV_REQUIRED
++ $HAL_REQUIRED
+ $GNOME_VIDEO_EFFECTS_REQUIRED" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
else
-@@ -13512,6 +13615,7 @@
- gee-1.0 >= \$GEE_REQUIRED \\
- libcanberra-gtk3 >= \$LIBCANBERRA_REQUIRED \\
- \$UDEV_PKG \\
-+ \$HAL_PKG \\
- gnome-video-effects
- \""; } >&5
- ($PKG_CONFIG --exists --print-errors "\
-@@ -13524,6 +13628,7 @@
- gee-1.0 >= $GEE_REQUIRED \
- libcanberra-gtk3 >= $LIBCANBERRA_REQUIRED \
- $UDEV_PKG \
-+ $HAL_PKG \
- gnome-video-effects
- ") 2>&5
+@@ -13010,6 +13048,7 @@
+ \$GEE_REQUIRED
+ \$LIBCANBERRA_REQUIRED
+ \$UDEV_REQUIRED
++ \$HAL_REQUIRED
+ \$GNOME_VIDEO_EFFECTS_REQUIRED\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "$GIO_REQUIRED
+ $GTK_REQUIRED
+@@ -13020,6 +13059,7 @@
+ $GEE_REQUIRED
+ $LIBCANBERRA_REQUIRED
+ $UDEV_REQUIRED
++ $HAL_REQUIRED
+ $GNOME_VIDEO_EFFECTS_REQUIRED") 2>&5
ac_status=$?
-@@ -13539,6 +13644,7 @@
- gee-1.0 >= $GEE_REQUIRED \
- libcanberra-gtk3 >= $LIBCANBERRA_REQUIRED \
- $UDEV_PKG \
-+ $HAL_PKG \
- gnome-video-effects
- " 2>/dev/null`
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+@@ -13033,6 +13073,7 @@
+ $GEE_REQUIRED
+ $LIBCANBERRA_REQUIRED
+ $UDEV_REQUIRED
++ $HAL_REQUIRED
+ $GNOME_VIDEO_EFFECTS_REQUIRED" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
else
-@@ -13570,6 +13676,7 @@
- gee-1.0 >= $GEE_REQUIRED \
- libcanberra-gtk3 >= $LIBCANBERRA_REQUIRED \
- $UDEV_PKG \
-+ $HAL_PKG \
- gnome-video-effects
- " 2>&1`
+@@ -13063,6 +13104,7 @@
+ $GEE_REQUIRED
+ $LIBCANBERRA_REQUIRED
+ $UDEV_REQUIRED
++ $HAL_REQUIRED
+ $GNOME_VIDEO_EFFECTS_REQUIRED" 2>&1`
else
-@@ -13583,6 +13690,7 @@
- gee-1.0 >= $GEE_REQUIRED \
- libcanberra-gtk3 >= $LIBCANBERRA_REQUIRED \
- $UDEV_PKG \
-+ $HAL_PKG \
- gnome-video-effects
- " 2>&1`
+ CHEESE_GTK_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$GIO_REQUIRED
+@@ -13074,6 +13116,7 @@
+ $GEE_REQUIRED
+ $LIBCANBERRA_REQUIRED
+ $UDEV_REQUIRED
++ $HAL_REQUIRED
+ $GNOME_VIDEO_EFFECTS_REQUIRED" 2>&1`
fi
-@@ -13599,6 +13707,7 @@
- gee-1.0 >= $GEE_REQUIRED \
- libcanberra-gtk3 >= $LIBCANBERRA_REQUIRED \
- $UDEV_PKG \
-+ $HAL_PKG \
- gnome-video-effects
- ) were not met:
+ # Put the nasty error message in config.log where it belongs
+@@ -13088,6 +13131,7 @@
+ $GEE_REQUIRED
+ $LIBCANBERRA_REQUIRED
+ $UDEV_REQUIRED
++ $HAL_REQUIRED
+ $GNOME_VIDEO_EFFECTS_REQUIRED) were not met:
+ $CHEESE_GTK_PKG_ERRORS
diff --git a/multimedia/cheese3/files/patch-libcheese_cheese-camera-device-monitor.c b/multimedia/cheese3/files/patch-libcheese_cheese-camera-device-monitor.c
index f208eae88..c88b60337 100644
--- a/multimedia/cheese3/files/patch-libcheese_cheese-camera-device-monitor.c
+++ b/multimedia/cheese3/files/patch-libcheese_cheese-camera-device-monitor.c
@@ -1,125 +1,35 @@
---- libcheese/cheese-camera-device-monitor.c.orig 2011-03-07 21:08:19.000000000 +0100
-+++ libcheese/cheese-camera-device-monitor.c 2011-04-13 11:07:36.000000000 +0200
-@@ -30,16 +30,11 @@
+--- libcheese/cheese-camera-device-monitor.c.orig 2012-03-20 11:46:57.000000000 +0100
++++ libcheese/cheese-camera-device-monitor.c 2012-05-17 23:27:23.000000000 +0200
+@@ -29,6 +29,12 @@
+ #ifdef HAVE_UDEV
#define G_UDEV_API_IS_SUBJECT_TO_CHANGE 1
#include <gudev/gudev.h>
++#elif defined(HAVE_HAL)
++ #include <glib/gstdio.h>
++ #include <libhal.h>
++ #include <dbus/dbus.h>
++ #include <dbus/dbus-glib-lowlevel.h>
++ #include <unistd.h>
#else
-- #include <fcntl.h>
-- #include <unistd.h>
-- #include <sys/ioctl.h>
-- #if USE_SYS_VIDEOIO_H > 0
-- #include <sys/types.h>
-- #include <sys/videoio.h>
-- #elif defined (__sun)
-- #include <sys/types.h>
-- #include <sys/videodev2.h>
-- #endif /* USE_SYS_VIDEOIO_H */
-+ #include <glib/gstdio.h>
-+ #include <libhal.h>
-+ #include <dbus/dbus.h>
-+ #include <dbus/dbus-glib-lowlevel.h>
-+ #include <unistd.h>
- #endif
-
- #include "cheese-camera-device-monitor.h"
-@@ -82,6 +77,8 @@ typedef struct
+ #include <fcntl.h>
+ #include <unistd.h>
+@@ -74,6 +80,9 @@
+ {
#ifdef HAVE_UDEV
GUdevClient *client;
- #else
++#elif defined(HAVE_HAL)
+ DBusConnection *connection;
-+ LibHalContext *hal_ctx;
++ LibHalContext *hal_ctx;
+ #else
guint filler;
#endif /* HAVE_UDEV */
- } CheeseCameraDeviceMonitorPrivate;
-@@ -243,93 +240,240 @@ cheese_camera_device_monitor_coldplug (C
- if (i == 0) GST_WARNING ("No device found");
+@@ -299,86 +308,278 @@
+ g_list_free (devices);
}
-#else /* HAVE_UDEV */
--void
--cheese_camera_device_monitor_coldplug (CheeseCameraDeviceMonitor *monitor)
-+static void
-+cheese_camera_device_monitor_finalize (GObject *object)
- {
-- #if 0
-+ CheeseCameraDeviceMonitor *monitor;
-+
-+ monitor = CHEESE_CAMERA_DEVICE_MONITOR (object);
- CheeseCameraDeviceMonitorPrivate *priv = CHEESE_CAMERA_DEVICE_MONITOR_GET_PRIVATE (monitor);
-- struct v4l2_capability v2cap;
-- struct video_capability v1cap;
-- int fd, ok;
-
-- if ((fd = open (device_path, O_RDONLY | O_NONBLOCK)) < 0)
-+ if (priv->client != NULL)
- {
-- g_warning ("Failed to open %s: %s", device_path, strerror (errno));
-+ g_object_unref (priv->client);
-+ priv->client = NULL;
-+ }
-+ G_OBJECT_CLASS (cheese_camera_device_monitor_parent_class)->finalize (object);
-+}
-+
-+static void
-+cheese_camera_device_monitor_class_init (CheeseCameraDeviceMonitorClass *klass)
-+{
-+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
-+
-+ if (cheese_device_monitor_cat == NULL)
-+ GST_DEBUG_CATEGORY_INIT (cheese_device_monitor_cat,
-+ "cheese-device-monitor",
-+ 0, "Cheese Camera Device Monitor");
-+
-+ object_class->finalize = cheese_camera_device_monitor_finalize;
-+
-+ /**
-+ * CheeseCameraDeviceMonitor::added:
-+ * @device: A private object representing the newly added camera.
-+ * @id: Device unique identifier.
-+ * @device: Device file name (e.g. /dev/video2).
-+ * @product_name: Device product name (human readable, intended to be displayed in a UI).
-+ * @api_version: Supported video4linux API: 1 for v4l, 2 for v4l2.
-+ *
-+ * The ::added signal is emitted when a camera is added, or on start-up
-+ * after #cheese_camera_device_monitor_colplug is called.
-+ **/
-+ monitor_signals[ADDED] = g_signal_new ("added", G_OBJECT_CLASS_TYPE (klass),
-+ G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
-+ G_STRUCT_OFFSET (CheeseCameraDeviceMonitorClass, added),
-+ NULL, NULL,
-+ _cheese_marshal_VOID__STRING_STRING_STRING_INT,
-+ G_TYPE_NONE, 4, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INT);
-+
-+ /**
-+ * CheeseCameraDeviceMonitor::removed:
-+ * @device: A private object representing the newly added camera
-+ * @id: Device unique identifier.
-+ *
-+ * The ::removed signal is emitted when a camera is un-plugged, or
-+ * disabled on the system.
-+ **/
-+ monitor_signals[REMOVED] = g_signal_new ("removed", G_OBJECT_CLASS_TYPE (klass),
-+ G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
-+ G_STRUCT_OFFSET (CheeseCameraDeviceMonitorClass, removed),
-+ NULL, NULL,
-+ g_cclosure_marshal_VOID__STRING,
-+ G_TYPE_NONE, 1, G_TYPE_STRING);
-+
-+ g_type_class_add_private (klass, sizeof (CheeseCameraDeviceMonitorPrivate));
-+}
-+
-+static void
-+cheese_camera_device_monitor_init (CheeseCameraDeviceMonitor *monitor)
-+{
-+ CheeseCameraDeviceMonitorPrivate *priv = CHEESE_CAMERA_DEVICE_MONITOR_GET_PRIVATE (monitor);
-+ const gchar *const subsystems[] = {"video4linux", NULL};
-+
-+ priv->client = g_udev_client_new (subsystems);
-+ g_signal_connect (G_OBJECT (priv->client), "uevent",
-+ G_CALLBACK (cheese_camera_device_monitor_uevent_cb), monitor);
-+}
-+
-+#else /* HAVE_UDEV */
++/* HAVE_UDEV */
++#elif defined(HAVE_HAL)
+
+static void
+cheese_camera_device_monitor_handle_udi (CheeseCameraDeviceMonitor *monitor,
@@ -141,57 +51,24 @@
+ {
+ GST_WARNING ("error getting product name: %s: %s", error.name, error.message);
+ dbus_error_free (&error);
- return;
- }
-- ok = ioctl (fd, VIDIOC_QUERYCAP, &v2cap);
-- if (ok < 0)
++ return;
++ }
+
+ device_file = libhal_device_get_property_string (priv->hal_ctx, udi, "video4linux.device", &error);
+ if (dbus_error_is_set (&error))
- {
-- ok = ioctl (fd, VIDIOCGCAP, &v1cap);
-- if (ok < 0)
-- {
-- g_warning ("Error while probing v4l capabilities for %s: %s",
-- device_path, strerror (errno));
-- close (fd);
-- return;
-- }
-- g_print ("Detected v4l device: %s\n", v1cap.name);
-- g_print ("Device type: %d\n", v1cap.type);
-- gstreamer_src = "v4lsrc";
-- product_name = v1cap.name;
++ {
+ GST_WARNING ("error getting V4L device for %s: %s: %s", udi, error.name, error.message);
+ dbus_error_free (&error);
+ libhal_free_string (product_name);
- }
-- else
++ }
+
+ if (g_access (device_file, (R_OK | W_OK)) == -1)
- {
-- guint cap = v2cap.capabilities;
-- g_print ("Detected v4l2 device: %s\n", v2cap.card);
-- g_print ("Driver: %s, version: %d\n", v2cap.driver, v2cap.version);
--
-- /* g_print ("Bus info: %s\n", v2cap.bus_info); */ /* Doesn't seem anything useful */
-- g_print ("Capabilities: 0x%08X\n", v2cap.capabilities);
-- if (!(cap & V4L2_CAP_VIDEO_CAPTURE))
-- {
-- g_print ("Device %s seems to not have the capture capability, (radio tuner?)\n"
-- "Removing it from device list.\n", device_path);
-- close (fd);
-- return;
-- }
-- gstreamer_src = "v4l2src";
-- product_name = (char *) v2cap.card;
++ {
+ GST_WARNING ("Device %s does not have proper permissions. Permissions must be 0666", device_file);
+ libhal_free_string (product_name);
+ libhal_free_string (device_file);
+ return;
- }
-- close (fd);
-
-- GList *devices, *l;
++ }
+ capstr = libhal_device_get_property_string (priv->hal_ctx, udi, "video4linux.version", &error);
+ if (dbus_error_is_set (&error))
+ {
@@ -201,30 +78,24 @@
+ libhal_free_string (device_file);
+ return;
+ }
-
-- g_print ("Probing devices with udev...\n");
++
+ v4l_version = atoi (capstr);
+ libhal_free_string (capstr);
-
-- if (priv->client == NULL)
-- return;
++
+ g_signal_emit (monitor, monitor_signals[ADDED], 0,
+ udi,
+ device_file,
+ product_name,
+ v4l_version);
+}
-
-- devices = g_udev_client_query_by_subsystem (priv->client, "video4linux");
++
+static void
+cheese_camera_device_monitor_removed (LibHalContext *ctx,
+ const char *udi)
+ {
+ CheeseCameraDeviceMonitor *monitor;
+ void *data;
-
-- /* Initialize camera structures */
-- for (l = devices; l != NULL; l = l->next)
++
+ data = libhal_ctx_get_user_data (ctx);
+ g_assert (data);
+
@@ -233,9 +104,14 @@
+ g_signal_emit (monitor, monitor_signals[REMOVED], 0, udi);
+}
+
-+void
-+cheese_camera_device_monitor_coldplug (CheeseCameraDeviceMonitor *monitor)
-+{
+ void
+ cheese_camera_device_monitor_coldplug (CheeseCameraDeviceMonitor *monitor)
+ {
+- #if 0
+- CheeseCameraDeviceMonitorPrivate *priv = monitor->priv;
+- struct v4l2_capability v2cap;
+- struct video_capability v1cap;
+- int fd, ok;
+ CheeseCameraDeviceMonitorPrivate *priv = CHEESE_CAMERA_DEVICE_MONITOR_GET_PRIVATE (monitor);
+ gint i, num_udis = 0;
+ gchar **udis;
@@ -244,33 +120,32 @@
+ if (priv->hal_ctx == NULL)
+ return;
+
-+ GST_INFO ("Probing devices with HAL...");
++ GST_INFO ("Probing devices with HAL...");
+
+ dbus_error_init (&error);
-+
+
+- if ((fd = open (device_path, O_RDONLY | O_NONBLOCK)) < 0)
+ udis = libhal_find_device_by_capability (priv->hal_ctx, "video4linux", &num_udis, &error);
+
+ if (dbus_error_is_set (&error))
{
-- cheese_camera_device_monitor_added (monitor, l->data);
-- g_object_unref (l->data);
+- g_warning ("Failed to open %s: %s", device_path, strerror (errno));
+ GST_WARNING ("libhal_find_device_by_capability: %s: %s", error.name, error.message);
+ dbus_error_free (&error);
-+ return;
+ return;
}
-- g_list_free (devices);
-- #endif
+- ok = ioctl (fd, VIDIOC_QUERYCAP, &v2cap);
+- if (ok < 0)
+
+ /* Initialize camera structures */
+ for (i = 0; i < num_udis; i++)
+ cheese_camera_device_monitor_handle_udi (monitor, udis[i]);
+ libhal_free_string_array (udis);
+
-+ if (i == 0)
++ if (i == 0)
+ GST_WARNING ("No device found");
- }
-
--#endif /* HAVE_UDEV */
++}
++
+static void
+cheese_camera_device_monitor_added (LibHalContext *ctx, const char *udi)
+{
@@ -289,35 +164,58 @@
+ return;
+
+ for (i = 0; caps[i] != NULL; i++)
-+ {
+ {
+- ok = ioctl (fd, VIDIOCGCAP, &v1cap);
+- if (ok < 0)
+ if (g_strcmp0 (caps[i], "video4linux") == 0)
-+ {
+ {
+- g_warning ("Error while probing v4l capabilities for %s: %s",
+- device_path, strerror (errno));
+- close (fd);
+- return;
+ cheese_camera_device_monitor_handle_udi (monitor, udi);
+ break;
-+ }
-+ }
+ }
+- g_print ("Detected v4l device: %s\n", v1cap.name);
+- g_print ("Device type: %d\n", v1cap.type);
+- gstreamer_src = "v4lsrc";
+- product_name = v1cap.name;
+ }
+- else
+ libhal_free_string_array (caps);
+}
-
- static void
- cheese_camera_device_monitor_finalize (GObject *object)
- {
--#ifdef HAVE_UDEV
- CheeseCameraDeviceMonitor *monitor;
-
- monitor = CHEESE_CAMERA_DEVICE_MONITOR (object);
- CheeseCameraDeviceMonitorPrivate *priv = CHEESE_CAMERA_DEVICE_MONITOR_GET_PRIVATE (monitor);
-
-- if (priv->client != NULL)
++
++static void
++cheese_camera_device_monitor_finalize (GObject *object)
++{
++ CheeseCameraDeviceMonitor *monitor;
++
++ monitor = CHEESE_CAMERA_DEVICE_MONITOR (object);
++ CheeseCameraDeviceMonitorPrivate *priv = CHEESE_CAMERA_DEVICE_MONITOR_GET_PRIVATE (monitor);
++
+ if (priv->connection != NULL)
{
-- g_object_unref (priv->client);
-- priv->client = NULL;
+- guint cap = v2cap.capabilities;
+- g_print ("Detected v4l2 device: %s\n", v2cap.card);
+- g_print ("Driver: %s, version: %d\n", v2cap.driver, v2cap.version);
+-
+- /* g_print ("Bus info: %s\n", v2cap.bus_info); */ /* Doesn't seem anything useful */
+- g_print ("Capabilities: 0x%08X\n", v2cap.capabilities);
+- if (!(cap & V4L2_CAP_VIDEO_CAPTURE))
+- {
+- g_print ("Device %s seems to not have the capture capability, (radio tuner?)\n"
+- "Removing it from device list.\n", device_path);
+- close (fd);
+- return;
+- }
+- gstreamer_src = "v4l2src";
+- product_name = (char *) v2cap.card;
+ dbus_connection_unref (priv->connection);
+ priv->connection = NULL;
}
--#endif /* HAVE_UDEV */
-+
+- close (fd);
+
+- GList *devices, *l;
+ if (priv->hal_ctx != NULL)
+ {
+ libhal_ctx_set_device_added (priv->hal_ctx, NULL);
@@ -325,25 +223,71 @@
+ libhal_ctx_free (priv->hal_ctx);
+ priv->hal_ctx = NULL;
+ }
-+
- G_OBJECT_CLASS (cheese_camera_device_monitor_parent_class)->finalize (object);
- }
-@@ -384,16 +528,56 @@ cheese_camera_device_monitor_class_init
- static void
- cheese_camera_device_monitor_init (CheeseCameraDeviceMonitor *monitor)
- {
--#ifdef HAVE_UDEV
-- CheeseCameraDeviceMonitorPrivate *priv = CHEESE_CAMERA_DEVICE_MONITOR_GET_PRIVATE (monitor);
-- const gchar *const subsystems[] = {"video4linux", NULL};
+- g_print ("Probing devices with udev...\n");
++ G_OBJECT_CLASS (cheese_camera_device_monitor_parent_class)->finalize (object);
++}
+
+- if (priv->client == NULL)
+- return;
++static void
++cheese_camera_device_monitor_class_init (CheeseCameraDeviceMonitorClass *klass)
++{
++ GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+- devices = g_udev_client_query_by_subsystem (priv->client, "video4linux");
++ if (cheese_device_monitor_cat == NULL)
++ GST_DEBUG_CATEGORY_INIT (cheese_device_monitor_cat,
++ "cheese-device-monitor",
++ 0, "Cheese Camera Device Monitor");
+
+- /* Initialize camera structures */
+- for (l = devices; l != NULL; l = l->next)
++ object_class->finalize = cheese_camera_device_monitor_finalize;
++
++ /**
++ * CheeseCameraDeviceMonitor::added:
++ * @device: A private object representing the newly added camera.
++ * @id: Device unique identifier.
++ * @device: Device file name (e.g. /dev/video2).
++ * @product_name: Device product name (human readable, intended to be displayed in a UI).
++ * @api_version: Supported video4linux API: 1 for v4l, 2 for v4l2.
++ *
++ * The ::added signal is emitted when a camera is added, or on start-up
++ * after #cheese_camera_device_monitor_colplug is called.
++ **/
++ monitor_signals[ADDED] = g_signal_new ("added", G_OBJECT_CLASS_TYPE (klass),
++ G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
++ G_STRUCT_OFFSET (CheeseCameraDeviceMonitorClass, added),
++ NULL, NULL,
++ g_cclosure_marshal_VOID__STRING,
++ G_TYPE_NONE, 4, G_TYPE_STRING);
++
++ /**
++ * CheeseCameraDeviceMonitor::removed:
++ * @device: A private object representing the newly added camera
++ * @id: Device unique identifier.
++ *
++ * The ::removed signal is emitted when a camera is un-plugged, or
++ * disabled on the system.
++ **/
++ monitor_signals[REMOVED] = g_signal_new ("removed", G_OBJECT_CLASS_TYPE (klass),
++ G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
++ G_STRUCT_OFFSET (CheeseCameraDeviceMonitorClass, removed),
++ NULL, NULL,
++ g_cclosure_marshal_VOID__STRING,
++ G_TYPE_NONE, 1, G_TYPE_STRING);
++
++ g_type_class_add_private (klass, sizeof (CheeseCameraDeviceMonitorPrivate));
++}
++
++static void
++cheese_camera_device_monitor_init (CheeseCameraDeviceMonitor *monitor)
++{
+ CheeseCameraDeviceMonitorPrivate *priv = CHEESE_CAMERA_DEVICE_MONITOR_GET_PRIVATE (monitor);
+ LibHalContext *hal_ctx;
+ DBusError error;
-
-- priv->client = g_udev_client_new (subsystems);
-- g_signal_connect (G_OBJECT (priv->client), "uevent",
-- G_CALLBACK (cheese_camera_device_monitor_uevent_cb), monitor);
--#endif /* HAVE_UDEV */
++
+ dbus_error_init (&error);
+
+ priv->connection = dbus_bus_get (DBUS_BUS_SYSTEM, &error);
@@ -352,11 +296,15 @@
+
+ hal_ctx = libhal_ctx_new ();
+ if (hal_ctx == NULL)
-+ {
+ {
+- cheese_camera_device_monitor_added (monitor, l->data);
+- g_object_unref (l->data);
+ GST_WARNING ("Could not create libhal context");
+ dbus_error_free (&error);
+ return;
-+ }
+ }
+- g_list_free (devices);
+- #endif
+
+ if (!libhal_ctx_set_dbus_connection (hal_ctx, priv->connection))
+ {
@@ -388,8 +336,37 @@
+ priv->hal_ctx = hal_ctx;
}
-+#endif /* !HAVE_UDEV */
-+
+-#endif /* HAVE_UDEV */
++#else /* HAVE_HAL */
++#error no hal or udev support here
++#endif
+
++#ifdef HAVE_UDEV
+ static void
+ cheese_camera_device_monitor_finalize (GObject *object)
+ {
+-#ifdef HAVE_UDEV
+ CheeseCameraDeviceMonitorPrivate *priv = CHEESE_CAMERA_DEVICE_MONITOR (object)->priv;
+
+ g_clear_object (&priv->client);
+-#endif /* HAVE_UDEV */
+ G_OBJECT_CLASS (cheese_camera_device_monitor_parent_class)->finalize (object);
+ }
+
+@@ -430,15 +631,14 @@
+ static void
+ cheese_camera_device_monitor_init (CheeseCameraDeviceMonitor *monitor)
+ {
+-#ifdef HAVE_UDEV
+ CheeseCameraDeviceMonitorPrivate *priv = monitor->priv = CHEESE_CAMERA_DEVICE_MONITOR_GET_PRIVATE (monitor);
+ const gchar *const subsystems[] = {"video4linux", NULL};
+
+ priv->client = g_udev_client_new (subsystems);
+ g_signal_connect (G_OBJECT (priv->client), "uevent",
+ G_CALLBACK (cheese_camera_device_monitor_uevent_cb), monitor);
+-#endif /* HAVE_UDEV */
+ }
++#endif /* HAVE_UDEV */
+
/**
* cheese_camera_device_monitor_new:
- *