Camera controls
The Video SDK for Windows lets you control the local camera during a session: select and switch cameras, and mirror or rotate the local video. You configure cameras with IZoomVideoSDKVideoHelper, obtained from getVideoHelper. For starting and stopping video, see Core features.
Get the camera list
To enumerate the cameras attached to the machine, call getCameraList. Each IZoomVideoSDKCameraDevice exposes its name and ID through getDeviceName and getDeviceId.
IZoomVideoSDKVideoHelper* pVideoHelper = m_pVideoSDK->getVideoHelper();
if (pVideoHelper->getNumberOfCameras() > 0)
{
IVideoSDKVector<IZoomVideoSDKCameraDevice*>* pCameraList = pVideoHelper->getCameraList();
for (int i = 0; i < pCameraList->GetCount(); i++)
{
IZoomVideoSDKCameraDevice* pCamera = pCameraList->GetItem(i);
// Inspect pCamera->getDeviceName() and pCamera->getDeviceId().
}
}
Select a camera
To select a specific camera, pass its device ID to selectCamera.
IVideoSDKVector<IZoomVideoSDKCameraDevice*>* pCameraList = pVideoHelper->getCameraList();
IZoomVideoSDKCameraDevice* pCamera = pCameraList->GetItem(0);
pVideoHelper->selectCamera(pCamera->getDeviceId());
Switch camera
To cycle to the next available camera, call switchCamera with no arguments.
IZoomVideoSDKVideoHelper* pVideoHelper = m_pVideoSDK->getVideoHelper();
if (pVideoHelper) {
pVideoHelper->switchCamera();
}
Mirror the local video
To mirror the local user's video, call mirrorMyVideo. Read the current state with isMyVideoMirrored.
IZoomVideoSDKVideoHelper* pVideoHelper = m_pVideoSDK->getVideoHelper();
// Mirror the local video.
pVideoHelper->mirrorMyVideo(true);
// Check whether the local video is mirrored.
bool isMirrored = pVideoHelper->isMyVideoMirrored();
Rotate the local video
To rotate the local user's video, for example to match a device that is mounted sideways, call rotateMyVideo with a VideoRotation value.
IZoomVideoSDKVideoHelper* pVideoHelper = m_pVideoSDK->getVideoHelper();
pVideoHelper->rotateMyVideo(VideoRotation_90);
rotateMyVideo takes one of the following values.
VideoRotation_0VideoRotation_90VideoRotation_180VideoRotation_270
Alpha channel mode
The SDK can produce a per-pixel alpha mask alongside the local video frame, which is useful for compositing the user over custom backgrounds. For details, see Raw video with alpha channel.