Merging gst-plugins-bad
[platform/upstream/gstreamer.git] / subprojects / gst-plugins-bad / ext / srt / gstsrtsink.h
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_SINK_H__
23 #define __GST_SRT_SINK_H__
24
25 #include <gst/gst.h>
26 #include <gst/base/gstbasesink.h>
27 #include <gio/gio.h>
28
29 #include "gstsrtobject.h"
30
31 G_BEGIN_DECLS
32
33 #define GST_TYPE_SRT_SINK              (gst_srt_sink_get_type ())
34 #define GST_IS_SRT_SINK(obj)           (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_SRT_SINK))
35 #define GST_IS_SRT_SINK_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_SRT_SINK))
36 #define GST_SRT_SINK_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_SRT_SINK, GstSRTSinkClass))
37 #define GST_SRT_SINK(obj)              (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_SRT_SINK, GstSRTSink))
38 #define GST_SRT_SINK_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_SRT_SINK, GstSRTSinkClass))
39 #define GST_SRT_SINK_CAST(obj)         ((GstSRTSink*)(obj))
40 #define GST_SRT_SINK_CLASS_CAST(klass) ((GstSRTSinkClass*)(klass))
41
42 typedef struct _GstSRTSink GstSRTSink;
43 typedef struct _GstSRTSinkClass GstSRTSinkClass;
44
45 struct _GstSRTSink {
46   GstBaseSink parent;
47
48   GstBufferList *headers;
49
50   GstSRTObject *srtobject;
51   GCancellable *cancellable;
52 };
53
54 struct _GstSRTSinkClass {
55   GstBaseSinkClass parent_class;
56
57   void (*caller_added)      (GstSRTSink *self, int sock, GSocketAddress * addr);
58   void (*caller_removed)    (GstSRTSink *self, int sock, GSocketAddress * addr);
59   void (*caller_rejected)   (GstSRTSink *self, GSocketAddress * peer_address,
60     const gchar * stream_id, gpointer data);
61   gboolean (*caller_connecting) (GstSRTSink *self, GSocketAddress * peer_address,
62     const gchar * stream_id, gpointer data);
63 };
64
65 GType gst_srt_sink_get_type (void);
66
67 G_END_DECLS
68
69 #endif // __GST_SRT_SINK_H__