gst_plugins_base/gst/tcp/gsttcpclientsink.h
changeset 0 0e761a78d257
equal deleted inserted replaced
-1:000000000000 0:0e761a78d257
       
     1 /* GStreamer
       
     2  * Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
       
     3  *
       
     4  * This library is free software; you can redistribute it and/or
       
     5  * modify it under the terms of the GNU Library General Public
       
     6  * License as published by the Free Software Foundation; either
       
     7  * version 2 of the License, or (at your option) any later version.
       
     8  *
       
     9  * This library is distributed in the hope that it will be useful,
       
    10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
       
    11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
       
    12  * Library General Public License for more details.
       
    13  *
       
    14  * You should have received a copy of the GNU Library General Public
       
    15  * License along with this library; if not, write to the
       
    16  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
       
    17  * Boston, MA 02111-1307, USA.
       
    18  */
       
    19 
       
    20 
       
    21 #ifndef __GST_TCP_CLIENT_SINK_H__
       
    22 #define __GST_TCP_CLIENT_SINK_H__
       
    23 
       
    24 
       
    25 #include <gst/gst.h>
       
    26 #include <gst/base/gstbasesink.h>
       
    27 
       
    28 #include "gsttcp.h"
       
    29 
       
    30 G_BEGIN_DECLS
       
    31 
       
    32 #include <stdio.h>
       
    33 #include <stdlib.h>
       
    34 #include <unistd.h>
       
    35 #include <errno.h>
       
    36 #include <string.h>
       
    37 #include <sys/time.h>
       
    38 #include <sys/types.h>
       
    39 #include <netinet/in.h>
       
    40 #include <netdb.h>
       
    41 #include <sys/socket.h>
       
    42 #include <sys/wait.h>
       
    43 #include <fcntl.h>
       
    44 #include <arpa/inet.h>
       
    45 #include "gsttcp.h"
       
    46 
       
    47 #define GST_TYPE_TCP_CLIENT_SINK \
       
    48   (gst_tcp_client_sink_get_type())
       
    49 #define GST_TCP_CLIENT_SINK(obj) \
       
    50   (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_TCP_CLIENT_SINK,GstTCPClientSink))
       
    51 #define GST_TCP_CLIENT_SINK_CLASS(klass) \
       
    52   (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_TCP_CLIENT_SINK,GstTCPClientSinkClass))
       
    53 #define GST_IS_TCP_CLIENT_SINK(obj) \
       
    54   (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_TCP_CLIENT_SINK))
       
    55 #define GST_IS_TCP_CLIENT_SINK_CLASS(klass) \
       
    56   (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_TCP_CLIENT_SINK))
       
    57 
       
    58 typedef struct _GstTCPClientSink GstTCPClientSink;
       
    59 typedef struct _GstTCPClientSinkClass GstTCPClientSinkClass;
       
    60 
       
    61 typedef enum {
       
    62   GST_TCP_CLIENT_SINK_OPEN             = (GST_ELEMENT_FLAG_LAST << 0),
       
    63 
       
    64   GST_TCP_CLIENT_SINK_FLAG_LAST        = (GST_ELEMENT_FLAG_LAST << 2),
       
    65 } GstTCPClientSinkFlags;
       
    66 
       
    67 struct _GstTCPClientSink {
       
    68   GstBaseSink element;
       
    69 
       
    70   /* server information */
       
    71   int port;
       
    72   gchar *host;
       
    73   struct sockaddr_in server_sin;
       
    74 
       
    75   /* socket */
       
    76   GstPollFD sock_fd;
       
    77 
       
    78   size_t data_written; /* how much bytes have we written ? */
       
    79   GstTCPProtocol protocol; /* used with the protocol enum */
       
    80   gboolean caps_sent; /* whether or not we sent caps already */
       
    81 };
       
    82 
       
    83 struct _GstTCPClientSinkClass {
       
    84   GstBaseSinkClass parent_class;
       
    85 };
       
    86 #ifdef __SYMBIAN32__
       
    87 IMPORT_C
       
    88 #endif
       
    89 
       
    90 
       
    91 GType gst_tcp_client_sink_get_type(void);
       
    92 
       
    93 G_END_DECLS
       
    94 
       
    95 #endif /* __GST_TCP_CLIENT_SINK_H__ */