LiveKit C++ Client SDK v1.9.0
Real-time audio/video/data SDK for C++
Loading...
Searching...
No Matches
livekit::DataTrackSchemaEncoding Class Reference

Encoding used to interpret a data track schema definition. More...

#include <data_track_schema.h>

Public Types

enum  WellKnown {
  Protobuf , Flatbuffer , Ros1Msg , Ros2Msg ,
  Ros2Idl , OmgIdl , JsonSchema , Other
}
 Well-known schema encodings. More...
 

Public Member Functions

 DataTrackSchemaEncoding (WellKnown well_known)
 Construct a well-known encoding.
 
bool isCustom () const
 Check whether this is a custom encoding.
 
WellKnown wellKnown () const
 Get the well-known encoding.
 
const std::string & customIdentifier () const
 Get the custom identifier.
 

Static Public Member Functions

static DataTrackSchemaEncoding custom (std::string identifier)
 Construct a custom, application-defined encoding.
 

Detailed Description

Encoding used to interpret a data track schema definition.

Identifies the interface definition language the schema is written in (for example, a .proto file for DataTrackSchemaEncoding::Protobuf), which in turn dictates the wire format of the frames the schema describes.

Almost all schemas use a well-known encoding, which converts implicitly:

Encoding used to interpret a data track schema definition.
Definition data_track_schema.h:36
@ Protobuf
Protocol Buffer IDL.
Definition data_track_schema.h:41

For the uncommon case of an encoding outside the well-known set, use DataTrackSchemaEncoding::custom.

Member Enumeration Documentation

◆ WellKnown

Well-known schema encodings.

Enumerator
Protobuf 

Protocol Buffer IDL.

Flatbuffer 

FlatBuffer IDL.

Ros1Msg 

ROS 1 Message.

Ros2Msg 

ROS 2 Message.

Ros2Idl 

ROS 2 IDL.

OmgIdl 

OMG IDL.

JsonSchema 

JSON Schema.

Other 

Another well-known encoding not known to this client version.

Constructor & Destructor Documentation

◆ DataTrackSchemaEncoding()

livekit::DataTrackSchemaEncoding::DataTrackSchemaEncoding ( WellKnown  well_known)
inline

Construct a well-known encoding.

The constructor is intentionally implicit for the common well-known case.

Parameters
well_knownWell-known schema encoding.

Member Function Documentation

◆ custom()

static DataTrackSchemaEncoding livekit::DataTrackSchemaEncoding::custom ( std::string  identifier)
inlinestatic

Construct a custom, application-defined encoding.

Prefer a well-known encoding wherever one applies. The identifier must be non-empty and no longer than 25 characters.

Parameters
identifierCustom encoding identifier.
Returns
Custom schema encoding.

◆ customIdentifier()

const std::string & livekit::DataTrackSchemaEncoding::customIdentifier ( ) const
inline

Get the custom identifier.

Returns
The custom identifier. Empty when isCustom is false.

◆ isCustom()

bool livekit::DataTrackSchemaEncoding::isCustom ( ) const
inline

Check whether this is a custom encoding.

Returns
true if this is a custom encoding rather than a well-known one.

◆ wellKnown()

WellKnown livekit::DataTrackSchemaEncoding::wellKnown ( ) const
inline

Get the well-known encoding.

Returns
The well-known encoding. Only meaningful when isCustom is false.

The documentation for this class was generated from the following file: