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

MNRTPSourceSH.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_SOURCE_STREAM_HANDLER_H 00025 #define MN_RTP_SOURCE_STREAM_HANDLER_H 00026 00027 #include <sys/types.h> 00028 00029 #include "SH.h" 00030 #include "SHEndpoint.h" 00031 #include "SHReport.h" 00032 #include "SHEndpointSpec.h" 00033 #include "MNRTPcallback.h" 00034 #include "var_type.h" 00035 #include "sdp/TransportTypes.h" 00036 00037 class MNRTPPacket; 00038 class MNRTCPPacket; 00039 class MNRTP; 00040 class MNUDPSocket; 00041 00042 namespace SH 00043 { 00044 00045 class RTPSourceSH; 00046 00051 /**********************************************************************/ 00052 /* RTPSourceEndpoint */ 00053 /**********************************************************************/ 00054 00055 class RTPSourceEndpoint 00056 : public SourceEndpoint 00057 , public MNRTP_RTPreader_callback 00058 , public MNRTP_RTCPreader_callback 00059 , public MNRTP_RTCPbye_callback 00060 { 00061 size_t _number_of_pending_ssrcs; 00062 public: 00063 RTPSourceEndpoint( RTPSourceSH* mySH ); 00064 virtual ~RTPSourceEndpoint( ); 00065 00066 virtual void RTCPreader_cb( RPtr<MNRTCPPacket> packet ); 00067 virtual void RTPreader_cb( RPtr<MNRTPPacket> packet ); 00068 virtual void RTCPbye_cb( u_int32 ssrc, 00069 text_item_t* bye_text); 00070 00071 size_t getMaxSupportedInstances() const; 00072 00073 virtual Endpoint* instantiate( Base* caller ) const; 00074 }; 00075 00076 /**********************************************************************/ 00077 /* RTPSourceSH */ 00078 /**********************************************************************/ 00079 00080 class RTPSourceSH 00081 : public Base 00082 { 00083 MNRTP* _rtp; 00084 RTPSourceEndpoint _outEP; 00085 RTPSourceEndpoint* _out_ep_a; 00086 int _rate; 00087 00093 SourceEndpoint* _referrable_out_ep_a; 00094 00095 public: 00096 RTPSourceSH( SHGraphManager* mgr, 00097 u_int32_t runtimeId, 00098 MNSelector& sel, 00099 RTSP::TransportTypes req_transport = RTSP::RTP_AVP_UDP ); 00100 00101 virtual ~RTPSourceSH(); 00102 00103 private: 00104 00109 RTPSourceSH( const RTPSourceSH& ); 00110 00115 RTPSourceSH& operator=( const RTPSourceSH& ); 00116 00117 public: 00120 virtual SH_RC initSH(); 00123 virtual SH_RC uninitSH(); 00124 00127 virtual SH_RC startStreaming(); 00130 virtual SH_RC stopStreaming(); 00131 00132 virtual void pushReport( ReportPtr report, Direction d ); 00133 00134 void notify( Notification attribute ); 00135 00137 int getNptSeconds(); 00138 00141 void setNptSeek(int npt); 00142 00144 void setRTPTimestamp(int idx, u_int32 rtptime); 00145 00146 void calcNptSeconds(RPtr<MNRTPPacket>& packet); 00147 00148 void setSubsessionIndex(int idx); 00149 00150 // Attributes haved been moved to SH.h 00151 00152 private: 00157 SA_RTPSRC_RTP_SOCK _rtp_socket; 00158 00163 SA_RTPSRC_RTCP_SOCK _rtcp_socket; 00164 SA_RTPSRC_REMOTE_UPSTREAM_PORT _remote_upstream_port; 00165 SA_RTPSRC_TARGET_ADDRESS _target_address; 00166 SA_RTPSRC_IGNORE_RTCP_RR _ignore_rtcp_rr; 00167 SA_RTP_RTP_PAYLOAD_TYPE _payload_type; 00168 SA_RTP_BANDWIDTH _bandwidth; 00169 00171 RTSP::TransportTypes _req_transport; 00172 00174 int _subsessionIndex; 00175 00176 u_int32 _timestampDiff; 00177 u_int32 _oldTimestamp; 00178 int _nptSeconds; 00179 int _nptSeekOffset; 00180 00181 /******************************************************************/ 00182 /* functions required for Base::Spec */ 00183 /******************************************************************/ 00184 public: 00185 virtual SinkEndpoint** getSinkSpecs(); 00186 virtual SourceEndpoint** getSourceSpecs(); 00187 00188 /******************************************************************/ 00189 /* functions required for Status */ 00190 /******************************************************************/ 00191 private: 00192 bool _isStreaming; 00193 00194 public: 00205 virtual bool isConnected() const; 00206 00207 /* 00208 virtual bool isStreaming() const = 0; 00209 virtual bool isInActiveMode() const = 0; 00210 virtual bool isInPassiveMode() const = 0; 00211 virtual bool isInThroughMode() const = 0;*/ 00212 }; 00213 00215 00216 }; // namespace SH 00217 00218 #endif /* MN_RTP_SOURCE_STREAM_HANDLER_H */ 00219

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