gstudpsrc.h 2.18 KB
Newer Older
Andy Wingo Wingo's avatar
Andy Wingo Wingo committed
1
/* GStreamer
Andy Wingo Wingo's avatar
Andy Wingo Wingo committed
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
 * Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
 *
 * 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
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 * Boston, MA 02111-1307, USA.
 */


#ifndef __GST_UDPSRC_H__
#define __GST_UDPSRC_H__

#include <gst/gst.h>
25
#include <gst/base/gstpushsrc.h>
Andy Wingo Wingo's avatar
Andy Wingo Wingo committed
26

27
G_BEGIN_DECLS
Andy Wingo Wingo's avatar
Andy Wingo Wingo committed
28
29
30
31

#include <errno.h>
#include <string.h>
#include <sys/types.h>
32

33
34
#include "gstudpnetutils.h"

35
#include "gstudp.h"
Andy Wingo Wingo's avatar
Andy Wingo Wingo committed
36
37
38
39
40
41

#define GST_TYPE_UDPSRC \
  (gst_udpsrc_get_type())
#define GST_UDPSRC(obj) \
  (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_UDPSRC,GstUDPSrc))
#define GST_UDPSRC_CLASS(klass) \
42
  (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_UDPSRC,GstUDPSrcClass))
Andy Wingo Wingo's avatar
Andy Wingo Wingo committed
43
44
#define GST_IS_UDPSRC(obj) \
  (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_UDPSRC))
45
#define GST_IS_UDPSRC_CLASS(klass) \
Andy Wingo Wingo's avatar
Andy Wingo Wingo committed
46
  (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_UDPSRC))
47
#define GST_UDPSRC_CAST(obj) ((GstUDPSrc *)(obj))
Andy Wingo Wingo's avatar
Andy Wingo Wingo committed
48

Johan Dahlin's avatar
Johan Dahlin committed
49
50
typedef struct _GstUDPSrc GstUDPSrc;
typedef struct _GstUDPSrcClass GstUDPSrcClass;
Andy Wingo Wingo's avatar
Andy Wingo Wingo committed
51

Johan Dahlin's avatar
Johan Dahlin committed
52
struct _GstUDPSrc {
53
  GstPushSrc parent;
54

55
  /* properties */
Wim Taymans's avatar
Wim Taymans committed
56
  GstUDPUri  uri;
57
  gchar     *multi_iface;
58
59
60
61
62
63
64
  gint       ttl;
  GstCaps   *caps;
  gint       buffer_size;
  guint64    timeout;
  gint       skip_first_bytes;
  int        sockfd;
  gboolean   closefd;
65
  gboolean   auto_multicast;
66
  gboolean   reuse;
67

68
  /* our sockets */
69
70
71
  GstPollFD  sock;
  GstPoll   *fdset;
  gboolean   externalfd;
Wim Taymans's avatar
Wim Taymans committed
72
  gboolean   is_ipv6;
73

74
  struct   sockaddr_storage myaddr;
Wim Taymans's avatar
Wim Taymans committed
75
76

  gchar     *uristr;
Johan Dahlin's avatar
Johan Dahlin committed
77
};
Andy Wingo Wingo's avatar
Andy Wingo Wingo committed
78

Johan Dahlin's avatar
Johan Dahlin committed
79
struct _GstUDPSrcClass {
80
  GstPushSrcClass parent_class;
Johan Dahlin's avatar
Johan Dahlin committed
81
};
Andy Wingo Wingo's avatar
Andy Wingo Wingo committed
82

Johan Dahlin's avatar
Johan Dahlin committed
83
GType gst_udpsrc_get_type(void);
Andy Wingo Wingo's avatar
Andy Wingo Wingo committed
84

85
G_END_DECLS
Andy Wingo Wingo's avatar
Andy Wingo Wingo committed
86
87


Johan Dahlin's avatar
Johan Dahlin committed
88
#endif /* __GST_UDPSRC_H__ */