Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

MNRTPDecoderSH.h

Go to the documentation of this file.
00001 /* Copyright (C) 2000 KOM/Darmstadt University of Technology 00002 * 00003 * You are allowed to use all other parts of the code under the following terms: 00004 * 00005 * For non-commercial use, code may be used in unmodified form provided 00006 * that this copyright notice and this permission notice appear in 00007 * supporting documentation. 00008 * 00009 * This software is provided "as is" and without any express or implied 00010 * warranties, including, without limitation, the implied warranty of 00011 * fitness for a particular purpose. 00012 * 00013 * The code may be subjected to the GNU General Public License, Version 2, 00014 * and re-distributed under the terms of this license. 00015 * As a special exception, permission is granted to link this code 00016 * with the Qt library and distribute executables, as long as you 00017 * follow the requirements of the GNU GPL in regard to all of the 00018 * software in the executable aside from Qt. 00019 * 00020 * Commercial use other than under the terms of the GNU General Public 00021 * License is allowed only after express negotiation of conditions 00022 * with the authors. 00023 */ 00024 #ifndef MN_RTP_DECODER_STREAM_HANDLER_H 00025 #define MN_RTP_DECODER_STREAM_HANDLER_H 00026 00027 #include <sys/types.h> 00028 00029 #include "SH.h" 00030 #include "SHEndpoint.h" 00031 #include "SHEndpointSpec.h" 00032 #include "var_type.h" 00033 #include "MNTimerCall.h" 00034 #include "lcrtp/MNLCRTPdefs.h" 00035 #include "lcrtp/MNLCRTPLossList.h" 00036 #include "sdp/PayloadTypes.h" 00037 #include "sdp/PayloadTypeEntry.h" 00038 #include "MNTFRCRecv.h" 00039 00040 class MNRTP; 00041 class MNUDPSocket; 00042 class MNRTPDecoderBase; 00043 class RetransRecvBase; 00044 class MNRope; 00045 00046 namespace SH 00047 { 00048 00049 class RTPDecoderSH; 00050 class RTPDecoderSinkEndpointSpec; 00051 class RTPDecoderSourceEndpointSpec; 00052 class RTPDecoderSinkEndpoint; 00053 class RTPDecoderSourceEndpoint; 00054 00059 /**********************************************************************/ 00060 /* RTPDecoderSinkEndpoint */ 00061 /**********************************************************************/ 00062 00063 class RTPDecoderSinkEndpoint 00064 : public SinkEndpoint 00065 { 00066 public: 00067 RTPDecoderSinkEndpoint( RTPDecoderSH* mySH ); 00068 virtual ~RTPDecoderSinkEndpoint( ); 00069 00070 virtual SH_RC push( DataPtr item ); 00071 00072 RTPDecoderSH* dsh(); 00073 }; 00074 00075 /**********************************************************************/ 00076 /* RTPDecoderSourceEndpoint */ 00077 /**********************************************************************/ 00078 00079 class RTPDecoderSourceEndpoint 00080 : public SourceEndpoint 00081 { 00082 public: 00083 RTPDecoderSourceEndpoint( RTPDecoderSH* mySH ); 00084 virtual ~RTPDecoderSourceEndpoint( ); 00085 00086 virtual SH_RC pull( DataPtr& item, 00087 SourceUnit su = UnitDefault, 00088 size_t amount = 0 ); 00089 00090 RTPDecoderSH* dsh(); 00091 }; 00092 00122 class RTPDecoderSH 00123 : public Base 00124 { 00125 MNRTPDecoderBase* _codec; 00126 RetransRecvBase* _retrans; 00127 00128 SA_HAS_ORDERED_DATA _hasOrderedData; 00129 // SA_RTP_PAYLOAD_TYPES _payload_types; 00130 const SDP::PayloadTypeTable* _payload_types; 00131 SA_RTP_RTP_PAYLOAD_TYPE _rtp_pt; 00132 SA_RTP_INT_PAYLOAD_TYPE _int_pt; 00133 SA_RTP_INT_RETRANS_TYPE _int_rt; // indicates retransmission type 00134 00135 //sequencenumber and time of the first RTP-packet to listen to 00136 SA_RTP_SEQ_LISTEN _rtp_seq; 00137 SA_RTP_TIME_LISTEN _rtp_time; 00138 00139 /* Experimental for RTP timestamp synchronization */ 00140 SA_IGNORE_SYNC_TIMESTAMP _ignore_sync_ts; 00141 unsigned _syncTimestamp; 00142 struct timeval _syncTime; 00143 bool _hasBeenSynced; 00144 00145 MNRope* _decodedDataRope; 00146 00147 bool _gotFirstPacket; 00148 00149 ProtectedVarEnum<streamer_state_t> _streamer_state; 00150 00154 SH_RC verify_codec( ); 00155 00159 MNSelector& _sel; 00160 void set_retrans( MNSelector& sel ); 00161 00162 00163 /* Experimental for TFRC - MZ */ 00164 MNTFRCRecv* _tfrc; 00165 00166 public: 00172 void set_payload_types(const SDP::PayloadTypeTable* ptt_ptr); 00173 00174 // SH_RC push_decode( MNRope* data, u_int32 payload_type ); 00175 SH_RC push_decode( DataPtr item ); 00176 SH_RC pull_decode( DataPtr& item ); 00177 00201 DataPtr evalLCRTPPacket( MNRTPPacketPtr packet, 00202 MNRope*& payload, 00203 u_int64_t& bytecount ); 00204 00205 /* Experimental for TFRC - MZ */ 00206 void tfrc_packet_received( MNRope*& payload, 00207 MNRTPPacketPtr packet); 00208 void send_feedback(u_int32 ssrc, LCfeedb_tfrc_t* reply); 00209 00223 DataPtr evalRTPPacket( MNRTPPacketPtr packet, 00224 MNRope*& payload, 00225 u_int64_t& bytecount); 00232 void evalSyncTimestamp(unsigned rtpTimestamp, struct timeval& resPT); 00233 00241 void evalSyncRTCP(u_int32 ntp_upper, u_int32 ntp_lower, u_int32 rtpTimestamp); 00242 00247 inline void resetSyncTime() { _syncTime.tv_sec = _syncTime.tv_usec = 0; } 00248 00249 public: 00250 RTPDecoderSH( SHGraphManager* mgr, 00251 u_int32_t runtimeId, 00252 MNSelector& sel ); 00253 00254 virtual ~RTPDecoderSH(); 00255 00256 private: 00257 00262 RTPDecoderSH( const RTPDecoderSH& ); 00263 00268 RTPDecoderSH& operator=( const RTPDecoderSH& ); 00269 00270 public: 00273 virtual SH_RC initSH(); 00276 virtual SH_RC uninitSH(); 00277 00280 virtual SH_RC startStreaming(); 00283 virtual SH_RC stopStreaming(); 00284 00285 /******************************************************************/ 00286 /* additional attributes for the set() functions */ 00287 /******************************************************************/ 00288 public: 00289 // Attributes have been moved to SH.h 00290 00291 /******************************************************************/ 00292 /* functions required for SHStatus */ 00293 /******************************************************************/ 00294 protected: 00295 friend class RTPDecoderSinkEndpoint; 00296 friend class RTPDecoderSourceEndpoint; 00297 00302 friend class LossList; 00303 00304 virtual void pushReport( ReportPtr report, Base::Direction d ); 00305 00306 SinkEndpoint* _in_ep_a[1]; 00307 SourceEndpoint* _out_ep_a[1]; 00308 RTPDecoderSinkEndpoint _inEP; 00309 RTPDecoderSourceEndpoint _outEP; 00310 00311 public: 00312 virtual SinkEndpoint** getSinkSpecs(); 00313 virtual SourceEndpoint** getSourceSpecs(); 00314 00324 virtual bool isConnected() const ; 00325 }; 00326 00328 00329 }; // namespace SH 00330 00331 #endif /* MN_RTP_DECODER_STREAM_HANDLER_H */ 00332

Generated on Sun Mar 6 13:35:49 2005 for Komssys by doxygen 1.3.8