Preview
Before joining a session, you can give users a preview of their video and audio by starting the camera and microphone locally. Access local video and audio through IZoomVideoSDKVideoHelper and IZoomVideoSDKTestAudioDeviceHelper.
Preview camera
To preview a camera on Linux, you will need a video UI control (such as QT, GTK, SDL, OpenCV or another) and stream YUV420 raw data frames into the UI control as a video.
Configure the camera with the following code.
//Get list of Cameras
IZoomVideoSDK* video_sdk_obj = CreateZoomVideoSDKObj();
IVideoSDKVector<IZoomVideoSDKCameraDevice*> *cameras = video_sdk_obj->getVideoHelper()->getCameraList();
//Get ID of selected camera
const zchar_t* deviceID = cameras->GetItem(0)->getDeviceId();
//Start Preview, and handle the callback in a ZoomVideoSDKRawDataPipeDelegate instance
ZoomVideoSDKRawDataPipeDelegate* dataDelegate = new ZoomVideoSDKRawDataPipeDelegate();
video_sdk_obj->getVideoHelper()->startVideoPreview(dataDelegate, deviceID);
//Stop Preview
IZoomVideoSDKVideoHelper->stopVideoPrevew();
Handle the callback with the following code.
//Handle callback
void ZoomVideoSDKRawDataPipeDelegate::onRawDataFrameReceived(YUVRawDataI420 *data){
//assign the data (yuv420 frame) here to your video UI control (QT, GTK, SDL, OpenCV) to preview your camera stream.
}
Preview audio unsupported
The Video SDK for Linux does not support microphone and speaker preview.