impl-device.h
Go to the documentation of this file.
/* PipeWire
*
* Copyright © 2018 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 PIPEWIRE_IMPL_DEVICE_H
#define PIPEWIRE_IMPL_DEVICE_H
#ifdef __cplusplus
extern "C" {
#endif
struct pw_impl_device;
#include <spa/monitor/device.h>
#include <pipewire/context.h>
#include <pipewire/global.h>
#include <pipewire/properties.h>
#include <pipewire/resource.h>
struct pw_impl_device_events {
#define PW_VERSION_IMPL_DEVICE_EVENTS 0
uint32_t version;
void (*destroy) (void *data);
void (*free) (void *data);
void (*initialized) (void *data);
void (*info_changed) (void *data, const struct pw_device_info *info);
};
struct pw_impl_device *pw_context_create_device(struct pw_context *context,
struct pw_properties *properties,
size_t user_data_size);
int pw_impl_device_register(struct pw_impl_device *device,
struct pw_properties *properties);
void pw_impl_device_destroy(struct pw_impl_device *device);
void *pw_impl_device_get_user_data(struct pw_impl_device *device);
int pw_impl_device_set_implementation(struct pw_impl_device *device, struct spa_device *spa_device);
struct spa_device *pw_impl_device_get_implementation(struct pw_impl_device *device);
struct pw_global *pw_impl_device_get_global(struct pw_impl_device *device);
void pw_impl_device_add_listener(struct pw_impl_device *device,
struct spa_hook *listener,
const struct pw_impl_device_events *events,
void *data);
int pw_impl_device_update_properties(struct pw_impl_device *device, const struct spa_dict *dict);
const struct pw_properties *pw_impl_device_get_properties(struct pw_impl_device *device);
int pw_impl_device_for_each_param(struct pw_impl_device *device,
int seq, uint32_t param_id,
uint32_t index, uint32_t max,
const struct spa_pod *filter,
int (*callback) (void *data, int seq,
uint32_t id, uint32_t index, uint32_t next,
struct spa_pod *param),
void *data);
#ifdef __cplusplus
}
#endif
#endif /* PIPEWIRE_IMPL_DEVICE_H */
context.h
pipewire/context.h
global.h
pipewire/global.h
pw_impl_device_get_user_data
void * pw_impl_device_get_user_data(struct pw_impl_device *device)
Definition: impl-device.c:917
pw_impl_device_destroy
void pw_impl_device_destroy(struct pw_impl_device *device)
Definition: impl-device.c:196
pw_impl_device_set_implementation
int pw_impl_device_set_implementation(struct pw_impl_device *device, struct spa_device *spa_device)
Set the device implementation.
Definition: impl-device.c:880
pw_impl_device_get_global
struct pw_global * pw_impl_device_get_global(struct pw_impl_device *device)
Get the global of this device.
Definition: impl-device.c:923
pw_impl_device_get_implementation
struct spa_device * pw_impl_device_get_implementation(struct pw_impl_device *device)
Get the device implementation.
Definition: impl-device.c:897
pw_impl_device_register
int pw_impl_device_register(struct pw_impl_device *device, struct pw_properties *properties)
Definition: impl-device.c:557
pw_context_create_device
struct pw_impl_device * pw_context_create_device(struct pw_context *context, struct pw_properties *properties, size_t user_data_size)
Definition: impl-device.c:143
pw_impl_device_add_listener
void pw_impl_device_add_listener(struct pw_impl_device *device, struct spa_hook *listener, const struct pw_impl_device_events *events, void *data)
Add an event listener.
Definition: impl-device.c:929
pw_impl_device_for_each_param
int pw_impl_device_for_each_param(struct pw_impl_device *device, int seq, uint32_t param_id, uint32_t index, uint32_t max, const struct spa_pod *filter, int(*callback)(void *data, int seq, uint32_t id, uint32_t index, uint32_t next, struct spa_pod *param), void *data)
Definition: impl-device.c:295
pw_impl_device_update_properties
int pw_impl_device_update_properties(struct pw_impl_device *device, const struct spa_dict *dict)
Definition: impl-device.c:909
pw_impl_device_get_properties
const struct pw_properties * pw_impl_device_get_properties(struct pw_impl_device *device)
Definition: impl-device.c:903
properties.h
pipewire/properties.h
resource.h
pipewire/resource.h
device.h
spa/monitor/device.h
pw_context
pw_device_info
The device information.
Definition: device.h:59
pw_global
Definition: context.h:67
pw_impl_device_events
Device events, listen to them with pw_impl_device_add_listener.
Definition: impl-device.h:61
pw_impl_device_events::free
void(* free)(void *data)
the device is freed
Definition: impl-device.h:69
pw_impl_device_events::destroy
void(* destroy)(void *data)
the device is destroyed
Definition: impl-device.h:67
pw_impl_device_events::initialized
void(* initialized)(void *data)
the device is initialized
Definition: impl-device.h:71
pw_impl_device_events::version
uint32_t version
Definition: impl-device.h:64
pw_impl_device_events::info_changed
void(* info_changed)(void *data, const struct pw_device_info *info)
the device info changed
Definition: impl-device.h:74
pw_impl_device
pw_properties
Definition: properties.h:53
spa_device
Definition: device.h:60
spa_dict
Definition: dict.h:59
spa_hook
A hook, contains the structure with functions and the data passed to the functions.
Definition: hook.h:342
spa_pod
Definition: pod.h:63