• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
47 
48 typedef struct _GstMultiSocketSink GstMultiSocketSink;
49 typedef struct _GstMultiSocketSinkClass GstMultiSocketSinkClass;
50 
51 /* structure for a client
52  */
53 typedef struct {
54   GstMultiHandleClient client;
55 
56   GSource *source;
57   GIOCondition condition;
58 } GstSocketClient;
59 
60 /**
61  * GstMultiSocketSink:
62  *
63  * The multisocketsink object structure.
64  */
65 struct _GstMultiSocketSink {
66   GstMultiHandleSink element;
67 
68   /*< private >*/
69   GMainContext *main_context;
70   GCancellable *cancellable;
71   gboolean send_messages;
72   gboolean send_dispatched;
73 };
74 
75 struct _GstMultiSocketSinkClass {
76   GstMultiHandleSinkClass parent_class;
77 
78   /* element methods */
79   void          (*add)          (GstMultiSocketSink *sink, GSocket *socket);
80   void          (*add_full)     (GstMultiSocketSink *sink, GSocket *socket,
81                                  GstSyncMethod sync,
82                                  GstFormat format, guint64 value,
83                                  GstFormat max_format, guint64 max_value);
84   void          (*remove)       (GstMultiSocketSink *sink, GSocket *socket);
85   void          (*remove_flush) (GstMultiSocketSink *sink, GSocket *socket);
86   GstStructure* (*get_stats)    (GstMultiSocketSink *sink, GSocket *socket);
87 
88   /* signals */
89 };
90 
91 GType gst_multi_socket_sink_get_type (void);
92 
93 G_END_DECLS
94 
95 #endif /* __GST_MULTI_SOCKET_SINK_H__ */
96