/**********************************************************************
*   Copyright	: (C) 2006 Video Surveillance(China) Co. Ltd. 
*   Source File  : rtsppub.h
*   Product	  : VS
*   Component	: 
*   Version	  : 1.0.0.1
*   Author	   : Lance Li
*   Date		 : 2007-2-13 17:34:16
*   Description  : public define for rtsp stack
*   Modification :
*   ------------------------------------------------------------------
*   No.	Date	Author	Comment
*   ------------------------------------------------------------------
*   1)  Feb/13/2007 Lance Li	new
***********************************************************************/
#ifndef RTSPPUB_H
#define RTSPPUB_H

#include "table_structs.h"

const U32 RTSP_MAX_DEVID_SIZE = VS_DEV_ID_LEN;

const U32 RTSP_MAX_USERID_SIZE = VS_USER_ID_LEN;

const U32 RTSP_INVALID_TIMESTAMP = 0xFFFFFFFF;

// RTSP protocol type enum.
typedef enum
{
	RTSP_VSMSG,
	RTSP_RFC2326	
}RtspProtoType_e;

// RTSP client type enum.
typedef enum
{
	VS_PlAYER,
	REAL_PlAYER,
	WIN_PLAYER
}RtspClientType_e;

// RTSP transport protocol type enum.
typedef enum
{
	VS_OVER_TCP,
	VS_OVER_UDP,
	RTSP_OVER_TCP,
	RTSP_OVER_UDP
}RtspCmdProto_e;

// Stream protocol type enum.
typedef enum
{
	UDP,
	TCP,
}RtspStreamProto_e;

// RTSP media type enum.
typedef enum
{
	RTSP_VIDEO_AUDIO,
	RTSP_VIDEO_ONLY,
	RTSP_AUDIO_ONLY
}RtspMediaType_e;

// RTSP media codec type enum.
typedef enum
{
	RTSP_MPEG4,
	RTSP_H264,
	RTSP_MPEG2
}RtspMediaCodec_e;


// RTSP location flag enum.
typedef enum
{	
	RTSP_LOCATION_NULL = -1,
	RTSP_LOCATION_FILE = 1,
	RTSP_LOCATION_TIME = 2,
}RtspLocation_e;

typedef enum
{
	RTSP_PLAYMODE_NORMAL,
	RTSP_PLAYMODE_LIVE,
}RtspPlayMode_e;


typedef enum
{
	RTSP_STREAM_STATE_STOP = 0,
	RTSP_STREAM_STATE_SENDING = 1,

}RtspStreamState_e;



// RTSP play scale enum.
typedef enum
{
	RTSP_STOP	   = 0,		
	RTSP_NORMAL	 = 1, 

	RTSP_SF_C_2X	= 2,	  // slow-forward play, x(1/2)
	RTSP_SF_C_4X	= 4,  // slow-forward play, x(1/4)
	RTSP_SF_C_8X	= 8,	  // slow-forward play, x(1/8)
	RTSP_SF_C_16X	= 16,  // slow-forward play, x(1/16)
	RTSP_SF_C_32X	= 32,  // slow-forward play, x(1/32)

	RTSP_SF_F_1X	= 51,	 // slow-forward play frame one by one
	
	RTSP_FF_C_2X	= 102,	// fast-forward play in 2X continuos frame
	RTSP_FF_C_4X	= 104,	
	RTSP_FF_C_8X	= 108, 
	RTSP_FF_C_16X	= 116,
	RTSP_FF_C_32X	= 132,
	

	RTSP_FF_I_1X	= 1001,   // fast-forward play in 1X I frame
	RTSP_FF_I_2X	= 1002,  
	RTSP_FF_I_4X	= 1004,
	RTSP_FF_I_8X	= 1008,
	RTSP_FF_I_16X   = 1016,
	RTSP_FF_I_32X   = 1032,

	//////////////////////////////////////////////////////
	RTSP_SR_I_2X	= -2,	 // slow-reverse play, x(-1/2)
	RTSP_SR_I_4X	= -4,	 // slow-reverse play, x(-1/4)
	RTSP_SR_I_8X	= -8,	 // slow-reverse play, x(-1/8)
	RTSP_SR_I_16X	= -16,	 // slow-reverse play, x(-1/16)
	RTSP_SR_I_32X	= -32,	 // slow-reverse play, x(-1/32)
	
	RTSP_SR_F_1X	= -51,	// slow-reverse play frame one by one
	
	RTSP_RR_I_1X	= -1001,  // round-reverse play in 1X I frame
	RTSP_RR_I_2X	= -1002,  
	RTSP_RR_I_4X	= -1004,
	RTSP_RR_I_8X	= -1008,
	RTSP_RR_I_16X   = -1016,
	RTSP_RR_I_32X   = -1032,
} RtspScaleMode_e;

