How to determine whether the frame is ScreenShare or Video RawData in onRawDataFrameReceived?

1. zoom-sdk-windows-5.11.1.6653

I am receiving raw data frames inside onRawDataFrameReceived but how we can differentiate b/w Video and ScreenShare raw frames?

Thanks.

@donte.zoom @gianni.zoom @elisa.zoom Please reply to my query. Thanks

Hi, @freelancer.nak ,

Can you provide clarification on what you are trying to accomplish and also what you mean by b/w video?

Hi, Thanks for the reply.

I mean we are receiving raw data frames inside ‘onRawDataFrameReceived’. Raw frames of ShareScreen and Video Stream how we can differentiate between those that frame is of Video or Share.

@donte.zoom and not able to record multi-user video and screen share at the same time. How Can we achieve that?

Thanks,

@donte.zoom Please reply. Thanks

@freelancer.nak ,

When you subscribe to a user’s raw video data, you provide a type indicating either share or video. You subscribe through the IZoomSDKRenderer.subscribe function for Windows

IZoomSDKRenderer.subscribe function link

I am looking into this and will provide an update on what I learn.

@donte.zoom Thanks I managed to record multi-users videos with screen share and audio concurrently.

Awesome @freelancer.nak! Glad to hear you were able to resolve the issue. Please share your solution for the benefit of other communities who may be facing a similar situation. We appreciate your contribution to the Developer forum.

Best,
Donte

I have created separate RendererHelpers for Audio and Video/ScreenShare as below:

RendererHelper.h

#pragma once

#include “RendererHelperBase.h”

class RendererHelper :
public RendererHelperBase,
public IZoomSDKRendererDelegate
{
public:
RendererHelper(UINT64 meetingNumber, ZoomSDKRawDataType type, string sourceId);

void setUserRendererStatus(SDKError recordingStatus);

string getRawDataStatus(RawDataStatus status);
string getFilePath();
string getResolution();
SDKError getUserRendererStatus();

private:
string resolution;
SDKError recordingStatus;

// Inherited via IZoomSDKRendererDelegate
virtual void onRendererBeDestroyed() override;
virtual void onRawDataFrameReceived(YUVRawDataI420* data) override;
virtual void onRawDataStatusChanged(RawDataStatus status) override;

};

AudioRendererHelper.h

#pragma once

#include “RendererHelperBase.h”

class AudioRendererHelper :
public RendererHelperBase,
public IZoomSDKRendererDelegate,
public IZoomSDKAudioRawDataDelegate
{
public:
AudioRendererHelper(UINT64 meetingNumber, ZoomSDKRawDataType type, string sourceId);
virtual string getRawDataStatus(RawDataStatus status) override;
string getAudioMeta();
string getFilePath();
string getResolution();

private:
string audioRawMeta;

// Inherited via IZoomSDKRendererDelegate
virtual void onRendererBeDestroyed() override;
virtual void onRawDataFrameReceived(YUVRawDataI420* data) override;
virtual void onRawDataStatusChanged(RawDataStatus status) override;

// Inherited via IZoomSDKAudioRawDataDelegate
virtual void onMixedAudioRawDataReceived(AudioRawData* data_) override;
virtual void onOneWayAudioRawDataReceived(AudioRawData* data_, uint32_t node_id) override;

};

and then creating new instances of the above classes once receiving a new participant video/screen share as below:

void CreateUserRenderer(UINT64 userId, ZoomSDKRawDataType type)
{
string raw_type;

switch (type)
{
case ZoomSDKRawDataType::RAW_DATA_TYPE_VIDEO:
	raw_type = "-video";
	break;

case ZoomSDKRawDataType::RAW_DATA_TYPE_SHARE:
	raw_type = "-screenshare";
	break;
}

string mapKey = to_string(userId) + raw_type;
IZoomSDKRendererDelegate* currentUserRenderer = rawData[mapKey];

if (currentUserRenderer == NULL)
{
	currentUserRenderer = new RendererHelper(meetingNumber, type, to_string(userId));
}

SDKError rendererStatus = createRenderer(&rawRender, currentUserRenderer);

rawData[mapKey] = currentUserRenderer;

if (rendererStatus == SDKError::SDKERR_SUCCESS)
{
	rawRender->setRawDataResolution(ZoomSDKResolution::ZoomSDKResolution_1080P);
	((RendererHelper*)currentUserRenderer)->setUserRendererStatus(rawRender->subscribe(userId, type));
}

}

and multi-user video/screenshare recording is working concurrently. Thanks

@freelancer.nak,

You’re fantastic! Thank you for sharing your knowledge with the Community. The information you gave is really helpful and we appreciate how you explained it! Thank you so much for taking the time to help.

Welcome and Thanks :slight_smile:

1 Like

@freelancer.nak,

It is our pleasure!

Best,
Donte

1 Like