public override void OnServerHandshake(AudioServerHandshake handshake) { AvailableFormats = handshake.Formats; ActiveFormat = AvailableFormats[0]; SendClientHandshake(ActiveFormat); HandshakeDone = true; }
public MediaCoreConsumer(Android.Graphics.SurfaceTexture surface, Packets.AudioFormat audioFormat, Packets.VideoFormat videoFormat) { _video = new VideoHandler(surface, videoFormat); _audio = new AudioHandler(audioFormat); //TODO: Setup dynamically _video.SetupVideo((int)videoFormat.Width, (int)videoFormat.Height, null, null); _audio.SetupAudio((int)audioFormat.SampleRate, (int)audioFormat.Channels, null); }
public override void OnServerHandshake(AudioServerHandshake handshake) { AvailableFormats = handshake.Formats; ActiveFormat = AvailableFormats[0]; SendClientHandshake(ActiveFormat); HandshakeDone = true; FeedAudioFormat?.Invoke(this, new AudioFormatEventArgs(ActiveFormat)); }
/* * Protocol */ public async Task StartStream(SurfaceTexture surface) { System.Diagnostics.Debug.WriteLine($"Connecting to console..."); _smartGlassClient = await SmartGlassClient.ConnectAsync(_hostName); // Get general gamestream configuration var config = GamestreamConfiguration.GetStandardConfig(); /* Modify standard config, if desired */ var broadcastChannel = _smartGlassClient.BroadcastChannel; var session = await broadcastChannel.StartGamestreamAsync(config); System.Diagnostics.Debug.WriteLine( $"Connecting to Nano, TCP: {session.TcpPort}, UDP: {session.UdpPort}"); _nanoClient = new NanoClient(_hostName, session); // General Handshaking & Opening channels await _nanoClient.InitializeProtocolAsync(); // Audio & Video client handshaking // Sets desired AV formats Packets.AudioFormat audioFormat = _nanoClient.AudioFormats[0]; Packets.VideoFormat videoFormat = _nanoClient.VideoFormats[0]; await _nanoClient.InitializeStreamAsync(audioFormat, videoFormat); // Start ChatAudio channel Packets.AudioFormat chatAudioFormat = new Packets.AudioFormat(1, 24000, AudioCodec.Opus); await _nanoClient.OpenChatAudioChannelAsync(chatAudioFormat); _mcConsumer = new MediaCoreConsumer(surface, audioFormat, videoFormat); _nanoClient.AddConsumer(_mcConsumer); // Tell console to start sending AV frames await _nanoClient.StartStreamAsync(); // Start Controller input channel await _nanoClient.OpenInputChannelAsync(1280, 720); System.Diagnostics.Debug.WriteLine($"Nano connected and running."); }
public AudioHandler(Packets.AudioFormat format) { _audioFormat = format; _audioFrameQueue = new Queue <Consumer.AACFrame>(); }