JRTPLIB 3.5.2 Chinese version-part6

Source: Internet
Author: User

 

3.2.8 RTPTransmissionInfo

----------------------------------------------------------------------- Header file: rtptransmitter. h

Class RTPTransmissionInfo is an abstract base class that has specific (inherited) implementations based on specific transmission components. All specific implementations inherit the following functions to determine which transmission component is valid for these parameters ([Note: this function is used to indicate the type of actually used transmission component, original article: All actual implementations inherit the following function which identify the component type for which
These parameters are valid ]):

RTPTransmitter: TransmissionProtocol GetTransmissionProtocol ()

About IPv4-based UDP Transmitter

------------------------------------------------------------------------ Header file: rtpudpv4transmitter. h

The RTPUDPv4TransmissionInfo class provides more information about the IPv4-based UDP transmission component. The available member functions are as follows:

Std: list <uint32_t> GetLocalIPList () const

----- Return to the IPv4 address list that the transmitter can select as the local IP address.

Int GetRTPSocket () const

----- Return the socket description child used to send and receive RTP data packets.

Int GetRTCPSocket () const

----- Return the socket description child used to send and receive RTCP packets.

IPv6-based UDP transmitter Information

------------------------------------------------------------------------ Header file: rtpudpv6transmitter. h

The RTPUDPv6TransmissionInfo class provides more information about the IPv6-based UDP transmission component. The available member functions are as follows:

Std: list <in6_addr> GetLocalIPList () const

----- Return to the IPv6 address list that the transmitter can select as the local IP address.

Int GetRTPSocket () const

----- Return the socket description child used to send and receive RTP data packets.

Int GetRTCPSocket () const

----- Return the socket description child used to send and receive RTCP packets.

 

3.2.9 RTPAddress

------------------------------------------------------------------------- Header file: rtpaddress. h

Class RTPAddress is an abstract base class used to point out the unicast destination address or multicast group. This class defines the following parameters used to determine the specific implementation (address type ).

Enum AddressType {IPv4Address, IPv6Address, UserDefinedAddress };

The IPv4-based UDP transmitter uses the RTPAddress: IPv4Address type, and the IPv6-based UDP transmitter uses the RTPAddress: IPv6Address type. When you use a custom transmission component, RTPAddress: UserDefinedAddress is useful.

Class defines the following interfaces:

AddressType GetAddressType () const

----- Return the address type represented by the specific implementation.

RTPAddress * CreateCopy () const

----- Create a copy of The RTPAddress object.

Bool IsSameAddress (const RTPAddress * addr) const

----- Check whether the address used by the object is the same as the address addr. The specific implementation must be able to handle the case where the parameter is NULL.

Bool IsFromSamHost (const RTPAddress * addr) const

----- Check whether the host represented by the address addr is the same as the object. The specific implementation must be able to handle the case where the parameter is NULL.

Rtp00004address

------------------------------------------------------------------------ Header file: rtp00004address. h

This class is used in the IPv4-based UDP transmission component, and the class defines the following functions.

Rtp00004address (uint32_t ip = 0, uint16_t port = 0)

----- Create an object with the ip address and port number. Both parameters are in the host byte sequence.

Rtp00004address (const uint8_t ip [4], uint16_t port = 0)

----- Create an object with the ip address and port number. Both parameters are in the host byte sequence.

Void SetIP (uint32_t ip)

----- Set the ip address of the object to ip, which is expressed in the host byte sequence.

Void SetPort (uint16_t port)

----- Set the port number of the object to port, which is expressed in the byte sequence of the host.

Uint32_t GetIP () const

----- Returns the IP address of the object in the byte sequence of the host.

Uint16_t GetPort () const

----- Return the port number of the object in the byte sequence of the host.

When the rtp00004address address is used for any multicast function of the transmitter, the port number is ignored. When the object of this class is used in the receiving or rejecting function of the transmitter, port 0 represents all ports of the specified IP address.

 

Rtp00006address

------------------------------------------------------------------------ Header file: rtp00006address. h

This class is used in the IPv6-based UDP transmission component, and the class defines the following functions.

Rtp00006address ()

----- Create an object whose IP address and port number are both 0.

Rtp00006address (const uint8_t ip [16], uint16_t port = 0)

----- Create an object with the ip address and port number. Both parameters are in the host byte sequence.

Rtp00006address (in6_addr ip, uint16_t port = 0)

----- Create an object with the ip address and port number. Both parameters are in the host byte sequence.

Void SetIP (in6_addr ip)

----- Set the ip address of the object to ip.

Void SetIP (const uint8_t ip [16])

----- Set the ip address of the object to ip.

Void SetPort (uint16_t port)

----- Set the port number of the object to port, which is expressed in the byte sequence of the host.

Void GetIP (uint8_t ip [16]) const

----- Copy the ip address of the object to the ip address.

In6_addr GetIP () const

----- The IP address of the returned object.

Uint16_t GetPort () const

----- Return the port number of the object in the byte sequence of the host.

When the rtp00006address address is used for any multicast function of the transmitter, the port number is ignored. When the object of this class is used in the receiving or rejecting function of the transmitter, port 0 represents all ports of the specified IP address.

[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.