gst_plugins_base/gst/tcp/gstmultifdsink.h
branchRCL_3
changeset 30 7e817e7e631c
parent 29 567bb019e3e3
equal deleted inserted replaced
29:567bb019e3e3 30:7e817e7e631c
    94   GST_SYNC_METHOD_BURST_KEYFRAME,
    94   GST_SYNC_METHOD_BURST_KEYFRAME,
    95   GST_SYNC_METHOD_BURST_WITH_KEYFRAME
    95   GST_SYNC_METHOD_BURST_WITH_KEYFRAME
    96 } GstSyncMethod;
    96 } GstSyncMethod;
    97 
    97 
    98 /**
    98 /**
    99  * GstTCPUnitType:
    99  * GstUnitType:
   100  * @GST_TCP_UNIT_TYPE_UNDEFINED: undefined
   100  * @GST_UNIT_TYPE_UNDEFINED: undefined
   101  * @GST_TCP_UNIT_TYPE_BUFFERS  : buffers
   101  * @GST_UNIT_TYPE_BUFFERS  : buffers
   102  * @GST_TCP_UNIT_TYPE_TIME     : timeunits (in nanoseconds)
   102  * @GST_UNIT_TYPE_TIME     : timeunits (in nanoseconds)
   103  * @GST_TCP_UNIT_TYPE_BYTES    : bytes
   103  * @GST_UNIT_TYPE_BYTES    : bytes
   104  *
   104  *
   105  * The units used to specify limits.
   105  * The units used to specify limits.
   106  */
   106  */
   107 typedef enum
   107 typedef enum
   108 {
   108 {
   109   GST_TCP_UNIT_TYPE_UNDEFINED,
   109   GST_UNIT_TYPE_UNDEFINED,
   110   GST_TCP_UNIT_TYPE_BUFFERS,
   110   GST_UNIT_TYPE_BUFFERS,
   111   GST_TCP_UNIT_TYPE_TIME,
   111   GST_UNIT_TYPE_TIME,
   112   GST_TCP_UNIT_TYPE_BYTES
   112   GST_UNIT_TYPE_BYTES
   113 } GstTCPUnitType;
   113 } GstUnitType;
   114 
   114 
   115 /**
   115 /**
   116  * GstClientStatus:
   116  * GstClientStatus:
   117  * @GST_CLIENT_STATUS_OK       : client is ok
   117  * @GST_CLIENT_STATUS_OK       : client is ok
   118  * @GST_CLIENT_STATUS_CLOSED   : client closed the socket
   118  * @GST_CLIENT_STATUS_CLOSED   : client closed the socket
   160 
   160 
   161   gboolean currently_removing;
   161   gboolean currently_removing;
   162 
   162 
   163   /* method to sync client when connecting */
   163   /* method to sync client when connecting */
   164   GstSyncMethod sync_method;
   164   GstSyncMethod sync_method;
   165   GstTCPUnitType   burst_min_unit;
   165   GstUnitType   burst_min_unit;
   166   guint64       burst_min_value;
   166   guint64       burst_min_value;
   167   GstTCPUnitType   burst_max_unit;
   167   GstUnitType   burst_max_unit;
   168   guint64       burst_max_value;
   168   guint64       burst_max_value;
   169 
   169 
   170   GstCaps *caps;                /* caps of last queued buffer */
   170   GstCaps *caps;                /* caps of last queued buffer */
   171 
   171 
   172   /* stats */
   172   /* stats */
   206   GSList *streamheader; /* GSList of GstBuffers to use as streamheader */
   206   GSList *streamheader; /* GSList of GstBuffers to use as streamheader */
   207   gboolean previous_buffer_in_caps;
   207   gboolean previous_buffer_in_caps;
   208 
   208 
   209   GstTCPProtocol protocol;
   209   GstTCPProtocol protocol;
   210   guint mtu;
   210   guint mtu;
   211   gint qos_dscp;
       
   212   gboolean handle_read;
       
   213 
   211 
   214   GArray *bufqueue;     /* global queue of buffers */
   212   GArray *bufqueue;     /* global queue of buffers */
   215 
   213 
   216   gboolean running;     /* the thread state */
   214   gboolean running;     /* the thread state */
   217   GThread *thread;      /* the sender thread */
   215   GThread *thread;      /* the sender thread */
   218 
   216 
   219   /* these values are used to check if a client is reading fast
   217   /* these values are used to check if a client is reading fast
   220    * enough and to control receovery */
   218    * enough and to control receovery */
   221   GstTCPUnitType unit_type;/* the type of the units */
   219   GstUnitType unit_type;/* the type of the units */
   222   gint64 units_max;       /* max units to queue for a client */
   220   gint64 units_max;       /* max units to queue for a client */
   223   gint64 units_soft_max;  /* max units a client can lag before recovery starts */
   221   gint64 units_soft_max;  /* max units a client can lag before recovery starts */
   224   GstRecoverPolicy recover_policy;
   222   GstRecoverPolicy recover_policy;
   225   GstClockTime timeout; /* max amount of nanoseconds to remain idle */
   223   GstClockTime timeout; /* max amount of nanoseconds to remain idle */
   226 
   224 
   227   GstSyncMethod def_sync_method;    /* what method to use for connecting clients */
   225   GstSyncMethod def_sync_method;    /* what method to use for connecting clients */
   228   GstTCPUnitType   def_burst_unit;
   226   GstUnitType   def_burst_unit;
   229   guint64       def_burst_value;
   227   guint64       def_burst_value;
   230 
   228 
   231   /* these values are used to control the amount of data
   229   /* these values are used to control the amount of data
   232    * kept in the queues. It allows clients to perform a burst
   230    * kept in the queues. It allows clients to perform a burst
   233    * on connect. */
   231    * on connect. */
   234   gint   bytes_min;	/* min number of bytes to queue */
   232   gint   bytes_min;	/* min number of bytes to queue */
   235   gint64 time_min;	/* min time to queue */
   233   gint64 time_min;	/* min time to queue */
   236   gint   buffers_min;   /* min number of buffers to queue */
   234   gint   buffers_min;   /* min number of buffers to queue */
   237 
   235 
   238   gboolean resend_streamheader; /* resend streamheader if it changes */
       
   239 
       
   240   /* stats */
   236   /* stats */
   241   gint buffers_queued;  /* number of queued buffers */
   237   gint buffers_queued;  /* number of queued buffers */
   242   gint bytes_queued;    /* number of queued bytes */
   238   gint bytes_queued;    /* number of queued bytes */
   243   gint time_queued;     /* number of queued time */
   239   gint time_queued;     /* number of queued time */
   244 
   240 
   249   GstBaseSinkClass parent_class;
   245   GstBaseSinkClass parent_class;
   250 
   246 
   251   /* element methods */
   247   /* element methods */
   252   void          (*add)          (GstMultiFdSink *sink, int fd);
   248   void          (*add)          (GstMultiFdSink *sink, int fd);
   253   void          (*add_full)     (GstMultiFdSink *sink, int fd, GstSyncMethod sync,
   249   void          (*add_full)     (GstMultiFdSink *sink, int fd, GstSyncMethod sync,
   254 		                 GstTCPUnitType format, guint64 value, 
   250 		                 GstUnitType format, guint64 value, 
   255 				 GstTCPUnitType max_unit, guint64 max_value);
   251 				 GstUnitType max_unit, guint64 max_value);
   256   void          (*remove)       (GstMultiFdSink *sink, int fd);
   252   void          (*remove)       (GstMultiFdSink *sink, int fd);
   257   void          (*remove_flush) (GstMultiFdSink *sink, int fd);
   253   void          (*remove_flush) (GstMultiFdSink *sink, int fd);
   258   void          (*clear)        (GstMultiFdSink *sink);
   254   void          (*clear)        (GstMultiFdSink *sink);
   259   GValueArray*  (*get_stats)    (GstMultiFdSink *sink, int fd);
   255   GValueArray*  (*get_stats)    (GstMultiFdSink *sink, int fd);
   260 
   256 
   284 #ifdef __SYMBIAN32__
   280 #ifdef __SYMBIAN32__
   285 IMPORT_C
   281 IMPORT_C
   286 #endif
   282 #endif
   287 
   283 
   288 void          gst_multi_fd_sink_add_full     (GstMultiFdSink *sink, int fd, GstSyncMethod sync, 
   284 void          gst_multi_fd_sink_add_full     (GstMultiFdSink *sink, int fd, GstSyncMethod sync, 
   289                                               GstTCPUnitType min_unit, guint64 min_value,
   285                                               GstUnitType min_unit, guint64 min_value,
   290                                               GstTCPUnitType max_unit, guint64 max_value);
   286                                               GstUnitType max_unit, guint64 max_value);
   291 #ifdef __SYMBIAN32__
   287 #ifdef __SYMBIAN32__
   292 IMPORT_C
   288 IMPORT_C
   293 #endif
   289 #endif
   294 
   290 
   295 void          gst_multi_fd_sink_remove       (GstMultiFdSink *sink, int fd);
   291 void          gst_multi_fd_sink_remove       (GstMultiFdSink *sink, int fd);