I want to capture the participant video streams in a meeting. There are no errors when the video stream is setup at the start of the meeting. However, I never receive any data either.
I noticed from the logs that the recording status is off. Not sure if this is the root cause or if it’s something else.
ZoomSDKRendererDelegate: onRawDataStatusChanged = 1
Ref: ZOOM Windows SDK: h/rawdata/rawdata_renderer_interface.h Source File
What am I doing wrong? It cannot be recording permissions because my bot is successfully able to capture the audio streams.
Code
IZoomSDKRendererDelegate implementation:
class ZoomSDKRendererDelegate : public IZoomSDKRendererDelegate
{
public:
virtual void onRawDataFrameReceived(YUVRawDataI420 *data);
virtual void onRawDataStatusChanged(RawDataStatus status);
virtual void onRendererBeDestroyed();
};
--
void ZoomSDKRendererDelegate::onRawDataFrameReceived(YUVRawDataI420 *data)
{
std::cout << "ZoomSDKRendererDelegate: onRawDataFrameReceived" << std::endl;
std::cout << "ZoomSDKRendererDelegate: width: " << data->GetStreamWidth() << std::endl;
std::cout << "ZoomSDKRendererDelegate: height: " << data->GetStreamHeight() << std::endl;
std::cout << "ZoomSDKRendererDelegate: sourceID: " << data->GetSourceID() << std::endl;
}
void ZoomSDKRendererDelegate::onRawDataStatusChanged(RawDataStatus status)
{
std::cout << "ZoomSDKRendererDelegate: onRawDataStatusChanged = " << status << std::endl;
}
void ZoomSDKRendererDelegate::onRendererBeDestroyed()
{
std::cout << "ZoomSDKRendererDelegate: onRendererBeDestroyed." << std::endl;
}
Subscribing to all the participant video streams at the start of a meeting:
std::cout << "Starting the video subscription now" << std::endl;
auto participant_user_ids = get_all_user_ids();
for (auto user_id : participant_user_ids)
{
ZoomSDKRendererDelegate* videoSource = new ZoomSDKRendererDelegate();
IZoomSDKRenderer* videoHelper;
SDKError renderer_err = createRenderer(&videoHelper, videoSource);
if (renderer_err != SDKERR_SUCCESS)
{
std::cout << "Error occurred in trying to createRenderer" << std::endl;
continue;
}
std::cout << "Subscribing to user ID for video stream: " << user_id << std::endl;
SDKError resolution_err = videoHelper->setRawDataResolution(ZoomSDKResolution_720P);
if (resolution_err != SDKERR_SUCCESS)
{
std::cout << "Error occurred setting resolution for video : " << resolution_err << std::endl;
continue;
}
SDKError subscribe_err = videoHelper->subscribe(user_id, RAW_DATA_TYPE_VIDEO);
if (subscribe_err != SDKERR_SUCCESS)
{
std::cout << "Error occurred subscribing to video : " << subscribe_err << std::endl;
}
}
}