// replay and error code
typedef enum
{
	RTSP_NULL							 = 0,

	RTSP_CONTINUE						 = 100,
	
	RTSP_SUCCESS_OK					   = 200,
	RTSP_SUCCESS_CREATED				  = 201,
	RTSP_SUCCESS_ACCEPTED				 = 202,
	RTSP_SUCCESS_NOCONTENT				= 203,
	RTSP_SUCCESS_PARTIALCONTENT		   = 204,
	
	RTSP_SUCCESS_LOWONSTORAGE			 = 250,
	
	RTSP_MULTIPLE_CHOICES				 = 300,
	RTSP_REDIRECT_PERMMOVED			   = 301,
	RTSP_REDIRECT_TEMPMOVED			   = 302,
	RTSP_REDIRECT_SEEOTHER				= 303,
	RTSP_REDIRECT_NOTMODIFIED			 = 304,
	RTSP_USE_PROXY						= 305,
	
	RTSP_CLIENT_BADREQUEST				= 400,
	RTSP_CLIENT_UNAUTHORIZED			  = 401,
	RTSP_PAYMENT_REQUIRED				 = 402,
	RTSP_CLIENT_FORBIDDEN				 = 403,
	RTSP_CLIENT_NOTFOUND				  = 404,
	RTSP_CLIENT_METHODNOTALLOWED		  = 405,
	RTSP_NOT_ACCEPTABLE				   = 406,
	RTSP_PROXY_AUTHENTICATION_REQUIRED	= 407,
	RTSP_REQUEST_TIMEOUT				  = 408,
	RTSP_CLIENT_CONFLICT				  = 409,
	RTSP_GONE							 = 410,
	RTSP_LENGTH_REQUIRED				  = 411,
	RTSP_PRECONDITION_FAILED			  = 412,
	RTSP_REQUEST_ENTITYTOOLARGE		   = 413,
	RTSP_REQUEST_URITOOLARGE			  = 414,
	RTSP_UNSUPPORTED_MEDIATYPE			= 415,
	
	RTSP_CLIENT_PARAMETER_NOTUNDERSTOOD	= 451,
	RTSP_CLIENT_CONFERENCE_NOTFOUND		= 452,
	RTSP_CLIENT_NOTENOUGH_BANDWIDTH		= 453,
	RTSP_CLIENT_SESSION_NOTFOUND		   = 454,
	RTSP_CLIENT_METHOD_NOTVALIDINSTATE	 = 455,
	RTSP_CLIENT_HEADERFIELD_NOTVALID	   = 456,
	RTSP_CLIENT_INVALID_RANGE			  = 457,
	RTSP_CLIENT_READONLY_PARAMETER		 = 458,
	RTSP_CLIENT_AGGREGATEOPTION_NOTALLOWED = 459,
	RTSP_CLIENT_AGGREGATEOPTION_ALLOWED	= 460,
	RTSP_CLIENT_UNSUPPORTED_TRANSPORT	  = 461,
	RTSP_CLIENT_DESTINATION_UNREACHABLE	= 462,
	RTSP_CLIENT_CAMERA_NOT_EXIST		   = 463,
	
	RTSP_SERVER_INTERNAL				   = 500,
	RTSP_SERVER_NOTIMPLEMENTED			 = 501,
	RTSP_SERVER_BADGATEWAY				 = 502,
	RTSP_SERVER_UNAVAILABLE				= 503,
	RTSP_SERVER_GATEWAYTIMEOUT			 = 504,
	RTSP_VERSION_NOTSUPPORTED			  = 505,
	
	RTSP_SERVER_OPTION_NOTSUPPORTED		= 551,
	RTSP_SERVER_BUFFERING				  = 552,
	RTSP_SERVER_LIVEPLAY				   = 553,
	RTSP_SERVER_DVRPLAY					= 554,
	RTSP_SERVER_END_OF_FILE             = 555,

	RTSP_NUMSTATUSCODES
} RtspErrorCode_e;

#endif // #ifndef RTSPPUB_H 

