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)
46 typedef struct _GstSRTObject GstSRTObject;
53 GstStructure *parameters;
57 gboolean sent_headers;
60 SRTSOCKET listener_sock;
61 gint listener_poll_id;
65 /* Protects the list of callers */
71 gboolean wait_for_connection;
73 gboolean authentication;
78 GstSRTObject *gst_srt_object_new (GstElement *element);
80 void gst_srt_object_destroy (GstSRTObject *srtobject);
82 gboolean gst_srt_object_open (GstSRTObject *srtobject,
83 GCancellable *cancellable,
86 void gst_srt_object_close (GstSRTObject *srtobject);
88 gboolean gst_srt_object_set_property_helper (GstSRTObject *srtobject,
89 guint prop_id, const GValue * value,
92 gboolean gst_srt_object_get_property_helper (GstSRTObject *srtobject,
93 guint prop_id, GValue * value,
96 void gst_srt_object_install_properties_helper (GObjectClass *gobject_class);
98 gboolean gst_srt_object_set_uri (GstSRTObject * srtobject, const gchar *uri, GError ** err);
100 gssize gst_srt_object_read (GstSRTObject * srtobject,
101 guint8 *data, gsize size,
102 GCancellable *cancellable,
106 gssize gst_srt_object_write (GstSRTObject * srtobject,
107 GstBufferList * headers,
108 const GstMapInfo * mapinfo,
109 GCancellable *cancellable,
112 void gst_srt_object_wakeup (GstSRTObject * srtobject,
113 GCancellable *cancellable);
115 GstStructure *gst_srt_object_get_stats (GstSRTObject * srtobject);
119 #endif // __GST_SRT_OBJECT_H__