mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-04 13:30:12 -05:00
stream: Use path as the string identifier for a source
Cleanup headers avoid strlen because we can
This commit is contained in:
parent
cca0e8eb15
commit
533ec2c19d
2 changed files with 24 additions and 23 deletions
|
|
@ -455,12 +455,13 @@ on_source_output_proxy (GObject *source_object,
|
||||||
|
|
||||||
v = g_dbus_proxy_get_cached_property (priv->source_output, "PossibleFormats");
|
v = g_dbus_proxy_get_cached_property (priv->source_output, "PossibleFormats");
|
||||||
if (v) {
|
if (v) {
|
||||||
str = g_variant_dup_string (v, NULL);
|
gsize len;
|
||||||
|
str = g_variant_dup_string (v, &len);
|
||||||
g_variant_unref (v);
|
g_variant_unref (v);
|
||||||
|
|
||||||
if (priv->possible_formats)
|
if (priv->possible_formats)
|
||||||
g_bytes_unref (priv->possible_formats);
|
g_bytes_unref (priv->possible_formats);
|
||||||
priv->possible_formats = g_bytes_new_take (str, strlen (str) + 1);
|
priv->possible_formats = g_bytes_new_take (str, len + 1);
|
||||||
|
|
||||||
g_object_notify (G_OBJECT (stream), "possible-formats");
|
g_object_notify (G_OBJECT (stream), "possible-formats");
|
||||||
}
|
}
|
||||||
|
|
@ -543,17 +544,17 @@ do_connect_capture (PinosStream *stream)
|
||||||
/**
|
/**
|
||||||
* pinos_stream_connect_capture:
|
* pinos_stream_connect_capture:
|
||||||
* @stream: a #PinosStream
|
* @stream: a #PinosStream
|
||||||
* @source: the source name to connect to
|
* @path: the source path to connect to
|
||||||
* @flags: a #PinosStreamFlags
|
* @flags: a #PinosStreamFlags
|
||||||
* @spec: a #GVariant
|
* @spec: a #GVariant
|
||||||
*
|
*
|
||||||
* Connect @stream for capturing from @source.
|
* Connect @stream for capturing from @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 *source,
|
const gchar *path,
|
||||||
PinosStreamFlags flags,
|
PinosStreamFlags flags,
|
||||||
GBytes *accepted_formats)
|
GBytes *accepted_formats)
|
||||||
{
|
{
|
||||||
|
|
@ -568,7 +569,7 @@ pinos_stream_connect_capture (PinosStream *stream,
|
||||||
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->target);
|
||||||
priv->target = g_strdup (source);
|
priv->target = g_strdup (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);
|
||||||
|
|
|
||||||
|
|
@ -93,30 +93,30 @@ struct _PinosStreamClass {
|
||||||
GType pinos_stream_get_type (void);
|
GType pinos_stream_get_type (void);
|
||||||
|
|
||||||
|
|
||||||
PinosStream * pinos_stream_new (PinosContext * context,
|
PinosStream * pinos_stream_new (PinosContext *context,
|
||||||
const gchar *name,
|
const gchar *name,
|
||||||
GVariant * props);
|
GVariant *props);
|
||||||
|
|
||||||
PinosStreamState pinos_stream_get_state (PinosStream *stream);
|
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 *source,
|
const gchar *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,
|
||||||
PinosStreamFlags flags,
|
PinosStreamFlags flags,
|
||||||
GBytes *possible_formats);
|
GBytes *possible_formats);
|
||||||
gboolean pinos_stream_disconnect (PinosStream *stream);
|
gboolean pinos_stream_disconnect (PinosStream *stream);
|
||||||
|
|
||||||
gboolean pinos_stream_start (PinosStream *stream,
|
gboolean pinos_stream_start (PinosStream *stream,
|
||||||
GBytes *format,
|
GBytes *format,
|
||||||
PinosStreamMode mode);
|
PinosStreamMode mode);
|
||||||
gboolean pinos_stream_stop (PinosStream *stream);
|
gboolean pinos_stream_stop (PinosStream *stream);
|
||||||
|
|
||||||
gboolean pinos_stream_capture_buffer (PinosStream *stream,
|
gboolean pinos_stream_capture_buffer (PinosStream *stream,
|
||||||
PinosBufferInfo *info);
|
PinosBufferInfo *info);
|
||||||
gboolean pinos_stream_provide_buffer (PinosStream *stream,
|
gboolean pinos_stream_provide_buffer (PinosStream *stream,
|
||||||
PinosBufferInfo *info);
|
PinosBufferInfo *info);
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue