예제 #1
0
        private void buttonJoin_Click(object sender, EventArgs e)
        {
            UnifiedDotNetSample.RoomLink roomLink = new UnifiedDotNetSample.RoomLink();
            roomLink.ShowDialog();
            if (!roomLink.m_bMakeCall)
            {
                return;
            }

            Vidyo32.VidyoClientInEventRoomLink guestJoin = new Vidyo32.VidyoClientInEventRoomLink();

            guestJoin.portalUri      = roomLink.m_strPortal;
            guestJoin.roomKey        = roomLink.m_strRoomKey;
            guestJoin.displayName    = roomLink.m_strDisplayName;
            guestJoin.pin            = roomLink.m_strPin;
            guestJoin.clientType     = VGUClientLogic.Vidyo32.VidyoClientClientType.VIDYO_CLIENT_CLIENTTYPE_W;
            guestJoin.muteCamera     = Vidyo32.VidyoBool.VIDYO_FALSE;
            guestJoin.muteMicrophone = Vidyo32.VidyoBool.VIDYO_FALSE;
            guestJoin.muteSpeaker    = Vidyo32.VidyoBool.VIDYO_FALSE;

            int    Gsize = Marshal.SizeOf(guestJoin);
            IntPtr Gptr  = Marshal.AllocCoTaskMem(Gsize);

            Marshal.StructureToPtr(guestJoin, Gptr, false);

            Int32 Guest = Vidyo32.VidyoClientSendEvent(Vidyo32.VidyoClientInEvent.VIDYO_CLIENT_IN_EVENT_ROOM_LINK, Gptr, Gsize);
        }
예제 #2
0
        private void buttonMuteMic_Click(object sender, EventArgs e)
        {
            Vidyo32.VidyoClientInEventMute mute = new Vidyo32.VidyoClientInEventMute();
            mute.isMuted = (IsFlagSet(cMicMuted)) ? Vidyo32.VidyoBool.VIDYO_FALSE : Vidyo32.VidyoBool.VIDYO_TRUE;
            int    Gsize = Marshal.SizeOf(mute);
            IntPtr Gptr  = Marshal.AllocCoTaskMem(Gsize);

            Marshal.StructureToPtr(mute, Gptr, false);

            Int32 Guest = Vidyo32.VidyoClientSendEvent(Vidyo32.VidyoClientInEvent.VIDYO_CLIENT_IN_EVENT_MUTE_AUDIO_IN, Gptr, Gsize);
        }
예제 #3
0
        private void buttonShare_Click(object sender, EventArgs e)
        {
            Vidyo32.VidyoClientRequestGetAlarms Alarm = new Vidyo32.VidyoClientRequestGetAlarms();

            int    szAlarm  = Marshal.SizeOf(Alarm);
            IntPtr ptrAlarm = Marshal.AllocCoTaskMem(szAlarm);

            Marshal.StructureToPtr(Alarm, ptrAlarm, true);
            uint errAlarm = Vidyo32.VidyoClientSendRequest(Vidyo32.VidyoClientRequest.VIDYO_CLIENT_REQUEST_GET_ALARMS, ptrAlarm, szAlarm);

            if (errAlarm == 0)
            {
                Vidyo32.VidyoClientRequestGetAlarms CurrentAlarm = (Vidyo32.VidyoClientRequestGetAlarms)Marshal.PtrToStructure(ptrAlarm, typeof(Vidyo32.VidyoClientRequestGetAlarms));
            }


            Vidyo32.VidyoClientRequestGetWindowsAndDesktops shares = new Vidyo32.VidyoClientRequestGetWindowsAndDesktops();
            shares.Init();

            int szShares = Marshal.SizeOf(shares);

            IntPtr ptrShares = Marshal.AllocCoTaskMem(szShares);

            Marshal.StructureToPtr(shares, ptrShares, true);
            uint error = Vidyo32.VidyoClientSendRequest(Vidyo32.VidyoClientRequest.VIDYO_CLIENT_REQUEST_GET_WINDOWS_AND_DESKTOPS,
                                                        ptrShares, szShares);

            if (error != 0)
            {
                return;
            }

            Vidyo32.VidyoClientRequestGetWindowsAndDesktops currentShares = (Vidyo32.VidyoClientRequestGetWindowsAndDesktops)Marshal.PtrToStructure(ptrShares, typeof(Vidyo32.VidyoClientRequestGetWindowsAndDesktops));


            if (currentShares.numSystemDesktops > 0)
            {
                // string firstDesktopId = Marshal.PtrToStringAuto(currentShares.sysDesktopId[0]);
                string firstDesktopId = currentShares.sysDesktopId[0];
                Vidyo32.VidyoClientInEventShare sharePara = new Vidyo32.VidyoClientInEventShare();
                sharePara.shareType = Vidyo32.VidyoClientContentsShareType.VIDYO_CLIENT_CONTENTS_SHARE_TYPE_DESKTOP_WINDOW;
                sharePara.window    = (IntPtr)1;
                sharePara.desktopId = firstDesktopId;

                int    sizeOfShareEvent = Marshal.SizeOf(sharePara);
                IntPtr sharePtr         = Marshal.AllocCoTaskMem(sizeOfShareEvent);
                Marshal.StructureToPtr(sharePara, sharePtr, false);

                Int32 returnValue = Vidyo32.VidyoClientSendEvent(Vidyo32.VidyoClientInEvent.VIDYO_CLIENT_IN_EVENT_SHARE, sharePtr, sizeOfShareEvent);

                return;
            }
        }
