mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-12-15 08:56:38 -05:00
clock: remove clock interface
Remove the clock interface, we need to get timing information with an io area to get the required precision and performance.
This commit is contained in:
parent
83bb8dc599
commit
fba00fb791
22 changed files with 31 additions and 516 deletions
|
|
@ -28,7 +28,6 @@
|
|||
#include <spa/support/log.h>
|
||||
#include <spa/support/loop.h>
|
||||
#include <spa/utils/list.h>
|
||||
#include <spa/clock/clock.h>
|
||||
#include <spa/node/node.h>
|
||||
#include <spa/node/io.h>
|
||||
#include <spa/param/video/format-utils.h>
|
||||
|
|
@ -71,7 +70,6 @@ struct buffer {
|
|||
|
||||
struct type {
|
||||
uint32_t node;
|
||||
uint32_t clock;
|
||||
uint32_t format;
|
||||
uint32_t props;
|
||||
uint32_t prop_unknown;
|
||||
|
|
@ -105,7 +103,6 @@ struct type {
|
|||
static inline void init_type(struct type *type, struct spa_type_map *map)
|
||||
{
|
||||
type->node = spa_type_map_get_id(map, SPA_TYPE__Node);
|
||||
type->clock = spa_type_map_get_id(map, SPA_TYPE__Clock);
|
||||
type->format = spa_type_map_get_id(map, SPA_TYPE__Format);
|
||||
type->props = spa_type_map_get_id(map, SPA_TYPE__Props);
|
||||
type->prop_unknown = spa_type_map_get_id(map, SPA_TYPE_PROPS__unknown);
|
||||
|
|
@ -189,7 +186,6 @@ struct port {
|
|||
struct impl {
|
||||
struct spa_handle handle;
|
||||
struct spa_node node;
|
||||
struct spa_clock clock;
|
||||
|
||||
struct spa_type_map *map;
|
||||
struct spa_log *log;
|
||||
|
|
@ -905,52 +901,6 @@ static const struct spa_node impl_node = {
|
|||
impl_node_process,
|
||||
};
|
||||
|
||||
static int impl_clock_enum_params(struct spa_clock *clock, uint32_t id, uint32_t *index,
|
||||
struct spa_pod **param,
|
||||
struct spa_pod_builder *builder)
|
||||
{
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
static int impl_clock_set_param(struct spa_clock *clock,
|
||||
uint32_t id, uint32_t flags,
|
||||
const struct spa_pod *param)
|
||||
{
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
static int impl_clock_get_time(struct spa_clock *clock,
|
||||
int32_t *rate,
|
||||
int64_t *ticks,
|
||||
int64_t *monotonic_time)
|
||||
{
|
||||
struct impl *this;
|
||||
struct port *port;
|
||||
|
||||
spa_return_val_if_fail(clock != NULL, -EINVAL);
|
||||
|
||||
this = SPA_CONTAINER_OF(clock, struct impl, clock);
|
||||
port = GET_OUT_PORT(this, 0);
|
||||
|
||||
if (rate)
|
||||
*rate = SPA_USEC_PER_SEC;
|
||||
if (ticks)
|
||||
*ticks = port->last_ticks;
|
||||
if (monotonic_time)
|
||||
*monotonic_time = port->last_monotonic;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct spa_clock impl_clock = {
|
||||
SPA_VERSION_CLOCK,
|
||||
NULL,
|
||||
SPA_CLOCK_STATE_STOPPED,
|
||||
impl_clock_enum_params,
|
||||
impl_clock_set_param,
|
||||
impl_clock_get_time,
|
||||
};
|
||||
|
||||
static int impl_get_interface(struct spa_handle *handle, uint32_t interface_id, void **interface)
|
||||
{
|
||||
struct impl *this;
|
||||
|
|
@ -962,8 +912,6 @@ static int impl_get_interface(struct spa_handle *handle, uint32_t interface_id,
|
|||
|
||||
if (interface_id == this->type.node)
|
||||
*interface = &this->node;
|
||||
else if (interface_id == this->type.clock)
|
||||
*interface = &this->clock;
|
||||
else
|
||||
return -ENOENT;
|
||||
|
||||
|
|
@ -1028,7 +976,6 @@ impl_init(const struct spa_handle_factory *factory,
|
|||
init_type(&this->type, this->map);
|
||||
|
||||
this->node = impl_node;
|
||||
this->clock = impl_clock;
|
||||
|
||||
reset_props(&this->props);
|
||||
|
||||
|
|
@ -1053,7 +1000,6 @@ impl_init(const struct spa_handle_factory *factory,
|
|||
|
||||
static const struct spa_interface_info impl_interfaces[] = {
|
||||
{SPA_TYPE__Node,},
|
||||
{SPA_TYPE__Clock,},
|
||||
};
|
||||
|
||||
static int impl_enum_interface_info(const struct spa_handle_factory *factory,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue