JRTPLIB 3.5.2 Chinese version-part3

Source: Internet
Author: User

 

3.2 All API descriptions

This section explains all the APIs of the database in the bottom-up mode.

3.2.1 library version

------------------------------------------------------------ Header file: rtplibraryversion. h

A static member of the RTPLibraryVersion class creates an object of the class.

Static RTPLibraryVersion GetVersion ()

You can use the following function to obtain version information.

Int GetMajorNumber () const

----- The primary version number is returned.

Int GetMinorNumber () const

----- Returns the minor version number.

Int GetDebugNumber () const

----- Return the debug version number.

Std: string GetVersionString () const

----- Returns the version description string.

3.2.2 error codes

-------------------------------------------------------------------- Header file: rtperrors. h

Unless otherwise specified, if the return value of the int function is negative, an error is returned. The return value is 0 or the regular expression is successful. You can use the following function to obtain a description of the error code:

Std: string rtpgterrorstring (int errcode)

3.2.3 utility time tool

-------------------------------------------------------------------- Header file: rtptimeutilities. h

RTPNTPTime

This is a simple package for MSW (highest valid word) and LSW (lowest valid word) of the NTP timestamp. This class has the following members.

RTPNTPTime (uint32_t m, uint32_t l );

----- This constructor creates a Class Object with MSW m and LSW l.

Uint32_t GetMSW () const

----- Returns the highest valid word.

Uint32_t GetLSW () const

----- Returns the lowest valid word.

RTPTime

This class is used to describe the clock time and delay interval. Save one second data and one millisecond data. The interface is as follows:

RTPTime (uint32_t seconds, uint32_t microseconds)

----- Create an object whose s and ms are seconds and microseconds respectively.

RTPTime (double t)

----- Create an RTPTime instance that represents the time t in seconds.

RTPTime (RTPNTPTime ntptime)

----- Create an object whose corresponding time is ntptime. If the conversion cannot be completed, the second and millisecond values of the object are set to 0.

Uint32_t GetSeconds () const

----- Returns the second value saved in the object.

Uint32_t GetMicroSeconds () const

---- Return the number of milliseconds saved in the object.

Double GetDouble () const

----- Return the time in seconds stored in the object.

RTPNTPTime GetNTPTime () const

----- Returns the corresponding NTP time of the storage time in the object.

Static RTPTime CurrentTime ()

----- Return the RTPTime object representing the current clock time. The value is the number of seconds since January 1, 1970 00:00:00 UTC.

Static void Wait (const RTPTime & delay)

----- This function waits for a period of time specified by delay.

The RTPTime class also defines the following operators:

Operator-=

Operator + =

Operator <

Operator>

Operator <=

Operator> =

3.2.4 RTPRandom

-------------------------------------------------------------------------- Header file: rtprandom. h

The RTPRandom class can be used to generate random numbers. The member functions are as follows:

Uint8_t GetRandom8 ()

----- Returns a random 8-bit value.

Uint16_t GetRandom16 ()

----- Returns a random 16-bit value.

Uint32_t GetRandom32 ()

----- Returns a random 32-bit value.

Double GetRandomDouble ()

----- Return a random number between 0.0 and 1.0.

3.2.5 RTPSDESInfo

------------------------------------------------------------------------- Header file: rtcpsdesinfo. h

The RTPSDESInfo class is a container of SDES information in RTCP. The interface is as follows:

Void Clear ()

----- Clear all SDES information.

Int SetCNAME (const uint8_t * s, size_t l)

----- Set the CNAME of SDES to point to the value of l memory in s.

Int SetName (const uint8_t * s, size_t l)

----- Set the name of SDES to the value of l memory in s.

Int SetEMail (const uint8_t * s, size_t l)

----- Set the e-mail entry of SDES to point to the value of l memory in s.

Int SetPhone (const uint8_t * s, size_t l)

----- Set the phone entry of SDES to point to the length of s as the value of l memory.

Int SetLocation (const uint8_t * s, size_t l)

----- Set the location item of SDES to point to the value of l memory in s.

Int SetTool (const uint8_t * s, size_t l)

----- Set the tool item of SDES to point to the value of l memory in s.

Int SetNote (const uint8_t * s, size_t l)

----- Set the note item of SDES to point to the value of l memory in s.

Uint8_t * GetCNAME (size_t * len) const

----- Return the CNAME of SDES and store the length in len.

Uint8_t * GetName (size_t * len) const

----- Return the name of SDES and store the length in len.

Uint8_t * GetEMail (size_t * len) const

----- Return the e-mail entry of SDES and store the length in len.

Uint8_t * GetPhone (size_t * len) const

----- Return the phone number of SDES and store the length in len.

Uint8_t * GetLocation (size_t * len) const

----- Return the location of SDES and store the length in len.

Uint8_t * GetTool (size_t * len) const

----- Return the tool item of SDES and store the length in len.

Uint8_t * GetNote (size_t * len) const

----- Return the Note of SDES and store the length in len.

If the private items of SDES are supported during library compilation, the following functions can also be used.

Int SetPrivateValue (const uint8_t * prefix, size_t prefixlen, const uint8_t * value, size_t valuelen)

----- Set the prefix string to the content pointed to by the prefix of the prefix string whose length is prefixlen. It is used to include the value string pointed by value whose length is valuelen. If the maximum allowed length of the prefix string is reached, the error code ERR_RTP_SDES_MAXPRIVITEMS is returned.

Int DeletePrivatePrefix (const uint8_t * s, size_t len)

----- Delete the input of a prefix string with the length indicated by s as len.

Void GotoFirstPrivateValue ()

----- Start to traverse the data associated with the prefix entries stored in SDES.

Bool GetNextPrivateValue (uint8_t ** prefix, size_t * prefixlen, uint8_t ** value, size_t * valuelen)

----- If available, true is returned, and the next SDES private prefix is saved to prefix, the length is saved to prefixlen, and the related data and length are saved to value and valuelen. If not, false is returned.

Bool GetPrivateValue (const uint8_t * prefix, size_t prefixlen, uint8_t ** value, size_t * valuelen) const

----- Find the input whose private entries in SDES are prefix and whose length is prefixlen. If yes, return true and store the associated values and lengths in value and valuelen respectively.

[To be continued !]

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.