Photon C++ Client API  5.0.7.3
Public Member Functions | Static Public Member Functions | List of all members
VoiceInfo Class Reference

Describes stream properties. More...

Inheritance diagram for VoiceInfo:
Inheritance graph
[legend]
Collaboration diagram for VoiceInfo:
Collaboration graph
[legend]

Public Member Functions

int getCodec (void) const
 
VoiceInfosetCodec (int codec)
 
int getSamplingRate (void) const
 Audio sampling rate (frequency, in Hz). More...
 
VoiceInfosetSamplingRate (int samplingRate)
 
int getChannels (void) const
 Number of channels. More...
 
VoiceInfosetChannels (int channels)
 
int getFrameDurationUs (void) const
 Uncompressed frame (audio packet) size in microseconds. More...
 
VoiceInfosetFrameDurationUs (int frameDurationUs)
 
int getBitrate (void) const
 Target bitrate (in bits/second). More...
 
VoiceInfosetBitrate (int bitrate)
 
const Common::ObjectgetUserData (void) const
 Optional user data. Should be serializable by Photon. More...
 
VoiceInfosetUserData (const Common::Object &userData)
 
int getFrameDurationSamples (void) const
 Uncompressed frame (data packet) size in samples. More...
 
int getFrameSize (void) const
 Uncompressed frame (data packet) array size. More...
 
int getWidth (void) const
 Video width (optional). More...
 
VoiceInfosetWidth (int width)
 
int getHeight (void) const
 Video height (optional) More...
 
VoiceInfosetHeight (int height)
 
virtual Common::JStringtoString (Common::JString &retStr, bool withTypes=false) const
 
virtual JStringtoString (JString &retStr, bool withTypes=false) const=0
 
JString toString (bool withTypes=false) const
 
- Public Member Functions inherited from ToString
virtual ~ToString (void)
 
virtual JString typeToString (void) const
 
JString toString (bool withTypes=false) const
 

Static Public Member Functions

static VoiceInfo createAudioOpus (int samplingRate, int channels, int frameDurationUs, int bitrate, const Common::Object &userdata=Common::Object())
 Create stream info for an Opus audio stream basing on audio source. More...
 
static VoiceInfo createVideoVP8 (int bitrate, int width=0, int heigth=-1, const Common::Object &userdata=Common::Object())
 Helper for VP8 stream info creation. More...
 

Detailed Description

Describes stream properties.

Member Function Documentation

◆ getSamplingRate()

int getSamplingRate ( void  ) const

Audio sampling rate (frequency, in Hz).

◆ getChannels()

int getChannels ( void  ) const

Number of channels.

◆ getFrameDurationUs()

int getFrameDurationUs ( void  ) const

Uncompressed frame (audio packet) size in microseconds.

◆ getBitrate()

int getBitrate ( void  ) const

Target bitrate (in bits/second).

◆ getUserData()

const Object & getUserData ( void  ) const

Optional user data. Should be serializable by Photon.

◆ getFrameDurationSamples()

int getFrameDurationSamples ( void  ) const

Uncompressed frame (data packet) size in samples.

◆ getFrameSize()

int getFrameSize ( void  ) const

Uncompressed frame (data packet) array size.

◆ getWidth()

int getWidth ( void  ) const

Video width (optional).

◆ getHeight()

int getHeight ( void  ) const

Video height (optional)

◆ createAudioOpus()

VoiceInfo createAudioOpus ( int  samplingRate,
int  channels,
int  frameDurationUs,
int  bitrate,
const Common::Object userdata = Common::Object() 
)
static

Create stream info for an Opus audio stream basing on audio source.

Parameters
samplingRateAudio sampling rate. This must be one of 8000, 12000, 16000, 24000, or 48000.
channelsNumber of channels.
frameDurationUsUncompressed frame (audio packet) size in microseconds. This must be one of 2500, 5000, 10000, 20000, 40000 or 60000.
bitrateStream bitrate (in bits/second).
userdataOptional user data. Should be serializable by Photon.
Returns
VoiceInfo instance.

◆ createVideoVP8()

VoiceInfo createVideoVP8 ( int  bitrate,
int  width = 0,
int  heigth = -1,
const Common::Object userdata = Common::Object() 
)
static

Helper for VP8 stream info creation.

Parameters
bitrateStream bitrate.
widthStreamed video width. If 0, width and height of video source used (no rescaling).
heigthStreamed video height. If -1, aspect ratio preserved during rescaling.
userdataOptional user data. Should be serializable by Photon.
Returns
VoiceInfo instance.

◆ toString() [1/3]

JString & toString ( Common::JString retStr,
bool  withTypes = false 
) const
virtual
Remarks
The cost of this function depends a lot on implementation details of the implementing subclasses, but for container classes this function can become quite expensive, if the instance contains huge amounts of data, as its cost for many container class implementations increases disproportionately high to the size of the payload.
Parameters
retStrreference to a string, to store the return-value in; the information, which is generated by this function, will be attached at the end of any eventually existing previous content of the string
withTypesset to true, to include type information in the generated string
Returns
a JString representation of the instance and its contents for debugging purposes.

Implements ToString.

◆ toString() [2/3]

toString
Remarks
The cost of this function depends a lot on implementation details of the implementing subclasses, but for container classes this function can become quite expensive, if the instance contains huge amounts of data, as its cost for many container class implementations increases disproportionately high to the size of the payload.
Parameters
retStrreference to a string, to store the return-value in; the information, which is generated by this function, will be attached at the end of any eventually existing previous content of the string
withTypesset to true, to include type information in the generated string
Returns
a JString representation of the instance and its contents for debugging purposes.

◆ toString() [3/3]

JString toString

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
withTypesset to true, to include type information in the generated string
Returns
a JString representation of the instance and its contents for debugging purposes.
See also
JString