本文来自:
http://blog.chinaunix.net/uid-23093301-id-86401.html
#ifndef RTP_SESSION_H_INCLUDE
#define RTP_SESSION_H_INCLUDE
#include "rtpsession.h"
#include "rtppacket.h"
#include "rtpudpv4transmitter.h"
#include "rtpipv4address.h"
#include "rtpsessionparams.h"
#include "rtperrors.h"
#include "rtpsourcedata.h"
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
using namespace std;
string rtp_error(int rtperr);
//
// The new class routine
//
class BaseRTPSession : public RTPSession
{
public:
BaseRTPSession();
int cur_num_dest(){return num_dest;}
protected:
void OnNewSource(RTPSourceData *dat);
void OnBYEPacket(RTPSourceData *dat);
void OnRemoveSource(RTPSourceData *dat);
private:
int num_dest;
};
class CRtpService
{
public:
CRtpService();
~CRtpService();
int
start(string port);
int
stop();
int
send_rtp_packet(const string& data);
int process_task();
private:
//string rtp_error(const int& rtp_err);
private:
queue
m_task_queue;
private:
pthread_t
m_thread_id;
pthread_cond_t
m_pthread_cond;
pthread_mutex_t
m_mutex;
BaseRTPSession
m_rtp_session;
private:
bool started;
long
m_timestamp;
};
#endif