subparse: fix off by one offset calculation
[platform/upstream/gstreamer.git] / gst / tcp / gstmultisocketsink.h
1 /* GStreamer
2  * Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
3  * Copyright (C) <2004> Thomas Vander Stichele <thomas at apestaart dot org>
4  * Copyright (C) <2011> Collabora Ltd.
5  *     Author: Sebastian Dröge <sebastian.droege@collabora.co.uk>
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Library General Public
9  * License as published by the Free Software Foundation; either
10  * version 2 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15  * Library General Public License for more details.
16  *
17  * You should have received a copy of the GNU Library General Public
18  * License along with this library; if not, write to the
19  * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
20  * Boston, MA 02110-1301, USA.
21  */
22
23
24 #ifndef __GST_MULTI_SOCKET_SINK_H__
25 #define __GST_MULTI_SOCKET_SINK_H__
26
27 #include <gio/gio.h>
28
29 #include <gst/gst.h>
30 #include <gst/base/gstbasesink.h>
31
32 #include "gstmultihandlesink.h"
33
34 G_BEGIN_DECLS
35
36 #define GST_TYPE_MULTI_SOCKET_SINK \
37   (gst_multi_socket_sink_get_type())
38 #define GST_MULTI_SOCKET_SINK(obj) \
39   (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_MULTI_SOCKET_SINK,GstMultiSocketSink))
40 #define GST_MULTI_SOCKET_SINK_CLASS(klass) \
41   (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_MULTI_SOCKET_SINK,GstMultiSocketSinkClass))
42 #define GST_IS_MULTI_SOCKET_SINK(obj) \
43   (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_MULTI_SOCKET_SINK))
44 #define GST_IS_MULTI_SOCKET_SINK_CLASS(klass) \
45   (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_MULTI_SOCKET_SINK))
46 #define GST_MULTI_SOCKET_SINK_GET_CLASS(klass) \
47   (G_TYPE_INSTANCE_GET_CLASS ((klass), GST_TYPE_MULTI_SOCKET_SINK, GstMultiSocketSinkClass))
48
49
50 typedef struct _GstMultiSocketSink GstMultiSocketSink;
51 typedef struct _GstMultiSocketSinkClass GstMultiSocketSinkClass;
52
53 /* structure for a client
54  */
55 typedef struct {
56   GstMultiHandleClient client;
57
58   GSource *source;
59 } GstSocketClient;
60
61 /**
62  * GstMultiSocketSink:
63  *
64  * The multisocketsink object structure.
65  */
66 struct _GstMultiSocketSink {
67   GstMultiHandleSink element;
68
69   /*< private >*/
70   GMainContext *main_context;
71   GCancellable *cancellable;
72 };
73
74 struct _GstMultiSocketSinkClass {
75   GstMultiHandleSinkClass parent_class;
76
77   /* element methods */
78   void          (*add)          (GstMultiSocketSink *sink, GSocket *socket);
79   void          (*add_full)     (GstMultiSocketSink *sink, GSocket *socket,
80                                  GstSyncMethod sync,
81                                  GstFormat format, guint64 value,
82                                  GstFormat max_format, guint64 max_value);
83   void          (*remove)       (GstMultiSocketSink *sink, GSocket *socket);
84   void          (*remove_flush) (GstMultiSocketSink *sink, GSocket *socket);
85   GstStructure* (*get_stats)    (GstMultiSocketSink *sink, GSocket *socket);
86
87   /* signals */
88 };
89
90 GType gst_multi_socket_sink_get_type (void);
91
92 G_END_DECLS
93
94 #endif /* __GST_MULTI_SOCKET_SINK_H__ */