/**  Switches between local webcams. This only works for video objects representing the local user. It is
   possible to switch to a different webcam on the fly, during a live session, i.e. you don't need to call
   SktVideo.Stop and SktVideo.Start while doing it. The easiest way to retrieve the local user is to call
   current live session's GetParticipants with PARTICIPANTFILTER.MYSELF. To get values for the deviceName
   and devicePath arguments, use SktSkype.GetAvailableVideoDevices method. Note that the SktSkype.GetAvailableVideoDevices
   should not be used immedately after account login. It will take several seconds to populate the video
   device list. You should handle the SktSkype.OnSkypeAvailableVideoDeviceListChange event to detect when
   the video device list is ready. Note that the device switching will only work with webcams that are not
   already in use by some other application. For example, if you have a Skype desktop client with video running in parallel, while testing,
   the desktop client will "claim" its default webcam. That webcam will still show up in the video device
   list in SkypeKit-based app, but switching to it will not work.
 @param [in] mediaType - Screensharing or webcam.
 @param [in] webcamName - Displayname of the webcam. Default value is ""
 @param [in] devicePath - Device ID (from the 2nd list you get back from the SktSkype.GetAvailableVideoDevices method) Default value is ""
 @param [in] updateSetup - Set true if you want to change the default value. Default value is false
  */
 public void SelectVideoSource(
 SktVideo.MEDIATYPE mediaType,
 String             webcamName="",
 String             devicePath="",
 Boolean            updateSetup=false)
 {
     if (skypeRef.logging) skypeRef.Log("Executing Video.SelectVideoSource");
     uint RequestId = skypeRef.encoder.AddMethodHeader(ClassId, 7, OID);
     skypeRef.encoder.AddEnumParam(1, (uint)mediaType);
     skypeRef.encoder.AddStringParam(2, webcamName);
     skypeRef.encoder.AddStringParam(3, devicePath);
     skypeRef.encoder.AddBoolParam(4, updateSetup);
     skypeRef.transport.SubmitMethodRequest (RequestId);
     skypeRef.decoder.DecodeMethodResponseWithNoArguments("SktVideo.SelectVideoSource");
 }
 /**  Queries whether the given video device has a specific SktVideo.VIDEO_DEVICE_CAPABILITY. Use SktSkype.GetAvailableVideoDevices
   method to retrieve sstring lists with available deviceName and devicePath values.
 @returns result Returns true if the given device has given capability.
 @param [in] deviceName - Human readable device name.
 @param [in] devicePath - Device ID.
 @param [in] cap - Any of the SktVideo.VIDEO_DEVICE_CAPABILITY values.
  */
 public Boolean HasVideoDeviceCapability(
 String                                deviceName,
 String                                devicePath,
 SktVideo.VIDEO_DEVICE_CAPABILITY      cap)
 {
     if (skypeRef.logging) skypeRef.Log("Executing Skype.HasVideoDeviceCapability");
     uint RequestId = skypeRef.encoder.AddMethodHeader(ClassId, 33, OID);
     skypeRef.encoder.AddStringParam(1, deviceName);
     skypeRef.encoder.AddStringParam(2, devicePath);
     skypeRef.encoder.AddEnumParam(3, (uint)cap);
     skypeRef.transport.SubmitMethodRequest (RequestId);
     Dictionary<uint, uint> tagMap = new Dictionary<uint, uint> { {1, 1} };
     object[] args = new object[1];
     args[0] = false;
     skypeRef.decoder.DecodeMethodResponseArguments(1, ref args, new uint[1]{0}, ref tagMap, "SktSkype.HasVideoDeviceCapability");
     return (Boolean)args[0];
 }
 /**
 @param [out] mediatype
 @param [out] deviceName
 @param [out] devicePath
  */
 public void GetCurrentVideoDevice(
 out SktVideo.MEDIATYPE mediatype,
 out String deviceName,
 out String devicePath)
 {
     if (skypeRef.logging) skypeRef.Log("Executing Video.GetCurrentVideoDevice");
     uint RequestId = skypeRef.encoder.AddMethodHeader(ClassId, 10, OID);
     skypeRef.transport.SubmitMethodRequest (RequestId);
     Dictionary<uint, uint> tagMap = new Dictionary<uint, uint> { {1, 1}, {2, 2}, {3, 3} };
     object[] args = new object[3];
     args[0] = 0;
     args[1] = "";
     args[2] = "";
     skypeRef.decoder.DecodeMethodResponseArguments(3, ref args, new uint[3]{0,0,0}, ref tagMap, "SktVideo.GetCurrentVideoDevice");
     mediatype = (SktVideo.MEDIATYPE)args[0];
     deviceName = (String)args[1];
     devicePath = (String)args[2];
 }
 public OnVideoStatusArgs(SktVideo sender, SktVideo.STATUS newValue)
 {
     this.sender = sender;  value = newValue;
 }
 /**  Warning: Will be deprecated soon
 @returns video
 @param [in] type
 @param [in] deviceName - name and path to be used only with media type VIDEO Default value is ""
 @param [in] devicePath Default value is ""
  */
 public SktVideo GetPreviewVideo(
 SktVideo.MEDIATYPE      type,
 String                  deviceName="",
 String                  devicePath="")
 {
     if (skypeRef.logging) skypeRef.Log("Executing Skype.GetPreviewVideo");
     uint RequestId = skypeRef.encoder.AddMethodHeader(ClassId, 35, OID);
     skypeRef.encoder.AddEnumParam(1, (uint)type);
     skypeRef.encoder.AddStringParam(2, deviceName);
     skypeRef.encoder.AddStringParam(3, devicePath);
     skypeRef.transport.SubmitMethodRequest (RequestId);
     Dictionary<uint, uint> tagMap = new Dictionary<uint, uint> { {1, 1} };
     object[] args = new object[1];
     args[0] = null;
     skypeRef.decoder.DecodeMethodResponseArguments(1, ref args, new uint[1]{11}, ref tagMap, "SktSkype.GetPreviewVideo");
     return (SktVideo)args[0];
 }
 /** Associates SktVideo object with the renderer. Throws exception if the renderer is already running.
  * This method is only usable from within descendants of the SktVideoRenderer class. Normally, you should
  * be assigning the SktVideo object directly to the SktVideoRenderer.VideoObject property.
  */
 protected void SetVideoObject(SktVideo video)
 {
     if (isRunning) throw new Exception("Error: cannot re-set video object while video is running."); ;
     videoObject = video;
 }
 public OnVideoMediaTypeArgs(SktVideo sender, SktVideo.MEDIATYPE newValue)
 {
     this.sender = sender;  value = newValue;
 }
 public OnVideoDevicePathArgs(SktVideo sender, String newValue)
 {
     this.sender = sender;  value = newValue;
 }
 public OnVideoDimensionsArgs(SktVideo sender, String newValue)
 {
     this.sender = sender;  value = newValue;
 }
 public OnVideoConvoIdArgs(SktVideo sender, SktConversation newValue)
 {
     this.sender = sender;  value = newValue;
 }
 public OnVideoDebuginfoArgs(SktVideo sender, String newValue)
 {
     this.sender = sender;  value = newValue;
 }
 internal void FireOnVideoStatus(SktVideo sender, SktVideo.STATUS value)
 {
     if (OnVideoStatus == null) return; // Event not assigned
     OnVideoStatusArgs args = new OnVideoStatusArgs(sender, value);
     if (gui == null) { FireCallbackInSeparateThread(args, OnVideoStatusInNewThread); return; } // No gui firing in separate thread
     gui.BeginInvoke(OnVideoStatus, new object[] { sender, args }); // Syncing to GUI thread
 }
 internal void FireOnVideoMediaType(SktVideo sender, SktVideo.MEDIATYPE value)
 {
     if (OnVideoMediaType == null) return; // Event not assigned
     OnVideoMediaTypeArgs args = new OnVideoMediaTypeArgs(sender, value);
     if (gui == null) { FireCallbackInSeparateThread(args, OnVideoMediaTypeInNewThread); return; } // No gui firing in separate thread
     gui.BeginInvoke(OnVideoMediaType, new object[] { sender, args }); // Syncing to GUI thread
 }
