1 /* GStreamer 2 * Copyright (C) 2018, Collabora Ltd. 3 * Copyright (C) 2018, SK Telecom, Co., Ltd. 4 * Author: Jeongseok Kim <jeongseok.kim@sk.com> 5 * 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. 10 * 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. 15 * 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. 20 */ 21 22 #ifndef __GST_SRT_SRC_H__ 23 #define __GST_SRT_SRC_H__ 24 25 #include <gio/gio.h> 26 #include <gst/gst.h> 27 #include <gst/base/gstpushsrc.h> 28 29 #include "gstsrtobject.h" 30 31 G_BEGIN_DECLS 32 33 #define GST_TYPE_SRT_SRC (gst_srt_src_get_type ()) 34 #define GST_IS_SRT_SRC(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_SRT_SRC)) 35 #define GST_IS_SRT_SRC_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_SRT_SRC)) 36 #define GST_SRT_SRC_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_SRT_SRC, GstSRTSrcClass)) 37 #define GST_SRT_SRC(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_SRT_SRC, GstSRTSrc)) 38 #define GST_SRT_SRC_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_SRT_SRC, GstSRTSrcClass)) 39 #define GST_SRT_SRC_CAST(obj) ((GstSRTSrc*)(obj)) 40 #define GST_SRT_SRC_CLASS_CAST(klass) ((GstSRTSrcClass*)(klass)) 41 42 typedef struct _GstSRTSrc GstSRTSrc; 43 typedef struct _GstSRTSrcClass GstSRTSrcClass; 44 45 struct _GstSRTSrc { 46 GstPushSrc parent; 47 48 GstCaps *caps; 49 50 GstSRTObject *srtobject; 51 GCancellable *cancellable; 52 53 guint32 next_pktseq; 54 }; 55 56 struct _GstSRTSrcClass { 57 GstPushSrcClass parent_class; 58 59 void (*caller_added) (GstSRTSrc *self, int sock, GSocketAddress * addr); 60 void (*caller_removed) (GstSRTSrc *self, int sock, GSocketAddress * addr); 61 void (*caller_rejected) (GstSRTSrc *self, GSocketAddress * peer_address, 62 const gchar * stream_id, gpointer data); 63 gboolean (*caller_connecting) (GstSRTSrc *self, GSocketAddress * peer_address, 64 const gchar * stream_id, gpointer data); 65 }; 66 67 GType gst_srt_src_get_type (void); 68 69 G_END_DECLS 70 71 #endif // __GST_SRT_SRC_H__ 72