mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-04 13:30:12 -05:00
parent
acffe1b90b
commit
bc4370e195
4 changed files with 51 additions and 9 deletions
|
|
@ -134,6 +134,7 @@ endif
|
|||
pipewire_module_protocol_pulse_sources = [
|
||||
'module-protocol-pulse.c',
|
||||
'module-protocol-pulse/collect.c',
|
||||
'module-protocol-pulse/dbus-name.c',
|
||||
'module-protocol-pulse/format.c',
|
||||
'module-protocol-pulse/manager.c',
|
||||
'module-protocol-pulse/pulse-server.c',
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* pulseaudio server
|
||||
/* PipeWire
|
||||
*
|
||||
* Copyright © 2019 Wim Taymans
|
||||
*
|
||||
|
|
@ -22,10 +22,18 @@
|
|||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include <dbus/dbus.h>
|
||||
#include <spa/support/dbus.h>
|
||||
#include <errno.h>
|
||||
|
||||
static void *dbus_request_name(struct pw_context *context, const char *name)
|
||||
#include <dbus/dbus.h>
|
||||
|
||||
#include <spa/support/dbus.h>
|
||||
#include <spa/support/plugin.h>
|
||||
#include <pipewire/context.h>
|
||||
#include <pipewire/log.h>
|
||||
|
||||
#include "dbus-name.h"
|
||||
|
||||
void *dbus_request_name(struct pw_context *context, const char *name)
|
||||
{
|
||||
struct spa_dbus *dbus;
|
||||
struct spa_dbus_connection *conn;
|
||||
|
|
@ -42,12 +50,12 @@ static void *dbus_request_name(struct pw_context *context, const char *name)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
conn = spa_dbus_get_connection(dbus, SPA_DBUS_TYPE_SESSION);
|
||||
if (conn == NULL)
|
||||
conn = spa_dbus_get_connection(dbus, SPA_DBUS_TYPE_SESSION);
|
||||
if (conn == NULL)
|
||||
return NULL;
|
||||
|
||||
bus = spa_dbus_connection_get(conn);
|
||||
if (bus == NULL)
|
||||
if (bus == NULL)
|
||||
return NULL;
|
||||
|
||||
dbus_error_init(&error);
|
||||
|
|
@ -68,7 +76,7 @@ static void *dbus_request_name(struct pw_context *context, const char *name)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
static void dbus_release_name(void *data)
|
||||
void dbus_release_name(void *data)
|
||||
{
|
||||
struct spa_dbus_connection *conn = data;
|
||||
spa_dbus_connection_destroy(conn);
|
||||
|
|
|
|||
33
src/modules/module-protocol-pulse/dbus-name.h
Normal file
33
src/modules/module-protocol-pulse/dbus-name.h
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
/* PipeWire
|
||||
*
|
||||
* Copyright © 2019 Wim Taymans
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the next
|
||||
* paragraph) shall be included in all copies or substantial portions of the
|
||||
* Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef PULSE_SERVER_DBUS_NAME_H
|
||||
#define PULSE_SERVER_DBUS_NAME_H
|
||||
|
||||
struct pw_context;
|
||||
|
||||
void *dbus_request_name(struct pw_context *context, const char *name);
|
||||
void dbus_release_name(void *data);
|
||||
|
||||
#endif /* PULSE_SERVER_DBUS_NAME_H */
|
||||
|
|
@ -82,6 +82,7 @@
|
|||
#include "pulse-server.h"
|
||||
#include "collect.h"
|
||||
#include "commands.h"
|
||||
#include "dbus-name.h"
|
||||
#include "defs.h"
|
||||
#include "format.h"
|
||||
#include "internal.h"
|
||||
|
|
@ -103,7 +104,6 @@
|
|||
|
||||
#include "message.c"
|
||||
#include "manager.h"
|
||||
#include "dbus-name.c"
|
||||
|
||||
static bool debug_messages = false;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue