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"
|
|
|
|
|
|
2024-05-29 17:56:38 +03:00
|
|
|
#include "gstpipewirestream.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
|
|
|
|
|
|
2024-06-01 18:01:42 +03:00
|
|
|
#define GST_TYPE_PIPEWIRE_SRC (gst_pipewire_src_get_type())
|
|
|
|
|
#define GST_PIPEWIRE_SRC_CAST(obj) ((GstPipeWireSrc *) (obj))
|
|
|
|
|
G_DECLARE_FINAL_TYPE (GstPipeWireSrc, gst_pipewire_src, GST, PIPEWIRE_SRC, GstPushSrc)
|
|
|
|
|
|
2025-03-24 15:50:22 +05:30
|
|
|
/**
|
|
|
|
|
* GstPipeWireSrcOnDisconnect:
|
|
|
|
|
* @GST_PIPEWIRE_SRC_ON_DISCONNECT_EOS: send EoS downstream
|
|
|
|
|
* @GST_PIPEWIRE_SRC_ON_DISCONNECT_ERROR: raise pipeline error
|
|
|
|
|
* @GST_PIPEWIRE_SRC_ON_DISCONNECT_NONE: no action
|
|
|
|
|
*
|
|
|
|
|
* Different actions on disconnect.
|
|
|
|
|
*/
|
|
|
|
|
typedef enum
|
|
|
|
|
{
|
|
|
|
|
GST_PIPEWIRE_SRC_ON_DISCONNECT_NONE,
|
|
|
|
|
GST_PIPEWIRE_SRC_ON_DISCONNECT_EOS,
|
|
|
|
|
GST_PIPEWIRE_SRC_ON_DISCONNECT_ERROR,
|
|
|
|
|
} GstPipeWireSrcOnDisconnect;
|
|
|
|
|
|
|
|
|
|
#define GST_TYPE_PIPEWIRE_SRC_ON_DISCONNECT (gst_pipewire_src_on_disconnect_get_type ())
|
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;
|
|
|
|
|
|
2024-05-29 17:56:38 +03:00
|
|
|
GstPipeWireStream *stream;
|
|
|
|
|
|
2015-04-28 17:36:44 +02:00
|
|
|
/*< private >*/
|
2025-03-24 15:50:22 +05:30
|
|
|
gint n_buffers;
|
2025-01-24 21:07:55 +05:30
|
|
|
gint use_bufferpool;
|
2020-03-20 17:00:36 +01:00
|
|
|
gint min_buffers;
|
|
|
|
|
gint max_buffers;
|
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;
|
2024-05-28 16:59:01 +02:00
|
|
|
GstCaps *possible_caps;
|
2020-08-06 13:03:40 +02:00
|
|
|
|
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;
|
2025-03-24 15:50:22 +05:30
|
|
|
gboolean flushing_on_remove_buffer;
|
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;
|
|
|
|
|
|
2020-07-13 12:11:34 +02:00
|
|
|
GstBuffer *last_buffer;
|
2022-12-03 23:20:52 +01:00
|
|
|
|
|
|
|
|
enum spa_meta_videotransform_value transform_value;
|
2025-03-24 15:50:22 +05:30
|
|
|
|
|
|
|
|
GstPipeWireSrcOnDisconnect on_disconnect;
|
2015-04-28 17:36:44 +02:00
|
|
|
};
|
|
|
|
|
|
2025-03-24 15:50:22 +05:30
|
|
|
GType gst_pipewire_src_on_stream_disconnect_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__ */
|