// ===================================================================== /// <inheritdoc /> public void disconnect(Responder <object> responder, string scopeId) { if (!isPlatformInitialized <object>(responder)) { return; } ADLString scpId = StringHelper.toNative(scopeId); NativeAPI.adl_disconnect(_voidRCallback, _platformHandle, saveResponder(responder), ref scpId); }
// ===================================================================== /// <inheritdoc /> public void stopMeasuringStatistics(Responder <object> responder, string scopeId) { if (!isPlatformInitialized <object>(responder)) { return; } ADLString nScopeId = StringHelper.toNative(scopeId); NativeAPI.adl_stop_measuring_stats(_voidRCallback, _platformHandle, saveResponder(responder), ref nScopeId); }
// ===================================================================== /// <inheritdoc /> public void setAudioOutputDevice(Responder <object> responder, string deviceId) { if (!isPlatformInitialized <object>(responder)) { return; } ADLString devId = StringHelper.toNative(deviceId); NativeAPI.adl_set_audio_output_device( _voidRCallback, _platformHandle, saveResponder(responder), ref devId); }
// ===================================================================== /// <inheritdoc /> public void setVideoCaptureDevice(Responder <object> responder, string deviceId) { if (!isPlatformInitialized <object>(responder)) { return; } ADLString devId = StringHelper.toNative(deviceId); NativeAPI.adl_set_video_capture_device( _voidRCallback, _platformHandle, saveResponder(responder), ref devId); }
// ===================================================================== /// <inheritdoc /> public void sendMessage(Responder <object> responder, string scopeId, string message, long targetUserId) { if (!isPlatformInitialized <object>(responder)) { return; } ADLString scpId = StringHelper.toNative(scopeId); UIntPtr msgSz = new UIntPtr((message != null) ? (uint)message.Length : 0u); NativeAPI.adl_send_message(_voidRCallback, _platformHandle, saveResponder(responder), ref scpId, message, msgSz, ref targetUserId); }
// ===================================================================== /// <inheritdoc /> public void unpublish(Responder <object> responder, string scopeId, MediaType mediaType) { if (!isPlatformInitialized <object>(responder)) { return; } ADLString scpId = StringHelper.toNative(scopeId); ADLString mediaTp = StringHelper.toNative(mediaType.StringValue); NativeAPI.adl_unpublish(_voidRCallback, _platformHandle, saveResponder(responder), ref scpId, ref mediaTp); }
// ===================================================================== /// <summary> /// /// </summary> /// <param name="opaque"></param> /// <param name="error"></param> /// <param name="str"></param> private void stringRCallback(IntPtr opaque, ref ADLError error, ref ADLString str) { Responder <string> responder = (Responder <string>)getResponder( (uint)opaque); try { if (error.err_code == 0) { responder.resultHandler(str.body); } else { responder.errHandler(error.err_code, error.err_message.body); } } catch (Exception) { } }
/// <summary> /// Initializes the Cloudeo SDK with custom options. /// </summary> /// <param name="listener"> /// Object that will process initialization state change notifications. /// This includes progress change and different states. /// </param> /// <param name="options"> /// Additionall initialization options container. /// </param> public static void init(PlatformInitListener listener, PlatformInitOptions options) { _listener = listener; //Perform platform initialization string sdkPath; if (options != null) { if (Path.IsPathRooted(options.sdkPath)) { sdkPath = options.sdkPath; } else { sdkPath = Path.Combine(AssemblyDirectory, options.sdkPath); } } else { sdkPath = Path.Combine(AssemblyDirectory, DEFAULT_SDK_PATH); } SetDllDirectory(sdkPath); ADLString logicLibPath = new ADLString(); logicLibPath.body = Path.Combine(sdkPath, "libs"); logicLibPath.length = (UInt32)sdkPath.Length; ADLInitOptions initOptions = new ADLInitOptions(); initOptions.logicLibPath = logicLibPath; doInit(initOptions); }
public static extern void adl_disconnect(adl_void_rclbck_t rclbck, ADLH handle, IntPtr opaque, ref ADLString scopeId);
public static extern void adl_stop_measuring_stats(adl_void_rclbck_t rclbck, ADLH handle, IntPtr opaque, ref ADLString scopeId);
public static extern void adl_send_message(adl_void_rclbck_t rclbck, ADLH handle, IntPtr opaque, ref ADLString scopeId, [MarshalAs(UnmanagedType.LPStr)] string msgBody, UIntPtr msgSize, ref Int64 recipientId);
public static extern void adl_unpublish(adl_void_rclbck_t rclbck, ADLH handle, IntPtr opaque, ref ADLString scopeId, ref ADLString what);
public static extern void adl_set_audio_output_device( adl_void_rclbck_t rclbck, ADLH handle, IntPtr opaque, ref ADLString device_id);
public static extern void adl_set_video_capture_device( adl_void_rclbck_t rclbck, ADLH handle, IntPtr opaque, ref ADLString device_id);
public static extern void adl_publish(adl_void_rclbck_t rclbck, ADLH handle, IntPtr opaque, ref ADLString scopeId, ref ADLString what, ref ADLMediaPublishOptions options);
public static extern void adl_send_message(adl_void_rclbck_t rclbck, ADLH handle, IntPtr opaque, ref ADLString scopeId, [MarshalAs(UnmanagedType.LPStr)]string msgBody, UIntPtr msgSize, ref Int64 recipientId);