gsttcpserversink.h 2.36 KB
Newer Older
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
/* GStreamer
 * Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
 * Copyright (C) <2004> Thomas Vander Stichele <thomas at apestaart dot org>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
 * License along with this library; if not, write to the
Tim-Philipp Müller's avatar
Tim-Philipp Müller committed
17 18
 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
 * Boston, MA 02110-1301, USA.
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
19 20 21
 */


Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
22 23
#ifndef __GST_TCP_SERVER_SINK_H__
#define __GST_TCP_SERVER_SINK_H__
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
24 25 26


#include <gst/gst.h>
Sebastian Dröge's avatar
Sebastian Dröge committed
27
#include <gio/gio.h>
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
28

Wim Taymans's avatar
Wim Taymans committed
29
G_BEGIN_DECLS
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
30

Sebastian Dröge's avatar
Sebastian Dröge committed
31
#include "gstmultisocketsink.h"
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
32

Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
33 34 35 36 37
#define GST_TYPE_TCP_SERVER_SINK \
  (gst_tcp_server_sink_get_type())
#define GST_TCP_SERVER_SINK(obj) \
  (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_TCP_SERVER_SINK,GstTCPServerSink))
#define GST_TCP_SERVER_SINK_CLASS(klass) \
38
  (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_TCP_SERVER_SINK,GstTCPServerSinkClass))
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
39 40
#define GST_IS_TCP_SERVER_SINK(obj) \
  (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_TCP_SERVER_SINK))
41
#define GST_IS_TCP_SERVER_SINK_CLASS(klass) \
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
42
  (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_TCP_SERVER_SINK))
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
43 44 45 46 47

typedef struct _GstTCPServerSink GstTCPServerSink;
typedef struct _GstTCPServerSinkClass GstTCPServerSinkClass;

typedef enum {
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
48
  GST_TCP_SERVER_SINK_OPEN             = (GST_ELEMENT_FLAG_LAST << 0),
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
49

Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
50
  GST_TCP_SERVER_SINK_FLAG_LAST        = (GST_ELEMENT_FLAG_LAST << 2)
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
51 52
} GstTCPServerSinkFlags;

Wim Taymans's avatar
Wim Taymans committed
53 54 55 56 57
/**
 * GstTCPServerSink:
 *
 * Opaque data structure.
 */
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
58
struct _GstTCPServerSink {
Sebastian Dröge's avatar
Sebastian Dröge committed
59
  GstMultiSocketSink element;
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
60 61

  /* server information */
62 63 64 65
  int current_port;        /* currently bound-to port, or 0 */ /* ATOMIC */
  int server_port;         /* port property */
  gchar *host;             /* host property */

Sebastian Dröge's avatar
Sebastian Dröge committed
66 67
  GSocket *server_socket;
  GSource *server_source;
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
68 69 70
};

struct _GstTCPServerSinkClass {
Sebastian Dröge's avatar
Sebastian Dröge committed
71
  GstMultiSocketSinkClass parent_class;
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
72 73
};

Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
74
GType gst_tcp_server_sink_get_type (void);
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
75

Wim Taymans's avatar
Wim Taymans committed
76
G_END_DECLS
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
77

Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
78
#endif /* __GST_TCP_SERVER_SINK_H__ */