예제 #4
0
        private void pnlVideoArea_SizeChanged(object sender, EventArgs e)
        {
            Vidyo32.VidyoClientInEventResize EventResize = new Vidyo32.VidyoClientInEventResize();
            if (true)//(inSizing)
            {
                EventResize.width  = (uint)pnlVideoArea.Width;
                EventResize.height = (uint)pnlVideoArea.Height;
            }
            int    szEventResize  = Marshal.SizeOf(EventResize);
            IntPtr ptrEventResize = Marshal.AllocCoTaskMem(szEventResize);

            Marshal.StructureToPtr(EventResize, ptrEventResize, true);
            Vidyo32.VidyoClientSendEvent(Vidyo32.VidyoClientInEvent.VIDYO_CLIENT_IN_EVENT_RESIZE, ptrEventResize, szEventResize);
        }
예제 #5
0
        public void StopLib()
        {
            if (IsFlagSet(cCallStarted))
            {
                SetFlag(cApplicationClosing);
                Vidyo32.VidyoClientSendEvent(Vidyo32.VidyoClientInEvent.VIDYO_CLIENT_IN_EVENT_LEAVE, (IntPtr)0, 0);
                return;
            }

            if (IsFlagSet(cVcStarted))
            {
                ClearFlag(cVcStarted);
                Vidyo32.VidyoClientStop();
            }
            Vidyo32.VidyoClientUninitialize();
            Application.Exit();
        }
예제 #6
0
        private void buttonShareWnd_Click(object sender, EventArgs e)
        {
            Vidyo32.VidyoClientRequestGetWindowsAndDesktops shares = new Vidyo32.VidyoClientRequestGetWindowsAndDesktops();
            shares.Init();

            int szShares = Marshal.SizeOf(shares);

            IntPtr ptrShares = Marshal.AllocCoTaskMem(szShares);

            Marshal.StructureToPtr(shares, ptrShares, true);
            int szShares2 = Marshal.SizeOf(ptrShares);

            uint error = Vidyo32.VidyoClientSendRequest(Vidyo32.VidyoClientRequest.VIDYO_CLIENT_REQUEST_GET_WINDOWS_AND_DESKTOPS,
                                                        ptrShares, szShares);

            if (error != 0)
            {
                return;
            }

            Vidyo32.VidyoClientRequestGetWindowsAndDesktops currentShares = (Vidyo32.VidyoClientRequestGetWindowsAndDesktops)Marshal.PtrToStructure(ptrShares, typeof(Vidyo32.VidyoClientRequestGetWindowsAndDesktops));
            if (currentShares.numApplicationWindows <= m_indexWindow)
            {
                m_indexWindow = 0;
            }

            if (currentShares.numApplicationWindows > m_indexWindow)
            {
                Vidyo32.VidyoClientInEventShare sharePara = new Vidyo32.VidyoClientInEventShare();
                sharePara.shareType = Vidyo32.VidyoClientContentsShareType.VIDYO_CLIENT_CONTENTS_SHARE_TYPE_APPLICATION_WINDOW;
                sharePara.window    = (IntPtr)currentShares.appWindowId[m_indexWindow++];

                int    sizeOfShareEvent = Marshal.SizeOf(sharePara);
                IntPtr sharePtr         = Marshal.AllocCoTaskMem(sizeOfShareEvent);
                Marshal.StructureToPtr(sharePara, sharePtr, false);

                Int32 returnValue = Vidyo32.VidyoClientSendEvent(Vidyo32.VidyoClientInEvent.VIDYO_CLIENT_IN_EVENT_SHARE, sharePtr, sizeOfShareEvent);

                return;
            }
        }
