The getstreamuri function can obtain the streaming media address.
The Code is as follows:
Void usergeturi (const char * xaddr)
{
Int result = 0;
Struct soap * soap = soap_new ();
Struct _ TRT _ getstreamuri;
Struct _ TRT _ getstreamuriresponse;
Printf ("\ n --------------- getting URI ---------------- \ n ");
Trt _ getstreamuri. streamsetup = (struct TT _ streamsetup *) soap_malloc (soap, sizeof (struct TT _ streamsetup ));
Trt _ getstreamuri. streamsetup->__ any = NULL;
Trt _ getstreamuri. streamsetup->__ anyattribute = NULL;
Trt _ getstreamuri. streamsetup->__ size = 1;
Trt _ getstreamuri. streamsetup-> stream = TT _ streamtype _ rtp_unicast;
Trt _ getstreamuri. streamsetup-> transport = (struct TT _ transport *) soap_malloc (soap, sizeof (struct TT _ transport ));
Trt _ getstreamuri. streamsetup-> transport-> protocol = TT _ transportprotocol _ UDP;
Trt _ getstreamuri. streamsetup-> transport-> tunnel = NULL;
Trt _ getstreamuri. profiletoken = soap_malloc (soap, 1024 );
Strcpy (TRT _ getstreamuri. profiletoken, "token_000"); // specifies the streaming media address of the channel.
Soap_call ___ TRT _ getstreamuri (soap, xaddr, null, & TRT _ getstreamuri, & TRT _ getstreamuriresponse );
If (soap-> error)
{
Printf ("Soap error: % d, % s, % s \ n", soap-> error, * soap_faultcode (SOAP), * soap_faultstring (SOAP ));
Result = soap-> error;
}
Else
{
Printf ("!!!! Note: rtsp addr get done is: % s \ n ", TRT _ getstreamuriresponse. mediauri-> URI );
}
}