Commit c9e33c76 authored by Sylvain Berfini's avatar Sylvain Berfini 🎩
Browse files

Merge branch 'master' into dev_bb10

parents 5ad8e59d 3cef9370
......@@ -30,7 +30,7 @@ set(MEDIASTREAMER_MICRO_VERSION "2")
set(MEDIASTREAMER_VERSION "${MEDIASTREAMER_MAJOR_VERSION}.${MEDIASTREAMER_MINOR_VERSION}.${MEDIASTREAMER_MICRO_VERSION}")
set(MEDIASTREAMER_SO_VERSION "5")
string(REGEX MATCH "^arm*" FIXED_POINT_PROCESSOR "${CMAKE_SYSTEM_PROCESSOR}")
string(REGEX MATCH "^(arm*|aarch64)" FIXED_POINT_PROCESSOR "${CMAKE_SYSTEM_PROCESSOR}")
if(FIXED_POINT_PROCESSOR)
set(ENABLE_FIXED_POINT_DEFAULT_VALUE YES)
else()
......
......@@ -195,10 +195,13 @@ AC_DEFUN([MS_CHECK_VIDEO],[
yes) enable_x11=true ;;
no) enable_x11=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --disable-x11) ;;
esac],[enable_x11=$enable_x11_default])
esac],[enable_x11=$enable_x11_default])
if test "$enable_x11" = "true"; then
AC_CHECK_HEADERS(X11/Xlib.h)
AC_CHECK_HEADERS(X11/Xlib.h)
else
enable_xv=no
enable_glx=no
fi
AC_ARG_ENABLE(xv,
......@@ -207,7 +210,7 @@ AC_DEFUN([MS_CHECK_VIDEO],[
yes) enable_xv=true ;;
no) enable_xv=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-xv) ;;
esac],[enable_xv=$enable_x11_default])
esac],[enable_xv=$enable_x11_default])
if test "$enable_xv" = "true"; then
AC_CHECK_HEADERS(X11/extensions/Xv.h,[] ,[enable_xv=false])
......
......@@ -80,6 +80,7 @@
<ClInclude Include="..\..\..\src\voip\private.h" />
<ClInclude Include="..\..\..\src\voip\qosanalyzer.h" />
<ClInclude Include="..\..\..\src\voip\rfc2429.h" />
<ClInclude Include="..\..\..\src\voip\vp8rtpfmt.h" />
<ClInclude Include="basedescs.h" />
<ClInclude Include="gitversion.h" />
<ClInclude Include="voipdescs.h" />
......@@ -134,6 +135,7 @@
<ClCompile Include="..\..\..\src\videofilters\nowebcam.c" />
<ClCompile Include="..\..\..\src\videofilters\pixconv.c" />
<ClCompile Include="..\..\..\src\videofilters\sizeconv.c" />
<ClCompile Include="..\..\..\src\videofilters\vp8.c" />
<ClCompile Include="..\..\..\src\voip\audioconference.c" />
<ClCompile Include="..\..\..\src\voip\audiostream.c" />
<ClCompile Include="..\..\..\src\voip\bitratecontrol.c" />
......@@ -154,6 +156,7 @@
<ClCompile Include="..\..\..\src\voip\videostarter.c" />
<ClCompile Include="..\..\..\src\voip\videostream.c" />
<ClCompile Include="..\..\..\src\voip\video_preset_high_fps.c" />
<ClCompile Include="..\..\..\src\voip\vp8rtpfmt.c" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\..\..\bzrtp\build\windows10\bzrtp\bzrtp.vcxproj">
......@@ -221,19 +224,20 @@
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<CompileAsWinRT>false</CompileAsWinRT>
<AdditionalIncludeDirectories>$(ProjectDir)..\..\..\include;$(ProjectDir)..\..\..\src\base;$(ProjectDir)..\..\..\src\voip;$(ProjectDir)..\..\..\src\audiofilters;$(ProjectDir)..\..\..\src\videofilters;$(ProjectDir)..\..\..\src\utils;$(ProjectDir)..\..\..\..\oRTP\include;$(ProjectDir)..\..\..\..\..\gsm\build\windows10\gsm\$(Platform)\$(Configuration);$(ProjectDir)..\..\..\..\..\srtp\include;$(ProjectDir)..\..\..\..\..\srtp\crypto\include;$(ProjectDir)..\..\..\..\..\srtp\build\windows10\srtp;$(ProjectDir)..\..\..\..\..\speex\include;$(ProjectDir)..\..\..\..\..\opus\include;$(ProjectDir)..\..\..\..\..\polarssl\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>$(ProjectDir)..\..\..\include;$(ProjectDir)..\..\..\src\base;$(ProjectDir)..\..\..\src\voip;$(ProjectDir)..\..\..\src\audiofilters;$(ProjectDir)..\..\..\src\videofilters;$(ProjectDir)..\..\..\src\utils;$(ProjectDir)..\..\..\..\oRTP\include;$(ProjectDir)..\..\..\..\..\gsm\build\windows10\gsm\$(Platform)\$(Configuration);$(ProjectDir)..\..\..\..\..\srtp\include;$(ProjectDir)..\..\..\..\..\srtp\crypto\include;$(ProjectDir)..\..\..\..\..\srtp\build\windows10\srtp;$(ProjectDir)..\..\..\..\..\speex\include;$(ProjectDir)..\..\..\..\..\opus\include;$(ProjectDir)..\..\..\..\..\polarssl\include;$(ProjectDir)..\..\..\..\..\libvpx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>MEDIASTREAMER2_INTERNAL_EXPORTS;MS2_INTERNAL;MS2_FILTERS;VIDEO_ENABLED;NO_FFMPEG;HAVE_CONFIG_H;HAVE_POLARSSL_SSL_H;HAVE_SPEEXDSP;HAVE_SRTP;_CRT_SECURE_NO_WARNINGS;_WINSOCK_DEPRECATED_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
<GenerateWindowsMetadata>false</GenerateWindowsMetadata>
<AdditionalDependencies>$(ProjectDir)..\..\..\..\..\build\libvpx\$(Platform)\vpxmd.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<PreBuildEvent>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">version.bat</Command>
<Command>version.bat</Command>
</PreBuildEvent>
<PreBuildEvent>
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Batch script to get the git version</Message>
<Message>Batch script to get the git version</Message>
</PreBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Platform)'=='ARM'">
......
......@@ -91,8 +91,8 @@ MSFilterDesc * ms_voip_filter_descs[]={
&ms_static_image_desc,
&ms_mire_desc,
&ms_ext_display_desc,
//&ms_vp8_enc_desc,
//&ms_vp8_dec_desc,
&ms_vp8_enc_desc,
&ms_vp8_dec_desc,
#endif
NULL
};
......
<Application
x:Class="ms2_tester.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:ms2_tester"
xmlns:model="using:ms2_tester.DataModel" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d"
x:Class="ms2_tester.App"
RequestedTheme="Light">
<Application.Resources>
<ResourceDictionary>
<model:UnitTestCaseStateToSymbolConverter x:Key="UnitTestCaseStateToSymbol"/>
<model:UnitTestCaseStateToSymbolColorConverter x:Key="UnitTestCaseStateToSymbolColor"/>
<model:OutputTraceLevelToColorConverter x:Key="OutputTraceLevelToColor"/>
</ResourceDictionary>
</Application.Resources>
</Application>
......@@ -8,6 +8,7 @@ using Windows.ApplicationModel;
using Windows.ApplicationModel.Activation;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.Storage;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
......@@ -40,8 +41,6 @@ namespace ms2_tester
this.InitializeComponent();
this.Suspending += OnSuspending;
tester = new MS2Tester();
}
/// <summary>
......@@ -113,13 +112,5 @@ namespace ms2_tester
//TODO: Save application state and stop any background activity
deferral.Complete();
}
public bool suiteRunning()
{
return (suiteRunner != null) && (suiteRunner.running);
}
public MS2Tester tester { get; set; }
public UnitTestSuiteRunner suiteRunner { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ms2_tester_runtime_component;
using System.Collections.ObjectModel;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Media;
using System.ComponentModel;
using Windows.UI;
using Windows.UI.Xaml.Documents;
using Windows.UI.Core;
namespace ms2_tester.DataModel
{
public class OutputTrace
{
public OutputTrace(String lev, String msg)
{
Level = lev;
Msg = msg;
}
public String Level { get; private set; }
public String Msg { get; private set; }
}
public class UnitTestSuite
{
public UnitTestSuite(string name)
{
Name = name;
Cases = new ObservableCollection<UnitTestCase>();
Selected = false;
}
public string Name { get; private set; }
public bool Selected
{
get { return Cases.All(x => x.Selected); }
set
{
foreach (UnitTestCase c in Cases)
{
c.Selected = value;
}
}
}
public ObservableCollection<UnitTestCase> Cases { get; private set; }
}
public enum UnitTestCaseState
{
NotRun,
Success,
Failure
}
public class UnitTestCase : INotifyPropertyChanged
{
public UnitTestCase(UnitTestSuite suite, string name)
{
_suite = new WeakReference(suite);
Name = name;
Selected = false;
State = UnitTestCaseState.NotRun;
Traces = new ObservableCollection<OutputTrace>();
}
public UnitTestSuite Suite
{
get { return _suite.Target as UnitTestSuite; }
}
public string Name { get; private set; }
public bool Selected
{
get { return _selected; }
set
{
_selected = value;
RaisePropertyChanged("Selected");
}
}
public UnitTestCaseState State
{
get { return _state; }
set
{
_state = value;
RaisePropertyChanged("State");
}
}
public ObservableCollection<OutputTrace> Traces
{
get { return _traces; }
set
{
_traces = value;
RaisePropertyChanged("Traces");
}
}
public CoreDispatcher Dispatcher { get; set; }
public event PropertyChangedEventHandler PropertyChanged;
protected void RaisePropertyChanged(string name)
{
if (PropertyChanged != null)
{
PropertyChanged(this, new PropertyChangedEventArgs(name));
}
}
private WeakReference _suite;
private bool _selected;
private UnitTestCaseState _state;
private ObservableCollection<OutputTrace> _traces;
}
public sealed class UnitTestDataSource
{
private static UnitTestDataSource _unitTestDataSource = new UnitTestDataSource();
private ObservableCollection<UnitTestSuite> _suites = new ObservableCollection<UnitTestSuite>();
public ObservableCollection<UnitTestSuite> Suites
{
get { return this._suites; }
}
public static IEnumerable<UnitTestSuite> GetSuites(MS2Tester tester)
{
return _unitTestDataSource.FillSuites(tester);
}
private IEnumerable<UnitTestSuite> FillSuites(MS2Tester tester)
{
if (this.Suites.Count != 0) return this.Suites;
for (int i = 0; i < tester.nbTestSuites(); i++)
{
UnitTestSuite suite = new UnitTestSuite(tester.testSuiteName(i));
for (int j = 0; j < tester.nbTests(suite.Name); j++)
{
suite.Cases.Add(new UnitTestCase(suite, tester.testName(suite.Name, j)));
}
this.Suites.Add(suite);
}
return this.Suites;
}
}
public sealed class UnitTestCaseStateToSymbolConverter : IValueConverter
{
object IValueConverter.Convert(object value, Type targetType, object parametr, string language)
{
if (!value.GetType().Equals(typeof(UnitTestCaseState)))
{
throw new ArgumentException("Only UnitTestCaseState is supported");
}
if (targetType.Equals(typeof(Symbol)))
{
switch ((UnitTestCaseState)value)
{
case UnitTestCaseState.Success:
return Symbol.Like;
case UnitTestCaseState.Failure:
return Symbol.Dislike;
case UnitTestCaseState.NotRun:
default:
return Symbol.Help;
}
}
else
{
throw new ArgumentException(string.Format("Unsupported type {0}", targetType.FullName));
}
}
object IValueConverter.ConvertBack(object value, Type targetType, object parameter, string language)
{
throw new NotImplementedException();
}
}
public sealed class UnitTestCaseStateToSymbolColorConverter : IValueConverter
{
object IValueConverter.Convert(object value, Type targetType, object parameter, string language)
{
if (!value.GetType().Equals(typeof(UnitTestCaseState)))
{
throw new ArgumentException("Only UnitTestCaseState is supported");
}
if (targetType.Equals(typeof(Brush)))
{
switch ((UnitTestCaseState)value)
{
case UnitTestCaseState.Success:
return new SolidColorBrush(Colors.ForestGreen);
case UnitTestCaseState.Failure:
return new SolidColorBrush(Colors.IndianRed);
case UnitTestCaseState.NotRun:
default:
return new SolidColorBrush(Colors.LightGray);
}
}
else
{
throw new ArgumentException(string.Format("Unsupported format {0}", targetType.FullName));
}
}
object IValueConverter.ConvertBack(object value, Type targetType, object parameter, string language)
{
throw new NotImplementedException();
}
}
public sealed class OutputTraceLevelToColorConverter : IValueConverter
{
object IValueConverter.Convert(object value, Type targetType, object parameter, string language)
{
if (!value.GetType().Equals(typeof(String)))
{
throw new ArgumentException("Only String is supported");
}
if (targetType.Equals(typeof(Brush)))
{
if ((String)value == "Error")
{
return new SolidColorBrush(Colors.IndianRed);
}
else if ((String)value == "Warning")
{
return new SolidColorBrush(Colors.Orange);
}
return new SolidColorBrush(Colors.Black);
}
else
{
throw new ArgumentException(string.Format("Unsupported format {0}", targetType.FullName));
}
}
object IValueConverter.ConvertBack(object value, Type targetType, object parameter, string language)
{
throw new NotImplementedException();
}
}
}
<Page
x:Class="ms2_tester.MainPage"
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">
xmlns:model="using:ms2_tester.DataModel"
xmlns:uixdata="using:Windows.UI.Xaml.Data" x:Name="page"
x:Class="ms2_tester.MainPage">
<Page.Resources>
<CollectionViewSource x:Name="UnitTestCVS"
Source="{x:Bind Suites}"
ItemsPath="Cases"
IsSourceGrouped="True"/>
<DataTemplate x:Key="ZoomedInTemplate" x:DataType="model:UnitTestCase">
<Grid Width="320">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<CheckBox Grid.Column="0"
Content="{x:Bind Name}"
IsChecked="{Binding Selected, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
<SymbolIcon Grid.Column="1"
Symbol="{Binding State, Mode=OneWay, Converter={StaticResource UnitTestCaseStateToSymbol}, UpdateSourceTrigger=PropertyChanged}"
Foreground="{Binding State, Mode=OneWay, Converter={StaticResource UnitTestCaseStateToSymbolColor}, UpdateSourceTrigger=PropertyChanged}" Margin="16,0,32,0"/>
</Grid>
</DataTemplate>
<DataTemplate x:Key="ZoomedInGroupHeaderTemplate" x:DataType="model:UnitTestSuite">
<StackPanel Orientation="Horizontal">
<TextBlock Text="{x:Bind Name}" Foreground="{ThemeResource ApplicationForegroundThemeBrush}" Style="{StaticResource SubtitleTextBlockStyle}"/>
</StackPanel>
</DataTemplate>
<DataTemplate x:Key="ZoomedOutTemplate" x:DataType="uixdata:ICollectionViewGroup">
<TextBlock Text="{x:Bind Group.(model:UnitTestSuite.Name)}" Style="{StaticResource SubtitleTextBlockStyle}" TextWrapping="Wrap"/>
</DataTemplate>
<DataTemplate x:Key="TraceTemplate">
<TextBlock FontFamily="Courier New">
<Run Text="{Binding Msg}" Foreground="{Binding Level, Converter={StaticResource OutputTraceLevelToColor}}"/>
</TextBlock>
</DataTemplate>
</Page.Resources>
<Page.BottomAppBar>
<CommandBar x:Name="CommandBar">
<AppBarToggleButton x:Name="VideoToggleButton" Icon="Video" Label="Video tester" Checked="VideoToggleButton_Checked" Unchecked="VideoToggleButton_Checked"/>
<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"/>
</CommandBar>
</Page.BottomAppBar>
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<StackPanel Grid.Row="0" Margin="12,17,0,28">
<TextBlock Text="MEDIASTREAMER2 TESTER"/>
<TextBlock Text="Test Suite"/>
</StackPanel>
<CheckBox Grid.Row="1" x:Name="Verbose" Content="Verbose" HorizontalAlignment="Right" IsChecked="True"></CheckBox>
<ListView Grid.Row="2" x:Name="Suites" ItemsSource="{Binding}" Tapped="Suite_Tapped">
<ListView.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Name}"/>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
<SplitView x:Name="splitView" Grid.Row="0" IsPaneOpen="True" DisplayMode="Inline">
<SplitView.Pane>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<TextBlock Grid.Row="0" Text="Test selection" Style="{StaticResource HeaderTextBlockStyle}" Margin="12,0,0,0"/>
<SemanticZoom x:Name="SemanticZoom" Grid.Row="1">
<SemanticZoom.ZoomedInView>
<ListView ItemsSource="{x:Bind UnitTestCVS.View}"
ScrollViewer.IsHorizontalScrollChainingEnabled="False"
SelectionMode="None"
ItemTemplate="{StaticResource ZoomedInTemplate}"
IsItemClickEnabled="True"
ItemClick="UnitTestCase_Click">
<ListView.GroupStyle>
<GroupStyle HeaderTemplate="{StaticResource ZoomedInGroupHeaderTemplate}" />
</ListView.GroupStyle>
</ListView>
</SemanticZoom.ZoomedInView>
<SemanticZoom.ZoomedOutView>
<ListView ItemsSource="{x:Bind UnitTestCVS.View.CollectionGroups}"
SelectionMode="None"
ItemTemplate="{StaticResource ZoomedOutTemplate}">
</ListView>
</SemanticZoom.ZoomedOutView>
</SemanticZoom>
</Grid>
</SplitView.Pane>
<Grid x:Name="TestResultPage">
<Grid.RowDefinitions>
<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"/>
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0" Style="{StaticResource SubheaderTextBlockStyle}" Margin="16,0,0,0" Text="{Binding Name, Mode=OneWay}"/>
<SymbolIcon Grid.Column="1" x:Name="TestResultState"
Visibility="Collapsed"
Symbol="{Binding State, Mode=OneWay, Converter={StaticResource UnitTestCaseStateToSymbol}, UpdateSourceTrigger=PropertyChanged}"
Foreground="{Binding State, Mode=OneWay, Converter={StaticResource UnitTestCaseStateToSymbolColor}, UpdateSourceTrigger=PropertyChanged}" Margin="16,0,32,0"/>
<AppBarButton Grid.Column="2" x:Name="TestResultRun"
Icon="Play" Label="Run"
IsEnabled="{Binding IsEnabled, ElementName=CommandBar}"
Click="RunSingle_Click" Visibility="Collapsed"/>
</Grid>
<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"
Width="{Binding ActualWidth, ElementName=CommandBar, Mode=OneWay}" Margin="16,0,0,0"/>
</Grid>
</Page>
......@@ -13,6 +13,12 @@ using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
using ms2_tester.DataModel;
using ms2_tester_runtime_component;
using System.Threading.Tasks;
using Windows.UI.Core;
using Windows.UI.Xaml.Documents;
using Windows.Storage;
// The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=402352&clcid=0x409
......@@ -21,56 +27,222 @@ 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 MainPage : Page
public sealed partial class MainPage : Page, OutputTraceListener
{