示例#14
0
        public void OnVideoStatus(SktVideo sender, SktEvents.OnVideoStatusArgs e)
        {
            Video video = (Video)sender;
            // Checking if we know already, what participant we are linked to
            // participant and video get linked in OnParticipantVideoStatus
            // and also in CheckIfVideoIsAvailable
            if (video.participant == null) return;

            if (e.value == SktVideo.STATUS.AVAILABLE)
            {
                video.Start();
            }
            else
            {
                if (e.value == SktVideo.STATUS.RUNNING)
                {
                    // just in case.. checking if the participant already has renderer running
                    if (!video.participant.pic.IsRunning) video.participant.SwitchPicModeToVideo();
                }
                else
                {
                    // The video is no longer streaming. Switching participant UI back to displaying avatar
                    video.participant.SwitchPicModeToAvatar();
                }
            }
        }
 public void Add(SktVideo item)
 {
     base.Add((SktVideo)item);
 }
 public OnVideoErrorArgs(SktVideo sender, String newValue)
 {
     this.sender = sender;  value = newValue;
 }
 /**  Attaches send video to livesession. There is no detach. If you don't want to use this video in livesession
   anymore - stop it. Video object will stay attached until the end of livesession
 @param [in] sendVideo
  */
 public void AttachVideoToLiveSession(SktVideo sendVideo)
 {
     if (skypeRef.logging) skypeRef.Log("Executing Conversation.AttachVideoToLiveSession");
     uint RequestId = skypeRef.encoder.AddMethodHeader(ClassId, 147, OID);
     skypeRef.encoder.AddObjectParam(1, sendVideo);
     skypeRef.transport.SubmitMethodRequest (RequestId);
     skypeRef.decoder.DecodeMethodResponseWithNoArguments("SktConversation.AttachVideoToLiveSession");
 }
示例#18
0
        // This will autostart the video when a video device becomes available and swicth it ON/OFF
        // on subsequent calls.
        public void ToggleVideo()
        {
            if (isRunning)
            {
                video.Stop();
                renderer.Stop();
                isRunning = false;
                return;
            }

            isRunning = true;

            // no webcam
            if (videoDeviceSelector.Items.Count == 0) return;

            VideoDevice device = (VideoDevice)videoDeviceSelector.SelectedItem;

            // This retrieves a video object for testing local webcam.
            // Unlike normal video objects, this one does not take place in context of a conversation.
            video = skype.CreatePreviewVideo(SktVideo.MEDIATYPE.MEDIA_VIDEO, device.name, device.path);

            // Associating the video object with renderer and starting both.
            renderer.VideoObject = video;

            video.Start();
            renderer.Start();
        }