VideoPage.xaml 5.91 KB
Newer Older
Ghislain MARY's avatar
Ghislain MARY committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
<Page
    x:Class="MS2Tester.VideoPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:ms2_tester"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">

    <Page.BottomAppBar>
        <CommandBar x:Name="CommandBar">
            <AppBarButton x:Name="BackButton" Icon="Back" Label="Back" Click="BackButton_Click"/>
        </CommandBar>
    </Page.BottomAppBar>

    <ScrollViewer>
        <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="*"/>
            </Grid.RowDefinitions>

            <Grid Grid.Row="0" HorizontalAlignment="Center">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="Auto"/>
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
35
                    <RowDefinition Height="Auto"/>
Ghislain MARY's avatar
Ghislain MARY committed
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
                </Grid.RowDefinitions>

                <TextBlock x:Name="CameraLabel" Grid.Row="0" Grid.Column="0" Text="Camera:" VerticalAlignment="Center" Margin="8"/>
                <ComboBox x:Name="CameraComboBox" Grid.Row="0" Grid.Column="1" HorizontalAlignment="Stretch" VerticalAlignment="Center" Margin="8"/>
                <TextBlock x:Name="CodecLabel" Grid.Row="1" Grid.Column="0" Text="Codec:" VerticalAlignment="Center" Margin="8"/>
                <ComboBox x:Name="CodecComboBox" Grid.Row="1" Grid.Column="1" HorizontalAlignment="Stretch" VerticalAlignment="Center" Margin="8">
                    <ComboBoxItem Content="H264"/>
                    <ComboBoxItem Content="VP8" IsSelected="True"/>
                </ComboBox>
                <TextBlock x:Name="VideoSizeLabel" Grid.Row="2" Grid.Column="0" Text="Video size:" VerticalAlignment="Center" Margin="8"/>
                <ComboBox x:Name="VideoSizeComboBox" Grid.Row="2" Grid.Column="1" HorizontalAlignment="Stretch" VerticalAlignment="Center" Margin="8">
                    <ComboBoxItem Content="720P"/>
                    <ComboBoxItem Content="VGA"/>
                    <ComboBoxItem Content="CIF"/>
                    <ComboBoxItem Content="QVGA" IsSelected="True"/>
                    <ComboBoxItem Content="QCIF"/>
                </ComboBox>
                <TextBlock x:Name="FramerateLabel" Grid.Row="3" Grid.Column="0" Text="FPS:" VerticalAlignment="Center" Margin="8"/>
                <ComboBox x:Name="FramerateComboBox" Grid.Row="3" Grid.Column="1" HorizontalAlignment="Stretch" VerticalAlignment="Center" Margin="8">
                    <ComboBoxItem Content="30"/>
                    <ComboBoxItem Content="25"/>
                    <ComboBoxItem Content="20"/>
                    <ComboBoxItem Content="15" IsSelected="True"/>
                    <ComboBoxItem Content="10"/>
                    <ComboBoxItem Content="5"/>
                </ComboBox>
                <TextBlock x:Name="BitrateLabel" Grid.Row="4" Grid.Column="0" Text="Bitrate:" VerticalAlignment="Center" Margin="8"/>
                <TextBox x:Name="BitrateTextBox" Grid.Row="4" Grid.Column="1" Margin="8" IsSpellCheckEnabled="False" IsTextPredictionEnabled="False" InputScope="Number" Text="1500"/>
64 65 66
                <TextBlock x:Name="UsePreviewStreamLabel" Grid.Row="5" Grid.Column="0" Text="Use preview stream:" VerticalAlignment="Center" Margin="8"/>
                <ToggleSwitch x:Name="UsePreviewStreamToggleSwitch" Grid.Row="5" Grid.Column="1" Margin="8" IsOn="False"/>
                <StackPanel Grid.Row="6" Grid.ColumnSpan="2" Orientation="Horizontal">
Ghislain MARY's avatar
Ghislain MARY committed
67 68
                    <ToggleButton x:Name="VideoToggleButton" Content="Toggle video" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="8" Checked="VideoToggleButton_Checked" Unchecked="VideoToggleButton_Checked"/>
                    <Button x:Name="ChangeCameraButton" Content="Change camera" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="8" Click="ChangeCameraButton_Click" IsEnabled="{Binding ElementName=VideoToggleButton, Path=IsChecked}"/>
69
                    <Button x:Name="RotateCameraButton" Content="Rotate camera" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="8" Click="RotateCameraButton_Click" IsEnabled="{Binding ElementName=VideoToggleButton, Path=IsChecked}"/>
Ghislain MARY's avatar
Ghislain MARY committed
70 71
                </StackPanel>
            </Grid>
Ghislain MARY's avatar
Ghislain MARY committed
72 73 74 75 76 77
            <Grid x:Name="VideoGrid" Grid.Row="1" HorizontalAlignment="Center" Background="Black">
                <Grid.RowDefinitions>
                    <RowDefinition Height="*"/>
                    <RowDefinition Height="*"/>
                    <RowDefinition Height="*"/>
                </Grid.RowDefinitions>
Ghislain MARY's avatar
Ghislain MARY committed
78
                <Grid.ColumnDefinitions>
Ghislain MARY's avatar
Ghislain MARY committed
79 80 81
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="*"/>
Ghislain MARY's avatar
Ghislain MARY committed
82 83
                </Grid.ColumnDefinitions>

Ghislain MARY's avatar
Ghislain MARY committed
84 85 86 87 88 89
                <SwapChainPanel x:Name="VideoSwapChainPanel" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="3" Grid.RowSpan="3"/>
                <SwapChainPanel x:Name="PreviewSwapChainPanel" Width="160" Height="120" Grid.Column="2" Grid.Row="2" RenderTransformOrigin="0.5,0.5">
                    <SwapChainPanel.RenderTransform>
                        <CompositeTransform ScaleX="-1"/>
                    </SwapChainPanel.RenderTransform>
                </SwapChainPanel>
Ghislain MARY's avatar
Ghislain MARY committed
90 91 92 93
            </Grid>
        </Grid>
    </ScrollViewer>
</Page>