2008-07-16 16:35:59 +08:00
|
|
|
//
|
2008-07-25 17:08:15 +08:00
|
|
|
// ZoneMinder RTP Data Class Interface, $Date$, $Revision$
|
2008-07-25 17:33:23 +08:00
|
|
|
// Copyright (C) 2001-2008 Philip Coombes
|
2008-07-16 16:35:59 +08:00
|
|
|
//
|
|
|
|
// This program is free software; you can redistribute it and/or
|
|
|
|
// modify it under the terms of the GNU General Public License
|
|
|
|
// as published by the Free Software Foundation; either version 2
|
|
|
|
// of the License, or (at your option) any later version.
|
|
|
|
//
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License for more details.
|
|
|
|
//
|
|
|
|
// You should have received a copy of the GNU General Public License
|
|
|
|
// along with this program; if not, write to the Free Software
|
2016-12-26 23:23:16 +08:00
|
|
|
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
2008-07-16 16:35:59 +08:00
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef ZM_RTP_DATA_H
|
|
|
|
#define ZM_RTP_DATA_H
|
|
|
|
|
|
|
|
#include "zm_thread.h"
|
|
|
|
#include "zm_buffer.h"
|
|
|
|
|
2010-07-05 02:09:44 +08:00
|
|
|
#include <stdint.h>
|
|
|
|
|
2008-07-16 16:35:59 +08:00
|
|
|
class RtspThread;
|
|
|
|
class RtpSource;
|
|
|
|
|
|
|
|
struct RtpDataHeader
|
|
|
|
{
|
2016-04-04 22:11:48 +08:00
|
|
|
uint8_t cc:4; // CSRC count
|
|
|
|
uint8_t x:1; // header extension flag
|
|
|
|
uint8_t p:1; // padding flag
|
|
|
|
uint8_t version:2; // protocol version
|
|
|
|
uint8_t pt:7; // payload type
|
|
|
|
uint8_t m:1; // marker bit
|
|
|
|
uint16_t seqN; // sequence number, network order
|
|
|
|
uint32_t timestampN; // timestamp, network order
|
|
|
|
uint32_t ssrcN; // synchronization source, network order
|
|
|
|
uint32_t csrc[]; // optional CSRC list
|
2008-07-16 16:35:59 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class RtpDataThread : public Thread
|
|
|
|
{
|
|
|
|
friend class RtspThread;
|
|
|
|
|
|
|
|
private:
|
2016-04-04 22:11:48 +08:00
|
|
|
RtspThread &mRtspThread;
|
|
|
|
RtpSource &mRtpSource;
|
|
|
|
bool mStop;
|
2008-07-16 16:35:59 +08:00
|
|
|
|
|
|
|
private:
|
2016-04-04 22:11:48 +08:00
|
|
|
bool recvPacket( const unsigned char *packet, size_t packetLen );
|
|
|
|
int run();
|
2008-07-16 16:35:59 +08:00
|
|
|
|
|
|
|
public:
|
2016-04-04 22:11:48 +08:00
|
|
|
RtpDataThread( RtspThread &rtspThread, RtpSource &rtpSource );
|
2008-07-16 16:35:59 +08:00
|
|
|
|
2016-04-04 22:11:48 +08:00
|
|
|
void stop()
|
|
|
|
{
|
|
|
|
mStop = true;
|
|
|
|
}
|
2008-07-16 16:35:59 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // ZM_RTP_DATA_H
|