C++ SDK Methods
Meeting
The Meeting constructor creates a new meeting instance. A MeetingConfig struct is passed into it to configure the meeting.
MeetingConfig
The MeetingConfig struct holds the meeting ID, authentication token, and the local participant's display name.
Properties
| Property | Type | Description |
|---|---|---|
meetingId | std::string | The meeting/room ID to connect to. |
token | std::string | The authentication token from VideoSDK dashboard. |
name | std::string | The display name for the local participant. |
Example
videosdk::MeetingConfig config;
config.meetingId = "MEETING_ID";
config.token = "TOKEN";
config.name = "Raspberry Pi";
videosdk::Meeting meeting(config);
join()
The join method connects the local participant to the meeting session.
Parameters
- void
Example
meeting.join(); // Connect the local participant to the meeting session
leave()
The leave method disconnects the local participant from the meeting and releases the session.
Parameters
- void
Example
meeting.leave(); // Leave the meeting and end the session
sendData()
The sendData method sends a payload to the other participants in the meeting over the data channel. It is the single entry point for all data types — data/len is an opaque byte range, so you can send a std::string, a std::vector<std::byte>, a raw buffer, a struct, a scalar, and so on. It returns false if the payload exceeds the 15 KiB limit or the data channel is not ready.
bool sendData(const void* data, size_t len, bool binary = true);
Parameters
- data
- type:
const void* REQUIRED- Pointer to the bytes to send.
- type:
- len
- type:
size_t REQUIRED- Number of bytes to send.
- type:
- binary
- type:
bool OPTIONAL(default:true)- Selects the SCTP frame type —
falsesends a UTF-8 text frame,truesends arbitrary bytes.
- type:
Example
// Send a UTF-8 text message
std::string msg = "Hello from Raspberry Pi";
meeting.sendData(msg.data(), msg.size(), /*binary=*/false);
// Send arbitrary binary bytes
uint8_t blob[] = {0x01, 0x02, 0x03};
meeting.sendData(blob, sizeof(blob), /*binary=*/true);
enableMic()
The enableMic method starts capturing audio from the device microphone (via PulseAudio) and sends the audio stream to other participants.
Parameters
- source_name
- type:
std::string OPTIONAL(default:"default")- The PulseAudio source to capture audio from.
- type:
Example
meeting.enableMic(); // Start capturing and sending microphone audio
disableMic()
The disableMic method stops capturing audio from the microphone and stops sending the audio stream to other participants.
Parameters
- void
Example
meeting.disableMic(); // Stop capturing and sending microphone audio
enableCamera()
The enableCamera method starts capturing video from a V4L2 camera device and sends the video stream to other participants.
Parameters
- device_path
- type:
std::string OPTIONAL(default:"/dev/video0")- The V4L2 camera device to capture from.
- type:
- width
- type:
int OPTIONAL(default:640)- Capture width in pixels.
- type:
- height
- type:
int OPTIONAL(default:480)- Capture height in pixels.
- type:
- fps
- type:
int OPTIONAL(default:30)- Capture frame rate (frames per second).
- type:
Example
meeting.enableCamera(); // Start capturing and sending camera video
disableCamera()
The disableCamera method stops capturing video from the camera and stops sending the video stream to other participants.
Parameters
- void
Example
meeting.disableCamera(); // Stop capturing and sending camera video
setSimulcastLayers()
The setSimulcastLayers method configures 1–3 VP8 simulcast layers for the outgoing camera video, letting the SDK send the stream at multiple resolutions and bitrates at the same time (multistream). It must be called before join(). Layers are ordered smallest → largest, and the top (largest) layer's resolution should match the enableCamera() capture size.
SimulcastLayer
| Property | Type | Description |
|---|---|---|
width | uint32_t | The layer's target width in pixels. |
height | uint32_t | The layer's target height in pixels. |
maxBitrateKbps | uint32_t | Maximum bitrate for the layer in kbps (0 = no explicit cap). |
maxFps | uint32_t | Maximum frame rate for the layer (0 = no explicit cap). |
active | bool | Whether the layer is enabled. Defaults to true. |
Parameters
- layers
- type:
std::vector<videosdk::SimulcastLayer> REQUIRED- 1–3 layers ordered from smallest to largest.
- type:
Example
meeting.setSimulcastLayers({
{.width = 320, .height = 180, .maxBitrateKbps = 300, .maxFps = 15},
{.width = 640, .height = 360, .maxBitrateKbps = 1500, .maxFps = 20},
{.width = 1280, .height = 720, .maxBitrateKbps = 3000, .maxFps = 30},
});
enableSpeaker()
The enableSpeaker method enables audio playback, allowing the device to play received audio streams from other participants.
Parameters
- void
Example
meeting.enableSpeaker(); // Start playing back audio received from other participants
disableSpeaker()
The disableSpeaker method disables audio playback so received audio streams are no longer played on the device.
Parameters
- void
Example
meeting.disableSpeaker(); // Stop playing back received audio
enableVideoDisplay()
The enableVideoDisplay method enables video rendering via SDL2, allowing the device to display received video streams from other participants.
Parameters
- width_hint
- type:
int OPTIONAL(default:1280)- Suggested width of the display window in pixels.
- type:
- height_hint
- type:
int OPTIONAL(default:720)- Suggested height of the display window in pixels.
- type:
- force_fullscreen
- type:
bool OPTIONAL(default:false)- Open the display window in fullscreen mode.
- type:
Example
meeting.enableVideoDisplay(); // Start rendering video received from other participants
disableVideoDisplay()
The disableVideoDisplay method stops rendering received video streams and closes the SDL2 display window.
Parameters
- void
Example
meeting.disableVideoDisplay(); // Stop rendering received video
enableVideoSubscriber()
The enableVideoSubscriber method starts receiving the video of remote participants. Each decoded frame is delivered to the provided callback as a VideoFrame (I420 / YUV planes), letting you render or process incoming video yourself instead of using enableVideoDisplay(). It returns true if the subscriber was enabled successfully.
VideoFrame
| Property | Type | Description |
|---|---|---|
width | int | Frame width in pixels. |
height | int | Frame height in pixels. |
y_plane / y_stride | const uint8_t* / int | Y (luma) plane pointer and its stride. |
u_plane / u_stride | const uint8_t* / int | U (chroma) plane pointer and its stride. |
v_plane / v_stride | const uint8_t* / int | V (chroma) plane pointer and its stride. |
Parameters
- callback
- type:
std::function<void(const videosdk::VideoFrame& frame)> REQUIRED- Invoked for each received video frame. The frame data is valid only for the duration of the callback — copy it out if you need to keep it.
- type:
Example
meeting.enableVideoSubscriber([](const videosdk::VideoFrame& frame) {
// Render or process the I420 frame (frame.width x frame.height)
});
disableVideoSubscriber()
The disableVideoSubscriber method stops receiving remote video frames and tears down the video subscriber.
Parameters
- void
Example
meeting.disableVideoSubscriber(); // Stop receiving remote video frames
Got a Question? Ask us on discord

