2023-02-08 18:12:00 +01:00
|
|
|
/* PipeWire */
|
|
|
|
|
/* SPDX-FileCopyrightText: Copyright © 2020 Wim Taymans */
|
|
|
|
|
/* SPDX-License-Identifier: MIT */
|
2021-06-18 22:23:53 +02:00
|
|
|
|
|
|
|
|
#ifndef PULSE_SERVER_SAMPLE_H
|
|
|
|
|
#define PULSE_SERVER_SAMPLE_H
|
|
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
|
|
|
|
|
|
#include "format.h"
|
|
|
|
|
|
|
|
|
|
struct impl;
|
|
|
|
|
struct pw_properties;
|
|
|
|
|
|
|
|
|
|
struct sample {
|
|
|
|
|
int ref;
|
|
|
|
|
uint32_t index;
|
|
|
|
|
struct impl *impl;
|
|
|
|
|
const char *name;
|
|
|
|
|
struct sample_spec ss;
|
|
|
|
|
struct channel_map map;
|
|
|
|
|
struct pw_properties *props;
|
|
|
|
|
uint32_t length;
|
|
|
|
|
uint8_t *buffer;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
void sample_free(struct sample *sample);
|
|
|
|
|
|
2021-11-17 11:30:39 +01:00
|
|
|
static inline struct sample *sample_ref(struct sample *sample)
|
|
|
|
|
{
|
|
|
|
|
sample->ref++;
|
|
|
|
|
return sample;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline void sample_unref(struct sample *sample)
|
|
|
|
|
{
|
|
|
|
|
if (--sample->ref == 0)
|
|
|
|
|
sample_free(sample);
|
|
|
|
|
}
|
|
|
|
|
|
2021-06-18 22:23:53 +02:00
|
|
|
#endif /* PULSE_SERVER_SAMPLE_H */
|