2023-02-08 18:12:00 +01:00
|
|
|
/* GStreamer */
|
|
|
|
|
/* SPDX-FileCopyrightText: Copyright © 2018 Wim Taymans */
|
|
|
|
|
/* SPDX-License-Identifier: MIT */
|
2015-04-28 17:36:44 +02:00
|
|
|
|
2017-05-23 19:15:33 +02:00
|
|
|
#ifndef __GST_PIPEWIRE_SRC_H__
|
|
|
|
|
#define __GST_PIPEWIRE_SRC_H__
|
2015-04-28 17:36:44 +02:00
|
|
|
|
2024-02-02 02:20:29 +01:00
|
|
|
#include "config.h"
|
|
|
|
|
|
2015-04-28 17:36:44 +02:00
|
|
|
#include <gst/gst.h>
|
|
|
|
|
#include <gst/base/gstpushsrc.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>
|
2018-03-22 16:40:27 +01:00
|
|
|
#include <gst/gstpipewirepool.h>
|
2020-07-13 17:42:09 +02:00
|
|
|
#include <gst/gstpipewirecore.h>
|
2015-04-28 17:36:44 +02:00
|
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
|
2017-05-23 19:15:33 +02:00
|
|
|
#define GST_TYPE_PIPEWIRE_SRC \
|
|
|
|
|
(gst_pipewire_src_get_type())
|
|
|
|
|
#define GST_PIPEWIRE_SRC(obj) \
|
|
|
|
|
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_PIPEWIRE_SRC,GstPipeWireSrc))
|
|
|
|
|
#define GST_PIPEWIRE_SRC_CLASS(klass) \
|
|
|
|
|
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_PIPEWIRE_SRC,GstPipeWireSrcClass))
|
|
|
|
|
#define GST_IS_PIPEWIRE_SRC(obj) \
|
|
|
|
|
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_PIPEWIRE_SRC))
|
|
|
|
|
#define GST_IS_PIPEWIRE_SRC_CLASS(klass) \
|
|
|
|
|
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_PIPEWIRE_SRC))
|
|
|
|
|
#define GST_PIPEWIRE_SRC_CAST(obj) \
|
|
|
|
|
((GstPipeWireSrc *) (obj))
|
|
|
|
|
|
|
|
|
|
typedef struct _GstPipeWireSrc GstPipeWireSrc;
|
|
|
|
|
typedef struct _GstPipeWireSrcClass GstPipeWireSrcClass;
|
2015-04-28 17:36:44 +02:00
|
|
|
|
|
|
|
|
/**
|
2017-05-23 19:15:33 +02:00
|
|
|
* GstPipeWireSrc:
|
2015-04-28 17:36:44 +02:00
|
|
|
*
|
|
|
|
|
* Opaque data structure.
|
|
|
|
|
*/
|
2017-05-23 19:15:33 +02:00
|
|
|
struct _GstPipeWireSrc {
|
2015-04-28 17:36:44 +02:00
|
|
|
GstPushSrc element;
|
|
|
|
|
|
|
|
|
|
/*< private >*/
|
2015-07-09 17:58:54 +02:00
|
|
|
gchar *path;
|
2022-03-06 14:10:55 +02:00
|
|
|
gchar *target_object;
|
2015-07-28 17:05:03 +02:00
|
|
|
gchar *client_name;
|
2017-05-17 11:49:57 +02:00
|
|
|
gboolean always_copy;
|
2020-03-20 17:00:36 +01:00
|
|
|
gint min_buffers;
|
|
|
|
|
gint max_buffers;
|
2018-01-22 17:05:13 +08:00
|
|
|
int fd;
|
2020-07-13 12:11:34 +02:00
|
|
|
gboolean resend_last;
|
2020-07-14 13:54:21 +02:00
|
|
|
gint keepalive_time;
|
2023-02-19 15:38:52 +00:00
|
|
|
gboolean autoconnect;
|
2015-04-28 17:36:44 +02:00
|
|
|
|
2020-08-06 13:03:40 +02:00
|
|
|
GstCaps *caps;
|
|
|
|
|
|
2023-02-03 13:02:49 +08:00
|
|
|
gboolean is_video;
|
|
|
|
|
GstVideoInfo video_info;
|
2024-02-02 02:20:29 +01:00
|
|
|
#ifdef HAVE_GSTREAMER_DMA_DRM
|
|
|
|
|
GstVideoInfoDmaDrm drm_info;
|
|
|
|
|
#endif
|
2023-02-03 13:02:49 +08:00
|
|
|
|
2015-05-14 17:46:12 +02:00
|
|
|
gboolean negotiated;
|
2016-01-07 15:07:15 +01:00
|
|
|
gboolean flushing;
|
2016-04-28 16:42:25 +02:00
|
|
|
gboolean started;
|
2020-07-13 12:11:34 +02:00
|
|
|
gboolean eos;
|
2015-04-28 17:36:44 +02:00
|
|
|
|
2016-04-28 11:18:10 +02:00
|
|
|
gboolean is_live;
|
2024-03-15 17:31:43 +01:00
|
|
|
int64_t delay;
|
2016-04-28 11:18:10 +02:00
|
|
|
GstClockTime min_latency;
|
|
|
|
|
GstClockTime max_latency;
|
|
|
|
|
|
2022-06-03 13:00:52 +02:00
|
|
|
GstStructure *client_properties;
|
2020-07-13 17:42:09 +02:00
|
|
|
GstPipeWireCore *core;
|
2020-05-21 12:22:48 +02:00
|
|
|
struct spa_hook core_listener;
|
|
|
|
|
int last_seq;
|
|
|
|
|
int pending_seq;
|
2016-11-24 17:00:42 +01:00
|
|
|
|
2017-05-23 19:15:33 +02:00
|
|
|
struct pw_stream *stream;
|
2017-08-08 16:56:29 +02:00
|
|
|
struct spa_hook stream_listener;
|
2016-11-24 17:00:42 +01:00
|
|
|
|
2020-07-13 12:11:34 +02:00
|
|
|
GstBuffer *last_buffer;
|
2022-06-03 13:00:52 +02:00
|
|
|
GstStructure *stream_properties;
|
2015-08-24 16:41:04 +02:00
|
|
|
|
2018-03-22 16:40:27 +01:00
|
|
|
GstPipeWirePool *pool;
|
2015-12-02 20:43:37 +01:00
|
|
|
GstClock *clock;
|
2018-08-13 15:19:20 +02:00
|
|
|
GstClockTime last_time;
|
2022-12-03 23:20:52 +01:00
|
|
|
|
|
|
|
|
enum spa_meta_videotransform_value transform_value;
|
2015-04-28 17:36:44 +02:00
|
|
|
};
|
|
|
|
|
|
2017-05-23 19:15:33 +02:00
|
|
|
struct _GstPipeWireSrcClass {
|
2015-04-28 17:36:44 +02:00
|
|
|
GstPushSrcClass parent_class;
|
|
|
|
|
};
|
|
|
|
|
|
2017-05-23 19:15:33 +02:00
|
|
|
GType gst_pipewire_src_get_type (void);
|
2015-04-28 17:36:44 +02:00
|
|
|
|
|
|
|
|
G_END_DECLS
|
|
|
|
|
|
2017-05-23 19:15:33 +02:00
|
|
|
#endif /* __GST_PIPEWIRE_SRC_H__ */
|