Subchapter 150.2
references/samples.mdMarkdown8 KBView on GitHub
Reference guide for Zoom Video SDK Windows sample applications.
Official Repository: https://github.com/zoom/videosdk-windows-rawdata-sample
| Sample | Description | Key Features |
|---|---|---|
| VSDK_SkeletonDemo | Minimal session join | Simplest starting point |
| VSDK_getRawVideo | Capture raw video | YUV420 frame extraction |
| VSDK_getRawAudio | Capture raw audio | PCM audio extraction |
| VSDK_getRawShare | Capture screen share | Share content capture |
| VSDK_sendRawVideo | Send custom video | Virtual camera injection |
| VSDK_sendRawAudio | Send custom audio | Virtual microphone injection |
| VSDK_sendRawShare | Send custom share | Custom screen share source |
| VSDK_CloudRecording | Cloud recording | Start/stop cloud recording |
| VSDK_CommandChannel | Custom messaging | Send/receive custom commands |
| VSDK_CallIn | PSTN dial-in | Phone dial-in support |
| VSDK_Callout | PSTN dial-out | Phone dial-out support |
| VSDK_ServiceQuality | Network statistics | Quality monitoring |
| VSDK_TranscriptionAndTranslation | Live transcription | Real-time captions |
| VSDK_MultiStreamVideo | Multiple video streams | Multi-camera support |
| VSDK_PreviewCameraAndMicrophone | Device preview | Pre-join device testing |
| VSDK_Share2ndCameraAsMultiCam | Secondary camera | Multi-camera sharing |
| VSDK_Share2ndCameraAsShareScreenDemo | Camera as share | Camera content sharing |
| VSDK_ShareScreenPreprocessorDemo | Share preprocessing | Custom share processing |
| VSDK_RTMSDemo | Real-time messaging | RTMS integration |
| VSDK_DuilibDemo2 | Full UI demo | Complete GUI application |
Minimal code to join a session. Demonstrates:
Key patterns to learn:
// 1. Create SDK
IZoomVideoSDK* sdk = CreateZoomVideoSDKObj();
// 2. Initialize
ZoomVideoSDKInitParams params;
params.domain = L"https://zoom.us";
sdk->initialize(params);
// 3. Add delegate
sdk->addListener(myDelegate);
// 4. Join session
ZoomVideoSDKSessionContext ctx;
ctx.sessionName = L"session";
ctx.token = L"jwt";
ctx.audioOption.connect = false;
sdk->joinSession(ctx);
// 5. Message loop (CRITICAL)
while (running) {
MSG msg;
while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) {
TranslateMessage(&msg);
DispatchMessage(&msg);
}
Sleep(10);
}Capture raw YUV420 video frames. Demonstrates:
IZoomVideoSDKRawDataPipeDelegate implementationonRawDataFrameReceived() callbackKey patterns:
class VideoCapture : public IZoomVideoSDKRawDataPipeDelegate {
void onRawDataFrameReceived(YUVRawDataI420* data) override {
int width = data->GetStreamWidth();
int height = data->GetStreamHeight();
char* yBuffer = data->GetYBuffer();
char* uBuffer = data->GetUBuffer();
char* vBuffer = data->GetVBuffer();
// Process frames...
}
};
// Subscribe
IZoomVideoSDKRawDataPipe* pipe = user->GetVideoPipe();
pipe->subscribe(ZoomVideoSDKResolution_720P, videoCapture);Capture raw PCM audio. Demonstrates:
Key patterns:
void onMixedAudioRawDataReceived(AudioRawData* data) override {
char* buffer = data->GetBuffer();
int length = data->GetBufferLen();
int sampleRate = data->GetSampleRate(); // 32000 Hz
int channels = data->GetChannelNum(); // 1 or 2
// Process PCM audio...
}Send custom video as virtual camera. Demonstrates:
IZoomVideoSDKVideoSource implementationsendVideoFrame()Send custom audio as virtual microphone. Demonstrates:
IZoomVideoSDKVirtualAudioMic implementation| Sample | Input | Output |
|---|---|---|
| VSDK_getRawVideo | Remote video | YUV420 frames |
| VSDK_getRawAudio | Session audio | PCM samples |
| VSDK_getRawShare | Screen share | YUV420 frames |
| Sample | Input | Output |
|---|---|---|
| VSDK_sendRawVideo | YUV420 frames | Virtual camera |
| VSDK_sendRawAudio | PCM samples | Virtual mic |
| VSDK_sendRawShare | YUV420 frames | Screen share |
| Sample | Feature |
|---|---|
| VSDK_CommandChannel | Custom command messaging (60 msgs/sec) |
| VSDK_CallIn | PSTN phone dial-in |
| VSDK_Callout | PSTN phone dial-out |
| Sample | Feature |
|---|---|
| VSDK_CloudRecording | Zoom cloud recording |
| VSDK_RTMSDemo | Real-time messaging service |
| Sample | Feature |
|---|---|
| VSDK_ServiceQuality | Network quality statistics |
| VSDK_TranscriptionAndTranslation | Live captions |
| VSDK_MultiStreamVideo | Multiple video streams |
| VSDK_PreviewCameraAndMicrophone | Device preview before join |
| VSDK_ShareScreenPreprocessorDemo | Custom share processing |
All samples follow this pattern:
// Initialize SDK
IZoomVideoSDK* sdk = CreateZoomVideoSDKObj();
ZoomVideoSDKInitParams params;
params.domain = L"https://zoom.us";
params.videoRawDataMemoryMode = ZoomVideoSDKRawDataMemoryModeHeap;
sdk->initialize(params);Always register before joining:
sdk->addListener(new MyDelegate());
sdk->joinSession(context);Connect audio in callback, not during join:
context.audioOption.connect = false; // Join config
void onSessionJoin() override {
sdk->getAudioHelper()->startAudio(); // Connect here
}All samples include message loop:
while (!g_exit) {
MSG msg;
while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) {
TranslateMessage(&msg);
DispatchMessage(&msg);
}
Sleep(10);
}.sln)Each sample uses config.json:
{
"jwt": "your-jwt-token",
"session_name": "test-session",
"password": "",
"user_name": "Bot"
}Recommendation: Start with VSDK_SkeletonDemo to understand the basic flow, then move to VSDK_getRawVideo or VSDK_getRawAudio based on your needs.