2 * Copyright (C) 2018, Collabora Ltd.
3 * Copyright (C) 2018, SK Telecom, Co., Ltd.
4 * Author: Jeongseok Kim <jeongseok.kim@sk.com>
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Library General Public License for more details.
16 * You should have received a copy of the GNU Library General Public
17 * License along with this library; if not, write to the
18 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
19 * Boston, MA 02110-1301, USA.
22 #ifndef __GST_SRT_OBJECT_H__
23 #define __GST_SRT_OBJECT_H__
25 #include "gstsrt-enums.h"
26 #include "gstsrt-enumtypes.h"
33 #define GST_SRT_DEFAULT_URI_SCHEME "srt"
34 #define GST_SRT_DEFAULT_PORT 7001
35 #define GST_SRT_DEFAULT_HOST "127.0.0.1"
36 #define GST_SRT_DEFAULT_LOCALADDRESS "0.0.0.0"
37 #define GST_SRT_DEFAULT_URI GST_SRT_DEFAULT_URI_SCHEME"://"GST_SRT_DEFAULT_HOST":"G_STRINGIFY(GST_SRT_DEFAULT_PORT)
39 #define GST_SRT_DEFAULT_MODE GST_SRT_CONNECTION_MODE_CALLER
40 #define GST_SRT_DEFAULT_PBKEYLEN GST_SRT_KEY_LENGTH_0
41 #define GST_SRT_DEFAULT_POLL_TIMEOUT -1
42 #define GST_SRT_DEFAULT_LATENCY 125
43 #define GST_SRT_DEFAULT_MSG_SIZE 1316
44 #define GST_SRT_DEFAULT_WAIT_FOR_CONNECTION (TRUE)
45 #define GST_SRT_DEFAULT_AUTO_RECONNECT (TRUE)
47 typedef struct _GstSRTObject GstSRTObject;
54 GstStructure *parameters;
58 gboolean sent_headers;
61 SRTSOCKET listener_sock;
62 gint listener_poll_id;
66 /* Protects the list of callers */
72 gboolean wait_for_connection;
73 gboolean auto_reconnect;
75 gboolean authentication;
80 GstSRTObject *gst_srt_object_new (GstElement *element);
82 void gst_srt_object_destroy (GstSRTObject *srtobject);
84 gboolean gst_srt_object_open (GstSRTObject *srtobject,
85 GCancellable *cancellable,
88 void gst_srt_object_close (GstSRTObject *srtobject);
90 gboolean gst_srt_object_set_property_helper (GstSRTObject *srtobject,
91 guint prop_id, const GValue * value,
94 gboolean gst_srt_object_get_property_helper (GstSRTObject *srtobject,
95 guint prop_id, GValue * value,
98 void gst_srt_object_install_properties_helper (GObjectClass *gobject_class);
100 gboolean gst_srt_object_set_uri (GstSRTObject * srtobject, const gchar *uri, GError ** err);
102 gssize gst_srt_object_read (GstSRTObject * srtobject,
103 guint8 *data, gsize size,
104 GCancellable *cancellable,
108 gssize gst_srt_object_write (GstSRTObject * srtobject,
109 GstBufferList * headers,
110 const GstMapInfo * mapinfo,
111 GCancellable *cancellable,
114 void gst_srt_object_wakeup (GstSRTObject * srtobject,
115 GCancellable *cancellable);
117 GstStructure *gst_srt_object_get_stats (GstSRTObject * srtobject);
121 #endif // __GST_SRT_OBJECT_H__