gstdynudpsink.h 2.22 KB
Newer Older
Philippe Khalaf's avatar
Philippe Khalaf committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
/* GStreamer
 * Copyright (C) <2005> Philippe Khalaf <burger@speedy.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
16 17
 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
 * Boston, MA 02110-1301, USA.
Philippe Khalaf's avatar
Philippe Khalaf committed
18 19 20 21 22 23 24
 */

#ifndef __GST_DYNUDPSINK_H__
#define __GST_DYNUDPSINK_H__

#include <gst/gst.h>
#include <gst/base/gstbasesink.h>
Sebastian Dröge's avatar
Sebastian Dröge committed
25
#include <gio/gio.h>
Philippe Khalaf's avatar
Philippe Khalaf committed
26 27 28

G_BEGIN_DECLS

29
#include "gstudpnetutils.h"
Philippe Khalaf's avatar
Philippe Khalaf committed
30

Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
31 32
#define GST_TYPE_DYNUDPSINK             (gst_dynudpsink_get_type())
#define GST_DYNUDPSINK(obj)             (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_DYNUDPSINK,GstDynUDPSink))
33 34 35
#define GST_DYNUDPSINK_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_DYNUDPSINK,GstDynUDPSinkClass))
#define GST_IS_DYNUDPSINK(obj)          (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_DYNUDPSINK))
#define GST_IS_DYNUDPSINK_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_DYNUDPSINK))
Philippe Khalaf's avatar
Philippe Khalaf committed
36 37 38 39 40 41 42 43 44 45

typedef struct _GstDynUDPSink GstDynUDPSink;
typedef struct _GstDynUDPSinkClass GstDynUDPSinkClass;


/* sends udp packets to host/port pairs contained in the GstNetBuffer received.
 */
struct _GstDynUDPSink {
  GstBaseSink parent;

46
  /* properties */
47
  GSocket *socket, *socket_v6;
Sebastian Dröge's avatar
Sebastian Dröge committed
48
  gboolean close_socket;
49 50
  gchar *bind_address;
  gint bind_port;
51 52

  /* the socket in use */
53
  GSocket *used_socket, *used_socket_v6;
Sebastian Dröge's avatar
Sebastian Dröge committed
54
  gboolean external_socket;
55
  gboolean made_cancel_fd;
Sebastian Dröge's avatar
Sebastian Dröge committed
56
  GCancellable *cancellable;
Philippe Khalaf's avatar
Philippe Khalaf committed
57 58 59 60 61 62
};

struct _GstDynUDPSinkClass {
  GstBaseSinkClass parent_class;

  /* element methods */
Sebastian Dröge's avatar
Sebastian Dröge committed
63
  GstStructure*  (*get_stats)    (GstDynUDPSink *sink, const gchar *host, gint port);
Philippe Khalaf's avatar
Philippe Khalaf committed
64 65 66 67 68 69 70 71 72

  /* signals */
};

GType gst_dynudpsink_get_type(void);

G_END_DECLS

#endif /* __GST_DYNUDPSINK_H__ */