Description
I have the below code, and when I call StartSharing() after a meeting has started,
and a participant has joined, setExternalShareSource() always succeeds, but onStartSend()
is called very rarely - only around 1% of the time is the callback is called.
I am not sure what I am doing wrong.
In a different approach to test this, I called StartSharing() from the onMeetingStatusChanged callback, and when meeting status is MEETING_STATUS_INMEETING, then it works reliably - i.e. the
onStartSend() gets called. Of course, this is before any participant joined the meeting.
However I want to start the sharing only after a participant joins, and in this case it is not working reliably at all.
Please let me know if you need more details.
Thanks!
The code is:
void ZoomSDKShareSource::onStartSend(ZOOM_SDK_NAMESPACE::IZoomSDKShareSender* pSender) {
m_rawDataSender = pSender;
}
void ZoomSDKShareSource::StartSharing() {
ZOOM_SDK_NAMESPACE::IMeetingService* pMeetingService =
SDKInterfaceWrap::GetInst().GetMeetingService();
ZOOM_SDK_NAMESPACE::IMeetingShareController* m_pShareController =
pMeetingService->GetMeetingShareController();
if (m_pShareController) {
if (m_pShareController->CanStartShare()) {
helper = ZOOM_SDK_NAMESPACE::GetRawdataShareSourceHelper();
ZOOM_SDK_NAMESPACE::SDKError err;
err = helper->setExternalShareSource(this);
if (err != ZOOM_SDK_NAMESPACE::SDKERR_SUCCESS) {
ZoomSdkHelper::printSdkError(err, "Raw sharing failed");
}
}
}
}
Which Windows Meeting SDK version?
zoom-sdk-windows-5.16.10.26236
@integrations3 ,
For these actions, typically you want to call them after the SDK has successfully joined the meeting, and in this case MEETING_STATUS_INMEETING lets you know that the SDK has successfully joined.
If you want to only start sharing when someone has joined, you might want to consider taking a look at onUserJoin event
You can also check the status of the SDK by directly calling GetMeetingStatus method
@chunsiong.zoom , the issue is that we need to start/stop the sharing at any random point in time while the meeting is in progress, not dependent on user join or another event.
So I am wondering if setExternalSource returns no error then why isn’t the onStartSend being called 100% of the time?
@integrations3 ,
I’m doing something like this. Do note that the garbage collection has not been completed yet. Everytime you stop a sharescreen, you should destroy / deference the objects, so that the next sharescreen won’t be affected by existing objects in memory.
void attemptToStartSendingShareScreenRaw() {
virtual_share_source = new ZoomSDKShareSource(video_source);
IZoomSDKShareSourceHelper* pShareSourceHelper = GetRawdataShareSourceHelper();
if (pShareSourceHelper)
{
SDKError err = pShareSourceHelper->setExternalShareSource(virtual_share_source);
if (err != SDKERR_SUCCESS) {
printf("Error occurred: %d\n", err);
//handle error
}
else {
printf("successfully set virtual share source...\n");
}
}
}
The problem is happening on the very first screenshare I try to do.
I actually took inspiration from your code to do it so thanks for the code!
Sometimes if I wait for 10 seconds after a user has joined, and after the 10 seconds I start the share, then onStartSend gets called.
However even in that case, sometimes the callback does not get called even after waiting 10 or more seconds.
So I wonder if this is a bug in the SDK? Is there some debug logging that I can enable to show me what the SDK is doing?
@integrations3 could you check out the sample here?