16 * License along with this library; if not, write to the |
16 * License along with this library; if not, write to the |
17 * Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
17 * Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
18 * Boston, MA 02111-1307, USA. |
18 * Boston, MA 02111-1307, USA. |
19 */ |
19 */ |
20 |
20 |
|
21 /** |
|
22 * SECTION:element-tcpserversrc |
|
23 * @see_also: #tcpserversink |
|
24 * |
|
25 * <refsect2> |
|
26 * <title>Example launch line</title> |
|
27 * |[ |
|
28 * # server: |
|
29 * gst-launch tcpserversrc protocol=none port=3000 ! fdsink fd=2 |
|
30 * # client: |
|
31 * gst-launch fdsrc fd=1 ! tcpclientsink protocol=none port=3000 |
|
32 * ]| |
|
33 * </refsect2> |
|
34 */ |
21 |
35 |
22 #ifdef HAVE_CONFIG_H |
36 #ifdef HAVE_CONFIG_H |
23 #include "config.h" |
37 #include "config.h" |
24 #endif |
38 #endif |
25 |
39 |
26 #ifdef __SYMBIAN32__ |
|
27 #include "gst/gst-i18n-plugin.h" |
|
28 #else |
|
29 #include <gst/gst-i18n-plugin.h> |
40 #include <gst/gst-i18n-plugin.h> |
30 #endif |
|
31 #include "gsttcp.h" |
41 #include "gsttcp.h" |
32 #include "gsttcpserversrc.h" |
42 #include "gsttcpserversrc.h" |
33 #include <string.h> /* memset */ |
43 #include <string.h> /* memset */ |
34 #include <unistd.h> |
44 #include <unistd.h> |
35 #include <sys/ioctl.h> |
45 #include <sys/ioctl.h> |
108 gobject_class->get_property = gst_tcp_server_src_get_property; |
118 gobject_class->get_property = gst_tcp_server_src_get_property; |
109 gobject_class->finalize = gst_tcp_server_src_finalize; |
119 gobject_class->finalize = gst_tcp_server_src_finalize; |
110 |
120 |
111 g_object_class_install_property (gobject_class, PROP_HOST, |
121 g_object_class_install_property (gobject_class, PROP_HOST, |
112 g_param_spec_string ("host", "Host", "The hostname to listen as", |
122 g_param_spec_string ("host", "Host", "The hostname to listen as", |
113 TCP_DEFAULT_LISTEN_HOST, G_PARAM_READWRITE)); |
123 TCP_DEFAULT_LISTEN_HOST, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); |
114 g_object_class_install_property (gobject_class, PROP_PORT, |
124 g_object_class_install_property (gobject_class, PROP_PORT, |
115 g_param_spec_int ("port", "Port", "The port to listen to", |
125 g_param_spec_int ("port", "Port", "The port to listen to", |
116 0, TCP_HIGHEST_PORT, TCP_DEFAULT_PORT, G_PARAM_READWRITE)); |
126 0, TCP_HIGHEST_PORT, TCP_DEFAULT_PORT, |
|
127 G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); |
117 g_object_class_install_property (gobject_class, PROP_PROTOCOL, |
128 g_object_class_install_property (gobject_class, PROP_PROTOCOL, |
118 g_param_spec_enum ("protocol", "Protocol", "The protocol to wrap data in", |
129 g_param_spec_enum ("protocol", "Protocol", "The protocol to wrap data in", |
119 GST_TYPE_TCP_PROTOCOL, GST_TCP_PROTOCOL_NONE, G_PARAM_READWRITE)); |
130 GST_TYPE_TCP_PROTOCOL, GST_TCP_PROTOCOL_NONE, |
|
131 G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); |
120 |
132 |
121 gstbasesrc_class->start = gst_tcp_server_src_start; |
133 gstbasesrc_class->start = gst_tcp_server_src_start; |
122 gstbasesrc_class->stop = gst_tcp_server_src_stop; |
134 gstbasesrc_class->stop = gst_tcp_server_src_stop; |
123 gstbasesrc_class->unlock = gst_tcp_server_src_unlock; |
135 gstbasesrc_class->unlock = gst_tcp_server_src_unlock; |
124 |
136 |