예제 #7
0
 private void buttonEnd_Click(object sender, EventArgs e)
 {
     Vidyo32.VidyoClientSendEvent(Vidyo32.VidyoClientInEvent.VIDYO_CLIENT_IN_EVENT_LEAVE, (IntPtr)0, 0);
 }
예제 #8
0
        unsafe  //unsafe for parsing messageCode Array

        void MessageFromVidyoClient(Vidyo32.VidyoClientOutEvent actionType, IntPtr param, uint paramSize, IntPtr ptr2)
        {
            string now     = DateTime.Now.ToString("HH:mm:ss:fff") + "  + ";
            string message = now + "Out Event from Vidyoclient: " + actionType;

            switch (actionType)
            {
            case Vidyo32.VidyoClientOutEvent.VIDYO_CLIENT_OUT_EVENT_SIGN_IN:
            {
                Vidyo32.VidyoClientOutEventSignIn eventSignIn = (Vidyo32.VidyoClientOutEventSignIn)Marshal.PtrToStructure(param, typeof(Vidyo32.VidyoClientOutEventSignIn));

                if (eventSignIn.activeEid == 0)
                {
                    //we need to consume a license
                    //As VidyoClient just informed that we never consume a license
                    Vidyo32.VidyoClientSendEvent(Vidyo32.VidyoClientInEvent.VIDYO_CLIENT_IN_EVENT_LICENSE, (IntPtr)0, 0);
                }
            }
            break;

            case Vidyo32.VidyoClientOutEvent.VIDYO_CLIENT_OUT_EVENT_ROOM_LINK:
            {
                Vidyo32.VidyoClientOutEventRoomLink guestLink = (Vidyo32.VidyoClientOutEventRoomLink)Marshal.PtrToStructure(param, typeof(Vidyo32.VidyoClientOutEventRoomLink));

                message += " Error = " + guestLink.error;
                message += "state =" + guestLink.state;
            } break;

            case Vidyo32.VidyoClientOutEvent.VIDYO_CLIENT_OUT_EVENT_CONFERENCE_CLEARED:
            {
                if (IsFlagSet(cApplicationClosing))
                {
                    //we were just waiting for application leave to come to restart closing process
                    ClearFlag(cCallStarted);
                    ClearFlag(cApplicationClosing);
                    StopLib();
                }
            }
            break;

            case Vidyo32.VidyoClientOutEvent.VIDYO_CLIENT_OUT_EVENT_CONFERENCE_ACTIVE:
            {
                SetFlag(cCallStarted);
            }
            break;

            case Vidyo32.VidyoClientOutEvent.VIDYO_CLIENT_OUT_EVENT_MUTED_VIDEO:
            {
                Vidyo32.VidyoClientOutEventMuted muteInfo = (Vidyo32.VidyoClientOutEventMuted)Marshal.PtrToStructure(param, typeof(Vidyo32.VidyoClientOutEventMuted));
                if (muteInfo.isMuted == Vidyo32.VIDYO_TRUE)
                {
                    SetFlag(cVideoMuted);
                }
                else
                {
                    ClearFlag(cVideoMuted);
                }
            }
            break;

            case Vidyo32.VidyoClientOutEvent.VIDYO_CLIENT_OUT_EVENT_MUTED_AUDIO_IN:
            {
                Vidyo32.VidyoClientOutEventMuted muteInfo = (Vidyo32.VidyoClientOutEventMuted)Marshal.PtrToStructure(param, typeof(Vidyo32.VidyoClientOutEventMuted));
                if (muteInfo.isMuted == Vidyo32.VIDYO_TRUE)
                {
                    SetFlag(cMicMuted);
                }
                else
                {
                    ClearFlag(cMicMuted);
                }
            }
            break;


                #region  VIDYO_CLIENT_OUT_EVENT(s) RINGING, CALLING AND RPOGRESS


                #endregion  VIDYO_CLIENT_OUT_EVENT(s) RINGING, CALLING AND RPOGRESS
            default:
            {
            }
            break;
            }
        }