2023-02-08 18:12:00 +01:00
|
|
|
/* GStreamer */
|
|
|
|
|
/* SPDX-FileCopyrightText: Copyright © 2018 Wim Taymans */
|
|
|
|
|
/* SPDX-License-Identifier: MIT */
|
2017-05-23 19:15:33 +02:00
|
|
|
|
|
|
|
|
#ifndef __GST_PIPEWIRE_POOL_H__
|
|
|
|
|
#define __GST_PIPEWIRE_POOL_H__
|
|
|
|
|
|
2024-06-01 17:15:09 +03:00
|
|
|
#include "gstpipewirestream.h"
|
|
|
|
|
|
2017-05-23 19:15:33 +02:00
|
|
|
#include <gst/gst.h>
|
|
|
|
|
|
2023-02-03 13:02:49 +08:00
|
|
|
#include <gst/video/video.h>
|
|
|
|
|
|
2017-07-11 15:57:20 +02:00
|
|
|
#include <pipewire/pipewire.h>
|
2017-05-23 19:15:33 +02:00
|
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
|
2024-06-01 18:01:42 +03:00
|
|
|
#define GST_TYPE_PIPEWIRE_POOL (gst_pipewire_pool_get_type())
|
|
|
|
|
G_DECLARE_FINAL_TYPE (GstPipeWirePool, gst_pipewire_pool, GST, PIPEWIRE_POOL, GstBufferPool)
|
2017-05-23 19:15:33 +02:00
|
|
|
|
2018-03-22 16:40:27 +01:00
|
|
|
typedef struct _GstPipeWirePoolData GstPipeWirePoolData;
|
|
|
|
|
struct _GstPipeWirePoolData {
|
|
|
|
|
GstPipeWirePool *pool;
|
|
|
|
|
void *owner;
|
|
|
|
|
struct spa_meta_header *header;
|
|
|
|
|
guint flags;
|
|
|
|
|
struct pw_buffer *b;
|
|
|
|
|
GstBuffer *buf;
|
2020-05-05 13:07:12 +02:00
|
|
|
gboolean queued;
|
2020-07-31 11:44:46 +02:00
|
|
|
struct spa_meta_region *crop;
|
2022-12-03 23:20:52 +01:00
|
|
|
struct spa_meta_videotransform *videotransform;
|
2018-03-22 16:40:27 +01:00
|
|
|
};
|
|
|
|
|
|
2017-05-23 19:15:33 +02:00
|
|
|
struct _GstPipeWirePool {
|
|
|
|
|
GstBufferPool parent;
|
|
|
|
|
|
2024-06-01 17:15:09 +03:00
|
|
|
GWeakRef stream;
|
2024-05-28 17:34:45 +03:00
|
|
|
guint n_buffers;
|
2018-03-22 16:40:27 +01:00
|
|
|
|
2023-02-03 13:02:49 +08:00
|
|
|
gboolean add_metavideo;
|
|
|
|
|
GstVideoInfo video_info;
|
|
|
|
|
|
2018-03-22 16:40:27 +01:00
|
|
|
GstAllocator *fd_allocator;
|
|
|
|
|
GstAllocator *dmabuf_allocator;
|
|
|
|
|
|
2017-05-23 19:15:33 +02:00
|
|
|
GCond cond;
|
2025-01-17 16:33:15 +01:00
|
|
|
gboolean paused;
|
2017-05-23 19:15:33 +02:00
|
|
|
};
|
|
|
|
|
|
2024-06-01 17:15:09 +03:00
|
|
|
GstPipeWirePool * gst_pipewire_pool_new (GstPipeWireStream *stream);
|
2017-05-23 19:15:33 +02:00
|
|
|
|
2018-03-22 16:40:27 +01:00
|
|
|
void gst_pipewire_pool_wrap_buffer (GstPipeWirePool *pool, struct pw_buffer *buffer);
|
2024-05-28 16:47:15 +03:00
|
|
|
void gst_pipewire_pool_remove_buffer (GstPipeWirePool *pool, struct pw_buffer *buffer);
|
2018-03-22 16:40:27 +01:00
|
|
|
|
2024-05-28 17:34:45 +03:00
|
|
|
static inline gboolean
|
|
|
|
|
gst_pipewire_pool_has_buffers (GstPipeWirePool *pool)
|
|
|
|
|
{
|
|
|
|
|
return pool->n_buffers > 0;
|
|
|
|
|
}
|
|
|
|
|
|
2018-03-22 16:40:27 +01:00
|
|
|
GstPipeWirePoolData *gst_pipewire_pool_get_data (GstBuffer *buffer);
|
|
|
|
|
|
2025-01-17 16:33:15 +01:00
|
|
|
void gst_pipewire_pool_set_paused (GstPipeWirePool *pool, gboolean paused);
|
|
|
|
|
|
2017-05-23 19:15:33 +02:00
|
|
|
G_END_DECLS
|
|
|
|
|
|
|
|
|
|
#endif /* __GST_PIPEWIRE_POOL_H__ */
|