Commit a9c38568 authored by Olivier Crête's avatar Olivier Crête 👻

Rename GstDeviceMonitor to GstDeviceProvider

parent e4f0133c
......@@ -4,7 +4,7 @@ libgstpulse_la_SOURCES = \
plugin.c \
pulsesink.c \
pulsesrc.c \
pulsedevicemonitor.c \
pulsedeviceprovider.c \
pulseutil.c
libgstpulse_la_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(GST_BASE_CFLAGS) $(GST_CFLAGS) $(PULSE_CFLAGS)
......@@ -17,6 +17,6 @@ libgstpulse_la_LIBTOOLFLAGS = $(GST_PLUGIN_LIBTOOLFLAGS)
noinst_HEADERS = \
pulsesink.h \
pulsesrc.h \
pulsedevicemonitor.h \
pulsedeviceprovider.h \
pulseutil.h
......@@ -27,7 +27,7 @@
#include "pulsesink.h"
#include "pulsesrc.h"
#include "pulsedevicemonitor.h"
#include "pulsedeviceprovider.h"
GST_DEBUG_CATEGORY (pulse_debug);
......@@ -49,8 +49,8 @@ plugin_init (GstPlugin * plugin)
GST_TYPE_PULSESRC))
return FALSE;
if (!gst_device_monitor_register (plugin, "pulsemonitor",
GST_RANK_PRIMARY, GST_TYPE_PULSE_DEVICE_MONITOR))
if (!gst_device_provider_register (plugin, "pulsedeviceprovider",
GST_RANK_PRIMARY, GST_TYPE_PULSE_DEVICE_PROVIDER))
return FALSE;
GST_DEBUG_CATEGORY_INIT (pulse_debug, "pulse", 0, "PulseAudio elements");
......
/* GStreamer
* Copyright (C) 2012 Olivier Crete <olivier.crete@collabora.com>
*
* gstv4l2devicemonitor.c: V4l2 device probing and monitoring
* gstv4l2deviceprovider.c: V4l2 device probing and monitoring
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
......@@ -23,7 +23,7 @@
#include "config.h"
#endif
#include "pulsedevicemonitor.h"
#include "pulsedeviceprovider.h"
#include <string.h>
......@@ -42,19 +42,19 @@ static GstDevice *gst_pulse_device_new (guint id,
const gchar * device_name, GstCaps * caps, const gchar * internal_name,
GstPulseDeviceType type);
G_DEFINE_TYPE (GstPulseDeviceMonitor, gst_pulse_device_monitor,
GST_TYPE_DEVICE_MONITOR);
G_DEFINE_TYPE (GstPulseDeviceProvider, gst_pulse_device_provider,
GST_TYPE_DEVICE_PROVIDER);
static void gst_pulse_device_monitor_finalize (GObject * object);
static void gst_pulse_device_monitor_set_property (GObject * object,
static void gst_pulse_device_provider_finalize (GObject * object);
static void gst_pulse_device_provider_set_property (GObject * object,
guint prop_id, const GValue * value, GParamSpec * pspec);
static void gst_pulse_device_monitor_get_property (GObject * object,
static void gst_pulse_device_provider_get_property (GObject * object,
guint prop_id, GValue * value, GParamSpec * pspec);
static GList *gst_pulse_device_monitor_probe (GstDeviceMonitor * monitor);
static gboolean gst_pulse_device_monitor_start (GstDeviceMonitor * monitor);
static void gst_pulse_device_monitor_stop (GstDeviceMonitor * monitor);
static GList *gst_pulse_device_provider_probe (GstDeviceProvider * provider);
static gboolean gst_pulse_device_provider_start (GstDeviceProvider * provider);
static void gst_pulse_device_provider_stop (GstDeviceProvider * provider);
enum
{
......@@ -66,19 +66,19 @@ enum
static void
gst_pulse_device_monitor_class_init (GstPulseDeviceMonitorClass * klass)
gst_pulse_device_provider_class_init (GstPulseDeviceProviderClass * klass)
{
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
GstDeviceMonitorClass *dm_class = GST_DEVICE_MONITOR_CLASS (klass);
GstDeviceProviderClass *dm_class = GST_DEVICE_PROVIDER_CLASS (klass);
gchar *client_name;
gobject_class->set_property = gst_pulse_device_monitor_set_property;
gobject_class->get_property = gst_pulse_device_monitor_get_property;
gobject_class->finalize = gst_pulse_device_monitor_finalize;
gobject_class->set_property = gst_pulse_device_provider_set_property;
gobject_class->get_property = gst_pulse_device_provider_get_property;
gobject_class->finalize = gst_pulse_device_provider_finalize;
dm_class->probe = gst_pulse_device_monitor_probe;
dm_class->start = gst_pulse_device_monitor_start;
dm_class->stop = gst_pulse_device_monitor_stop;
dm_class->probe = gst_pulse_device_provider_probe;
dm_class->start = gst_pulse_device_provider_start;
dm_class->stop = gst_pulse_device_provider_stop;
g_object_class_install_property (gobject_class,
PROP_SERVER,
......@@ -95,35 +95,35 @@ gst_pulse_device_monitor_class_init (GstPulseDeviceMonitorClass * klass)
GST_PARAM_MUTABLE_READY));
g_free (client_name);
gst_device_monitor_class_set_static_metadata (dm_class,
"PulseAudio Device Monitor", "Sink/Source/Audio",
"List and monitor PulseAudio source and sink devices",
gst_device_provider_class_set_static_metadata (dm_class,
"PulseAudio Device Provider", "Sink/Source/Audio",
"List and provider PulseAudio source and sink devices",
"Olivier Crete <olivier.crete@collabora.com>");
}
static void
gst_pulse_device_monitor_init (GstPulseDeviceMonitor * self)
gst_pulse_device_provider_init (GstPulseDeviceProvider * self)
{
self->client_name = gst_pulse_client_name ();
}
static void
gst_pulse_device_monitor_finalize (GObject * object)
gst_pulse_device_provider_finalize (GObject * object)
{
GstPulseDeviceMonitor *self = GST_PULSE_DEVICE_MONITOR (object);
GstPulseDeviceProvider *self = GST_PULSE_DEVICE_PROVIDER (object);
g_free (self->client_name);
g_free (self->server);
G_OBJECT_CLASS (gst_pulse_device_monitor_parent_class)->finalize (object);
G_OBJECT_CLASS (gst_pulse_device_provider_parent_class)->finalize (object);
}
static void
gst_pulse_device_monitor_set_property (GObject * object,
gst_pulse_device_provider_set_property (GObject * object,
guint prop_id, const GValue * value, GParamSpec * pspec)
{
GstPulseDeviceMonitor *self = GST_PULSE_DEVICE_MONITOR (object);
GstPulseDeviceProvider *self = GST_PULSE_DEVICE_PROVIDER (object);
switch (prop_id) {
case PROP_SERVER:
......@@ -147,10 +147,10 @@ gst_pulse_device_monitor_set_property (GObject * object,
}
static void
gst_pulse_device_monitor_get_property (GObject * object,
gst_pulse_device_provider_get_property (GObject * object,
guint prop_id, GValue * value, GParamSpec * pspec)
{
GstPulseDeviceMonitor *self = GST_PULSE_DEVICE_MONITOR (object);
GstPulseDeviceProvider *self = GST_PULSE_DEVICE_PROVIDER (object);
switch (prop_id) {
case PROP_SERVER:
......@@ -168,7 +168,7 @@ gst_pulse_device_monitor_get_property (GObject * object,
static void
context_state_cb (pa_context * c, void *userdata)
{
GstPulseDeviceMonitor *self = userdata;
GstPulseDeviceProvider *self = userdata;
switch (pa_context_get_state (c)) {
case PA_CONTEXT_READY:
......@@ -219,7 +219,7 @@ static void
get_source_info_cb (pa_context * context,
const pa_source_info * info, int eol, void *userdata)
{
GstPulseDeviceMonitor *self = userdata;
GstPulseDeviceProvider *self = userdata;
GstDevice *dev;
if (eol) {
......@@ -230,14 +230,14 @@ get_source_info_cb (pa_context * context,
dev = new_source (info);
if (dev)
gst_device_monitor_device_add (GST_DEVICE_MONITOR (self), dev);
gst_device_provider_device_add (GST_DEVICE_PROVIDER (self), dev);
}
static void
get_sink_info_cb (pa_context * context,
const pa_sink_info * info, int eol, void *userdata)
{
GstPulseDeviceMonitor *self = userdata;
GstPulseDeviceProvider *self = userdata;
GstDevice *dev;
if (eol) {
......@@ -248,15 +248,15 @@ get_sink_info_cb (pa_context * context,
dev = new_sink (info);
if (dev)
gst_device_monitor_device_add (GST_DEVICE_MONITOR (self), dev);
gst_device_provider_device_add (GST_DEVICE_PROVIDER (self), dev);
}
static void
context_subscribe_cb (pa_context * context, pa_subscription_event_type_t type,
uint32_t idx, void *userdata)
{
GstPulseDeviceMonitor *self = userdata;
GstDeviceMonitor *monitor = userdata;
GstPulseDeviceProvider *self = userdata;
GstDeviceProvider *provider = userdata;
pa_subscription_event_type_t facility =
type & PA_SUBSCRIPTION_EVENT_FACILITY_MASK;
pa_subscription_event_type_t event_type =
......@@ -279,7 +279,7 @@ context_subscribe_cb (pa_context * context, pa_subscription_event_type_t type,
GList *item;
GST_OBJECT_LOCK (self);
for (item = monitor->devices; item; item = item->next) {
for (item = provider->devices; item; item = item->next) {
dev = item->data;
if (((facility == PA_SUBSCRIPTION_EVENT_SOURCE &&
......@@ -295,7 +295,7 @@ context_subscribe_cb (pa_context * context, pa_subscription_event_type_t type,
GST_OBJECT_UNLOCK (self);
if (dev) {
gst_device_monitor_device_remove (GST_DEVICE_MONITOR (self),
gst_device_provider_device_remove (GST_DEVICE_PROVIDER (self),
GST_DEVICE (dev));
gst_object_unref (dev);
}
......@@ -327,9 +327,9 @@ get_sink_info_list_cb (pa_context * context, const pa_sink_info * info,
}
static GList *
gst_pulse_device_monitor_probe (GstDeviceMonitor * monitor)
gst_pulse_device_provider_probe (GstDeviceProvider * provider)
{
GstPulseDeviceMonitor *self = GST_PULSE_DEVICE_MONITOR (monitor);
GstPulseDeviceProvider *self = GST_PULSE_DEVICE_PROVIDER (provider);
GList *devices = NULL;
pa_mainloop *m = NULL;
pa_context *c = NULL;
......@@ -397,9 +397,9 @@ failed:
}
static gboolean
gst_pulse_device_monitor_start (GstDeviceMonitor * monitor)
gst_pulse_device_provider_start (GstDeviceProvider * provider)
{
GstPulseDeviceMonitor *self = GST_PULSE_DEVICE_MONITOR (monitor);
GstPulseDeviceProvider *self = GST_PULSE_DEVICE_PROVIDER (provider);
pa_operation *initial_operation;
if (!(self->mainloop = pa_threaded_mainloop_new ())) {
......@@ -484,7 +484,7 @@ gst_pulse_device_monitor_start (GstDeviceMonitor * monitor)
unlock_and_fail:
pa_threaded_mainloop_unlock (self->mainloop);
gst_pulse_device_monitor_stop (monitor);
gst_pulse_device_provider_stop (provider);
return FALSE;
mainloop_failed:
......@@ -497,9 +497,9 @@ cancel_and_fail:
}
static void
gst_pulse_device_monitor_stop (GstDeviceMonitor * monitor)
gst_pulse_device_provider_stop (GstDeviceProvider * provider)
{
GstPulseDeviceMonitor *self = GST_PULSE_DEVICE_MONITOR (monitor);
GstPulseDeviceProvider *self = GST_PULSE_DEVICE_PROVIDER (provider);
pa_threaded_mainloop_stop (self->mainloop);
......
/* GStreamer
* Copyright (C) 2012 Olivier Crete <olivier.crete@collabora.com>
*
* pulsedevicemonitor.h: Device probing and monitoring
* pulsedeviceprovider.h: Device probing and monitoring
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
......@@ -20,8 +20,8 @@
*/
#ifndef __GST_PULSE_DEVICE_MONITOR_H__
#define __GST_PULSE_DEVICE_MONITOR_H__
#ifndef __GST_PULSE_DEVICE_PROVIDER_H__
#define __GST_PULSE_DEVICE_PROVIDER_H__
#ifdef HAVE_CONFIG_H
#include "config.h"
......@@ -34,20 +34,20 @@
G_BEGIN_DECLS
typedef struct _GstPulseDeviceMonitor GstPulseDeviceMonitor;
typedef struct _GstPulseDeviceMonitorPrivate GstPulseDeviceMonitorPrivate;
typedef struct _GstPulseDeviceMonitorClass GstPulseDeviceMonitorClass;
typedef struct _GstPulseDeviceProvider GstPulseDeviceProvider;
typedef struct _GstPulseDeviceProviderPrivate GstPulseDeviceProviderPrivate;
typedef struct _GstPulseDeviceProviderClass GstPulseDeviceProviderClass;
#define GST_TYPE_PULSE_DEVICE_MONITOR (gst_pulse_device_monitor_get_type())
#define GST_IS_PULSE_DEVICE_MONITOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_PULSE_DEVICE_MONITOR))
#define GST_IS_PULSE_DEVICE_MONITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_PULSE_DEVICE_MONITOR))
#define GST_PULSE_DEVICE_MONITOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_PULSE_DEVICE_MONITOR, GstPulseDeviceMonitorClass))
#define GST_PULSE_DEVICE_MONITOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_PULSE_DEVICE_MONITOR, GstPulseDeviceMonitor))
#define GST_PULSE_DEVICE_MONITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_DEVICE_MONITOR, GstPulseDeviceMonitorClass))
#define GST_PULSE_DEVICE_MONITOR_CAST(obj) ((GstPulseDeviceMonitor *)(obj))
#define GST_TYPE_PULSE_DEVICE_PROVIDER (gst_pulse_device_provider_get_type())
#define GST_IS_PULSE_DEVICE_PROVIDER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_PULSE_DEVICE_PROVIDER))
#define GST_IS_PULSE_DEVICE_PROVIDER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_PULSE_DEVICE_PROVIDER))
#define GST_PULSE_DEVICE_PROVIDER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_PULSE_DEVICE_PROVIDER, GstPulseDeviceProviderClass))
#define GST_PULSE_DEVICE_PROVIDER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_PULSE_DEVICE_PROVIDER, GstPulseDeviceProvider))
#define GST_PULSE_DEVICE_PROVIDER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_DEVICE_PROVIDER, GstPulseDeviceProviderClass))
#define GST_PULSE_DEVICE_PROVIDER_CAST(obj) ((GstPulseDeviceProvider *)(obj))
struct _GstPulseDeviceMonitor {
GstDeviceMonitor parent;
struct _GstPulseDeviceProvider {
GstDeviceProvider parent;
gchar *server;
gchar *client_name;
......@@ -61,11 +61,11 @@ typedef enum {
GST_PULSE_DEVICE_TYPE_SINK
} GstPulseDeviceType;
struct _GstPulseDeviceMonitorClass {
GstDeviceMonitorClass parent_class;
struct _GstPulseDeviceProviderClass {
GstDeviceProviderClass parent_class;
};
GType gst_pulse_device_monitor_get_type (void);
GType gst_pulse_device_provider_get_type (void);
typedef struct _GstPulseDevice GstPulseDevice;
......@@ -95,4 +95,4 @@ struct _GstPulseDeviceClass {
GType gst_pulse_device_get_type (void);
#endif /* __GST_PULSE_DEVICE_MONITOR_H__ */
#endif /* __GST_PULSE_DEVICE_PROVIDER_H__ */
......@@ -5,7 +5,7 @@ include $(top_srcdir)/common/gst-glib-gen.mak
libgstvideo4linux2_la_SOURCES = gstv4l2.c \
gstv4l2allocator.c \
gstv4l2colorbalance.c \
gstv4l2devicemonitor.c \
gstv4l2deviceprovider.c \
gstv4l2object.c \
gstv4l2bufferpool.c \
gstv4l2sink.c \
......@@ -47,7 +47,7 @@ noinst_HEADERS = \
gstv4l2allocator.h \
gstv4l2bufferpool.h \
gstv4l2colorbalance.h \
gstv4l2devicemonitor.h \
gstv4l2deviceprovider.h \
gstv4l2object.h \
gstv4l2sink.h \
gstv4l2src.h \
......
......@@ -43,7 +43,7 @@
#include "gstv4l2sink.h"
#include "gstv4l2radio.h"
#include "gstv4l2videodec.h"
#include "gstv4l2devicemonitor.h"
#include "gstv4l2deviceprovider.h"
#include "gstv4l2transform.h"
/* used in v4l2_calls.c and v4l2src_calls.c */
......@@ -199,8 +199,8 @@ plugin_init (GstPlugin * plugin)
GST_TYPE_V4L2SINK) ||
!gst_element_register (plugin, "v4l2radio", GST_RANK_NONE,
GST_TYPE_V4L2RADIO) ||
!gst_device_monitor_register (plugin, "v4l2monitor",
GST_RANK_PRIMARY, GST_TYPE_V4L2_DEVICE_MONITOR) ||
!gst_device_provider_register (plugin, "v4l2deviceprovider",
GST_RANK_PRIMARY, GST_TYPE_V4L2_DEVICE_PROVIDER) ||
/* etc. */
!gst_v4l2_probe_and_register (plugin))
return FALSE;
......
/* GStreamer
* Copyright (C) 2012 Olivier Crete <olivier.crete@collabora.com>
*
* gstv4l2devicemonitor.h: V4l2 device probing and monitoring
* gstv4l2deviceprovider.h: V4l2 device probing and monitoring
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
......@@ -20,8 +20,8 @@
*/
#ifndef __GST_V4L2_DEVICE_MONITOR_H__
#define __GST_V4L2_DEVICE_MONITOR_H__
#ifndef __GST_V4L2_DEVICE_PROVIDER_H__
#define __GST_V4L2_DEVICE_PROVIDER_H__
#ifdef HAVE_CONFIG_H
#include "config.h"
......@@ -35,20 +35,20 @@
G_BEGIN_DECLS
typedef struct _GstV4l2DeviceMonitor GstV4l2DeviceMonitor;
typedef struct _GstV4l2DeviceMonitorPrivate GstV4l2DeviceMonitorPrivate;
typedef struct _GstV4l2DeviceMonitorClass GstV4l2DeviceMonitorClass;
typedef struct _GstV4l2DeviceProvider GstV4l2DeviceProvider;
typedef struct _GstV4l2DeviceProviderPrivate GstV4l2DeviceProviderPrivate;
typedef struct _GstV4l2DeviceProviderClass GstV4l2DeviceProviderClass;
#define GST_TYPE_V4L2_DEVICE_MONITOR (gst_v4l2_device_monitor_get_type())
#define GST_IS_V4L2_DEVICE_MONITOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_V4L2_DEVICE_MONITOR))
#define GST_IS_V4L2_DEVICE_MONITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_V4L2_DEVICE_MONITOR))
#define GST_V4L2_DEVICE_MONITOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_V4L2_DEVICE_MONITOR, GstV4l2DeviceMonitorClass))
#define GST_V4L2_DEVICE_MONITOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_V4L2_DEVICE_MONITOR, GstV4l2DeviceMonitor))
#define GST_V4L2_DEVICE_MONITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_DEVICE_MONITOR, GstV4l2DeviceMonitorClass))
#define GST_V4L2_DEVICE_MONITOR_CAST(obj) ((GstV4l2DeviceMonitor *)(obj))
#define GST_TYPE_V4L2_DEVICE_PROVIDER (gst_v4l2_device_provider_get_type())
#define GST_IS_V4L2_DEVICE_PROVIDER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_V4L2_DEVICE_PROVIDER))
#define GST_IS_V4L2_DEVICE_PROVIDER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_V4L2_DEVICE_PROVIDER))
#define GST_V4L2_DEVICE_PROVIDER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_V4L2_DEVICE_PROVIDER, GstV4l2DeviceProviderClass))
#define GST_V4L2_DEVICE_PROVIDER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_V4L2_DEVICE_PROVIDER, GstV4l2DeviceProvider))
#define GST_V4L2_DEVICE_PROVIDER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_DEVICE_PROVIDER, GstV4l2DeviceProviderClass))
#define GST_V4L2_DEVICE_PROVIDER_CAST(obj) ((GstV4l2DeviceProvider *)(obj))
struct _GstV4l2DeviceMonitor {
GstDeviceMonitor parent;
struct _GstV4l2DeviceProvider {
GstDeviceProvider parent;
#ifdef HAVE_GUDEV
GMainContext *context;
......@@ -65,11 +65,11 @@ typedef enum {
GST_V4L2_DEVICE_TYPE_SINK
} GstV4l2DeviceType;
struct _GstV4l2DeviceMonitorClass {
GstDeviceMonitorClass parent_class;
struct _GstV4l2DeviceProviderClass {
GstDeviceProviderClass parent_class;
};
GType gst_v4l2_device_monitor_get_type (void);
GType gst_v4l2_device_provider_get_type (void);
typedef struct _GstV4l2Device GstV4l2Device;
......@@ -98,4 +98,4 @@ struct _GstV4l2DeviceClass {
GType gst_v4l2_device_get_type (void);
#endif /* __GST_V4L2_DEVICE_MONITOR_H__ */
#endif /* __GST_V4L2_DEVICE_PROVIDER_H__ */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment