gst_plugins_base/gst/tcp/gsttcpclientsink.c
changeset 16 8e837d1bf446
parent 0 0e761a78d257
child 30 7e817e7e631c
equal deleted inserted replaced
15:4b0c6ed43234 16:8e837d1bf446
    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-tcpclientsink
       
    23  * @see_also: #tcpclientsrc
       
    24  *
       
    25  * <refsect2>
       
    26  * <title>Example launch line</title>
       
    27  * |[
       
    28  * # server:
       
    29  * nc -l -p 3000
       
    30  * # client:
       
    31  * gst-launch fdsrc fd=1 ! tcpclientsink protocol=none port=3000
       
    32  * ]| everything you type in the client is shown on the server
       
    33  * </refsect2>
       
    34  */
       
    35 
    21 #ifdef HAVE_CONFIG_H
    36 #ifdef HAVE_CONFIG_H
    22 #include "config.h"
    37 #include "config.h"
    23 #endif
    38 #endif
    24 #ifdef __SYMBIAN32__
       
    25 #include "gst/gst-i18n-plugin.h"
       
    26 #else
       
    27 #include <gst/gst-i18n-plugin.h>
    39 #include <gst/gst-i18n-plugin.h>
    28 #endif
       
    29 #include <gst/dataprotocol/dataprotocol.h>
    40 #include <gst/dataprotocol/dataprotocol.h>
    30 #include "gsttcp.h"
    41 #include "gsttcp.h"
    31 #include "gsttcpclientsink.h"
    42 #include "gsttcpclientsink.h"
    32 #include <string.h>             /* memset */
    43 #include <string.h>             /* memset */
    33 
    44 
   144   gobject_class->get_property = gst_tcp_client_sink_get_property;
   155   gobject_class->get_property = gst_tcp_client_sink_get_property;
   145   gobject_class->finalize = gst_tcp_client_sink_finalize;
   156   gobject_class->finalize = gst_tcp_client_sink_finalize;
   146 
   157 
   147   g_object_class_install_property (gobject_class, ARG_HOST,
   158   g_object_class_install_property (gobject_class, ARG_HOST,
   148       g_param_spec_string ("host", "Host", "The host/IP to send the packets to",
   159       g_param_spec_string ("host", "Host", "The host/IP to send the packets to",
   149           TCP_DEFAULT_HOST, G_PARAM_READWRITE));
   160           TCP_DEFAULT_HOST, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
   150   g_object_class_install_property (gobject_class, ARG_PORT,
   161   g_object_class_install_property (gobject_class, ARG_PORT,
   151       g_param_spec_int ("port", "Port", "The port to send the packets to",
   162       g_param_spec_int ("port", "Port", "The port to send the packets to",
   152           0, TCP_HIGHEST_PORT, TCP_DEFAULT_PORT, G_PARAM_READWRITE));
   163           0, TCP_HIGHEST_PORT, TCP_DEFAULT_PORT,
       
   164           G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
   153   g_object_class_install_property (gobject_class, ARG_PROTOCOL,
   165   g_object_class_install_property (gobject_class, ARG_PROTOCOL,
   154       g_param_spec_enum ("protocol", "Protocol", "The protocol to wrap data in",
   166       g_param_spec_enum ("protocol", "Protocol", "The protocol to wrap data in",
   155           GST_TYPE_TCP_PROTOCOL, GST_TCP_PROTOCOL_NONE, G_PARAM_READWRITE));
   167           GST_TYPE_TCP_PROTOCOL, GST_TCP_PROTOCOL_NONE,
       
   168           G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
   156 
   169 
   157   gstelement_class->change_state = gst_tcp_client_sink_change_state;
   170   gstelement_class->change_state = gst_tcp_client_sink_change_state;
   158 
   171 
   159   gstbasesink_class->set_caps = gst_tcp_client_sink_setcaps;
   172   gstbasesink_class->set_caps = gst_tcp_client_sink_setcaps;
   160   gstbasesink_class->render = gst_tcp_client_sink_render;
   173   gstbasesink_class->render = gst_tcp_client_sink_render;