#ifndef __PROTOCOL_ONVIF_HEADER__
#define __PROTOCOL_ONVIF_HEADER__
#include "../../components/base/basicMutex.h"
#include "protocolHTTP.h"
#include "xmlParser.h"
#define ONE_WAY_TEMPLATE ""
/*
device.GetSystemDateAndTime
xml version = "1.0" encoding = "UTF-8" ?>
GetDeviceInformation
device.GetCapabilities
All
*/
// GetProfiles
#define ONVIF_GetProfiles ""
// GetStreamURI
// #define ONVIF_GetStreamURI "RTP-UnicastUDP%s"
#define ONVIF_GetStreamURI \
"%s"
/*
GetVideoSourceConfigurations
ContinuousMove
Profile1
Stop
Profile1
true
true
*/
#define ONVIF_REQUEST_TIMEOUT_TIME 10 // in Milliseconds
#define ONVIF_REQUEST_TIMEOUT_COUNT 1000 // 10 sec
typedef struct S_PROFILE_ONVIF
{
CSTR pToken;
CSTR pNcode;
CSTR pName;
int nWidth;
int nHeight;
int nFramerate;
int nBitrate;
} profileONVIF;
typedef std::vector vectorProfileOnvif;
/**
* TODO: Add class description
*
* @author gagua
*/
class protocolONVIF : public protocolHTTP
{
private:
CSTR buildOneWayRequest(CSTR OPName, CSTR Prefix);
bool m_bRequestIsActive;
basicMutex * m_pRequestMutex; //???
bool m_bProtoIsBusy;
int m_nRequestTimeOut;
CSTR m_pStreamURI;
vectorProfileOnvif m_vProfiles;
protected:
basicTransport * m_oDataTransport;
// virtual bool packetHandler(unsigned char *Buffer, size_t BufferSize);
virtual bool packetHandler(protocolPackage * Package);
public:
// Constructor
protocolONVIF();
// ToDo: change Serial to BaseClass of some kind of socket
protocolONVIF(basicTransport * SocketTransport);
// Destructor
virtual ~protocolONVIF();
virtual bool init()
{
return true;
}
bool GetProfiles(CSTR URL);
CSTR GetStreamURI(CSTR URL, int profileID);
vectorProfileOnvif * GetAccessProfiles(void)
{
return &m_vProfiles;
}
};
#endif