/// <summary>
 ///
 /// </summary>
 /// <param name="runPreDisposeDelegate"></param>
 internal void stop(bool runPreDisposeDelegate = true)
 {
     if (_rendererId < 0)
     {
         return;
     }
     stoppedEvent  = new ManualResetEvent(false);
     _stopRHandler = new adl_void_rclbck_t(stopRHandler);
     NativeAPI.adl_stop_render(_stopRHandler, _platformHandle,
                               IntPtr.Zero, _rendererId);
     stoppedEvent.WaitOne(2000);
     if (runPreDisposeDelegate)
     {
         _preDisposeDelegate(_rendererId);
     }
     _rendererId = -1;
 }
Beispiel #2
0
        /**
         * Constructors
         * =====================================================================
         */

        /// <summary>
        /// Basic constructor.
        /// </summary>
        /// <param name="platformHnandle">
        /// handle for the platform that should be used when performing API
        /// calls.
        /// </param>
        public CloudeoServiceImpl(IntPtr platformHandle)
        {
            // 1. Initialize all fields.
            _platformHandle       = platformHandle;
            _respondersDictionary = new Dictionary <uint, object>();
            _listeners            = new List <NativeServiceListenerAdapter>();
            _callIdGenerator      = 0;
            _renderSupport        = new RenderSupport(platformHandle);

            // 2. Create all the result delegates.
            _voidRCallback         = new adl_void_rclbck_t(voidRCallback);
            _stringRCallback       = new adl_string_rclbck_t(stringRCallback);
            _intRCallback          = new adl_int_rclbck_t(intRCallback);
            _devsRCallback         = new adl_get_device_names_rclbck_t(devsRCallback);
            _screenSourceRCallback =
                new adl_get_screen_capture_srcs_rclbck_t(screenCaptureSourcesRClbck);
        }
 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_set_volume(
     adl_void_rclbck_t rclbck, ADLH handle, IntPtr opaque, int volume);
 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_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_monitor_mic_activity(
     adl_void_rclbck_t rclbck, ADLH handle, IntPtr opaque, bool monitor);
 public static extern void adl_connect(adl_void_rclbck_t rclbck,
     ADLH handle, IntPtr opaque, ref ADLConnectionDescription connDescr);
 public static extern void adl_stop_render(adl_void_rclbck_t rclbck,
                                           ADLH handle, IntPtr opaque, int rendererId);
 public static extern void adl_stop_playing_test_sound(
     adl_void_rclbck_t rclbck, ADLH handle, IntPtr opaque);
 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_add_service_listener(
     adl_void_rclbck_t resultHandler, ADLH handle, IntPtr opaque,
     ref ADLServiceListener listener);
 public static extern void adl_set_application_id(adl_void_rclbck_t rclbck,
                                                  ADLH handle, IntPtr opaque, long applicationId);
 public static extern void adl_stop_render(adl_void_rclbck_t rclbck,
     ADLH handle, IntPtr opaque, int rendererId);
 public static extern void adl_set_volume(
     adl_void_rclbck_t rclbck, ADLH handle, IntPtr opaque, int volume);
 public static extern void adl_monitor_mic_activity(
     adl_void_rclbck_t rclbck, ADLH handle, IntPtr opaque, bool monitor);
 public static extern void adl_add_service_listener(
     adl_void_rclbck_t resultHandler, ADLH handle, IntPtr opaque,
     ref ADLServiceListener listener);
 public static extern void adl_stop_local_video(
     adl_void_rclbck_t rclbck, ADLH handle, IntPtr opaque);
 public static extern void adl_disconnect(adl_void_rclbck_t rclbck,
     ADLH handle, IntPtr opaque, ref ADLString scopeId);
 public static extern void adl_connect(adl_void_rclbck_t rclbck,
                                       ADLH handle, IntPtr opaque, ref ADLConnectionDescription connDescr);
 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_disconnect(adl_void_rclbck_t rclbck,
                                          ADLH handle, IntPtr opaque, ref ADLString scopeId);
 public static extern void adl_set_application_id(adl_void_rclbck_t rclbck,
 ADLH handle, IntPtr opaque, long applicationId);
 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_set_video_capture_device(
     adl_void_rclbck_t rclbck, ADLH handle, IntPtr opaque,
     ref ADLString device_id);
 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_stop_local_video(
     adl_void_rclbck_t rclbck, ADLH handle, IntPtr opaque);
 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_stop_playing_test_sound(
     adl_void_rclbck_t rclbck, ADLH handle, IntPtr opaque);
 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_unpublish(adl_void_rclbck_t rclbck,
     ADLH handle, IntPtr opaque, ref ADLString scopeId,
     ref ADLString what);
 /// <summary>
 /// 
 /// </summary>
 /// <param name="runPreDisposeDelegate"></param>
 internal void stop(bool runPreDisposeDelegate = true)
 {
     if (_rendererId < 0)
     {
         return;
     }
     stoppedEvent = new ManualResetEvent(false);
     _stopRHandler = new adl_void_rclbck_t(stopRHandler);
     NativeAPI.adl_stop_render(_stopRHandler, _platformHandle,
         IntPtr.Zero, _rendererId);
     stoppedEvent.WaitOne(2000);
     if (runPreDisposeDelegate)
         _preDisposeDelegate(_rendererId);
     _rendererId = -1;
 }