Ejemplo n.º 1
0
GF_EXPORT
void gf_rtsp_command_reset(GF_RTSPCommand *com)
{
	GF_RTSPTransport *trans;
	GF_X_Attribute *att;
	if (!com) return;

	//free all headers
	COM_FREE_CLEAN(Accept);
	COM_FREE_CLEAN(Accept_Encoding);
	COM_FREE_CLEAN(Accept_Language);
	COM_FREE_CLEAN(Authorization);
	COM_FREE_CLEAN(Cache_Control);
	COM_FREE_CLEAN(Conference);
	COM_FREE_CLEAN(Connection);
	COM_FREE_CLEAN(From);
	COM_FREE_CLEAN(Proxy_Authorization);
	COM_FREE_CLEAN(Proxy_Require);
	COM_FREE_CLEAN(Referer);
	COM_FREE_CLEAN(Session);
	COM_FREE_CLEAN(User_Agent);
	COM_FREE_CLEAN(body);
	COM_FREE_CLEAN(service_name);
	COM_FREE_CLEAN(ControlString);
	COM_FREE_CLEAN(method);

	//this is for server only, set to OK by default
	com->StatusCode = NC_RTSP_OK;
	
	
	com->user_data = NULL;

	com->Bandwidth = com->Blocksize = com->Content_Length = com->CSeq = 0;
	com->Scale = com->Speed = 0.0;
	if (com->Range) gf_free(com->Range);
	com->Range = NULL;

	while (gf_list_count(com->Transports)) {
		trans = (GF_RTSPTransport *) gf_list_get(com->Transports, 0);
		gf_list_rem(com->Transports, 0);
		gf_rtsp_transport_del(trans);
	}
	while (gf_list_count(com->Xtensions)) {
		att = (GF_X_Attribute*)gf_list_get(com->Xtensions, 0);
		gf_list_rem(com->Xtensions, 0);
		gf_free(att->Name);
		gf_free(att->Value);
		gf_free(att);
	}
}
Ejemplo n.º 2
0
void RTSP_ResetCommand(RTSPCommand *com)
{
	RTSPTransport *trans;
	X_Attribute *att;
	if (!com) return;

	//free all headers
	COM_FREE_CLEAN(Accept);
	COM_FREE_CLEAN(Accept_Encoding);
	COM_FREE_CLEAN(Accept_Language);
	COM_FREE_CLEAN(Authorization);
	COM_FREE_CLEAN(Cache_Control);
	COM_FREE_CLEAN(Conference);
	COM_FREE_CLEAN(Connection);
	COM_FREE_CLEAN(From);
	COM_FREE_CLEAN(Proxy_Authorization);
	COM_FREE_CLEAN(Proxy_Require);
	COM_FREE_CLEAN(Referer);
	COM_FREE_CLEAN(Session);
	COM_FREE_CLEAN(User_Agent);
	COM_FREE_CLEAN(body);
	COM_FREE_CLEAN(service_name);
	COM_FREE_CLEAN(ControlString);
	COM_FREE_CLEAN(method);

	//this is for server only, set to OK by default
	com->StatusCode = NC_RTSP_OK;
	
	
	com->user_data = NULL;

	com->Bandwidth = com->Blocksize = com->Content_Length = com->CSeq = 0;
	com->Scale = com->Speed = 0.0;
	if (com->Range) free(com->Range);
	com->Range = NULL;

	while (ChainGetCount(com->Transports)) {
		trans = ChainGetEntry(com->Transports, 0);
		ChainDeleteEntry(com->Transports, 0);
		RTSP_DeleteTransport(trans);
	}
	while (ChainGetCount(com->Xtensions)) {
		att = ChainGetEntry(com->Xtensions, 0);
		ChainDeleteEntry(com->Xtensions, 0);
		free(att->Name);
		free(att->Value);
		free(att);
	}
}