Onvif gets the streaming media address of the specified channel

Source: Internet
Author: User

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 );
}

}

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.