Commit 0b72fb67 authored by Ghislain MARY's avatar Ghislain MARY

Fix build for Windows 10 with final version of Visual Studio 2015.

parent 8d06ddb2
......@@ -193,7 +193,9 @@
<MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
<AppContainerApplication>true</AppContainerApplication>
<ApplicationType>Windows Store</ApplicationType>
<ApplicationTypeRevision>8.2</ApplicationTypeRevision>
<ApplicationTypeRevision>10</ApplicationTypeRevision>
<WindowsTargetPlatformVersion>10.0.10240.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformMinVersion>10.0.10069.0</WindowsTargetPlatformMinVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)'=='Debug'" Label="Configuration">
......
......@@ -49,7 +49,7 @@
<Page.BottomAppBar>
<CommandBar x:Name="CommandBar">
<AppBarToggleButton x:Name="VideoToggleButton" Icon="Video" Label="Video tester" Checked="VideoToggleButton_Checked" Unchecked="VideoToggleButton_Checked"/>
<AppBarButton x:Name="VideoButton" Icon="Video" Label="Video tester" Click="VideoButton_Click"/>
<AppBarButton x:Name="Run" Icon="Play" Label="Run" Click="RunSelected_Click"/>
<AppBarButton x:Name="SelectAll" Icon="SelectAll" Label="Select all" Click="SelectAll_Click"/>
<AppBarToggleButton x:Name="Verbose" Icon="Comment" IsChecked="True" Label="Verbose"/>
......@@ -99,7 +99,6 @@
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<TextBlock Grid.Row="0" Text="Test result" Style="{StaticResource HeaderTextBlockStyle}" Margin="12,0,0,0"/>
......@@ -122,10 +121,6 @@
<ScrollViewer Grid.Row="2">
<ItemsControl ItemsSource="{Binding Traces}" ItemTemplate="{StaticResource TraceTemplate}" Margin="20,12,0,0"/>
</ScrollViewer>
<StackPanel Orientation="Horizontal" Grid.Row="3" MaxHeight="320">
<CaptureElement x:Name="LocalVideo" Stretch="Uniform"/>
<MediaElement x:Name="RemoteVideo" Stretch="Uniform" MediaFailed="RemoteVideo_MediaFailed" MediaEnded="RemoteVideo_MediaEnded" MediaOpened="RemoteVideo_MediaOpened" PartialMediaFailureDetected="RemoteVideo_PartialMediaFailureDetected" RateChanged="RemoteVideo_RateChanged" SizeChanged="RemoteVideo_SizeChanged" CurrentStateChanged="RemoteVideo_CurrentStateChanged"/>
</StackPanel>
</Grid>
</SplitView>
<ProgressBar x:Name="ProgressIndicator" Grid.Row="1"
......
......@@ -31,12 +31,13 @@ namespace ms2_tester
{
public MainPage()
{
this.InitializeComponent();
this.InitializeComponent();
}
protected override void OnNavigatedTo(NavigationEventArgs e)
{
base.OnNavigatedTo(e);
MS2Tester.Instance.setWritableDirectory(ApplicationData.Current.LocalFolder);
_suites = UnitTestDataSource.GetSuites(MS2Tester.Instance);
TryAutoLaunch();
}
......@@ -183,7 +184,8 @@ namespace ms2_tester
MS2Tester.Instance.runAllToXml();
if (MS2Tester.Instance.AsyncAction != null)
{
MS2Tester.Instance.AsyncAction.Completed += (asyncInfo, asyncStatus) => {
MS2Tester.Instance.AsyncAction.Completed += (asyncInfo, asyncStatus) =>
{
App.Current.Exit();
};
}
......@@ -194,55 +196,9 @@ namespace ms2_tester
private UnitTestCase RunningTestCase;
private UnitTestCase DisplayedTestCase;
private void VideoToggleButton_Checked(object sender, RoutedEventArgs e)
{
AppBarToggleButton b = sender as AppBarToggleButton;
if (b.IsChecked == true)
{
MS2Tester.Instance.startVideoStream(LocalVideo, RemoteVideo);
Run.IsEnabled = false;
}
else
{
MS2Tester.Instance.stopVideoStream();
Run.IsEnabled = true;
}
}
private void RemoteVideo_MediaFailed(object sender, ExceptionRoutedEventArgs e)
{
System.Diagnostics.Debug.WriteLine("RemoteVideo_MediaFailed");
}
private void RemoteVideo_MediaEnded(object sender, RoutedEventArgs e)
{
System.Diagnostics.Debug.WriteLine("RemoteVideo_MediaEnded");
}
private void RemoteVideo_MediaOpened(object sender, RoutedEventArgs e)
{
System.Diagnostics.Debug.WriteLine("RemoteVideo_MediaOpened");
}
private void RemoteVideo_PartialMediaFailureDetected(MediaElement sender, PartialMediaFailureDetectedEventArgs args)
{
System.Diagnostics.Debug.WriteLine("RemoteVideo_PartialMediaFailureDetected");
}
private void RemoteVideo_RateChanged(object sender, RateChangedRoutedEventArgs e)
{
System.Diagnostics.Debug.WriteLine("RemoteVideo_RateChanged");
}
private void RemoteVideo_SizeChanged(object sender, SizeChangedEventArgs e)
{
System.Diagnostics.Debug.WriteLine(String.Format("RemoteVideo_SizeChanged from {0}x{1} to {2}x{3}", e.PreviousSize.Width, e.PreviousSize.Height, e.NewSize.Width, e.NewSize.Height));
}
private void RemoteVideo_CurrentStateChanged(object sender, RoutedEventArgs e)
private void VideoButton_Click(object sender, RoutedEventArgs e)
{
MediaElement mediaElement = sender as MediaElement;
System.Diagnostics.Debug.WriteLine(String.Format("RemoteVideo_CurrentStateChanged: {0}", mediaElement.CurrentState));
((Frame)Window.Current.Content).Navigate(typeof(VideoPage));
}
}
}
<Page
x:Class="ms2_tester.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>
<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"/>
</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" IsSelected="True"/>
<ComboBoxItem Content="VP8"/>
</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" IsSelected="True"/>
<ComboBoxItem Content="CIF"/>
<ComboBoxItem Content="QVGA"/>
<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" IsSelected="True"/>
<ComboBoxItem Content="20"/>
<ComboBoxItem Content="15"/>
<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"/>
<ToggleButton x:Name="VideoToggleButton" Grid.Row="5" Grid.Column="0" Grid.ColumnSpan="2" Content="Toggle video" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="8" Checked="VideoToggleButton_Checked" Unchecked="VideoToggleButton_Checked"/>
</Grid>
<Grid Grid.Row="1" MaxHeight="320">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.5*"/>
<ColumnDefinition Width="0.5*"/>
</Grid.ColumnDefinitions>
<CaptureElement x:Name="LocalVideo" Stretch="Uniform" Grid.Column="0"/>
<MediaElement x:Name="RemoteVideo" Stretch="Uniform" MediaFailed="RemoteVideo_MediaFailed" MediaEnded="RemoteVideo_MediaEnded" MediaOpened="RemoteVideo_MediaOpened" PartialMediaFailureDetected="RemoteVideo_PartialMediaFailureDetected" RateChanged="RemoteVideo_RateChanged" SizeChanged="RemoteVideo_SizeChanged" CurrentStateChanged="RemoteVideo_CurrentStateChanged" Grid.Column="1"/>
</Grid>
</Grid>
</Page>
using ms2_tester_runtime_component;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
// The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
namespace ms2_tester
{
/// <summary>
/// An empty page that can be used on its own or navigated to within a Frame.
/// </summary>
public sealed partial class VideoPage : Page
{
public VideoPage()
{
this.InitializeComponent();
MS2Tester.Instance.initVideo();
bool isSelected = true;
foreach (String device in MS2Tester.Instance.VideoDevices)
{
ComboBoxItem item = new ComboBoxItem();
item.Content = device;
item.IsSelected = isSelected;
isSelected = false;
CameraComboBox.Items.Add(item);
}
}
private void BackButton_Click(object sender, RoutedEventArgs e)
{
MS2Tester.Instance.uninitVideo();
((Frame)Window.Current.Content).GoBack();
}
private void RemoteVideo_MediaFailed(object sender, ExceptionRoutedEventArgs e)
{
System.Diagnostics.Debug.WriteLine("RemoteVideo_MediaFailed");
}
private void RemoteVideo_MediaEnded(object sender, RoutedEventArgs e)
{
System.Diagnostics.Debug.WriteLine("RemoteVideo_MediaEnded");
}
private void RemoteVideo_MediaOpened(object sender, RoutedEventArgs e)
{
System.Diagnostics.Debug.WriteLine("RemoteVideo_MediaOpened");
}
private void RemoteVideo_PartialMediaFailureDetected(MediaElement sender, PartialMediaFailureDetectedEventArgs args)
{
System.Diagnostics.Debug.WriteLine("RemoteVideo_PartialMediaFailureDetected");
}
private void RemoteVideo_RateChanged(object sender, RateChangedRoutedEventArgs e)
{
System.Diagnostics.Debug.WriteLine("RemoteVideo_RateChanged");
}
private void RemoteVideo_SizeChanged(object sender, SizeChangedEventArgs e)
{
System.Diagnostics.Debug.WriteLine(String.Format("RemoteVideo_SizeChanged from {0}x{1} to {2}x{3}", e.PreviousSize.Width, e.PreviousSize.Height, e.NewSize.Width, e.NewSize.Height));
}
private void RemoteVideo_CurrentStateChanged(object sender, RoutedEventArgs e)
{
MediaElement mediaElement = sender as MediaElement;
System.Diagnostics.Debug.WriteLine(String.Format("RemoteVideo_CurrentStateChanged: {0}", mediaElement.CurrentState));
}
private void VideoToggleButton_Checked(object sender, RoutedEventArgs e)
{
ToggleButton b = sender as ToggleButton;
if (b.IsChecked == true)
{
String camera = (CameraComboBox.SelectedItem as ComboBoxItem).Content as String;
String codec = (CodecComboBox.SelectedItem as ComboBoxItem).Content as String;
String videoSize = (VideoSizeComboBox.SelectedItem as ComboBoxItem).Content as String;
UInt32 frameRate = 25;
UInt32.TryParse((FramerateComboBox.SelectedItem as ComboBoxItem).Content as String, out frameRate);
UInt32 bitRate = 1500;
UInt32.TryParse(BitrateTextBox.Text, out bitRate);
MS2Tester.Instance.startVideoStream(LocalVideo, RemoteVideo, camera, codec, videoSize, frameRate, bitRate);
}
else
{
MS2Tester.Instance.stopVideoStream();
}
}
}
}
......@@ -73,7 +73,9 @@
<MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
<AppContainerApplication>true</AppContainerApplication>
<ApplicationType>Windows Store</ApplicationType>
<ApplicationTypeRevision>8.2</ApplicationTypeRevision>
<ApplicationTypeRevision>10</ApplicationTypeRevision>
<WindowsTargetPlatformVersion>10.0.10240.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformMinVersion>10.0.10069.0</WindowsTargetPlatformMinVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)'=='Debug'" Label="Configuration">
......
......@@ -64,7 +64,9 @@
<MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
<AppContainerApplication>true</AppContainerApplication>
<ApplicationType>Windows Store</ApplicationType>
<ApplicationTypeRevision>8.2</ApplicationTypeRevision>
<ApplicationTypeRevision>10</ApplicationTypeRevision>
<WindowsTargetPlatformVersion>10.0.10240.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformMinVersion>10.0.10069.0</WindowsTargetPlatformMinVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)'=='Debug'" Label="Configuration">
......
......@@ -11,7 +11,7 @@
<AssemblyName>ms2-tester</AssemblyName>
<DefaultLanguage>en-US</DefaultLanguage>
<TargetPlatformIdentifier>UAP</TargetPlatformIdentifier>
<TargetPlatformVersion>10.0.10069.0</TargetPlatformVersion>
<TargetPlatformVersion>10.0.10240.0</TargetPlatformVersion>
<TargetPlatformMinVersion>10.0.10069.0</TargetPlatformMinVersion>
<MinimumVisualStudioVersion>14</MinimumVisualStudioVersion>
<EnableDotNetNativeCompatibleProfile>true</EnableDotNetNativeCompatibleProfile>
......@@ -24,7 +24,7 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|ARM'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\ARM\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UAP</DefineConstants>
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<NoWarn>;2008</NoWarn>
<DebugType>full</DebugType>
<PlatformTarget>ARM</PlatformTarget>
......@@ -34,7 +34,7 @@
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|ARM'">
<OutputPath>bin\ARM\Release\</OutputPath>
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UAP</DefineConstants>
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<Optimize>true</Optimize>
<NoWarn>;2008</NoWarn>
<DebugType>pdbonly</DebugType>
......@@ -47,7 +47,7 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UAP</DefineConstants>
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<NoWarn>;2008</NoWarn>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
......@@ -57,7 +57,7 @@
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath>
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UAP</DefineConstants>
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<Optimize>true</Optimize>
<NoWarn>;2008</NoWarn>
<DebugType>pdbonly</DebugType>
......@@ -70,7 +70,7 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x86\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UAP</DefineConstants>
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<NoWarn>;2008</NoWarn>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
......@@ -80,7 +80,7 @@
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>bin\x86\Release\</OutputPath>
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UAP</DefineConstants>
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<Optimize>true</Optimize>
<NoWarn>;2008</NoWarn>
<DebugType>pdbonly</DebugType>
......@@ -90,6 +90,13 @@
<Prefer32Bit>true</Prefer32Bit>
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
</PropertyGroup>
<ItemGroup>
<!-- A reference to the entire .Net Framework and Windows SDK are automatically included -->
<Content Include="ApplicationInsights.config">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<None Include="project.json" />
</ItemGroup>
<ItemGroup>
<Compile Include="App.xaml.cs">
<DependentUpon>App.xaml</DependentUpon>
......@@ -99,12 +106,14 @@
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="DataModel\UnitTestDataSource.cs" />
<Compile Include="VideoPage.xaml.cs">
<DependentUpon>VideoPage.xaml</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<AppxManifest Include="Package.appxmanifest">
<SubType>Designer</SubType>
</AppxManifest>
<None Include="ApplicationInsights.config" />
<None Include="ms2-tester_TemporaryKey.pfx" />
<None Include="packages.config" />
</ItemGroup>
......@@ -141,28 +150,10 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
</ItemGroup>
<ItemGroup>
<Reference Include="Microsoft.ApplicationInsights, Version=0.14.3.177, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>packages\Microsoft.ApplicationInsights.0.14.3-build00177\lib\portable-win81+wpa81\Microsoft.ApplicationInsights.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.ApplicationInsights.Extensibility.Windows, Version=0.14.3.177, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>packages\Microsoft.ApplicationInsights.WindowsApps.0.14.3-build00177\lib\win81\Microsoft.ApplicationInsights.Extensibility.Windows.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.ApplicationInsights.PersistenceChannel, Version=0.14.3.186, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>packages\Microsoft.ApplicationInsights.PersistenceChannel.0.14.3-build00177\lib\portable-win81+wpa81\Microsoft.ApplicationInsights.PersistenceChannel.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Numerics.Vectors, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>packages\System.Numerics.Vectors.4.0.0\lib\win8\System.Numerics.Vectors.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Numerics.Vectors.WindowsRuntime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>packages\System.Numerics.Vectors.4.0.0\lib\win8\System.Numerics.Vectors.WindowsRuntime.dll</HintPath>
<Private>True</Private>
</Reference>
<Page Include="VideoPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="ms2-tester-runtime-component\ms2-tester-runtime-component.vcxproj">
......@@ -174,15 +165,6 @@
<VisualStudioVersion>14.0</VisualStudioVersion>
</PropertyGroup>
<Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets" />
<Import Project="packages\Microsoft.Diagnostics.Tracing.EventSource.Redist.1.1.16-beta\build\portable-net45+win8+wpa81\Microsoft.Diagnostics.Tracing.EventSource.Redist.targets" Condition="Exists('packages\Microsoft.Diagnostics.Tracing.EventSource.Redist.1.1.16-beta\build\portable-net45+win8+wpa81\Microsoft.Diagnostics.Tracing.EventSource.Redist.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('packages\Microsoft.Diagnostics.Tracing.EventSource.Redist.1.1.16-beta\build\portable-net45+win8+wpa81\Microsoft.Diagnostics.Tracing.EventSource.Redist.targets')" Text="$([System.String]::Format('$(ErrorText)', 'packages\Microsoft.Diagnostics.Tracing.EventSource.Redist.1.1.16-beta\build\portable-net45+win8+wpa81\Microsoft.Diagnostics.Tracing.EventSource.Redist.targets'))" />
<Error Condition="!Exists('packages\Microsoft.ApplicationInsights.0.14.3-build00177\build\portable-win81+wpa81\Microsoft.ApplicationInsights.targets')" Text="$([System.String]::Format('$(ErrorText)', 'packages\Microsoft.ApplicationInsights.0.14.3-build00177\build\portable-win81+wpa81\Microsoft.ApplicationInsights.targets'))" />
</Target>
<Import Project="packages\Microsoft.ApplicationInsights.0.14.3-build00177\build\portable-win81+wpa81\Microsoft.ApplicationInsights.targets" Condition="Exists('packages\Microsoft.ApplicationInsights.0.14.3-build00177\build\portable-win81+wpa81\Microsoft.ApplicationInsights.targets')" />
<PropertyGroup>
<PreBuildEvent>XCopy /I /Y $(ProjectDir)..\..\..\tester\sounds $(ProjectDir)Assets\Sounds
XCopy /I /Y $(ProjectDir)..\..\..\src\voip\*.jpg $(ProjectDir)Assets\Images</PreBuildEvent>
......
{
"dependencies": {
"Microsoft.ApplicationInsights": "1.0.0",
"Microsoft.ApplicationInsights.PersistenceChannel": "1.0.0",
"Microsoft.ApplicationInsights.WindowsApps": "1.0.0",
"Microsoft.NETCore.UniversalWindowsPlatform": "5.0.0"
},
"frameworks": {
"uap10.0": {}
},
"runtimes": {
"win10-arm": {},
"win10-arm-aot": {},
"win10-x86": {},
"win10-x86-aot": {},
"win10-x64": {},
"win10-x64-aot": {}
}
}
\ No newline at end of file
......@@ -46,9 +46,9 @@
<MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
<AppContainerApplication>true</AppContainerApplication>
<ApplicationType>Windows Store</ApplicationType>
<ApplicationTypeRevision>8.2</ApplicationTypeRevision>
<TargetPlatformVersion>10.0.10069.0</TargetPlatformVersion>
<TargetPlatformMinVersion>10.0.10069.0</TargetPlatformMinVersion>
<ApplicationTypeRevision>10</ApplicationTypeRevision>
<WindowsTargetPlatformVersion>10.0.10240.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformMinVersion>10.0.10069.0</WindowsTargetPlatformMinVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)'=='Debug'" Label="Configuration">
......
#include <string>
#include <collection.h>
#include "mediastreamer2_tester_windows.h"
#include "mswinrtvid.h"
using namespace ms2_tester_runtime_component;
using namespace Platform;
using namespace Platform::Collections;
using namespace Windows::Foundation;
using namespace Windows::Storage;
using namespace Windows::System::Threading;
......@@ -12,6 +14,8 @@ using namespace Windows::System::Threading;
#define MAX_TRACE_SIZE 2048
#define MAX_SUITE_NAME_SIZE 128
#define MAX_WRITABLE_DIR_SIZE 1024
#define MAX_FILEPATH_SIZE 2048
#define MAX_DEVICE_NAME_SIZE 256
static OutputTraceListener^ sTraceListener;
......@@ -56,13 +60,8 @@ static void ms2NativeOutputTraceHandler(OrtpLogLevel lev, const char *fmt, va_li
MS2Tester::MS2Tester()
{
char writable_dir[MAX_WRITABLE_DIR_SIZE];
StorageFolder ^folder = ApplicationData::Current->LocalFolder;
const wchar_t *wwritable_dir = folder->Path->Data();
wcstombs(writable_dir, wwritable_dir, sizeof(writable_dir));
mediastreamer2_tester_init(nativeOutputTraceHandler);
bc_tester_set_resource_dir_prefix("Assets");
bc_tester_set_writable_dir_prefix(writable_dir);
}
MS2Tester::~MS2Tester()
......@@ -70,6 +69,14 @@ MS2Tester::~MS2Tester()
mediastreamer2_tester_uninit();
}
void MS2Tester::setWritableDirectory(StorageFolder^ folder)
{
char writable_dir[MAX_WRITABLE_DIR_SIZE] = { 0 };
const wchar_t *wwritable_dir = folder->Path->Data();
wcstombs(writable_dir, wwritable_dir, sizeof(writable_dir));
bc_tester_set_writable_dir_prefix(writable_dir);
}
void MS2Tester::setOutputTraceListener(OutputTraceListener^ traceListener)
{
sTraceListener = traceListener;
......@@ -151,7 +158,21 @@ Platform::String^ MS2Tester::testName(Platform::String^ suiteName, int testIndex
return ref new String(wcname);
}
void MS2Tester::startVideoStream(Platform::Object^ CaptureElement, Platform::Object^ MediaElement)
Windows::Foundation::Collections::IVector<Platform::String^>^ MS2Tester::VideoDevices::get()
{
wchar_t wcname[MAX_DEVICE_NAME_SIZE];
Vector<Platform::String^>^ devices = ref new Vector<Platform::String^>();
const MSList *elem = ms_web_cam_manager_get_list(ms_web_cam_manager_get());
for (int i = 0; elem != NULL; elem = elem->next, i++) {
const char *id = ms_web_cam_get_string_id((MSWebCam *)elem->data);
memset(wcname, 0, sizeof(wcname));
mbstowcs(wcname, id, sizeof(wcname));
devices->Append(ref new String(wcname));
}
return devices;
}
void MS2Tester::initVideo()
{
ortp_init();
ms_base_init();
......@@ -160,19 +181,70 @@ void MS2Tester::startVideoStream(Platform::Object^ CaptureElement, Platform::Obj
ms_voip_init();
ms_plugins_init();
rtp_profile_set_payload(&av_profile, 102, &payload_type_h264);
rtp_profile_set_payload(&av_profile, 103, &payload_type_vp8);
Platform::String^ appFolder = Windows::ApplicationModel::Package::Current->InstalledLocation->Path;
Platform::String^ psPath = Platform::String::Concat(appFolder, ref new Platform::String(L"\\Assets\\Images\\nowebcamCIF.jpg"));
std::wstring wsPath = psPath->Data();
char cPath[MAX_FILEPATH_SIZE] = { 0 };
wcstombs(cPath, wsPath.c_str(), sizeof(cPath));
ms_static_image_set_default_image(cPath);
}
void MS2Tester::uninitVideo()
{
ms_exit();
}
#define PLATFORM_STRING_TO_C_STRING(x) \
memset(cst, 0, sizeof(cst)); \
wst = x->Data(); \
wcstombs(cst, wst.c_str(), sizeof(cst))
void MS2Tester::startVideoStream(Platform::Object^ CaptureElement, Platform::Object^ MediaElement, Platform::String^ camera, Platform::String^ codec, Platform::String^ videoSize, unsigned int frameRate, unsigned int bitRate)
{
ms_filter_enable_statistics(TRUE);
ms_filter_reset_statistics();
MSVideoSize vsize = { MS_VIDEO_SIZE_CIF_W, MS_VIDEO_SIZE_CIF_H };
int payload = 102;
char cst[1024];
std::wstring wst;
MSWebCamManager *manager = ms_web_cam_manager_get();
MSWebCam *camera = ms_web_cam_manager_get_default_cam(manager);
PLATFORM_STRING_TO_C_STRING(camera);
MSWebCam *cam = ms_web_cam_manager_get_cam(manager, cst);
PLATFORM_STRING_TO_C_STRING(codec);
if (strcmp(cst, "VP8") == 0) payload = 103;
PLATFORM_STRING_TO_C_STRING(videoSize);
if (strcmp(cst, "720P") == 0) {
vsize.width = MS_VIDEO_SIZE_720P_W;
vsize.height = MS_VIDEO_SIZE_720P_H;
} else if (strcmp(cst, "VGA") == 0) {
vsize.width = MS_VIDEO_SIZE_VGA_W;
vsize.height = MS_VIDEO_SIZE_VGA_H;
} else if (strcmp(cst, "CIF") == 0) {
vsize.width = MS_VIDEO_SIZE_CIF_W;
vsize.height = MS_VIDEO_SIZE_CIF_H;
} else if (strcmp(cst, "QVGA") == 0) {
vsize.width = MS_VIDEO_SIZE_QVGA_W;
vsize.height = MS_VIDEO_SIZE_QVGA_H;
} else if (strcmp(cst, "QCIF") == 0) {
vsize.width = MS_VIDEO_SIZE_QCIF_W;
vsize.height = MS_VIDEO_SIZE_QCIF_H;
}
PayloadType *pt = rtp_profile_get_payload(&av_profile, payload);
pt->normal_bitrate = bitRate * 1000;
_videoStream = video_stream_new(20000, 0, FALSE);
RefToPtrProxy<Platform::Object^> *previewWindowId = new RefToPtrProxy<Platform::Object^>(CaptureElement);
video_stream_set_native_preview_window_id(_videoStream, previewWindowId);
RefToPtrProxy<Platform::Object^> *nativeWindowId = new RefToPtrProxy<Platform::Object^>(MediaElement);
video_stream_set_native_window_id(_videoStream, nativeWindowId);
video_stream_set_display_filter_name(_videoStream, "MSWinRTDis");
video_stream_set_direction(_videoStream, VideoStreamRecvOnly);
video_stream_start(_videoStream, &av_profile, "127.0.0.1", 21000, NULL, 0, 102, 0, camera);
video_stream_use_video_preset(_videoStream, "custom");
video_stream_set_sent_video_size(_videoStream, vsize);
video_stream_set_fps(_videoStream, frameRate);
//video_stream_set_device_rotation(_videoStream, 90);
video_stream_start(_videoStream, &av_profile, "127.0.0.1", 20000, NULL, 0, payload, 0, cam);
}
void MS2Tester::stopVideoStream()
......@@ -180,5 +252,4 @@ void MS2Tester::stopVideoStream()
ms_filter_log_statistics();
video_stream_stop(_videoStream);
_videoStream = NULL;
ms_exit();
}
......@@ -14,6 +14,7 @@ namespace ms2_tester_runtime_component
public ref class MS2Tester sealed
{
public:
void setWritableDirectory(Windows::Storage::StorageFolder^ folder);
void setOutputTraceListener(OutputTraceListener^ traceListener);
unsigned int nbTestSuites();
unsigned int nbTests(Platform::String^ suiteName);
......@@ -21,7 +22,9 @@ namespace ms2_tester_runtime_component
Platform::String^ testName(Platform::String^ suiteName, int testIndex);
bool run(Platform::String^ suiteName, Platform::String^ caseName, Platform::Boolean verbose);
void runAllToXml();
void startVideoStream(Platform::Object^ CaptureElement, Platform::Object^ MediaElement);
void initVideo();
void uninitVideo();
void startVideoStream(Platform::Object^ CaptureElement, Platform::Object^ MediaElement, Platform::String^ camera, Platform::String^ codec, Platform::String^ videoSize, unsigned int frameRate, unsigned int bitRate);
void stopVideoStream();
static property MS2Tester^ Instance
......@@ -32,6 +35,10 @@ namespace ms2_tester_runtime_component
{
Windows::Foundation::IAsyncAction^ get() { return _asyncAction; }
}
property Windows::Foundation::Collections::IVector<Platform::String^>^ VideoDevices
{
Windows::Foundation::Collections::IVector<Platform::String^>^ get();
}
private:
MS2Tester();
~MS2Tester();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment