示例#1
0
 public static void onSubscribeResultDE_(string strUid, AliRtcAudioTrack audioTrack, AliRtcVideoTrack videoTrack)
 {
     if (videoTrack == AliRtcVideoTrack.AliRtcVideoTrackNo ||
         videoTrack == AliRtcVideoTrack.AliRtcVideoTrackEnd)
     {
         DeleteViewInfo(strUid, AliRtcVideoTrack.AliRtcVideoTrackCamera);
         DeleteViewInfo(strUid, AliRtcVideoTrack.AliRtcVideoTrackScreen);
     }
     else if (videoTrack == AliRtcVideoTrack.AliRtcVideoTrackCamera)
     {
         Panel panel_camera;
         DeleteViewInfo(strUid, AliRtcVideoTrack.AliRtcVideoTrackScreen);
         findOrCreatPanel_(strUid, videoTrack, out panel_camera);
         Debug.Assert(panel_camera != null);
         ImportDll.setRemoteViewConfig(panel_camera.Handle, strUid, videoTrack,
                                       AliRtcRenderMode.AliRtcRenderModeFill, AliRtcScaleRatio.AliRtcScaleRatio_16_9, false);
     }
     else if (videoTrack == AliRtcVideoTrack.AliRtcVideoTrackScreen)
     {
         Panel panel_screen;
         DeleteViewInfo(strUid, AliRtcVideoTrack.AliRtcVideoTrackCamera);
         findOrCreatPanel_(strUid, videoTrack, out panel_screen);
         Debug.Assert(panel_screen != null);
         ImportDll.setRemoteViewConfig(panel_screen.Handle, strUid, videoTrack,
                                       AliRtcRenderMode.AliRtcRenderModeFill, AliRtcScaleRatio.AliRtcScaleRatio_16_9, false);
     }
     else if (videoTrack == AliRtcVideoTrack.AliRtcVideoTrackBoth)
     {
         Panel panel_camera;
         Panel panel_screen;
         findOrCreatPanel_(strUid, AliRtcVideoTrack.AliRtcVideoTrackCamera, out panel_camera);
         findOrCreatPanel_(strUid, AliRtcVideoTrack.AliRtcVideoTrackScreen, out panel_screen);
         Debug.Assert(panel_camera != null);
         Debug.Assert(panel_screen != null);
         ImportDll.setRemoteViewConfig(panel_camera.Handle, strUid, AliRtcVideoTrack.AliRtcVideoTrackCamera,
                                       AliRtcRenderMode.AliRtcRenderModeFill, AliRtcScaleRatio.AliRtcScaleRatio_16_9, false);
         ImportDll.setRemoteViewConfig(panel_screen.Handle, strUid, AliRtcVideoTrack.AliRtcVideoTrackScreen,
                                       AliRtcRenderMode.AliRtcRenderModeFill, AliRtcScaleRatio.AliRtcScaleRatio_16_9, false);
     }
     Layout_RemoteView_();
 }
示例#2
0
        public static void onSubscribeResultDE(string strUid, AliRtcAudioTrack audioTrack, AliRtcVideoTrack videoTrack)
        {
            if (videoTrack == AliRtcVideoTrack.AliRtcVideoTrackNo ||
                videoTrack == AliRtcVideoTrack.AliRtcVideoTrackEnd)
            {
                if (m_uidList.Contains(strUid))
                {
                    m_uidList.Remove(strUid);
                }
                if (m_camaraUid2panelHash.Contains(strUid))
                {
                    m_camaraUid2panelHash.Remove(strUid);
                }
                if (m_screenUid2panelHash.Contains(strUid))
                {
                    m_screenUid2panelHash.Remove(strUid);
                }
            }

            else if (videoTrack == AliRtcVideoTrack.AliRtcVideoTrackCamera)
            {
                if (!m_uidList.Contains(strUid))
                {
                    m_uidList.AddLast(strUid);
                }
                if (m_screenUid2panelHash.Contains(strUid))
                {
                    m_screenUid2panelHash.Remove(strUid);
                }
                Panel panel_camera;
                findOrCreatPanel(strUid, videoTrack, out panel_camera);
                Debug.Assert(panel_camera != null);
                ImportDll.setRemoteViewConfig(panel_camera.Handle, strUid, videoTrack,
                                              AliRtcRenderMode.AliRtcRenderModeAuto, AliRtcScaleRatio.AliRtcScaleRatio_16_9, false);
            }
            else if (videoTrack == AliRtcVideoTrack.AliRtcVideoTrackScreen)
            {
                if (!m_uidList.Contains(strUid))
                {
                    m_uidList.AddLast(strUid);
                }
                if (m_camaraUid2panelHash.Contains(strUid))
                {
                    m_camaraUid2panelHash.Remove(strUid);
                }
                Panel panel_screen;
                findOrCreatPanel(strUid, videoTrack, out panel_screen);
                Debug.Assert(panel_screen != null);
                ImportDll.setRemoteViewConfig(panel_screen.Handle, strUid, videoTrack,
                                              AliRtcRenderMode.AliRtcRenderModeAuto, AliRtcScaleRatio.AliRtcScaleRatio_16_9, false);
            }
            else if (videoTrack == AliRtcVideoTrack.AliRtcVideoTrackBoth)
            {
                if (!m_uidList.Contains(strUid))
                {
                    m_uidList.AddLast(strUid);
                }
                Panel panel_camera;
                Panel panel_screen;
                findOrCreatPanel(strUid, AliRtcVideoTrack.AliRtcVideoTrackCamera, out panel_camera);
                findOrCreatPanel(strUid, AliRtcVideoTrack.AliRtcVideoTrackScreen, out panel_screen);
                Debug.Assert(panel_camera != null);
                Debug.Assert(panel_screen != null);
                ImportDll.setRemoteViewConfig(panel_camera.Handle, strUid, AliRtcVideoTrack.AliRtcVideoTrackCamera,
                                              AliRtcRenderMode.AliRtcRenderModeAuto, AliRtcScaleRatio.AliRtcScaleRatio_16_9, false);
                ImportDll.setRemoteViewConfig(panel_screen.Handle, strUid, AliRtcVideoTrack.AliRtcVideoTrackScreen,
                                              AliRtcRenderMode.AliRtcRenderModeAuto, AliRtcScaleRatio.AliRtcScaleRatio_16_9, false);
            }
            Layout_RemoteView();
        }