2015-04-28 17:36:44 +02:00
|
|
|
/* GStreamer
|
|
|
|
|
*
|
2018-11-05 17:48:52 +01:00
|
|
|
* Copyright © 2018 Wim Taymans
|
2015-04-28 17:36:44 +02:00
|
|
|
*
|
2018-11-05 17:48:52 +01:00
|
|
|
* Permission is hereby granted, free of charge, to any person obtaining a
|
|
|
|
|
* copy of this software and associated documentation files (the "Software"),
|
|
|
|
|
* to deal in the Software without restriction, including without limitation
|
|
|
|
|
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
|
|
|
* and/or sell copies of the Software, and to permit persons to whom the
|
|
|
|
|
* Software is furnished to do so, subject to the following conditions:
|
2015-04-28 17:36:44 +02:00
|
|
|
*
|
2018-11-05 17:48:52 +01:00
|
|
|
* The above copyright notice and this permission notice (including the next
|
|
|
|
|
* paragraph) shall be included in all copies or substantial portions of the
|
|
|
|
|
* Software.
|
|
|
|
|
*
|
|
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
|
|
|
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
|
|
|
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
|
|
|
* DEALINGS IN THE SOFTWARE.
|
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
|
|
|
|
|
|
|
|
#include <gst/gst.h>
|
|
|
|
|
#include <gst/base/gstpushsrc.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;
|
2015-04-28 17:36:44 +02:00
|
|
|
|
2020-08-06 13:03:40 +02:00
|
|
|
GstCaps *caps;
|
|
|
|
|
|
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;
|
|
|
|
|
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__ */
|