public GLSketchViewer(GraphicsInterface gi, int width, int height) { fDynamicTexture = new SnapNGLView.DynamicTexture(gi, width, height, 3); // Create the backing buffer to retain the image backingBuffer = new PixelBuffer24(width, height); //backingBuffer.DeviceContext.ClearToWhite(); // 1. Show a dialog box to allow the user to type in the // group IP address and port number. HostForm groupForm = new HostForm(); groupForm.ShowDialog(); // 2. Get the address and port from the form, and use // them to setup the MultiSession object string groupIP = groupForm.groupAddressField.Text; int groupPort = int.Parse(groupForm.groupPortField.Text); IPEndPoint ipep = new IPEndPoint(IPAddress.Parse(groupIP), groupPort); // Create the session fSession = new MultiSession(Guid.NewGuid().ToString(), ipep); // Add the channel for graphics commands fSketchChannel = fSession.CreateChannel(PayloadType.Whiteboard); // 3. Setup the chunk decoder so we can receive new images // when they come in fChunkDecoder = new GraphPortChunkDecoder(backingBuffer, fSketchChannel); fChunkDecoder.PixBltPixelBuffer24Handler += this.PixBltPixelBuffer24; fChunkDecoder.PixBltLumbHandler += this.PixBltLum24; //fSketchChannel.FrameReceivedEvent += FrameReceived; }
public Form1() : base("Snap N Viewer", 20, 20, 640, 480) { fAutoScale = true; // Create the backing buffer to retain the image fBackingBuffer = new GDIDIBSection(1600, 1200); // 1. Show a dialog box to allow the user to type in the // group IP address and port number. HostForm groupForm = new HostForm(); //groupForm.ShowDialog(); // 2. Get the address and port from the form, and use // them to setup the MultiSession object string groupIP = groupForm.groupAddressField.Text; int groupPort = int.Parse(groupForm.groupPortField.Text); IPEndPoint ipep = new IPEndPoint(IPAddress.Parse(groupIP), groupPort); Title = "Snap N Viewer - " + ipep.ToString(); fSession = new MultiSession(Guid.NewGuid().ToString(), ipep); fSketchChannel = fSession.CreateChannel(PayloadType.dynamicPresentation); // 3. Setup the chunk decoder so we can receive new images // when they come in fChunkDecoder = new GraphPortChunkDecoder(fBackingBuffer, fSketchChannel); fChunkDecoder.PixBltPixelBuffer24Handler += this.PixBltPixelBuffer24; fChunkDecoder.PixBltLumbHandler += this.PixBltLum24; }
public GraphPortChunkDecoder(GDIDIBSection pixMap, PayloadChannel channel) { fGrayImage = new PixelArray<Lumb>(pixMap.Width, pixMap.Height); fChannel = channel; fChannel.FrameReceivedEvent += FrameReceived; fPixMap = pixMap; }
public UICommandSender(PayloadChannel channel) { fCollaborationChannel = channel; // Create the sending graph port fChunkEncoder = new GraphPortChunkEncoder(); fChunkEncoder.ChunkPackedEvent += new GraphPortChunkEncoder.ChunkPacked(GDIChunkPacked); AddPort(fChunkEncoder); }
public VideoSender(int deviceIndex, PayloadChannel channel) { fChannel = channel; fImageStream = new MemoryStream(1024); fCamera = VideoCaptureDevice.CreateCaptureDeviceFromIndex(0, -1, -1); PrintCamera(fCamera); fCamera.NewFrame += new CameraEventHandler(ReceiveFrameFromCamera); }
public SketchViewer(PayloadChannel channel, int width, int height) { fSketchChannel = channel; // Create the backing buffer to retain the image fBackingBuffer = new PixelBuffer24(width, height); // Create the decoder and assign ourself to received // decoded methods fChunkDecoder = new GraphPortChunkDecoder(fBackingBuffer, fSketchChannel); fChunkDecoder.AddPort(this); }
public Form1() :base("Camera Server", 10, 10, 320, 240) { string groupIP = "234.5.7.15"; int groupPort = 5004; IPEndPoint ipep = new IPEndPoint(IPAddress.Parse(groupIP), groupPort); fSession = new MultiSession(Guid.NewGuid().ToString(), ipep); fChannel = fSession.CreateChannel(PayloadType.xApplication3); fCameraSender = new VideoSender(0, fChannel); fCameraSender.Start(); }
public Form1() { InitializeComponent(); // Setup the audio processing stuff fSpeakers = new WaveSpeaker(); IPAddress address = IPAddress.Parse("239.5.7.15"); IPEndPoint ep = new IPEndPoint(address, 5004); fSession = new MultiSession(ep, Guid.NewGuid().ToString(), Environment.UserName, true, true, null); fAudioChannel = fSession.CreateChannel(PayloadType.dynamicAudio); fAudioChannel.FrameReceivedEvent += new RtpStream.FrameReceivedEventHandler(ReceivedAudioEvent); }
DesktopSnapper fSnapper; // The object that managers the snapshots public DDHostTrayApp() { // Create a simple tray menu with only one item. trayMenu = new ContextMenu(); menu_Settings=new MenuItem("Settings", OnSettingsSelect); menu_Sharing = new MenuItem("Sharing", OnChangeSharing); menu_RemoteControl = new MenuItem("Remote Control", OnRemoteControl); menu_Gray = new MenuItem("Gray", OnChangeGray); menu_Exit = new MenuItem("Exit", OnExit); trayMenu.MenuItems.Add(menu_Settings); trayMenu.MenuItems.Add(menu_RemoteControl); trayMenu.MenuItems.Add(menu_Sharing); trayMenu.MenuItems.Add(menu_Gray); trayMenu.MenuItems.Add(new MenuItem("-")); trayMenu.MenuItems.Add(menu_Exit); // Create a tray icon. In this example we use a // standard system icon for simplicity, but you // can of course use your own custom icon too. trayIcon = new NotifyIcon(); trayIcon.Text = "DD Host"; trayIcon.Icon = new Icon("computer.ico"); // Add menu to tray icon and show it. trayIcon.ContextMenu = trayMenu; trayIcon.Visible = true; trayIcon.MouseDown += new System.Windows.Forms.MouseEventHandler(DDHostTrayApp_MouseDown); trayIcon.ShowBalloonTip(0, "DD Host", "Right Click for Settings", ToolTipIcon.Info); trayIcon.BalloonTipShown += new EventHandler(trayIcon_BalloonTipShown); // Create the communications sessions fGroupEndPoint = new IPEndPoint(IPAddress.Parse("234.5.7.15"), 5004); fSession = new MultiSession(Guid.NewGuid().ToString(), fGroupEndPoint); fGraphicsChannel = fSession.CreateChannel(PayloadType.dynamicPresentation); fUserIOChannel = fSession.CreateChannel(PayloadType.xApplication2); fSnapper = new DesktopSnapper(fGraphicsChannel, fUserIOChannel, true); menu_Gray.Checked = fSnapper.SendLuminance; menu_RemoteControl.Checked = fSnapper.AllowRemoteControl; menu_Sharing.Checked = fSnapper.ActivelySharing; }
public SketchView(MultiSession session, int width, int height) { fSession = session; // Create the backing buffer to retain the image backingBuffer = GDIDIBSection.Create(width, height); GDIContext bufferContext = GDIContext.CreateForBitmap(backingBuffer); bufferContext.ClearToWhite(); fBackingGraphPort = new GDIRenderer(bufferContext); //fBackingGraphPort.ClearToWhite(); // Add the channel for graphics commands fSketchChannel = fSession.CreateChannel(PayloadType.Whiteboard); fChunkDecoder = new GraphPortChunkDecoder(); fChunkDecoder.AddGraphPort(fBackingGraphPort); fSketchChannel.FrameReceivedEvent += new RtpStream.FrameReceivedEventHandler(GDICommandReceived); }
//Bitmap fPreviewBitmap; //GDIRenderer fRenderer; //GDIContext fRendererContext; public MainForm() { InitializeComponent(); fSetupControl = new CaptureDeviceSetupPage(); //this.Controls.Add(fSetupControl); splitContainer1.Panel1.Controls.Add(fSetupControl); string groupIP = "234.5.7.15"; int groupPort = 5004; IPEndPoint ipep = new IPEndPoint(IPAddress.Parse(groupIP), groupPort); fSession = new MultiSession(Guid.NewGuid().ToString(), ipep); fChannel = fSession.CreateChannel(PayloadType.dynamicPresentation); fCameraSender = new VideoSender(0, fChannel); //fPreviewBitmap = new Bitmap(fCameraSender.Width, fCameraSender.Height, fCameraSender.ReceivedVideoFrameEvent += new VideoSender.ReceivedVideoFrameHandler(fCameraSender_ReceivedVideoFrameEvent); fCameraSender.Start(); }
public Form1() { InitializeComponent(); IPAddress address = IPAddress.Parse("239.5.7.15"); IPEndPoint ep = new IPEndPoint(address, 5010); fSession = new MultiSession(ep, Guid.NewGuid().ToString(), Environment.UserName, true, true, null); fAudioChannel = fSession.CreateChannel(PayloadType.dynamicAudio); fMicrophone = new WaveMicrophone(1, 11025, 8, 1.0 / 10.0); fSpeakers = new WaveSpeaker(1, 11025, 8, 1.0/10.0) ; // Startup a thread to process the audio as it comes in stopProcessing = false; processingStopped = new AutoResetEvent(false); audioProcessor = new Thread(ProcessAudio); audioProcessor.IsBackground = true; audioProcessor.Start(); }
ConferenceSession(IPEndPoint endPoint, string uniqueName, string friendlyName, bool rtpTraffic, bool receiveData, IPEndPoint reflector) : base() { fModel = new ShowItModel(this); // Step 1 fLocalParticipant = new RtpParticipant(uniqueName, friendlyName); if (null == reflector) Session = new RtpSession(endPoint, fLocalParticipant, true, true); else Session = new RtpSession(endPoint, fLocalParticipant, true, true, reflector); HookRtpEvents(); // After everything is setup, initialize the session, which will // start the network messages flowing. Session.Initialize(); // Create the three channels that are used in the conference fDesktopChannel = CreateChannel(PayloadType.xApplication2); fDesktopChannel.FrameReceivedEvent += new RtpStream.FrameReceivedEventHandler(ReceiveDesktopFrame); fAudioChannel = CreateChannel(PayloadType.xApplication3); fAudioChannel.FrameReceivedEvent += new RtpStream.FrameReceivedEventHandler(ReceiveAudioFrame); fVideoChannel = CreateChannel(PayloadType.xApplication4); fVideoChannel.FrameReceivedEvent += new RtpStream.FrameReceivedEventHandler(ReceiveVideoFrame); // Wait until the channels are ready // to send before proceeding do { Thread.Sleep(10); } while (!fDesktopChannel.IsReadyToSend && !fAudioChannel.IsReadyToSend && !fVideoChannel.IsReadyToSend); }
protected virtual void AddChannels() { // Add the channel for graphics commands fSketchChannel = fSession.CreateChannel(PayloadType.Whiteboard); fGraphicsChannel = new GraphicsChannel(fRetainedGraphPort, fSketchChannel); }
public SnapperWindow(int x, int y, int width, int height) : base("Snap N Share", 10, 10, 640, 480) { // Show a form so we can capture the desired group IP and port number ServerForm groupForm = new ServerForm(); //IPAddress randomAddress = NewTOAPIA.Net.Utility.GetRandomMulticastAddress(); //groupForm.groupAddressField.Text = randomAddress.ToString(); groupForm.ShowDialog(); // Get the address and port from the form fUseGray = groupForm.checkBox1.Checked; string groupIP = groupForm.groupAddressField.Text; int groupPort = int.Parse(groupForm.groupPortField.Text); IPEndPoint ipep = new IPEndPoint(IPAddress.Parse(groupIP), groupPort); // Set our title to the address specified so the user // can easily identify their session. Title = "SnapNShare - " + ipep.ToString(); fSnapper = new ScreenSnapper(); fClientOrigin = new POINT(); int pwidth = ClientRectangle.Width; int pheight = ClientRectangle.Height; fScreenImage = new GDIDIBSection(width, height, BitCount.Bits24); fGrayImage = new PixelArray<Lumb>(width, height,fScreenImage.Orientation, new Lumb()); BackgroundColor = RGBColor.White; this.Opacity = 0.5; // Create the MultiSession object so we can send stuff out to a group //fSession = new MultiSession(Guid.NewGuid().ToString(), ipep); fSession = new MultiSession(ipep, Guid.NewGuid().ToString(), "William", true, true, null); // Add the channel for graphics commands PayloadChannel payloadChannel = fSession.CreateChannel(PayloadType.dynamicPresentation); fCommandDispatcher = new GraphPortChunkEncoder(payloadChannel); fUserIOChannel = fSession.CreateChannel(PayloadType.xApplication2); //fUserIOEncoder = new UserIOChannelEncoder(fUserIOChannel); //fUserIODecoder = new UserIOChannelDecoder(fUserIOChannel); //fUserIODecoder.MouseActivityEvent += new MouseActivityEventHandler(fUserIODecoder_MouseActivityEvent); //fUserIODecoder.KeyboardActivityEvent += new KeyboardActivityEventHandler(fUserIODecoder_KeyboardActivityEvent); // Start the thread that will take snapshots of the screen fGlobalTimer = new PrecisionTimer(); fFrameRate = 2; // Frames per second fSnapperRunning = true; snapperThread = new Thread(RunSnaps); snapperThread.Start(); }
public UserIOChannelDecoder(PayloadChannel commandChannel) { fCommandChannel = commandChannel; fCommandChannel.FrameReceivedEvent += FrameReceived; }
public GraphPortChunkEncoder(PayloadChannel aChannel) { fCollaborationChannel = aChannel; }