⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ietf.h

📁 一个用于智能手机的多媒体库适合S60 WinCE的跨平台开发库
💻 H
📖 第 1 页 / 共 3 页
字号:
GF_Err gf_rtsp_send_command(GF_RTSPSession *sess, GF_RTSPCommand *com);GF_Err gf_rtsp_set_interleave_callback(GF_RTSPSession *sess,						GF_Err (*SignalData)(GF_RTSPSession *sess, void *cbk_ptr, char *buffer, u32 bufferSize, Bool IsRTCP)				);GF_Err gf_rtsp_session_read(GF_RTSPSession *sess);GF_Err gf_rtsp_register_interleave(GF_RTSPSession *sess, void *the_ch, u8 LowInterID, u8 HighInterID);u32 gf_rtsp_unregister_interleave(GF_RTSPSession *sess, u8 LowInterID);/*			Server side session constructor	create a new RTSP session from an existing socket in listen state. If no pending connection	is detected, return NULL*/GF_RTSPSession *gf_rtsp_session_new_server(GF_Socket *rtsp_listener);/*fetch an RTSP request. The GF_RTSPCommand will be reseted before fetch*/GF_Err gf_rtsp_get_command(GF_RTSPSession *sess, GF_RTSPCommand *com);/*unpack the URL, check the service name / server. Typically used when a client sends a  DESCRIBE || SETUP url RTSP/1.0. Server / service name check must be performed by your app as redirectionor services available are unknown here.*/GF_Err gf_rtsp_load_service_name(GF_RTSPSession *sess, char *URL);/*geenrates a session ID fpor the given session*/char *gf_rtsp_generate_session_id(GF_RTSPSession *sess);/*send the RTSP response*/GF_Err gf_rtsp_send_response(GF_RTSPSession *sess, GF_RTSPResponse *rsp);/*gets the IP address of the local host running the sessionbuffer shall be GF_MAX_IP_NAME_LEN long*/GF_Err gf_rtsp_get_session_ip(GF_RTSPSession *sess, char *buffer);/*returns the next available ID for interleaving. It is recommended that you use 2 consecutive IDs for RTP/RTCP interleaving*/u8 gf_rtsp_get_next_interleave_id(GF_RTSPSession *sess);/*gets the IP address of the connected peer - buffer shall be GF_MAX_IP_NAME_LEN long*/GF_Err gf_rtsp_get_remote_address(GF_RTSPSession *sess, char *buffer);/*		RTP LIB EXPORTS*/typedef struct tagRTP_HEADER {	/*version, must be 2*/	u8 Version;	/*padding bits in the payload*/	u8 Padding;	/*header extension is defined*/	u8 Extension;	/*number of CSRC (<=15)*/	u8 CSRCCount;	/*Marker Bit*/	u8 Marker;	/*payload type on 7 bits*/	u8 PayloadType;	/*packet seq number*/	u16 SequenceNumber;	/*packet time stamp*/	u32 TimeStamp;	/*sync source identifier*/	u32 SSRC;	/*in our basic client, CSRC should always be NULL*/	u32 CSRC[16];} GF_RTPHeader;/*	structure containing the rtpmap information*/typedef struct{	/*dynamic payload type of this map*/	u32 PayloadType;	/*registered payload name of this map*/	char *payload_name;	/*RTP clock rate (TS resolution) of this map*/	u32 ClockRate;	/*optional parameters for audio, specifying number of channels. Unused for other media types.*/	u32 AudioChannels;} GF_RTPMap;typedef struct __tag_rtp_channel GF_RTPChannel;GF_RTPChannel *gf_rtp_new();void gf_rtp_del(GF_RTPChannel *ch);/*you configure a server channel through the transport structure, with the same info as a client channel, the client_port_* info designing the REMOTE client and port_* designingyour server channel*/GF_Err gf_rtp_setup_transport(GF_RTPChannel *ch, GF_RTSPTransport *trans_info, char *remote_address);/*auto-setup of rtp/rtcp transport ports - only effective in unicast, non interleaved cases. for multicast port setup MUST be done through the above gf_rtp_setup_transport functionthis will take care of port reuse*/GF_Err gf_rtp_set_ports(GF_RTPChannel *ch, u16 first_port);/*init of payload information. only ONE payload per sync source is supported in thisversion of the library (a sender cannot switch payload types on a single media)*/GF_Err gf_rtp_setup_payload(GF_RTPChannel *ch, GF_RTPMap *map);/*enables sending of NAT keep-alive packets for NAT traversal	@nat_timeout: specifies the inactivity period in ms after which NAT keepalive packets are sent. 	If 0, disables NAT keep-alive packets */void gf_rtp_enable_nat_keepalive(GF_RTPChannel *ch, u32 nat_timeout);/*initialize the RTP channel.UDPBufferSize: UDP stack buffer size if configurable by OS/ISP - ignored otherwiseNOTE: on WinCE devices, this is not configurable on an app bases but for the whole OSyou must update the device registry with:	[HKEY_LOCAL_MACHINE\Comm\Afd]	DgramBuffer=dword:N	where N is the number of UDP datagrams a socket should be able to buffer. For multimediaapp you should set N as large as possible. The device MUST be reseted for the param to take effectReorederingSize: max number of packets to queue for reordering. 0 means no reorderingMaxReorderDelay: max time to wait in ms before releasing first packet in reoderer when only one packet is present.If 0 and reordering size is specified, defaults to 200 ms (usually enough).IsSource: if true, the channel is a sender (media data, sender report, Reciever report processing)if source, you must specify the Path MTU size. The RTP lib won't send any packet bigger than this sizeyour application shall perform payload size splitting if neededlocal_interface_ip: local interface address to use for multicast. If NULL, default address is used*/GF_Err gf_rtp_initialize(GF_RTPChannel *ch, u32 UDPBufferSize, Bool IsSource, u32 PathMTU, u32 ReorederingSize, u32 MaxReorderDelay, char *local_interface_ip);/*init the RTP info after a PLAY or PAUSE, rtp_time is the rtp TimeStamp of the RTP packetwith seq_num sequence number. This info is needed to compute the CurrentTime of the RTP channel ssrc may not be known if sender hasn't indicated it (use 0 then)*/GF_Err gf_rtp_set_info_rtp(GF_RTPChannel *ch, u32 seq_num, u32 rtp_time, u32 ssrc);/*retrieve current RTP time in sec. If rtp_time was unknown (not on demand media) the time is absolute.Otherwise this is the time in ms elapsed since the last PLAY range start valueNot supported yet if played without RTSP (aka RTCP time not supported)*/Double gf_rtp_get_current_time(GF_RTPChannel *ch);void gf_rtp_reset_buffers(GF_RTPChannel *ch);/*read any data on UDP only (not valid for TCP). Performs re-ordering if configured for itreturns amount of data read (raw UDP packet size)*/u32 gf_rtp_read_rtp(GF_RTPChannel *ch, char *buffer, u32 buffer_size);u32 gf_rtp_read_rtcp(GF_RTPChannel *ch, char *buffer, u32 buffer_size);/*decodes an RTP packet and gets the begining of the RTP payload*/GF_Err gf_rtp_decode_rtp(GF_RTPChannel *ch, char *pck, u32 pck_size, GF_RTPHeader *rtp_hdr, u32 *PayloadStart);/*decodes an RTCP packet and update timing info, send RR too*/GF_Err gf_rtp_decode_rtcp(GF_RTPChannel *ch, char *pck, u32 pck_size);/*computes and send Reciever report. If the channel is a TCP channel, you must specifythe callback function. NOTE: many RTP implementation do NOT process RTCP info recieved on TCP...the lib will decide whether the report shall be sent or not, therefore you should callthis function at regular times*/GF_Err gf_rtp_send_rtcp_report(GF_RTPChannel *ch, 						GF_Err (*RTP_TCPCallback)(void *cbk, char *pck, u32 pck_size),						void *rtsp_cbk);/*send a BYE info (leaving the session)*/GF_Err gf_rtp_send_bye(GF_RTPChannel *ch,						GF_Err (*RTP_TCPCallback)(void *cbk, char *pck, u32 pck_size),						void *rtsp_cbk);/*send RTP packet*/GF_Err gf_rtp_send_packet(GF_RTPChannel *ch, GF_RTPHeader *rtp_hdr, char *extra_header, u32 extra_header_size, char *pck, u32 pck_size);enum{	GF_RTCP_INFO_NAME = 0,	GF_RTCP_INFO_EMAIL,	GF_RTCP_INFO_PHONE,	GF_RTCP_INFO_LOCATION,	GF_RTCP_INFO_TOOL,	GF_RTCP_INFO_NOTE,	GF_RTCP_INFO_PRIV};/*sets RTCP info sent in RTCP reports. info_string shall NOT exceed 255 chars*/GF_Err gf_rtp_set_info_rtcp(GF_RTPChannel *ch, u32 InfoCode, char *info_string);u32 gf_rtp_is_unicast(GF_RTPChannel *ch);u32 gf_rtp_is_interleaved(GF_RTPChannel *ch);u32 gf_rtp_get_clockrate(GF_RTPChannel *ch);u32 gf_rtp_is_active(GF_RTPChannel *ch);u8 gf_rtp_get_low_interleave_id(GF_RTPChannel *ch);u8 gf_rtp_get_hight_interleave_id(GF_RTPChannel *ch);GF_RTSPTransport *gf_rtp_get_transport(GF_RTPChannel *ch);u32 gf_rtp_get_local_ssrc(GF_RTPChannel *ch);Float gf_rtp_get_loss(GF_RTPChannel *ch);u32 gf_rtp_get_tcp_bytes_sent(GF_RTPChannel *ch);void gf_rtp_get_ports(GF_RTPChannel *ch, u16 *rtp_port, u16 *rtcp_port);	/****************************************************************************					SDP LIBRARY EXPORTS				  Note: SDP is mainly a text protocol with 	well defined containers. The following structures are used to write / read	SDP informations, and the library also provides consistency checking  When reading SDP, all text items/structures are allocated by the lib, and you  must call gf_sdp_info_reset(GF_SDPInfo *sdp) or gf_sdp_info_del(GF_SDPInfo *sdp) to release the memory  When writing the SDP from a GF_SDPInfo, the output buffer is allocated by the library,   and you must release it yourself  Some quick constructors are available for GF_SDPConnection and GF_SDPMedia in order to set up  some specific parameters to their default value  An extra function gf_sdp_info_check(GF_SDPInfo *sdp) is provided for compliency check   with RFC2327: all requested fields are checked as well as conflicting information forbidden  in RFC 2327****************************************************************************//*	All attributes x-ZZZZ are considered as extensions attributes. If no "x-" is found 	the attributes in the RTSP response is SKIPPED. The "x-" radical is removed in the structure	when parsing commands / responses*/typedef struct{	char *Name;	char *Value;} GF_X_Attribute;/*	Structure for bandwidth info*/typedef struct{	/*"CT", "AS" are defined. Private extensions must be "X-*" ( * "are recommended to be short")*/	char *name;	/*in kBitsPerSec*/	u32 value;} GF_SDPBandwidth;/*	Structure for Time info*//*we do not support more than ... time offsets / zone adjustmentif more are needed, RFC recommends to use several entries rather than a big*/#define GF_SDP_MAX_TIMEOFFSET	10typedef struct{	/*NPT time in sec*/	u32 StartTime;	/*if 0, session is unbound. NPT time in sec*/	u32 StopTime;	/*if 0 session is not repeated. Expressed in sec.	Session is signaled repeated every repeatInterval*/	u32 RepeatInterval;	/*active duration of the session in sec*/	u32 ActiveDuration;	/*time offsets to use with repeat. Specify a non-regular repeat time from the Start time*/	u32 OffsetFromStart[GF_SDP_MAX_TIMEOFFSET];	/*Number of offsets*/	u32 NbRepeatOffsets;	/*EX of repeat:	a session happens 3 times a week, on mon 1PM, thu 3PM and fri 10AM	1- StartTime should be NPT for the session on the very first monday, StopTime	the end of this session	2- the repeatInterval should be 1 week, ActiveDuration the length of the session	3- 3 offsets: 0 (for monday) (3*24+2)*3600 for thu and (4*24-3) for fri	*/	/*timezone adjustments, to cope with #timezones, daylight saving countries and co ...	Ex: adjTime = [2882844526 2898848070] adjOffset=[-1h 0]	[0]: at 2882844526 the time base by which the session's repeat times are calculated 	is shifted back by 1 hour	[1]: at time 2898848070 the session's original time base is restored	*/	/*Adjustment time at which the corresponding time offset is to be applied to the 	session time line (time used to compute the "repeat session"). 	All Expressed in NPT*/	u32 AdjustmentTime[GF_SDP_MAX_TIMEOFFSET];	/* Offset with the session time line, ALWAYS ABSOLUTE OFFSET TO the specified StartTime*/	s32 AdjustmentOffset[GF_SDP_MAX_TIMEOFFSET];	/*Number of offsets.*/	u32 NbZoneOffsets;} GF_SDPTiming;typedef struct{	/*only "IN" currently defined*/	char *net_type;	/*"IP4","IP6"*/	char *add_type;	/*hex IPv6 address or doted IPv4 address*/	char *host;	/*TTL - MUST BE PRESENT if IP is multicast - -1 otherwise*/	s32 TTL;	/*multiple address counts - ONLY in media descriptions if needed. This	is used for content scaling, when # quality of the same media are multicasted on	# IP addresses*/	u32 add_count;} GF_SDPConnection;/*	FMTP: description of dynamic payload types. This is opaque at the SDP level.	Each attributes is assumed to be formatted as <param_name=param_val; ...>	If not the case the attribute will have an empty value string and only the	parameter name.*/typedef struct{	/*payload type of the format described*/	u32 PayloadType;	/*list of GF_X_Attribute elements. The Value field may be NULL*/	GF_List *Attributes;} GF_SDP_FMTP;typedef struct{	/*m=	0: application - 1:video - 2: audio - 3: text - 4:data - 5: control*/	u32 Type;	/*Port Number - For transports based on UDP, the value should be in the range 1024 	to 65535 inclusive. For RTP compliance it should be an even number*/	u32 PortNumber;	/*number of ports described. If >= 2, the next media(s) in the SDP will be configured	to use the next tuple (for RTP). If 0 or 1, ignored	Note: this is used for scalable media: PortNumber indicates the port of the base 	media and NumPorts the ports||total number of the upper layers*/	u32 NumPorts;	/*currently ony "RTP/AVP" and "udp" defined*/	char *Profile;	/*list of GF_SDPConnection's. A media can have several connection in case of scalable content*/	GF_List *Connections;	/*RTPMaps contains a list SDPRTPMaps*/	GF_List *RTPMaps;	/*FMTP contains a list of FMTP structures*/	GF_List *FMTP;		/*for RTP this is PayloadType, but can be opaque (string) depending on the app.	Formated as XX WW QQ FF	When reading the SDP, the payloads defined in RTPMap are removed from this list	When writing the SDP for RTP, you should only specify static payload types here,	as dynamic ones are stored in RTPMaps and automatically written*/	char *fmt_list;	/*all attributes not defined in RFC 2327 for the media*/	GF_List *Attributes;	/*Other SDP attributes for media desc*/	/*k=	method is 'clear' (key follows), 'base64' (key in base64), 'uri' (key is the URI) 	or 'prompt' (key not included)*/	char *k_method, *k_key;	GF_List *Bandwidths;	/*0 if not present*/	u32 PacketTime;	/*0: none - 1: recv, 2: send, 3 both*/	u32 SendRecieve;	char *orientation, *sdplang, *lang;	/*for video only, 0.0 if not present*/	Double FrameRate;	/*between 0 and 10, -1 if not present*/	s32 Quality;} GF_SDPMedia;typedef struct{	/*v=*/	u32 Version;	/*o=*/	char *o_username, *o_session_id, *o_version, *o_address;	/*"IN" for Net, "IP4" or "IP6" for address are currently valid*/	char *o_net_type, *o_add_type;	/*s=*/	char *s_session_name;	/*i=*/	char *i_description;	/*u=*/	char *u_uri;	/*e=*/	char *e_email;	/*p=*/	char *p_phone;	/*c= either 1 or 0 GF_SDPConnection */	GF_SDPConnection *c_connection;		/*b=*/	GF_List *b_bandwidth;	/*All time info (t, r, z)*/	GF_List *Timing;	/*k=	method is 'clear' (key follows), 'base64' (key in base64), 'uri' (key is the URI) 	or 'prompt' (key not included)*/	char *k_method, *k_key;	/*all possible attributes (a=), session level*/	char *a_cat, *a_keywds, *a_tool;	/*0: none, 1: recv, 2: send, 3 both*/	u32 a_SendRecieve;	/*should be `broadcast', `meeting', `moderated', `test' or `H332'*/	char *a_type;	char *a_charset;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -