| author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> | 
| Tue, 31 Aug 2010 15:30:33 +0300 | |
| branch | RCL_3 | 
| changeset 7 | 567bb019e3e3 | 
| parent 0 | 0e761a78d257 | 
| child 8 | 7e817e7e631c | 
| permissions | -rw-r--r-- | 
| 0 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 1 | /* GStreamer | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 2 | * Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu> | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 3 | * Copyright (C) <2004> Thomas Vander Stichele <thomas at apestaart dot org> | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 4 | * | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 5 | * This library is free software; you can redistribute it and/or | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 6 | * modify it under the terms of the GNU Library General Public | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 7 | * License as published by the Free Software Foundation; either | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 8 | * version 2 of the License, or (at your option) any later version. | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 9 | * | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 10 | * This library is distributed in the hope that it will be useful, | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 13 | * Library General Public License for more details. | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 14 | * | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 15 | * You should have received a copy of the GNU Library General Public | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 16 | * License along with this library; if not, write to the | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 17 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 18 | * Boston, MA 02111-1307, USA. | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 19 | */ | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 20 | |
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 21 | |
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 22 | #ifndef __GST_MULTI_FD_SINK_H__ | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 23 | #define __GST_MULTI_FD_SINK_H__ | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 24 | |
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 25 | #include <gst/gst.h> | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 26 | #include <gst/base/gstbasesink.h> | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 27 | |
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 28 | G_BEGIN_DECLS | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 29 | |
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 30 | #include "gsttcp.h" | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 31 | |
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 32 | #define GST_TYPE_MULTI_FD_SINK \ | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 33 | (gst_multi_fd_sink_get_type()) | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 34 | #define GST_MULTI_FD_SINK(obj) \ | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 35 | (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_MULTI_FD_SINK,GstMultiFdSink)) | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 36 | #define GST_MULTI_FD_SINK_CLASS(klass) \ | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 37 | (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_MULTI_FD_SINK,GstMultiFdSinkClass)) | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 38 | #define GST_IS_MULTI_FD_SINK(obj) \ | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 39 | (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_MULTI_FD_SINK)) | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 40 | #define GST_IS_MULTI_FD_SINK_CLASS(klass) \ | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 41 | (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_MULTI_FD_SINK)) | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 42 | #define GST_MULTI_FD_SINK_GET_CLASS(klass) \ | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 43 | (G_TYPE_INSTANCE_GET_CLASS ((klass), GST_TYPE_MULTI_FD_SINK, GstMultiFdSinkClass)) | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 44 | |
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 45 | |
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 46 | typedef struct _GstMultiFdSink GstMultiFdSink; | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 47 | typedef struct _GstMultiFdSinkClass GstMultiFdSinkClass; | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 48 | |
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 49 | typedef enum {
 | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 50 | GST_MULTI_FD_SINK_OPEN = (GST_ELEMENT_FLAG_LAST << 0), | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 51 | |
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 52 | GST_MULTI_FD_SINK_FLAG_LAST = (GST_ELEMENT_FLAG_LAST << 2) | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 53 | } GstMultiFdSinkFlags; | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 54 | |
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 55 | /** | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 56 | * GstRecoverPolicy: | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 57 | * @GST_RECOVER_POLICY_NONE : no recovering is done | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 58 | * @GST_RECOVER_POLICY_RESYNC_LATEST : client is moved to last buffer | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 59 | * @GST_RECOVER_POLICY_RESYNC_SOFT_LIMIT: client is moved to the soft limit | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 60 | * @GST_RECOVER_POLICY_RESYNC_KEYFRAME : client is moved to latest keyframe | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 61 | * | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 62 | * Possible values for the recovery procedure to use when a client consumes | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 63 | * data too slow and has a backlag of more that soft-limit buffers. | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 64 | */ | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 65 | typedef enum | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 66 | {
 | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 67 | GST_RECOVER_POLICY_NONE, | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 68 | GST_RECOVER_POLICY_RESYNC_LATEST, | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 69 | GST_RECOVER_POLICY_RESYNC_SOFT_LIMIT, | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 70 | GST_RECOVER_POLICY_RESYNC_KEYFRAME | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 71 | } GstRecoverPolicy; | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 72 | |
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 73 | /** | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 74 | * GstSyncMethod: | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 75 | * @GST_SYNC_METHOD_LATEST : client receives most recent buffer | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 76 | * @GST_SYNC_METHOD_NEXT_KEYFRAME : client receives next keyframe | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 77 | * @GST_SYNC_METHOD_LATEST_KEYFRAME : client receives latest keyframe (burst) | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 78 | * @GST_SYNC_METHOD_BURST : client receives specific amount of data | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 79 | * @GST_SYNC_METHOD_BURST_KEYFRAME : client receives specific amount of data | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 80 | * starting from latest keyframe | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 81 | * @GST_SYNC_METHOD_BURST_WITH_KEYFRAME : client receives specific amount of data from | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 82 | * a keyframe, or if there is not enough data after | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 83 | * the keyframe, starting before the keyframe | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 84 | * | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 85 | * This enum defines the selection of the first buffer that is sent | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 86 | * to a new client. | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 87 | */ | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 88 | typedef enum | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 89 | {
 | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 90 | GST_SYNC_METHOD_LATEST, | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 91 | GST_SYNC_METHOD_NEXT_KEYFRAME, | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 92 | GST_SYNC_METHOD_LATEST_KEYFRAME, | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 93 | GST_SYNC_METHOD_BURST, | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 94 | GST_SYNC_METHOD_BURST_KEYFRAME, | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 95 | GST_SYNC_METHOD_BURST_WITH_KEYFRAME | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 96 | } GstSyncMethod; | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 97 | |
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 98 | /** | 
| 7 
567bb019e3e3
Revision: 201010
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: 
0diff
changeset | 99 | * GstTCPUnitType: | 
| 
567bb019e3e3
Revision: 201010
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: 
0diff
changeset | 100 | * @GST_TCP_UNIT_TYPE_UNDEFINED: undefined | 
| 
567bb019e3e3
Revision: 201010
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: 
0diff
changeset | 101 | * @GST_TCP_UNIT_TYPE_BUFFERS : buffers | 
| 
567bb019e3e3
Revision: 201010
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: 
0diff
changeset | 102 | * @GST_TCP_UNIT_TYPE_TIME : timeunits (in nanoseconds) | 
| 
567bb019e3e3
Revision: 201010
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: 
0diff
changeset | 103 | * @GST_TCP_UNIT_TYPE_BYTES : bytes | 
| 0 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 104 | * | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 105 | * The units used to specify limits. | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 106 | */ | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 107 | typedef enum | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 108 | {
 | 
| 7 
567bb019e3e3
Revision: 201010
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: 
0diff
changeset | 109 | GST_TCP_UNIT_TYPE_UNDEFINED, | 
| 
567bb019e3e3
Revision: 201010
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: 
0diff
changeset | 110 | GST_TCP_UNIT_TYPE_BUFFERS, | 
| 
567bb019e3e3
Revision: 201010
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: 
0diff
changeset | 111 | GST_TCP_UNIT_TYPE_TIME, | 
| 
567bb019e3e3
Revision: 201010
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: 
0diff
changeset | 112 | GST_TCP_UNIT_TYPE_BYTES | 
| 
567bb019e3e3
Revision: 201010
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: 
0diff
changeset | 113 | } GstTCPUnitType; | 
| 0 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 114 | |
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 115 | /** | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 116 | * GstClientStatus: | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 117 | * @GST_CLIENT_STATUS_OK : client is ok | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 118 | * @GST_CLIENT_STATUS_CLOSED : client closed the socket | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 119 | * @GST_CLIENT_STATUS_REMOVED : client is removed | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 120 | * @GST_CLIENT_STATUS_SLOW : client is too slow | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 121 | * @GST_CLIENT_STATUS_ERROR : client is in error | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 122 | * @GST_CLIENT_STATUS_DUPLICATE: same client added twice | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 123 | * @GST_CLIENT_STATUS_FLUSHING : client is flushing out the remaining buffers. | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 124 | * | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 125 | * This specifies the reason why a client was removed from | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 126 | * multifdsink and is received in the "client-removed" signal. | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 127 | */ | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 128 | typedef enum | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 129 | {
 | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 130 | GST_CLIENT_STATUS_OK = 0, | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 131 | GST_CLIENT_STATUS_CLOSED = 1, | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 132 | GST_CLIENT_STATUS_REMOVED = 2, | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 133 | GST_CLIENT_STATUS_SLOW = 3, | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 134 | GST_CLIENT_STATUS_ERROR = 4, | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 135 | GST_CLIENT_STATUS_DUPLICATE = 5, | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 136 | GST_CLIENT_STATUS_FLUSHING = 6 | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 137 | } GstClientStatus; | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 138 | |
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 139 | /* structure for a client | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 140 | */ | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 141 | typedef struct {
 | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 142 | GstPollFD fd; | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 143 | |
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 144 | gint bufpos; /* position of this client in the global queue */ | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 145 | gint flushcount; /* the remaining number of buffers to flush out or -1 if the | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 146 | client is not flushing. */ | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 147 | |
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 148 | GstClientStatus status; | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 149 | gboolean is_socket; | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 150 | |
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 151 | GSList *sending; /* the buffers we need to send */ | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 152 | gint bufoffset; /* offset in the first buffer */ | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 153 | |
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 154 | gboolean discont; | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 155 | |
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 156 | GstTCPProtocol protocol; | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 157 | |
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 158 | gboolean caps_sent; | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 159 | gboolean new_connection; | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 160 | |
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 161 | gboolean currently_removing; | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 162 | |
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 163 | /* method to sync client when connecting */ | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 164 | GstSyncMethod sync_method; | 
| 7 
567bb019e3e3
Revision: 201010
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: 
0diff
changeset | 165 | GstTCPUnitType burst_min_unit; | 
| 0 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 166 | guint64 burst_min_value; | 
| 7 
567bb019e3e3
Revision: 201010
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: 
0diff
changeset | 167 | GstTCPUnitType burst_max_unit; | 
| 0 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 168 | guint64 burst_max_value; | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 169 | |
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 170 | GstCaps *caps; /* caps of last queued buffer */ | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 171 | |
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 172 | /* stats */ | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 173 | guint64 bytes_sent; | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 174 | guint64 connect_time; | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 175 | guint64 disconnect_time; | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 176 | guint64 last_activity_time; | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 177 | guint64 dropped_buffers; | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 178 | guint64 avg_queue_size; | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 179 | } GstTCPClient; | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 180 | |
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 181 | #define CLIENTS_LOCK_INIT(fdsink) (g_static_rec_mutex_init(&fdsink->clientslock)) | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 182 | #define CLIENTS_LOCK_FREE(fdsink) (g_static_rec_mutex_free(&fdsink->clientslock)) | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 183 | #define CLIENTS_LOCK(fdsink) (g_static_rec_mutex_lock(&fdsink->clientslock)) | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 184 | #define CLIENTS_UNLOCK(fdsink) (g_static_rec_mutex_unlock(&fdsink->clientslock)) | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 185 | |
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 186 | /** | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 187 | * GstMultiFdSink: | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 188 | * | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 189 | * The multifdsink object structure. | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 190 | */ | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 191 | struct _GstMultiFdSink {
 | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 192 | GstBaseSink element; | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 193 | |
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 194 | /*< private >*/ | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 195 | guint64 bytes_to_serve; /* how much bytes we must serve */ | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 196 | guint64 bytes_served; /* how much bytes have we served */ | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 197 | |
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 198 | GStaticRecMutex clientslock; /* lock to protect the clients list */ | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 199 | GList *clients; /* list of clients we are serving */ | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 200 | GHashTable *fd_hash; /* index on fd to client */ | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 201 | guint clients_cookie; /* Cookie to detect changes to the clients list */ | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 202 | |
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 203 | gint mode; | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 204 | GstPoll *fdset; | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 205 | |
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 206 | GSList *streamheader; /* GSList of GstBuffers to use as streamheader */ | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 207 | gboolean previous_buffer_in_caps; | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 208 | |
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 209 | GstTCPProtocol protocol; | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 210 | guint mtu; | 
| 7 
567bb019e3e3
Revision: 201010
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: 
0diff
changeset | 211 | gint qos_dscp; | 
| 
567bb019e3e3
Revision: 201010
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: 
0diff
changeset | 212 | gboolean handle_read; | 
| 0 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 213 | |
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 214 | GArray *bufqueue; /* global queue of buffers */ | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 215 | |
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 216 | gboolean running; /* the thread state */ | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 217 | GThread *thread; /* the sender thread */ | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 218 | |
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 219 | /* these values are used to check if a client is reading fast | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 220 | * enough and to control receovery */ | 
| 7 
567bb019e3e3
Revision: 201010
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: 
0diff
changeset | 221 | GstTCPUnitType unit_type;/* the type of the units */ | 
| 0 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 222 | gint64 units_max; /* max units to queue for a client */ | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 223 | gint64 units_soft_max; /* max units a client can lag before recovery starts */ | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 224 | GstRecoverPolicy recover_policy; | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 225 | GstClockTime timeout; /* max amount of nanoseconds to remain idle */ | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 226 | |
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 227 | GstSyncMethod def_sync_method; /* what method to use for connecting clients */ | 
| 7 
567bb019e3e3
Revision: 201010
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: 
0diff
changeset | 228 | GstTCPUnitType def_burst_unit; | 
| 0 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 229 | guint64 def_burst_value; | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 230 | |
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 231 | /* these values are used to control the amount of data | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 232 | * kept in the queues. It allows clients to perform a burst | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 233 | * on connect. */ | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 234 | gint bytes_min; /* min number of bytes to queue */ | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 235 | gint64 time_min; /* min time to queue */ | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 236 | gint buffers_min; /* min number of buffers to queue */ | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 237 | |
| 7 
567bb019e3e3
Revision: 201010
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: 
0diff
changeset | 238 | gboolean resend_streamheader; /* resend streamheader if it changes */ | 
| 
567bb019e3e3
Revision: 201010
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: 
0diff
changeset | 239 | |
| 0 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 240 | /* stats */ | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 241 | gint buffers_queued; /* number of queued buffers */ | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 242 | gint bytes_queued; /* number of queued bytes */ | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 243 | gint time_queued; /* number of queued time */ | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 244 | |
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 245 | guint8 header_flags; | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 246 | }; | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 247 | |
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 248 | struct _GstMultiFdSinkClass {
 | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 249 | GstBaseSinkClass parent_class; | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 250 | |
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 251 | /* element methods */ | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 252 | void (*add) (GstMultiFdSink *sink, int fd); | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 253 | void (*add_full) (GstMultiFdSink *sink, int fd, GstSyncMethod sync, | 
| 7 
567bb019e3e3
Revision: 201010
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: 
0diff
changeset | 254 | GstTCPUnitType format, guint64 value, | 
| 
567bb019e3e3
Revision: 201010
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: 
0diff
changeset | 255 | GstTCPUnitType max_unit, guint64 max_value); | 
| 0 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 256 | void (*remove) (GstMultiFdSink *sink, int fd); | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 257 | void (*remove_flush) (GstMultiFdSink *sink, int fd); | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 258 | void (*clear) (GstMultiFdSink *sink); | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 259 | GValueArray* (*get_stats) (GstMultiFdSink *sink, int fd); | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 260 | |
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 261 | /* vtable */ | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 262 | gboolean (*init) (GstMultiFdSink *sink); | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 263 | gboolean (*wait) (GstMultiFdSink *sink, GstPoll *set); | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 264 | gboolean (*close) (GstMultiFdSink *sink); | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 265 | void (*removed) (GstMultiFdSink *sink, int fd); | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 266 | |
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 267 | /* signals */ | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 268 | void (*client_added) (GstElement *element, gint fd); | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 269 | void (*client_removed) (GstElement *element, gint fd, GstClientStatus status); | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 270 | void (*client_fd_removed) (GstElement *element, gint fd); | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 271 | }; | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 272 | #ifdef __SYMBIAN32__ | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 273 | IMPORT_C | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 274 | #endif | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 275 | |
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 276 | |
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 277 | GType gst_multi_fd_sink_get_type (void); | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 278 | #ifdef __SYMBIAN32__ | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 279 | IMPORT_C | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 280 | #endif | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 281 | |
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 282 | |
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 283 | void gst_multi_fd_sink_add (GstMultiFdSink *sink, int fd); | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 284 | #ifdef __SYMBIAN32__ | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 285 | IMPORT_C | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 286 | #endif | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 287 | |
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 288 | void gst_multi_fd_sink_add_full (GstMultiFdSink *sink, int fd, GstSyncMethod sync, | 
| 7 
567bb019e3e3
Revision: 201010
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: 
0diff
changeset | 289 | GstTCPUnitType min_unit, guint64 min_value, | 
| 
567bb019e3e3
Revision: 201010
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: 
0diff
changeset | 290 | GstTCPUnitType max_unit, guint64 max_value); | 
| 0 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 291 | #ifdef __SYMBIAN32__ | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 292 | IMPORT_C | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 293 | #endif | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 294 | |
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 295 | void gst_multi_fd_sink_remove (GstMultiFdSink *sink, int fd); | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 296 | #ifdef __SYMBIAN32__ | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 297 | IMPORT_C | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 298 | #endif | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 299 | |
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 300 | void gst_multi_fd_sink_remove_flush (GstMultiFdSink *sink, int fd); | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 301 | #ifdef __SYMBIAN32__ | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 302 | IMPORT_C | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 303 | #endif | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 304 | |
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 305 | void gst_multi_fd_sink_clear (GstMultiFdSink *sink); | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 306 | #ifdef __SYMBIAN32__ | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 307 | IMPORT_C | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 308 | #endif | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 309 | |
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 310 | GValueArray* gst_multi_fd_sink_get_stats (GstMultiFdSink *sink, int fd); | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 311 | |
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 312 | G_END_DECLS | 
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 313 | |
| 
0e761a78d257
Revision: 200949
 Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> parents: diff
changeset | 314 | #endif /* __GST_MULTI_FD_SINK_H__ */ |