| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261 |
- #import <Foundation/Foundation.h>
- #import <CoreGraphics/CoreGraphics.h>
- #import "ZMVideoSDKAnnotationHelper.h"
- /**
- @brief Share sender interface.
- */
- @interface ZMVideoSDKShareSender : NSObject
- /**
- @brief Send one frame data.
- @param frameBuffer FrameBuffer YUVI420 buffer.
- @param width Frame width.
- @param height Frame height.
- @param frameLength Buffer length.
- @return If the function succeeds, the return value is ZMVideoSDKErrors_Success, otherwise failed. To get extended error information, see {@link ZMVideoSDKErrors}.
- */
- - (ZMVideoSDKErrors)sendShareFrame:(char*)frameBuffer width:(int)width height:(int)height frameLength:(int)frameLength DEPRECATED_MSG_ATTRIBUTE("Use -sendShareFrame: width: height: frameLength: format: instead");
- /**
- @brief Send one frame data.
- @param frameBuffer FrameBuffer YUVI420 buffer.
- @param width Frame width.
- @param height Frame height.
- @param frameLength Buffer length.
- @param format Raw data format.
- @return If the function succeeds, the return value is ZMVideoSDKErrors_Success, otherwise failed. To get extended error information, see {@link ZMVideoSDKErrors}.
- */
- - (ZMVideoSDKErrors)sendShareFrame:(char*)frameBuffer width:(int)width height:(int)height frameLength:(int)frameLength format:(ZMVideoSDKFrameDataFormat)format;
- @end
- /**
- @brief Share source sink interface.
- */
- @protocol ZMVideoSDKShareSource <NSObject>
- /**
- @brief Callback for share source can start send raw data.
- @param sender See {@link ZMVideoSDKShareSender}.
- */
- -(void)onShareSendStarted:(ZMVideoSDKShareSender*)sender;
- /**
- @brief Callback for share source stop send raw data.
- */
- -(void)onShareSendStopped;
- @end
- @interface ZMVideoSDKShareAudioSender : NSObject
- /**
- @brief Sends audio raw data.
- @param data The audio data address.
- @param length The audio data length. It must be even numbers.
- @param rate The audio data sampling rate.
- @param channel The channel type. Default type is ZoomVideoSDKAudioChannel_Mono.
- @return If the function succeeds, the return value is ZMVideoSDKErrors_Success, otherwise failed. To get extended error information, see {@link ZMVideoSDKErrors}.
- @note Support sample Rate 44100/48000/50000/50400/.
- */
- -(ZMVideoSDKErrors)sendShareAudio:(char *)data dataLength:(unsigned int)length sampleRate:(int)rate audioChannel:(ZMVideoSDKAudioChannel)channel;
- @end
- @protocol ZMVideoSDKShareAudioSource <NSObject>
- /**
- @brief Callback for audio source to start sending raw data.
- @param sender See {@link ZMVideoSDKShareAudioSender}.
- */
- -(void)onStartSendAudio:(ZMVideoSDKShareAudioSender *)sender;
- /**
- @brief Callback for audio source to stop sending raw data.
- */
- -(void)onStopSendAudio;
- @end
- /**
- @brief Share option interface.
- */
- @interface ZMVideoSDKShareOption : NSObject
- /**
- @brief Share option, YES means share computer sound when share screen/window, otherwise not.
- */
- @property (nonatomic, assign, readwrite) BOOL isWithDeviceAudio;
- /**
- @brief Share option, YES means optimize the frame rate when share screen/window, otherwise not.
- */
- @property (nonatomic, assign, readwrite) BOOL isOptimizeForSharedVideo;
- @end
- /**
- @brief Share helper interface.
- */
- @interface ZMVideoSDKShareHelper : NSObject
- /**
- @brief Start Share a window.
- @param windowID The App window id.
- @note The CGWindowID contains a unique value within the user session
- representing a window.
- @param option It is a share option object, contain all option of share.
- @return If the function succeeds, the return value is ZMVideoSDKErrors_Success, otherwise failed. To get extended error information, see {@link ZMVideoSDKErrors}.
- */
- - (ZMVideoSDKErrors)startShareView:(CGWindowID)windowID shareOption:(ZMVideoSDKShareOption*)option;
-
- /**
- @brief Start share screen.
- @param monitorID The ID of the monitor that you want to display the shared content.
- @param option It is a share option object, contain all option of share.
- @return If the function succeeds, the return value is ZMVideoSDKErrors_Success. Otherwise failed. To get extended error information, see {@link ZMVideoSDKErrors}.
- */
- - (ZMVideoSDKErrors)startShareScreen:(CGDirectDisplayID)monitorID shareOption:(ZMVideoSDKShareOption*)option;
-
- /**
- @brief Start sharing the computer audio only.
- @return If the function succeeds, the return value is ZMVideoSDKErrors_Success. Otherwise failed. To get extended error information, see {@link ZMVideoSDKErrors}.
- */
- - (ZMVideoSDKErrors)startShareComputerAudio;
- /**
- @brief Stop view or screen share.
- @return If the function succeeds, the return value is ZMVideoSDKErrors_Success. Otherwise failed. To get extended error information, see {@link ZMVideoSDKErrors}.
- */
- - (ZMVideoSDKErrors)stopShare;
-
- /**
- @brief Determine whether the current user is sharing.
- @return YES indicates the current user is sharing, otherwise NO.
- */
- - (BOOL)isSharingOut;
-
- /**
- @brief Determine whether the current user is sharing the screen.
- @return YES indicates the current user is sharing the screen, otherwise NO.
- */
- - (BOOL)isScreenSharingOut;
-
- /**
- @brief Determine whether other user is sharing.
- @return YES indicates another user is sharing, otherwise NO.
- */
- - (BOOL)isOtherSharing;
-
- /**
- @brief Lock sharing the view or screen. Only the host can call this method.
- @param lock YES to lock sharing.
- @return If the function succeeds, the return value is ZMVideoSDKErrors_Success, otherwise failed. To get extended error information, see {@link ZMVideoSDKErrors}.
- */
- - (ZMVideoSDKErrors)lockShare:(BOOL)lock;
-
- /**
- @brief Determine whether sharing the view or screen is locked.
- @return YES indicates that sharing is locked, otherwise NO.
- */
- - (BOOL)isShareLocked;
- /**
- @brief Enable or disable the computer sound when sharing, the SDK does not support sharing raw data audio, for example, when you've enabled virtual speaker.
- @param enable YES to enable. NO to disable.
- @return If the function succeeds, it will return ZMVideoSDKErrors_Success.
- */
- - (ZMVideoSDKErrors)enableShareDeviceAudio:(BOOL)enable;
- /**
- @brief Determine if the SDK has enabled share computer sound. This reflects the execution status of 'enableShareDeviceAudio' instead of 'startShareComputerAudio'.
- @return YES if enabled, otherwise not.
- */
- - (BOOL)isShareDeviceAudioEnabled;
- /**
- @brief Enable or disable the optimization of frame rate, you can enable it when there is video in shared content.
- @param enable YES indicates to enable. NO disable.
- @return If the function succeeds, it will return ZMVideoSDKErrors_Success.
- */
- - (ZMVideoSDKErrors)enableOptimizeForSharedVideo:(BOOL)enable;
- /**
- @brief Determine if optimization for video is enabled.
- @return YES means enabled. Otherwise not.
- */
- - (BOOL)isOptimizeForSharedVideoEnabled;
- /**
- @brief Start sharing a camera feed specified by the cameraID as the second camera.
- @param cameraID The camera ID.
- @return If the function succeeds, it will return ZMVideoSDKErrors_Success.
- @note This cameraID must be a different camera than the one sending your primary video.
- */
- - (ZMVideoSDKErrors)startShare2ndCamera:(NSString*)cameraID;
- /**
- @brief Subscribe to the raw data stream of the camera that is shared as the second camera.
- @param dataHandler The callback sink object.
- @return If the function succeeds, it will return ZMVideoSDKErrors_Success.
- */
- - (ZMVideoSDKErrors)subscribeMyShareCamera:(id<ZMVideoSDKRawDataPipeDelegate>)dataHandler;
- /**
- @brief Unsubscribe to the raw data stream of the camera that is shared as the second camera.
- @return If the function succeeds, it will return ZMVideoSDKErrors_Success.
- */
- - (ZMVideoSDKErrors)unSubscribeMyShareCamera;
- /**
- @brief Share an external source.
- @param pSource External share source. To get extended error information, see {@link ZMVideoSDKShareSource}.
- @return If the function succeeds, it will return ZMVideoSDKErrors_Success. Otherwise failed. To get extended error information, see {@link ZMVideoSDKErrors}.
- */
- - (ZMVideoSDKErrors)startSharingExternalSource:(id<ZMVideoSDKShareSource>)pSource DEPRECATED_MSG_ATTRIBUTE("Use -startSharingExternalSource: audioSource: instead");
- /**
- @brief Shares an external source.
- @param pSource External share source. To get extended error information, see {@link ZMVideoSDKShareSource}.
- @param audioSource External audio source. To get extended error information, see {@link ZMVideoSDKShareAudioSource}.
- @return If the function succeeds, it will return ZMVideoSDKErrors_Success. Otherwise failed. To get extended error information, see {@link ZMVideoSDKErrors}.
- @note If audioSource is non-null, it means share user-defined audio at the same time.
- */
- - (ZMVideoSDKErrors)startSharingExternalSource:(id<ZMVideoSDKShareSource> _Nonnull)shareSource audioSource:(id<ZMVideoSDKShareAudioSource> _Nullable)audioSource;
- /**
- @brief Starts sharing the pure external audio source.
- @param audioSource the pointer of external audio source object. To get extended error information, see {@link ZMVideoSDKShareAudioSource}.
- @return If the function succeeds, it will return ZMVideoSDKErrors_Success. Otherwise failed. To get extended error information, see {@link ZMVideoSDKErrors}.
- */
- - (ZMVideoSDKErrors)startSharePureAudioSource:(id<ZMVideoSDKShareAudioSource> _Nonnull)audioSource;
- /**
- @brief Whether annotation feature is supported or not.
- @return YES if support. Otherwise not.
- */
- - (BOOL)isAnnotationFeatureSupport;
- /**
- @brief Disable or enable viewer's annotation by the share owner.
- @param disable YES mean disable, NO, mean enable.
- @return If the function succeeds, it will return ZMVideoSDKErrors_Success. Otherwise failed.
- @warning Only the share owner can call this function.
- */
- - (ZMVideoSDKErrors)disableViewerAnnotation:(BOOL)disable;
- /**
- @brief Whether annotation on current sharing is disabled or not.
- @return YES if disable. Otherwise not.
- @warning Only the share owner can call this function.
- */
- - (BOOL)isViewerAnnotationDisabled;
- /**
- @brief Creates annotation helper based on shared view.
- @param view The shared view. Pass the nil will return the helper for self sharing.
- @return If the function succeeds, it will return the object of ZMVideoSDKAnnotationHelper. Otherwise nil.
- @warning When the share owner not support the feature of annotate, the others should not do annotate in that case.
- */
- - (ZMVideoSDKAnnotationHelper* _Nullable)createAnnotationHelper:(NSView* _Nullable)view;
- /**
- @brief Destroys annotation helper.
- @param helper The object of ZMVideoSDKAnnotationHelper.
- @return If the function succeeds, it will return ZMVideoSDKErrors_Success. Otherwise failed. To get extended error information, see {@link ZMVideoSDKErrors}.
- */
- - (ZMVideoSDKErrors)destroyAnnotationHelper:(ZMVideoSDKAnnotationHelper* _Nonnull)helper;
- @end
|