* Authors: Emilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>
*/
-#include <config.h>
-
-#include <string.h>
-
-#include <telepathy-glib/util.h>
-
+#include "config.h"
#include "empathy-camera-monitor.h"
+
#include "cheese-camera-device-monitor.h"
-#include "empathy-utils.h"
#define DEBUG_FLAG EMPATHY_DEBUG_OTHER
#include "empathy-debug.h"
struct _EmpathyCameraMonitorPrivate
{
- CheeseCameraDeviceMonitor *cheese_monitor;
+ EmpathyCameraDeviceMonitor *empathy_monitor;
GQueue *cameras;
gint num_cameras;
};
}
static void
-on_camera_added (CheeseCameraDeviceMonitor *device,
+on_camera_added (EmpathyCameraDeviceMonitor *device,
gchar *id,
gchar *filename,
gchar *product_name,
gint api_version,
EmpathyCameraMonitor *self)
{
- EmpathyCamera *camera = empathy_camera_new (id, filename, product_name);
+ EmpathyCamera *camera;
if (self->priv->cameras == NULL)
return;
+ camera = empathy_camera_new (id, filename, product_name);
+
g_queue_push_tail (self->priv->cameras, camera);
self->priv->num_cameras++;
}
static void
-on_camera_removed (CheeseCameraDeviceMonitor *device,
+on_camera_removed (EmpathyCameraDeviceMonitor *device,
gchar *id,
EmpathyCameraMonitor *self)
{
{
EmpathyCameraMonitor *self = EMPATHY_CAMERA_MONITOR (object);
- tp_clear_object (&self->priv->cheese_monitor);
+ tp_clear_object (&self->priv->empathy_monitor);
g_queue_foreach (self->priv->cameras,
empathy_camera_monitor_free_camera_foreach, NULL);
G_OBJECT_CLASS (empathy_camera_monitor_parent_class)->constructed (object);
- cheese_camera_device_monitor_coldplug (self->priv->cheese_monitor);
+ empathy_camera_device_monitor_coldplug (self->priv->empathy_monitor);
}
static void
g_signal_new ("added", G_OBJECT_CLASS_TYPE (klass),
G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
0, NULL, NULL,
- g_cclosure_marshal_VOID__BOXED,
+ g_cclosure_marshal_generic,
G_TYPE_NONE, 1, EMPATHY_TYPE_CAMERA);
signals[CAMERA_REMOVED] =
g_signal_new ("removed", G_OBJECT_CLASS_TYPE (klass),
G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
0, NULL, NULL,
- g_cclosure_marshal_VOID__BOXED,
+ g_cclosure_marshal_generic,
G_TYPE_NONE, 1, EMPATHY_TYPE_CAMERA);
g_type_class_add_private (object_class,
self->priv->cameras = g_queue_new ();
- self->priv->cheese_monitor = cheese_camera_device_monitor_new ();
+ self->priv->empathy_monitor = empathy_camera_device_monitor_new ();
- g_signal_connect (self->priv->cheese_monitor, "added",
+ g_signal_connect (self->priv->empathy_monitor, "added",
G_CALLBACK (on_camera_added), self);
- g_signal_connect (self->priv->cheese_monitor, "removed",
+ g_signal_connect (self->priv->empathy_monitor, "removed",
G_CALLBACK (on_camera_removed), self);
#ifndef HAVE_UDEV