mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-03 09:01:54 -05:00
Try to use source_path consistently
This commit is contained in:
parent
1e4e4ef185
commit
f268cdfda6
8 changed files with 28 additions and 28 deletions
|
|
@ -34,7 +34,7 @@ fill_info (PinosSourceInfo *info, GDBusProxy *proxy)
|
||||||
|
|
||||||
info->id = proxy;
|
info->id = proxy;
|
||||||
|
|
||||||
info->path = g_dbus_proxy_get_object_path (proxy);
|
info->source_path = g_dbus_proxy_get_object_path (proxy);
|
||||||
|
|
||||||
if ((variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "Name"))) {
|
if ((variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "Name"))) {
|
||||||
info->name = g_variant_get_string (variant, NULL);
|
info->name = g_variant_get_string (variant, NULL);
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ typedef enum {
|
||||||
/**
|
/**
|
||||||
* PinosSourceInfo:
|
* PinosSourceInfo:
|
||||||
* @id: generic id of the source
|
* @id: generic id of the source
|
||||||
* @path: the unique path of the source, suitable for connecting
|
* @source_path: the unique path of the source, suitable for connecting
|
||||||
* @name: name the source, suitable for display
|
* @name: name the source, suitable for display
|
||||||
* @properties: the properties of the source
|
* @properties: the properties of the source
|
||||||
* @state: the current state of the source
|
* @state: the current state of the source
|
||||||
|
|
@ -61,7 +61,7 @@ typedef enum {
|
||||||
*/
|
*/
|
||||||
typedef struct {
|
typedef struct {
|
||||||
gpointer id;
|
gpointer id;
|
||||||
const char *path;
|
const char *source_path;
|
||||||
const char *name;
|
const char *name;
|
||||||
GVariant *properties;
|
GVariant *properties;
|
||||||
PinosSourceState state;
|
PinosSourceState state;
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@ struct _PinosStreamPrivate
|
||||||
PinosStreamState state;
|
PinosStreamState state;
|
||||||
GError *error;
|
GError *error;
|
||||||
|
|
||||||
gchar *target;
|
gchar *source_path;
|
||||||
GBytes *accepted_formats;
|
GBytes *accepted_formats;
|
||||||
gboolean provide;
|
gboolean provide;
|
||||||
|
|
||||||
|
|
@ -226,7 +226,7 @@ pinos_stream_finalize (GObject * object)
|
||||||
if (priv->format)
|
if (priv->format)
|
||||||
g_bytes_unref (priv->format);
|
g_bytes_unref (priv->format);
|
||||||
|
|
||||||
g_free (priv->target);
|
g_free (priv->source_path);
|
||||||
if (priv->accepted_formats)
|
if (priv->accepted_formats)
|
||||||
g_bytes_unref (priv->accepted_formats);
|
g_bytes_unref (priv->accepted_formats);
|
||||||
|
|
||||||
|
|
@ -530,7 +530,7 @@ do_connect_capture (PinosStream *stream)
|
||||||
g_dbus_proxy_call (context->priv->client,
|
g_dbus_proxy_call (context->priv->client,
|
||||||
"CreateSourceOutput",
|
"CreateSourceOutput",
|
||||||
g_variant_new ("(ss)",
|
g_variant_new ("(ss)",
|
||||||
(priv->target ? priv->target : ""),
|
(priv->source_path ? priv->source_path : ""),
|
||||||
g_bytes_get_data (priv->accepted_formats, NULL)),
|
g_bytes_get_data (priv->accepted_formats, NULL)),
|
||||||
G_DBUS_CALL_FLAGS_NONE,
|
G_DBUS_CALL_FLAGS_NONE,
|
||||||
-1,
|
-1,
|
||||||
|
|
@ -544,17 +544,17 @@ do_connect_capture (PinosStream *stream)
|
||||||
/**
|
/**
|
||||||
* pinos_stream_connect_capture:
|
* pinos_stream_connect_capture:
|
||||||
* @stream: a #PinosStream
|
* @stream: a #PinosStream
|
||||||
* @path: the source path to connect to
|
* @source_path: the source path to connect to
|
||||||
* @flags: a #PinosStreamFlags
|
* @flags: a #PinosStreamFlags
|
||||||
* @spec: a #GVariant
|
* @spec: a #GVariant
|
||||||
*
|
*
|
||||||
* Connect @stream for capturing from @path.
|
* Connect @stream for capturing from @source_path.
|
||||||
*
|
*
|
||||||
* Returns: %TRUE on success.
|
* Returns: %TRUE on success.
|
||||||
*/
|
*/
|
||||||
gboolean
|
gboolean
|
||||||
pinos_stream_connect_capture (PinosStream *stream,
|
pinos_stream_connect_capture (PinosStream *stream,
|
||||||
const gchar *path,
|
const gchar *source_path,
|
||||||
PinosStreamFlags flags,
|
PinosStreamFlags flags,
|
||||||
GBytes *accepted_formats)
|
GBytes *accepted_formats)
|
||||||
{
|
{
|
||||||
|
|
@ -568,8 +568,8 @@ pinos_stream_connect_capture (PinosStream *stream,
|
||||||
context = priv->context;
|
context = priv->context;
|
||||||
g_return_val_if_fail (pinos_context_get_state (context) == PINOS_CONTEXT_STATE_READY, FALSE);
|
g_return_val_if_fail (pinos_context_get_state (context) == PINOS_CONTEXT_STATE_READY, FALSE);
|
||||||
|
|
||||||
g_free (priv->target);
|
g_free (priv->source_path);
|
||||||
priv->target = g_strdup (path);
|
priv->source_path = g_strdup (source_path);
|
||||||
if (priv->accepted_formats)
|
if (priv->accepted_formats)
|
||||||
g_bytes_unref (priv->accepted_formats);
|
g_bytes_unref (priv->accepted_formats);
|
||||||
priv->accepted_formats = g_bytes_ref (accepted_formats);
|
priv->accepted_formats = g_bytes_ref (accepted_formats);
|
||||||
|
|
|
||||||
|
|
@ -101,7 +101,7 @@ PinosStreamState pinos_stream_get_state (PinosStream *stream);
|
||||||
const GError * pinos_stream_get_error (PinosStream *stream);
|
const GError * pinos_stream_get_error (PinosStream *stream);
|
||||||
|
|
||||||
gboolean pinos_stream_connect_capture (PinosStream *stream,
|
gboolean pinos_stream_connect_capture (PinosStream *stream,
|
||||||
const gchar *path,
|
const gchar *source_path,
|
||||||
PinosStreamFlags flags,
|
PinosStreamFlags flags,
|
||||||
GBytes *accepted_formats);
|
GBytes *accepted_formats);
|
||||||
gboolean pinos_stream_connect_provide (PinosStream *stream,
|
gboolean pinos_stream_connect_provide (PinosStream *stream,
|
||||||
|
|
|
||||||
|
|
@ -635,7 +635,7 @@ pinos_subscribe_class_init (PinosSubscribeClass * klass)
|
||||||
* @subscribe: The #PinosSubscribe emitting the signal.
|
* @subscribe: The #PinosSubscribe emitting the signal.
|
||||||
* @event: A #PinosSubscriptionEvent
|
* @event: A #PinosSubscriptionEvent
|
||||||
* @flags: #PinosSubscriptionFlags indicating the object
|
* @flags: #PinosSubscriptionFlags indicating the object
|
||||||
* @path: the object path
|
* @id: the unique and opaque object id
|
||||||
*
|
*
|
||||||
* Notify about a new object that was added/removed/modified.
|
* Notify about a new object that was added/removed/modified.
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -88,7 +88,7 @@ gst_pinos_device_create_element (GstDevice * device, const gchar * name)
|
||||||
GstElement *elem;
|
GstElement *elem;
|
||||||
|
|
||||||
elem = gst_element_factory_make (pinos_dev->element, name);
|
elem = gst_element_factory_make (pinos_dev->element, name);
|
||||||
g_object_set (elem, "source", pinos_dev->path, NULL);
|
g_object_set (elem, "path", pinos_dev->path, NULL);
|
||||||
|
|
||||||
return elem;
|
return elem;
|
||||||
}
|
}
|
||||||
|
|
@ -108,7 +108,7 @@ gst_pinos_device_reconfigure_element (GstDevice * device, GstElement * element)
|
||||||
g_assert_not_reached ();
|
g_assert_not_reached ();
|
||||||
}
|
}
|
||||||
|
|
||||||
g_object_set (element, "source", pinos_dev->path, NULL);
|
g_object_set (element, "path", pinos_dev->path, NULL);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,7 @@ GST_DEBUG_CATEGORY_STATIC (pinos_src_debug);
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
PROP_0,
|
PROP_0,
|
||||||
PROP_SOURCE
|
PROP_PATH
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -87,9 +87,9 @@ gst_pinos_src_set_property (GObject * object, guint prop_id,
|
||||||
GstPinosSrc *pinossrc = GST_PINOS_SRC (object);
|
GstPinosSrc *pinossrc = GST_PINOS_SRC (object);
|
||||||
|
|
||||||
switch (prop_id) {
|
switch (prop_id) {
|
||||||
case PROP_SOURCE:
|
case PROP_PATH:
|
||||||
g_free (pinossrc->source);
|
g_free (pinossrc->path);
|
||||||
pinossrc->source = g_value_dup_string (value);
|
pinossrc->path = g_value_dup_string (value);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|
@ -105,8 +105,8 @@ gst_pinos_src_get_property (GObject * object, guint prop_id,
|
||||||
GstPinosSrc *pinossrc = GST_PINOS_SRC (object);
|
GstPinosSrc *pinossrc = GST_PINOS_SRC (object);
|
||||||
|
|
||||||
switch (prop_id) {
|
switch (prop_id) {
|
||||||
case PROP_SOURCE:
|
case PROP_PATH:
|
||||||
g_value_set_string (value, pinossrc->source);
|
g_value_set_string (value, pinossrc->path);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|
@ -121,7 +121,7 @@ gst_pinos_src_finalize (GObject * object)
|
||||||
GstPinosSrc *pinossrc = GST_PINOS_SRC (object);
|
GstPinosSrc *pinossrc = GST_PINOS_SRC (object);
|
||||||
|
|
||||||
g_object_unref (pinossrc->fd_allocator);
|
g_object_unref (pinossrc->fd_allocator);
|
||||||
g_free (pinossrc->source);
|
g_free (pinossrc->path);
|
||||||
|
|
||||||
G_OBJECT_CLASS (parent_class)->finalize (object);
|
G_OBJECT_CLASS (parent_class)->finalize (object);
|
||||||
}
|
}
|
||||||
|
|
@ -144,10 +144,10 @@ gst_pinos_src_class_init (GstPinosSrcClass * klass)
|
||||||
gobject_class->get_property = gst_pinos_src_get_property;
|
gobject_class->get_property = gst_pinos_src_get_property;
|
||||||
|
|
||||||
g_object_class_install_property (gobject_class,
|
g_object_class_install_property (gobject_class,
|
||||||
PROP_SOURCE,
|
PROP_PATH,
|
||||||
g_param_spec_string ("source",
|
g_param_spec_string ("path",
|
||||||
"Source",
|
"Path",
|
||||||
"The source name to connect to (NULL = default)",
|
"The source path to connect to (NULL = default)",
|
||||||
NULL,
|
NULL,
|
||||||
G_PARAM_READWRITE |
|
G_PARAM_READWRITE |
|
||||||
G_PARAM_STATIC_STRINGS));
|
G_PARAM_STATIC_STRINGS));
|
||||||
|
|
@ -304,7 +304,7 @@ gst_pinos_src_negotiate (GstBaseSrc * basesrc)
|
||||||
accepted = g_bytes_new_take (str, strlen (str) + 1);
|
accepted = g_bytes_new_take (str, strlen (str) + 1);
|
||||||
|
|
||||||
pinos_main_loop_lock (pinossrc->loop);
|
pinos_main_loop_lock (pinossrc->loop);
|
||||||
pinos_stream_connect_capture (pinossrc->stream, pinossrc->source, 0, accepted);
|
pinos_stream_connect_capture (pinossrc->stream, pinossrc->path, 0, accepted);
|
||||||
|
|
||||||
while (TRUE) {
|
while (TRUE) {
|
||||||
PinosStreamState state = pinos_stream_get_state (pinossrc->stream);
|
PinosStreamState state = pinos_stream_get_state (pinossrc->stream);
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,7 @@ struct _GstPinosSrc {
|
||||||
GstPushSrc element;
|
GstPushSrc element;
|
||||||
|
|
||||||
/*< private >*/
|
/*< private >*/
|
||||||
gchar *source;
|
gchar *path;
|
||||||
|
|
||||||
gboolean negotiated;
|
gboolean negotiated;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue