mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-08 13:30:08 -05:00
Remove dynamic types
Do not use dynamic types anymore. The reason is that it's difficult: - to maintain a shared type database over a network. - the extra overhead when translating between processes and for maintaining the translation tables. - race conditions in translating in RT-threads, this is a problem because we want to make event streams. We now have simple enums with types and extension points for all types. This is also nicer to use in general. We don't need the mapper anymore or pass strings around as types. There is a parallel type info system to get more info about ids and enums and their hierarchy. It can also be used for debugging.
This commit is contained in:
parent
e6977fa178
commit
fca3e1d85d
162 changed files with 5200 additions and 7461 deletions
|
|
@ -371,13 +371,12 @@ static void port_event_info(void *data, struct pw_port_info *info)
|
|||
struct port_data *port_data = data;
|
||||
struct node_data *node_data = port_data->node_data;
|
||||
GstPipeWireDeviceProvider *self = node_data->self;
|
||||
struct pw_type *t = node_data->self->type;
|
||||
|
||||
pw_log_debug("%p", port_data);
|
||||
|
||||
if (info->change_mask & PW_PORT_CHANGE_MASK_ENUM_PARAMS) {
|
||||
pw_port_proxy_enum_params((struct pw_port_proxy*)port_data->proxy,
|
||||
t->param.idEnumFormat, 0, 0, NULL);
|
||||
SPA_ID_PARAM_EnumFormat, 0, 0, NULL);
|
||||
add_pending(self, &port_data->pending_param, do_add_node, port_data);
|
||||
}
|
||||
}
|
||||
|
|
@ -387,13 +386,11 @@ static void port_event_param(void *data, uint32_t id, uint32_t index, uint32_t n
|
|||
{
|
||||
struct port_data *port_data = data;
|
||||
struct node_data *node_data = port_data->node_data;
|
||||
GstPipeWireDeviceProvider *self = node_data->self;
|
||||
struct pw_type *t = self->type;
|
||||
GstCaps *c1;
|
||||
|
||||
pw_log_debug("%p", port_data);
|
||||
|
||||
c1 = gst_caps_from_format (param, t->map);
|
||||
c1 = gst_caps_from_format (param);
|
||||
if (c1 && node_data->caps)
|
||||
gst_caps_append (node_data->caps, c1);
|
||||
|
||||
|
|
@ -467,11 +464,11 @@ static void registry_event_global(void *data, uint32_t id, uint32_t parent_id, u
|
|||
GstPipeWireDeviceProvider *self = rd->self;
|
||||
struct node_data *nd;
|
||||
|
||||
if (type == self->type->node) {
|
||||
if (type == PW_ID_INTERFACE_Node) {
|
||||
struct pw_node_proxy *node;
|
||||
|
||||
node = pw_registry_proxy_bind(rd->registry,
|
||||
id, self->type->node,
|
||||
id, PW_ID_INTERFACE_Node,
|
||||
PW_VERSION_NODE, sizeof(*nd));
|
||||
if (node == NULL)
|
||||
goto no_mem;
|
||||
|
|
@ -487,7 +484,7 @@ static void registry_event_global(void *data, uint32_t id, uint32_t parent_id, u
|
|||
pw_proxy_add_listener((struct pw_proxy*)node, &nd->proxy_listener, &proxy_node_events, nd);
|
||||
add_pending(self, &nd->pending, NULL, NULL);
|
||||
}
|
||||
else if (type == self->type->port) {
|
||||
else if (type == PW_ID_INTERFACE_Port) {
|
||||
struct pw_port_proxy *port;
|
||||
struct port_data *pd;
|
||||
|
||||
|
|
@ -495,7 +492,7 @@ static void registry_event_global(void *data, uint32_t id, uint32_t parent_id, u
|
|||
return;
|
||||
|
||||
port = pw_registry_proxy_bind(rd->registry,
|
||||
id, self->type->port,
|
||||
id, PW_ID_INTERFACE_Port,
|
||||
PW_VERSION_PORT, sizeof(*pd));
|
||||
if (port == NULL)
|
||||
goto no_mem;
|
||||
|
|
@ -540,7 +537,6 @@ gst_pipewire_device_provider_probe (GstDeviceProvider * provider)
|
|||
GstPipeWireDeviceProvider *self = GST_PIPEWIRE_DEVICE_PROVIDER (provider);
|
||||
struct pw_loop *l = NULL;
|
||||
struct pw_core *c = NULL;
|
||||
struct pw_type *t = NULL;
|
||||
struct pw_remote *r = NULL;
|
||||
struct remote_data *data;
|
||||
struct spa_hook listener;
|
||||
|
|
@ -553,8 +549,6 @@ gst_pipewire_device_provider_probe (GstDeviceProvider * provider)
|
|||
if (!(c = pw_core_new (l, NULL)))
|
||||
return NULL;
|
||||
|
||||
t = pw_core_get_type(c);
|
||||
|
||||
if (!(r = pw_remote_new (c, NULL, sizeof(*data))))
|
||||
goto failed;
|
||||
|
||||
|
|
@ -595,7 +589,8 @@ gst_pipewire_device_provider_probe (GstDeviceProvider * provider)
|
|||
self->devices = NULL;
|
||||
|
||||
self->core_proxy = pw_remote_get_core_proxy(r);
|
||||
data->registry = pw_core_proxy_get_registry(self->core_proxy, t->registry, PW_VERSION_REGISTRY, 0);
|
||||
data->registry = pw_core_proxy_get_registry(self->core_proxy,
|
||||
PW_ID_INTERFACE_Registry, PW_VERSION_REGISTRY, 0);
|
||||
pw_registry_proxy_add_listener(data->registry, &data->registry_listener, ®istry_events, data);
|
||||
pw_core_proxy_sync(self->core_proxy, ++self->seq);
|
||||
|
||||
|
|
@ -641,7 +636,6 @@ gst_pipewire_device_provider_start (GstDeviceProvider * provider)
|
|||
GST_ERROR_OBJECT (self, "Could not create PipeWire core");
|
||||
goto failed_core;
|
||||
}
|
||||
self->type = pw_core_get_type (self->core);
|
||||
|
||||
if (pw_thread_loop_start (self->main_loop) < 0) {
|
||||
GST_ERROR_OBJECT (self, "Could not start PipeWire mainloop");
|
||||
|
|
@ -682,8 +676,8 @@ gst_pipewire_device_provider_start (GstDeviceProvider * provider)
|
|||
get_core_info (self->remote, self);
|
||||
|
||||
self->core_proxy = pw_remote_get_core_proxy(self->remote);
|
||||
self->registry = pw_core_proxy_get_registry(self->core_proxy, self->type->registry,
|
||||
PW_VERSION_REGISTRY, 0);
|
||||
self->registry = pw_core_proxy_get_registry(self->core_proxy,
|
||||
PW_ID_INTERFACE_Registry, PW_VERSION_REGISTRY, 0);
|
||||
|
||||
data->registry = self->registry;
|
||||
|
||||
|
|
@ -709,7 +703,6 @@ failed_remote:
|
|||
failed_start:
|
||||
pw_core_destroy (self->core);
|
||||
self->core = NULL;
|
||||
self->type = NULL;
|
||||
failed_core:
|
||||
pw_thread_loop_destroy (self->main_loop);
|
||||
self->main_loop = NULL;
|
||||
|
|
@ -734,7 +727,6 @@ gst_pipewire_device_provider_stop (GstDeviceProvider * provider)
|
|||
if (self->core) {
|
||||
pw_core_destroy (self->core);
|
||||
self->core = NULL;
|
||||
self->type = NULL;
|
||||
}
|
||||
if (self->main_loop) {
|
||||
pw_thread_loop_destroy (self->main_loop);
|
||||
|
|
|
|||
|
|
@ -85,7 +85,6 @@ struct _GstPipeWireDeviceProvider {
|
|||
struct pw_thread_loop *main_loop;
|
||||
|
||||
struct pw_core *core;
|
||||
struct pw_type *type;
|
||||
|
||||
struct pw_remote *remote;
|
||||
struct spa_hook remote_listener;
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@
|
|||
#include <gst/video/video.h>
|
||||
#include <gst/audio/audio.h>
|
||||
|
||||
#include <spa/utils/type.h>
|
||||
#include <spa/param/video/format-utils.h>
|
||||
#include <spa/param/audio/format-utils.h>
|
||||
#include <spa/pod/builder.h>
|
||||
|
|
@ -32,141 +33,112 @@
|
|||
|
||||
struct media_type {
|
||||
const char *name;
|
||||
uint32_t *media_type;
|
||||
uint32_t *media_subtype;
|
||||
uint32_t media_type;
|
||||
uint32_t media_subtype;
|
||||
};
|
||||
|
||||
static struct {
|
||||
struct spa_type_map *map;
|
||||
uint32_t format;
|
||||
struct spa_type_media_type media_type;
|
||||
struct spa_type_media_subtype media_subtype;
|
||||
struct spa_type_media_subtype_video media_subtype_video;
|
||||
struct spa_type_media_subtype_audio media_subtype_audio;
|
||||
struct spa_type_format_video format_video;
|
||||
struct spa_type_format_audio format_audio;
|
||||
struct spa_type_video_format video_format;
|
||||
struct spa_type_audio_format audio_format;
|
||||
} type = { NULL, };
|
||||
|
||||
static void
|
||||
ensure_types (struct spa_type_map *map)
|
||||
{
|
||||
type.map = map;
|
||||
|
||||
type.format = spa_type_map_get_id (map, SPA_TYPE__Format);
|
||||
spa_type_media_type_map (map, &type.media_type);
|
||||
spa_type_media_subtype_map (map, &type.media_subtype);
|
||||
spa_type_media_subtype_video_map (map, &type.media_subtype_video);
|
||||
spa_type_media_subtype_audio_map (map, &type.media_subtype_audio);
|
||||
spa_type_format_video_map (map, &type.format_video);
|
||||
spa_type_format_audio_map (map, &type.format_audio);
|
||||
spa_type_video_format_map (map, &type.video_format);
|
||||
spa_type_audio_format_map (map, &type.audio_format);
|
||||
}
|
||||
|
||||
static const struct media_type media_type_map[] = {
|
||||
{ "video/x-raw", &type.media_type.video, &type.media_subtype.raw },
|
||||
{ "audio/x-raw", &type.media_type.audio, &type.media_subtype.raw },
|
||||
{ "image/jpeg", &type.media_type.video, &type.media_subtype_video.mjpg },
|
||||
{ "video/x-h264", &type.media_type.video, &type.media_subtype_video.h264 },
|
||||
{ "video/x-raw", SPA_MEDIA_TYPE_video, SPA_MEDIA_SUBTYPE_raw },
|
||||
{ "audio/x-raw", SPA_MEDIA_TYPE_audio, SPA_MEDIA_SUBTYPE_raw },
|
||||
{ "image/jpeg", SPA_MEDIA_TYPE_video, SPA_MEDIA_SUBTYPE_mjpg },
|
||||
{ "video/x-h264", SPA_MEDIA_TYPE_video, SPA_MEDIA_SUBTYPE_h264 },
|
||||
{ NULL, }
|
||||
};
|
||||
|
||||
static const uint32_t *video_format_map[] = {
|
||||
&type.video_format.UNKNOWN,
|
||||
&type.video_format.ENCODED,
|
||||
&type.video_format.I420,
|
||||
&type.video_format.YV12,
|
||||
&type.video_format.YUY2,
|
||||
&type.video_format.UYVY,
|
||||
&type.video_format.AYUV,
|
||||
&type.video_format.RGBx,
|
||||
&type.video_format.BGRx,
|
||||
&type.video_format.xRGB,
|
||||
&type.video_format.xBGR,
|
||||
&type.video_format.RGBA,
|
||||
&type.video_format.BGRA,
|
||||
&type.video_format.ARGB,
|
||||
&type.video_format.ABGR,
|
||||
&type.video_format.RGB,
|
||||
&type.video_format.BGR,
|
||||
&type.video_format.Y41B,
|
||||
&type.video_format.Y42B,
|
||||
&type.video_format.YVYU,
|
||||
&type.video_format.Y444,
|
||||
&type.video_format.v210,
|
||||
&type.video_format.v216,
|
||||
&type.video_format.NV12,
|
||||
&type.video_format.NV21,
|
||||
&type.video_format.GRAY8,
|
||||
&type.video_format.GRAY16_BE,
|
||||
&type.video_format.GRAY16_LE,
|
||||
&type.video_format.v308,
|
||||
&type.video_format.RGB16,
|
||||
&type.video_format.BGR16,
|
||||
&type.video_format.RGB15,
|
||||
&type.video_format.BGR15,
|
||||
&type.video_format.UYVP,
|
||||
&type.video_format.A420,
|
||||
&type.video_format.RGB8P,
|
||||
&type.video_format.YUV9,
|
||||
&type.video_format.YVU9,
|
||||
&type.video_format.IYU1,
|
||||
&type.video_format.ARGB64,
|
||||
&type.video_format.AYUV64,
|
||||
&type.video_format.r210,
|
||||
&type.video_format.I420_10BE,
|
||||
&type.video_format.I420_10LE,
|
||||
&type.video_format.I422_10BE,
|
||||
&type.video_format.I422_10LE,
|
||||
&type.video_format.Y444_10BE,
|
||||
&type.video_format.Y444_10LE,
|
||||
&type.video_format.GBR,
|
||||
&type.video_format.GBR_10BE,
|
||||
&type.video_format.GBR_10LE,
|
||||
&type.video_format.NV16,
|
||||
&type.video_format.NV24,
|
||||
&type.video_format.NV12_64Z32,
|
||||
&type.video_format.A420_10BE,
|
||||
&type.video_format.A420_10LE,
|
||||
&type.video_format.A422_10BE,
|
||||
&type.video_format.A422_10LE,
|
||||
&type.video_format.A444_10BE,
|
||||
&type.video_format.A444_10LE,
|
||||
&type.video_format.NV61,
|
||||
&type.video_format.P010_10BE,
|
||||
&type.video_format.P010_10LE,
|
||||
&type.video_format.IYU2,
|
||||
&type.video_format.VYUY,
|
||||
&type.video_format.GBRA,
|
||||
&type.video_format.GBRA_10BE,
|
||||
&type.video_format.GBRA_10LE,
|
||||
&type.video_format.GBR_12BE,
|
||||
&type.video_format.GBR_12LE,
|
||||
&type.video_format.GBRA_12BE,
|
||||
&type.video_format.GBRA_12LE,
|
||||
&type.video_format.I420_12BE,
|
||||
&type.video_format.I420_12LE,
|
||||
&type.video_format.I422_12BE,
|
||||
&type.video_format.I422_12LE,
|
||||
&type.video_format.Y444_12BE,
|
||||
&type.video_format.Y444_12LE,
|
||||
static const uint32_t video_format_map[] = {
|
||||
SPA_VIDEO_FORMAT_UNKNOWN,
|
||||
SPA_VIDEO_FORMAT_ENCODED,
|
||||
SPA_VIDEO_FORMAT_I420,
|
||||
SPA_VIDEO_FORMAT_YV12,
|
||||
SPA_VIDEO_FORMAT_YUY2,
|
||||
SPA_VIDEO_FORMAT_UYVY,
|
||||
SPA_VIDEO_FORMAT_AYUV,
|
||||
SPA_VIDEO_FORMAT_RGBx,
|
||||
SPA_VIDEO_FORMAT_BGRx,
|
||||
SPA_VIDEO_FORMAT_xRGB,
|
||||
SPA_VIDEO_FORMAT_xBGR,
|
||||
SPA_VIDEO_FORMAT_RGBA,
|
||||
SPA_VIDEO_FORMAT_BGRA,
|
||||
SPA_VIDEO_FORMAT_ARGB,
|
||||
SPA_VIDEO_FORMAT_ABGR,
|
||||
SPA_VIDEO_FORMAT_RGB,
|
||||
SPA_VIDEO_FORMAT_BGR,
|
||||
SPA_VIDEO_FORMAT_Y41B,
|
||||
SPA_VIDEO_FORMAT_Y42B,
|
||||
SPA_VIDEO_FORMAT_YVYU,
|
||||
SPA_VIDEO_FORMAT_Y444,
|
||||
SPA_VIDEO_FORMAT_v210,
|
||||
SPA_VIDEO_FORMAT_v216,
|
||||
SPA_VIDEO_FORMAT_NV12,
|
||||
SPA_VIDEO_FORMAT_NV21,
|
||||
SPA_VIDEO_FORMAT_GRAY8,
|
||||
SPA_VIDEO_FORMAT_GRAY16_BE,
|
||||
SPA_VIDEO_FORMAT_GRAY16_LE,
|
||||
SPA_VIDEO_FORMAT_v308,
|
||||
SPA_VIDEO_FORMAT_RGB16,
|
||||
SPA_VIDEO_FORMAT_BGR16,
|
||||
SPA_VIDEO_FORMAT_RGB15,
|
||||
SPA_VIDEO_FORMAT_BGR15,
|
||||
SPA_VIDEO_FORMAT_UYVP,
|
||||
SPA_VIDEO_FORMAT_A420,
|
||||
SPA_VIDEO_FORMAT_RGB8P,
|
||||
SPA_VIDEO_FORMAT_YUV9,
|
||||
SPA_VIDEO_FORMAT_YVU9,
|
||||
SPA_VIDEO_FORMAT_IYU1,
|
||||
SPA_VIDEO_FORMAT_ARGB64,
|
||||
SPA_VIDEO_FORMAT_AYUV64,
|
||||
SPA_VIDEO_FORMAT_r210,
|
||||
SPA_VIDEO_FORMAT_I420_10BE,
|
||||
SPA_VIDEO_FORMAT_I420_10LE,
|
||||
SPA_VIDEO_FORMAT_I422_10BE,
|
||||
SPA_VIDEO_FORMAT_I422_10LE,
|
||||
SPA_VIDEO_FORMAT_Y444_10BE,
|
||||
SPA_VIDEO_FORMAT_Y444_10LE,
|
||||
SPA_VIDEO_FORMAT_GBR,
|
||||
SPA_VIDEO_FORMAT_GBR_10BE,
|
||||
SPA_VIDEO_FORMAT_GBR_10LE,
|
||||
SPA_VIDEO_FORMAT_NV16,
|
||||
SPA_VIDEO_FORMAT_NV24,
|
||||
SPA_VIDEO_FORMAT_NV12_64Z32,
|
||||
SPA_VIDEO_FORMAT_A420_10BE,
|
||||
SPA_VIDEO_FORMAT_A420_10LE,
|
||||
SPA_VIDEO_FORMAT_A422_10BE,
|
||||
SPA_VIDEO_FORMAT_A422_10LE,
|
||||
SPA_VIDEO_FORMAT_A444_10BE,
|
||||
SPA_VIDEO_FORMAT_A444_10LE,
|
||||
SPA_VIDEO_FORMAT_NV61,
|
||||
SPA_VIDEO_FORMAT_P010_10BE,
|
||||
SPA_VIDEO_FORMAT_P010_10LE,
|
||||
SPA_VIDEO_FORMAT_IYU2,
|
||||
SPA_VIDEO_FORMAT_VYUY,
|
||||
SPA_VIDEO_FORMAT_GBRA,
|
||||
SPA_VIDEO_FORMAT_GBRA_10BE,
|
||||
SPA_VIDEO_FORMAT_GBRA_10LE,
|
||||
SPA_VIDEO_FORMAT_GBR_12BE,
|
||||
SPA_VIDEO_FORMAT_GBR_12LE,
|
||||
SPA_VIDEO_FORMAT_GBRA_12BE,
|
||||
SPA_VIDEO_FORMAT_GBRA_12LE,
|
||||
SPA_VIDEO_FORMAT_I420_12BE,
|
||||
SPA_VIDEO_FORMAT_I420_12LE,
|
||||
SPA_VIDEO_FORMAT_I422_12BE,
|
||||
SPA_VIDEO_FORMAT_I422_12LE,
|
||||
SPA_VIDEO_FORMAT_Y444_12BE,
|
||||
SPA_VIDEO_FORMAT_Y444_12LE,
|
||||
};
|
||||
|
||||
#if __BYTE_ORDER == __BIG_ENDIAN
|
||||
#define _FORMAT_LE(fmt) &type.audio_format. fmt ## _OE
|
||||
#define _FORMAT_BE(fmt) &type.audio_format. fmt
|
||||
#define _FORMAT_LE(fmt) SPA_AUDIO_FORMAT_ ## fmt ## _OE
|
||||
#define _FORMAT_BE(fmt) SPA_AUDIO_FORMAT_ ## fmt
|
||||
#elif __BYTE_ORDER == __LITTLE_ENDIAN
|
||||
#define _FORMAT_LE(fmt) &type.audio_format. fmt
|
||||
#define _FORMAT_BE(fmt) &type.audio_format. fmt ## _OE
|
||||
#define _FORMAT_LE(fmt) SPA_AUDIO_FORMAT_ ## fmt
|
||||
#define _FORMAT_BE(fmt) SPA_AUDIO_FORMAT_ ## fmt ## _OE
|
||||
#endif
|
||||
|
||||
static const uint32_t *audio_format_map[] = {
|
||||
&type.audio_format.UNKNOWN,
|
||||
&type.audio_format.ENCODED,
|
||||
&type.audio_format.S8,
|
||||
&type.audio_format.U8,
|
||||
static const uint32_t audio_format_map[] = {
|
||||
SPA_AUDIO_FORMAT_UNKNOWN,
|
||||
SPA_AUDIO_FORMAT_ENCODED,
|
||||
SPA_AUDIO_FORMAT_S8,
|
||||
SPA_AUDIO_FORMAT_U8,
|
||||
_FORMAT_LE (S16),
|
||||
_FORMAT_BE (S16),
|
||||
_FORMAT_LE (U16),
|
||||
|
|
@ -217,6 +189,15 @@ find_media_types (const char *name)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
static int find_index(const uint32_t *items, int n_items, uint32_t id)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < n_items; i++)
|
||||
if (items[i] == id)
|
||||
return i;
|
||||
return -1;
|
||||
}
|
||||
|
||||
static const char *
|
||||
get_nth_string (const GValue *val, int idx)
|
||||
{
|
||||
|
|
@ -385,12 +366,12 @@ handle_video_fields (ConvertData *d)
|
|||
for (i = 0; (v = get_nth_string (value, i)); i++) {
|
||||
if (i == 0)
|
||||
spa_pod_builder_push_prop (&d->b,
|
||||
type.format_video.format,
|
||||
SPA_FORMAT_VIDEO_format,
|
||||
get_range_type (value));
|
||||
|
||||
idx = gst_video_format_from_string (v);
|
||||
if (idx < SPA_N_ELEMENTS (video_format_map))
|
||||
spa_pod_builder_id (&d->b, *video_format_map[idx]);
|
||||
spa_pod_builder_id (&d->b, video_format_map[idx]);
|
||||
}
|
||||
prop = spa_pod_builder_pop(&d->b);
|
||||
if (i > 1)
|
||||
|
|
@ -403,7 +384,7 @@ handle_video_fields (ConvertData *d)
|
|||
for (i = 0; get_nth_rectangle (value, value2, i, &v); i++) {
|
||||
if (i == 0)
|
||||
spa_pod_builder_push_prop (&d->b,
|
||||
type.format_video.size,
|
||||
SPA_FORMAT_VIDEO_size,
|
||||
get_range_type2 (value, value2));
|
||||
|
||||
spa_pod_builder_rectangle (&d->b, v.width, v.height);
|
||||
|
|
@ -419,7 +400,7 @@ handle_video_fields (ConvertData *d)
|
|||
for (i = 0; get_nth_fraction (value, i, &v); i++) {
|
||||
if (i == 0)
|
||||
spa_pod_builder_push_prop (&d->b,
|
||||
type.format_video.framerate,
|
||||
SPA_FORMAT_VIDEO_framerate,
|
||||
get_range_type (value));
|
||||
|
||||
spa_pod_builder_fraction (&d->b, v.num, v.denom);
|
||||
|
|
@ -435,7 +416,7 @@ handle_video_fields (ConvertData *d)
|
|||
for (i = 0; get_nth_fraction (value, i, &v); i++) {
|
||||
if (i == 0)
|
||||
spa_pod_builder_push_prop (&d->b,
|
||||
type.format_video.max_framerate,
|
||||
SPA_FORMAT_VIDEO_maxFramerate,
|
||||
get_range_type (value));
|
||||
|
||||
spa_pod_builder_fraction (&d->b, v.num, v.denom);
|
||||
|
|
@ -461,12 +442,12 @@ handle_audio_fields (ConvertData *d)
|
|||
for (i = 0; (v = get_nth_string (value, i)); i++) {
|
||||
if (i == 0)
|
||||
spa_pod_builder_push_prop (&d->b,
|
||||
type.format_audio.format,
|
||||
SPA_FORMAT_AUDIO_format,
|
||||
get_range_type (value));
|
||||
|
||||
idx = gst_audio_format_from_string (v);
|
||||
if (idx < SPA_N_ELEMENTS (audio_format_map))
|
||||
spa_pod_builder_id (&d->b, *audio_format_map[idx]);
|
||||
spa_pod_builder_id (&d->b, audio_format_map[idx]);
|
||||
}
|
||||
prop = spa_pod_builder_pop(&d->b);
|
||||
if (i > 1)
|
||||
|
|
@ -488,7 +469,7 @@ handle_audio_fields (ConvertData *d)
|
|||
|
||||
if (i == 0)
|
||||
spa_pod_builder_push_prop (&d->b,
|
||||
type.format_audio.layout,
|
||||
SPA_FORMAT_AUDIO_layout,
|
||||
get_range_type (value));
|
||||
|
||||
spa_pod_builder_int (&d->b, layout);
|
||||
|
|
@ -503,7 +484,7 @@ handle_audio_fields (ConvertData *d)
|
|||
for (i = 0; get_nth_int (value, i, &v); i++) {
|
||||
if (i == 0)
|
||||
spa_pod_builder_push_prop (&d->b,
|
||||
type.format_audio.rate,
|
||||
SPA_FORMAT_AUDIO_rate,
|
||||
get_range_type (value));
|
||||
|
||||
spa_pod_builder_int (&d->b, v);
|
||||
|
|
@ -518,7 +499,7 @@ handle_audio_fields (ConvertData *d)
|
|||
for (i = 0; get_nth_int (value, i, &v); i++) {
|
||||
if (i == 0)
|
||||
spa_pod_builder_push_prop (&d->b,
|
||||
type.format_audio.channels,
|
||||
SPA_FORMAT_AUDIO_channels,
|
||||
get_range_type (value));
|
||||
|
||||
spa_pod_builder_int (&d->b, v);
|
||||
|
|
@ -553,13 +534,13 @@ convert_1 (ConvertData *d)
|
|||
|
||||
d->b.write = write_pod;
|
||||
|
||||
spa_pod_builder_push_object (&d->b, d->id, type.format);
|
||||
spa_pod_builder_id(&d->b, *d->type->media_type);
|
||||
spa_pod_builder_id(&d->b, *d->type->media_subtype);
|
||||
spa_pod_builder_push_object (&d->b, d->id, SPA_ID_OBJECT_Format);
|
||||
spa_pod_builder_id(&d->b, d->type->media_type);
|
||||
spa_pod_builder_id(&d->b, d->type->media_subtype);
|
||||
|
||||
if (*d->type->media_type == type.media_type.video)
|
||||
if (d->type->media_type == SPA_MEDIA_TYPE_video)
|
||||
handle_video_fields (d);
|
||||
else if (*d->type->media_type == type.media_type.audio)
|
||||
else if (d->type->media_type == SPA_MEDIA_TYPE_audio)
|
||||
handle_audio_fields (d);
|
||||
|
||||
spa_pod_builder_pop (&d->b);
|
||||
|
|
@ -568,7 +549,7 @@ convert_1 (ConvertData *d)
|
|||
}
|
||||
|
||||
struct spa_pod *
|
||||
gst_caps_to_format (GstCaps *caps, guint index, uint32_t id, struct spa_type_map *map)
|
||||
gst_caps_to_format (GstCaps *caps, guint index, uint32_t id)
|
||||
{
|
||||
ConvertData d;
|
||||
struct spa_pod *res;
|
||||
|
|
@ -576,8 +557,6 @@ gst_caps_to_format (GstCaps *caps, guint index, uint32_t id, struct spa_type_map
|
|||
g_return_val_if_fail (GST_IS_CAPS (caps), NULL);
|
||||
g_return_val_if_fail (gst_caps_is_fixed (caps), NULL);
|
||||
|
||||
ensure_types(map);
|
||||
|
||||
spa_zero (d);
|
||||
d.cf = gst_caps_get_features (caps, index);
|
||||
d.cs = gst_caps_get_structure (caps, index);
|
||||
|
|
@ -607,12 +586,10 @@ foreach_func (GstCapsFeatures *features,
|
|||
|
||||
|
||||
GPtrArray *
|
||||
gst_caps_to_format_all (GstCaps *caps, uint32_t id, struct spa_type_map *map)
|
||||
gst_caps_to_format_all (GstCaps *caps, uint32_t id)
|
||||
{
|
||||
ConvertData d;
|
||||
|
||||
ensure_types(map);
|
||||
|
||||
spa_zero (d);
|
||||
d.id = id;
|
||||
d.array = g_ptr_array_new_full (gst_caps_get_size (caps), (GDestroyNotify)g_free);
|
||||
|
|
@ -622,8 +599,26 @@ gst_caps_to_format_all (GstCaps *caps, uint32_t id, struct spa_type_map *map)
|
|||
return d.array;
|
||||
}
|
||||
|
||||
typedef const char *(*id_to_string_func)(uint32_t id);
|
||||
|
||||
static const char *video_id_to_string(uint32_t id)
|
||||
{
|
||||
int idx;
|
||||
if ((idx = find_index(video_format_map, SPA_N_ELEMENTS(video_format_map), id)) == -1)
|
||||
return NULL;
|
||||
return gst_video_format_to_string(idx);
|
||||
}
|
||||
|
||||
static const char *audio_id_to_string(uint32_t id)
|
||||
{
|
||||
int idx;
|
||||
if ((idx = find_index(audio_format_map, SPA_N_ELEMENTS(audio_format_map), id)) == -1)
|
||||
return NULL;
|
||||
return gst_audio_format_to_string(idx);
|
||||
}
|
||||
|
||||
static void
|
||||
handle_id_prop (struct spa_pod_prop *prop, const char *key, GstCaps *res)
|
||||
handle_id_prop (struct spa_pod_prop *prop, const char *key, id_to_string_func func, GstCaps *res)
|
||||
{
|
||||
const char * str;
|
||||
uint32_t *id = SPA_POD_CONTENTS (struct spa_pod_prop, prop);
|
||||
|
|
@ -636,7 +631,7 @@ handle_id_prop (struct spa_pod_prop *prop, const char *key, GstCaps *res)
|
|||
|
||||
switch (flags & SPA_POD_PROP_RANGE_MASK) {
|
||||
case SPA_POD_PROP_RANGE_NONE:
|
||||
if (!(str = spa_type_map_get_type (type.map, id[0])))
|
||||
if (!(str = func(id[0])))
|
||||
return;
|
||||
gst_caps_set_simple (res, key, G_TYPE_STRING, rindex (str, ':') + 1, NULL);
|
||||
break;
|
||||
|
|
@ -646,7 +641,7 @@ handle_id_prop (struct spa_pod_prop *prop, const char *key, GstCaps *res)
|
|||
|
||||
g_value_init (&list, GST_TYPE_LIST);
|
||||
for (i = 1; i < n_items; i++) {
|
||||
if (!(str = spa_type_map_get_type (type.map, id[i])))
|
||||
if (!(str = func(id[i])))
|
||||
continue;
|
||||
|
||||
g_value_init (&v, G_TYPE_STRING);
|
||||
|
|
@ -798,58 +793,56 @@ handle_fraction_prop (struct spa_pod_prop *prop, const char *key, GstCaps *res)
|
|||
}
|
||||
}
|
||||
GstCaps *
|
||||
gst_caps_from_format (const struct spa_pod *format, struct spa_type_map *map)
|
||||
gst_caps_from_format (const struct spa_pod *format)
|
||||
{
|
||||
GstCaps *res = NULL;
|
||||
uint32_t media_type, media_subtype;
|
||||
struct spa_pod_prop *prop;
|
||||
|
||||
ensure_types(map);
|
||||
|
||||
spa_pod_object_parse(format, "I", &media_type,
|
||||
"I", &media_subtype);
|
||||
|
||||
if (media_type == type.media_type.video) {
|
||||
if (media_subtype == type.media_subtype.raw) {
|
||||
if (media_type == SPA_MEDIA_TYPE_video) {
|
||||
if (media_subtype == SPA_MEDIA_SUBTYPE_raw) {
|
||||
res = gst_caps_new_empty_simple ("video/x-raw");
|
||||
if ((prop = spa_pod_find_prop (format, type.format_video.format))) {
|
||||
handle_id_prop (prop, "format", res);
|
||||
if ((prop = spa_pod_find_prop (format, SPA_FORMAT_VIDEO_format))) {
|
||||
handle_id_prop (prop, "format", video_id_to_string, res);
|
||||
}
|
||||
}
|
||||
else if (media_subtype == type.media_subtype_video.mjpg) {
|
||||
else if (media_subtype == SPA_MEDIA_SUBTYPE_mjpg) {
|
||||
res = gst_caps_new_empty_simple ("image/jpeg");
|
||||
}
|
||||
else if (media_subtype == type.media_subtype_video.h264) {
|
||||
else if (media_subtype == SPA_MEDIA_SUBTYPE_h264) {
|
||||
res = gst_caps_new_simple ("video/x-h264",
|
||||
"stream-format", G_TYPE_STRING, "byte-stream",
|
||||
"alignment", G_TYPE_STRING, "au",
|
||||
NULL);
|
||||
}
|
||||
if ((prop = spa_pod_find_prop (format, type.format_video.size))) {
|
||||
if ((prop = spa_pod_find_prop (format, SPA_FORMAT_VIDEO_size))) {
|
||||
handle_rect_prop (prop, "width", "height", res);
|
||||
}
|
||||
if ((prop = spa_pod_find_prop (format, type.format_video.framerate))) {
|
||||
if ((prop = spa_pod_find_prop (format, SPA_FORMAT_VIDEO_framerate))) {
|
||||
handle_fraction_prop (prop, "framerate", res);
|
||||
}
|
||||
if ((prop = spa_pod_find_prop (format, type.format_video.max_framerate))) {
|
||||
if ((prop = spa_pod_find_prop (format, SPA_FORMAT_VIDEO_maxFramerate))) {
|
||||
handle_fraction_prop (prop, "max-framerate", res);
|
||||
}
|
||||
} else if (media_type == type.media_type.audio) {
|
||||
if (media_subtype == type.media_subtype.raw) {
|
||||
} else if (media_type == SPA_MEDIA_TYPE_audio) {
|
||||
if (media_subtype == SPA_MEDIA_SUBTYPE_raw) {
|
||||
res = gst_caps_new_simple ("audio/x-raw",
|
||||
"layout", G_TYPE_STRING, "interleaved",
|
||||
NULL);
|
||||
if ((prop = spa_pod_find_prop (format, type.format_audio.format))) {
|
||||
handle_id_prop (prop, "format", res);
|
||||
if ((prop = spa_pod_find_prop (format, SPA_FORMAT_AUDIO_format))) {
|
||||
handle_id_prop (prop, "format", audio_id_to_string, res);
|
||||
}
|
||||
if ((prop = spa_pod_find_prop (format, type.format_audio.rate))) {
|
||||
if ((prop = spa_pod_find_prop (format, SPA_FORMAT_AUDIO_rate))) {
|
||||
handle_int_prop (prop, "rate", res);
|
||||
}
|
||||
if ((prop = spa_pod_find_prop (format, type.format_audio.channels))) {
|
||||
if ((prop = spa_pod_find_prop (format, SPA_FORMAT_AUDIO_channels))) {
|
||||
handle_int_prop (prop, "channels", res);
|
||||
}
|
||||
}
|
||||
else if (media_subtype == type.media_subtype_audio.aac) {
|
||||
else if (media_subtype == SPA_MEDIA_SUBTYPE_aac) {
|
||||
}
|
||||
}
|
||||
return res;
|
||||
|
|
|
|||
|
|
@ -22,17 +22,15 @@
|
|||
|
||||
#include <gst/gst.h>
|
||||
|
||||
#include <spa/support/type-map.h>
|
||||
#include <spa/pod/pod.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
struct spa_pod * gst_caps_to_format (GstCaps *caps,
|
||||
guint index, uint32_t id,
|
||||
struct spa_type_map *map);
|
||||
GPtrArray * gst_caps_to_format_all (GstCaps *caps, uint32_t id, struct spa_type_map *map);
|
||||
guint index, uint32_t id);
|
||||
GPtrArray * gst_caps_to_format_all (GstCaps *caps, uint32_t id);
|
||||
|
||||
GstCaps * gst_caps_from_format (const struct spa_pod *format, struct spa_type_map *map);
|
||||
GstCaps * gst_caps_from_format (const struct spa_pod *format);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
|
|
|||
|
|
@ -71,7 +71,6 @@ void gst_pipewire_pool_wrap_buffer (GstPipeWirePool *pool, struct pw_buffer *b)
|
|||
GstBuffer *buf;
|
||||
uint32_t i;
|
||||
GstPipeWirePoolData *data;
|
||||
struct pw_type *t = pool->t;
|
||||
|
||||
GST_LOG_OBJECT (pool, "wrap buffer");
|
||||
|
||||
|
|
@ -84,19 +83,19 @@ void gst_pipewire_pool_wrap_buffer (GstPipeWirePool *pool, struct pw_buffer *b)
|
|||
GstMemory *gmem = NULL;
|
||||
|
||||
GST_LOG_OBJECT (pool, "wrap buffer %d %d", d->mapoffset, d->maxsize);
|
||||
if (d->type == t->data.MemFd) {
|
||||
if (d->type == SPA_DATA_MemFd) {
|
||||
gmem = gst_fd_allocator_alloc (pool->fd_allocator, dup (d->fd),
|
||||
d->mapoffset + d->maxsize, GST_FD_MEMORY_FLAG_NONE);
|
||||
gst_memory_resize (gmem, d->mapoffset, d->maxsize);
|
||||
data->offset = d->mapoffset;
|
||||
}
|
||||
else if(d->type == t->data.DmaBuf) {
|
||||
else if(d->type == SPA_DATA_DmaBuf) {
|
||||
gmem = gst_dmabuf_allocator_alloc (pool->dmabuf_allocator, dup (d->fd),
|
||||
d->mapoffset + d->maxsize);
|
||||
gst_memory_resize (gmem, d->mapoffset, d->maxsize);
|
||||
data->offset = d->mapoffset;
|
||||
}
|
||||
else if (d->type == t->data.MemPtr) {
|
||||
else if (d->type == SPA_DATA_MemPtr) {
|
||||
gmem = gst_memory_new_wrapped (0, d->data, d->maxsize, 0,
|
||||
d->maxsize, NULL, NULL);
|
||||
data->offset = 0;
|
||||
|
|
@ -107,7 +106,7 @@ void gst_pipewire_pool_wrap_buffer (GstPipeWirePool *pool, struct pw_buffer *b)
|
|||
|
||||
data->pool = gst_object_ref (pool);
|
||||
data->owner = NULL;
|
||||
data->header = spa_buffer_find_meta_data (b->buffer, t->meta.Header, sizeof(*data->header));
|
||||
data->header = spa_buffer_find_meta_data (b->buffer, SPA_META_Header, sizeof(*data->header));
|
||||
data->flags = GST_BUFFER_FLAGS (buf);
|
||||
data->b = b;
|
||||
data->buf = buf;
|
||||
|
|
|
|||
|
|
@ -217,7 +217,6 @@ gst_pipewire_sink_class_init (GstPipeWireSinkClass * klass)
|
|||
static void
|
||||
pool_activated (GstPipeWirePool *pool, GstPipeWireSink *sink)
|
||||
{
|
||||
struct pw_type *t = sink->type;
|
||||
GstStructure *config;
|
||||
GstCaps *caps;
|
||||
guint size;
|
||||
|
|
@ -231,27 +230,27 @@ pool_activated (GstPipeWirePool *pool, GstPipeWireSink *sink)
|
|||
gst_buffer_pool_config_get_params (config, &caps, &size, &min_buffers, &max_buffers);
|
||||
|
||||
spa_pod_builder_init (&b, buffer, sizeof (buffer));
|
||||
spa_pod_builder_push_object (&b, t->param.idBuffers, t->param_buffers.Buffers);
|
||||
spa_pod_builder_push_object (&b, SPA_ID_PARAM_Buffers, SPA_ID_OBJECT_ParamBuffers);
|
||||
if (size == 0)
|
||||
spa_pod_builder_add (&b,
|
||||
":", t->param_buffers.size, "iru", 0, SPA_POD_PROP_MIN_MAX(0, INT32_MAX), NULL);
|
||||
":", SPA_PARAM_BUFFERS_size, "iru", 0, SPA_POD_PROP_MIN_MAX(0, INT32_MAX), NULL);
|
||||
else
|
||||
spa_pod_builder_add (&b,
|
||||
":", t->param_buffers.size, "iru", size, SPA_POD_PROP_MIN_MAX(size, INT32_MAX), NULL);
|
||||
":", SPA_PARAM_BUFFERS_size, "iru", size, SPA_POD_PROP_MIN_MAX(size, INT32_MAX), NULL);
|
||||
|
||||
spa_pod_builder_add (&b,
|
||||
":", t->param_buffers.stride, "iru", 0, SPA_POD_PROP_MIN_MAX(0, INT32_MAX),
|
||||
":", t->param_buffers.buffers, "iru", min_buffers,
|
||||
":", SPA_PARAM_BUFFERS_stride, "iru", 0, SPA_POD_PROP_MIN_MAX(0, INT32_MAX),
|
||||
":", SPA_PARAM_BUFFERS_buffers, "iru", min_buffers,
|
||||
SPA_POD_PROP_MIN_MAX(min_buffers,
|
||||
max_buffers ? max_buffers : INT32_MAX),
|
||||
":", t->param_buffers.align, "i", 16,
|
||||
":", SPA_PARAM_BUFFERS_align, "i", 16,
|
||||
NULL);
|
||||
port_params[0] = spa_pod_builder_pop (&b);
|
||||
|
||||
port_params[1] = spa_pod_builder_object (&b,
|
||||
t->param.idMeta, t->param_meta.Meta,
|
||||
":", t->param_meta.type, "I", t->meta.Header,
|
||||
":", t->param_meta.size, "i", sizeof (struct spa_meta_header));
|
||||
SPA_ID_PARAM_Meta, SPA_ID_OBJECT_ParamMeta,
|
||||
":", SPA_PARAM_META_type, "I", SPA_META_Header,
|
||||
":", SPA_PARAM_META_size, "i", sizeof (struct spa_meta_header));
|
||||
|
||||
|
||||
pw_thread_loop_lock (sink->main_loop);
|
||||
|
|
@ -274,8 +273,6 @@ gst_pipewire_sink_init (GstPipeWireSink * sink)
|
|||
sink->loop = pw_loop_new (NULL);
|
||||
sink->main_loop = pw_thread_loop_new (sink->loop, "pipewire-sink-loop");
|
||||
sink->core = pw_core_new (sink->loop, NULL);
|
||||
sink->type = pw_core_get_type (sink->core);
|
||||
sink->pool->t = sink->type;
|
||||
GST_DEBUG ("loop %p %p", sink->loop, sink->main_loop);
|
||||
}
|
||||
|
||||
|
|
@ -510,12 +507,10 @@ gst_pipewire_sink_setcaps (GstBaseSink * bsink, GstCaps * caps)
|
|||
enum pw_stream_state state;
|
||||
const char *error = NULL;
|
||||
gboolean res = FALSE;
|
||||
struct pw_type *t;
|
||||
|
||||
pwsink = GST_PIPEWIRE_SINK (bsink);
|
||||
t = pwsink->type;
|
||||
|
||||
possible = gst_caps_to_format_all (caps, t->param.idEnumFormat, t->map);
|
||||
possible = gst_caps_to_format_all (caps, SPA_ID_PARAM_EnumFormat);
|
||||
|
||||
pw_thread_loop_lock (pwsink->main_loop);
|
||||
state = pw_stream_get_state (pwsink->stream, &error);
|
||||
|
|
|
|||
|
|
@ -82,7 +82,6 @@ struct _GstPipeWireSink {
|
|||
struct pw_thread_loop *main_loop;
|
||||
|
||||
struct pw_core *core;
|
||||
struct pw_type *type;
|
||||
struct pw_remote *remote;
|
||||
struct spa_hook remote_listener;
|
||||
|
||||
|
|
|
|||
|
|
@ -203,7 +203,6 @@ gst_pipewire_src_finalize (GObject * object)
|
|||
|
||||
pw_core_destroy (pwsrc->core);
|
||||
pwsrc->core = NULL;
|
||||
pwsrc->type = NULL;
|
||||
pw_thread_loop_destroy (pwsrc->main_loop);
|
||||
pwsrc->main_loop = NULL;
|
||||
pw_loop_destroy (pwsrc->loop);
|
||||
|
|
@ -326,8 +325,6 @@ gst_pipewire_src_init (GstPipeWireSrc * src)
|
|||
src->loop = pw_loop_new (NULL);
|
||||
src->main_loop = pw_thread_loop_new (src->loop, "pipewire-main-loop");
|
||||
src->core = pw_core_new (src->loop, NULL);
|
||||
src->type = pw_core_get_type (src->core);
|
||||
src->pool->t = src->type;
|
||||
GST_DEBUG ("loop %p, mainloop %p", src->loop, src->main_loop);
|
||||
|
||||
}
|
||||
|
|
@ -590,7 +587,7 @@ gst_pipewire_src_negotiate (GstBaseSrc * basesrc)
|
|||
GST_DEBUG_OBJECT (basesrc, "have common caps: %" GST_PTR_FORMAT, caps);
|
||||
|
||||
/* open a connection with these caps */
|
||||
possible = gst_caps_to_format_all (caps, pwsrc->type->param.idEnumFormat, pwsrc->type->map);
|
||||
possible = gst_caps_to_format_all (caps, SPA_ID_PARAM_EnumFormat);
|
||||
gst_caps_unref (caps);
|
||||
|
||||
/* first disconnect */
|
||||
|
|
@ -686,8 +683,6 @@ on_format_changed (void *data,
|
|||
GstPipeWireSrc *pwsrc = data;
|
||||
GstCaps *caps;
|
||||
gboolean res;
|
||||
struct pw_core *core = pwsrc->core;
|
||||
struct pw_type *t = pw_core_get_type(core);
|
||||
|
||||
if (format == NULL) {
|
||||
GST_DEBUG_OBJECT (pwsrc, "clear format");
|
||||
|
|
@ -695,7 +690,7 @@ on_format_changed (void *data,
|
|||
return;
|
||||
}
|
||||
|
||||
caps = gst_caps_from_format (format, t->map);
|
||||
caps = gst_caps_from_format (format);
|
||||
GST_DEBUG_OBJECT (pwsrc, "we got format %" GST_PTR_FORMAT, caps);
|
||||
res = gst_base_src_set_caps (GST_BASE_SRC (pwsrc), caps);
|
||||
gst_caps_unref (caps);
|
||||
|
|
@ -707,16 +702,17 @@ on_format_changed (void *data,
|
|||
|
||||
spa_pod_builder_init (&b, buffer, sizeof (buffer));
|
||||
params[0] = spa_pod_builder_object (&b,
|
||||
t->param.idBuffers, t->param_buffers.Buffers,
|
||||
":", t->param_buffers.size, "iru", 0, SPA_POD_PROP_MIN_MAX(0, INT32_MAX),
|
||||
":", t->param_buffers.stride, "iru", 0, SPA_POD_PROP_MIN_MAX(0, INT32_MAX),
|
||||
":", t->param_buffers.buffers, "iru", 16, SPA_POD_PROP_MIN_MAX(1, INT32_MAX),
|
||||
":", t->param_buffers.align, "i", 16);
|
||||
SPA_ID_PARAM_Buffers, SPA_ID_OBJECT_ParamBuffers,
|
||||
":", SPA_PARAM_BUFFERS_buffers, "iru", 16, SPA_POD_PROP_MIN_MAX(1, INT32_MAX),
|
||||
":", SPA_PARAM_BUFFERS_blocks, "iru", 0, SPA_POD_PROP_MIN_MAX(1, INT32_MAX),
|
||||
":", SPA_PARAM_BUFFERS_size, "iru", 0, SPA_POD_PROP_MIN_MAX(0, INT32_MAX),
|
||||
":", SPA_PARAM_BUFFERS_stride, "iru", 0, SPA_POD_PROP_MIN_MAX(0, INT32_MAX),
|
||||
":", SPA_PARAM_BUFFERS_align, "i", 16);
|
||||
|
||||
params[1] = spa_pod_builder_object (&b,
|
||||
t->param.idMeta, t->param_meta.Meta,
|
||||
":", t->param_meta.type, "I", t->meta.Header,
|
||||
":", t->param_meta.size, "i", sizeof (struct spa_meta_header));
|
||||
SPA_ID_PARAM_Meta, SPA_ID_OBJECT_ParamMeta,
|
||||
":", SPA_PARAM_META_type, "I", SPA_META_Header,
|
||||
":", SPA_PARAM_META_size, "i", sizeof (struct spa_meta_header));
|
||||
|
||||
GST_DEBUG_OBJECT (pwsrc, "doing finish format");
|
||||
pw_stream_finish_format (pwsrc->stream, 0, params, 2);
|
||||
|
|
|
|||
|
|
@ -70,7 +70,6 @@ struct _GstPipeWireSrc {
|
|||
struct pw_thread_loop *main_loop;
|
||||
|
||||
struct pw_core *core;
|
||||
struct pw_type *type;
|
||||
struct pw_remote *remote;
|
||||
struct spa_hook remote_listener;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue