示例#1
0
        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);
        }
示例#2
0
        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);
        }
示例#3
0
        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);
        }
示例#4
0
        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);
        }
示例#5
0
 protected void HandleBroadcastStopped()
 {
     mSubmitFrameTimer.Enabled = false;
     mFrameGenerator = null;
     mMetaDataGroup.Enabled = false;
 }
示例#6
0
 protected void HandleBroadcastStopped()
 {
     mSubmitFrameTimer.Enabled = false;
     mFrameGenerator           = null;
     mMetaDataGroup.Enabled    = false;
 }