00001 00007 #ifndef CETONRTP_H 00008 #define CETONRTP_H 00009 00010 #include <QObject> 00011 #include <QUdpSocket> 00012 00013 #include "cetonrtsp.h" 00014 00015 struct RtpFixedHeader 00016 { 00017 uint csrccount : 4; 00018 uint extension : 1; 00019 uint padding : 1; 00020 uint version : 2; 00021 00022 uint payloadtype : 7; 00023 uint marker : 1; 00024 00025 uint sequencenumber : 16; 00026 uint timestamp : 32; 00027 uint ssrc : 32; 00028 }; 00029 00030 class CetonRTP 00031 { 00032 public: 00033 explicit CetonRTP(const QString &ip, uint tuner, ushort listenPort = 0, 00034 ushort controlPort = 8554); 00035 00036 bool Init(void); 00037 00038 bool StartStreaming(void); 00039 bool StopStreaming(void); 00040 00041 int Read(char *buffer, int bufferSize); 00042 00043 private: 00044 void ProcessIncomingData(void); 00045 bool FindRTPPayload( 00046 char* packet, char* &payload, int &payloadSize, int &sequenceNumber); 00047 00048 private: 00049 QString _ip; 00050 uint _tuner; 00051 uint _listenPort; 00052 00053 QUdpSocket _rtpSocket; 00054 QUdpSocket _dummySocket; 00055 QHostAddress _acceptFrom; 00056 CetonRTSP _rtsp; 00057 00058 QByteArray _readBuffer; 00059 QByteArray _mpegBuffer; 00060 00061 int _lastRead; 00062 int _thisRead; 00063 int _lastSequenceNumber; 00064 }; 00065 00066 #endif // CETONRTP_H
1.6.3