private void mStartButtonRecommended_Click(object sender, EventArgs e) { uint fps = (uint)mFramesPerSecondSelector.Value; uint maxKbps = (uint)mMaxKbpsTrackbar.Value; string[] arr = mAspectRatioCombo.Text.Split(':'); float aspectRatio = float.Parse(arr[0]) / float.Parse(arr[1]); Twitch.Broadcast.VideoParams videoParams = mBroadcastController.GetRecommendedVideoParams(maxKbps, fps, 0.1f, aspectRatio); mBroadcastController.EnableAudio = mEnableAudioCheckbox.Checked; if (!mBroadcastController.StartBroadcasting(videoParams)) { return; } mSubmitFrameTimer.Interval = 1000 / (int)fps; mFrameGenerator = new Twitch.Test.TestFrameGenerator(videoParams.OutputWidth, videoParams.OutputHeight); }
private void mStartButton_Click(object sender, EventArgs e) { if (mResolutionCombo.SelectedItem == null) { return; } string[] resolution = mResolutionCombo.SelectedItem.ToString().Split(new char[] { 'x' }); uint width = uint.Parse(resolution[0]); uint height = uint.Parse(resolution[1]); uint fps = (uint)mFramesPerSecondSelector.Value; Twitch.Broadcast.VideoParams videoParams = mBroadcastController.GetRecommendedVideoParams(width, height, fps); mBroadcastController.EnableAudio = mEnableAudioCheckbox.Checked; if (!mBroadcastController.StartBroadcasting(videoParams)) { return; } mFrameGenerator = new Twitch.Test.TestFrameGenerator(width, height); }
private void mStartButton_Click(object sender, EventArgs e) { if (mResolutionCombo.SelectedItem == null) { return; } string[] resolution = mResolutionCombo.SelectedItem.ToString().Split(new char[]{'x'}); uint width = uint.Parse(resolution[0]); uint height = uint.Parse(resolution[1]); uint fps = (uint)mFramesPerSecondSelector.Value; Twitch.Broadcast.VideoParams videoParams = mBroadcastController.GetRecommendedVideoParams(width, height, fps); mBroadcastController.EnableAudio = mEnableAudioCheckbox.Checked; if (!mBroadcastController.StartBroadcasting(videoParams)) { return; } mFrameGenerator = new Twitch.Test.TestFrameGenerator(width, height); }
protected void HandleBroadcastStopped() { mSubmitFrameTimer.Enabled = false; mFrameGenerator = null; mMetaDataGroup.Enabled = false; }