Commit 75081159 authored by Ghislain MARY's avatar Ghislain MARY

Add build of VP8 on Windows Phone 8.

parent ffbe08f5
......@@ -53,7 +53,7 @@
<ItemDefinitionGroup>
<ClCompile>
<WarningLevel>Level4</WarningLevel>
<AdditionalIncludeDirectories>$(ProjectDir)..\..\..\include;$(ProjectDir)..\..\..\src\base;$(ProjectDir)..\..\..\src\utils;$(ProjectDir)..\..\..\src\voip;$(ProjectDir)..\..\..\src\audiofilters;$(ProjectDil)..\..\..\src\otherfilters;$(ProjectDir)..\..\..\src/videofilters;$(ProjectDir)..\..\..\..\oRTP\include;$(ProjectDir)..\..\..\..\oRTP\build\wp8\oRTP;$(ProjectDir)..\..\..\..\..\gsm\build\wp8\gsm\$(Platform)\$(Configuration);$(ProjectDir)..\..\..\..\..\srtp\include;$(ProjectDir)..\..\..\..\..\srtp\crypto\include;$(ProjectDir)..\..\..\..\..\srtp\build\wp8\srtp;$(ProjectDir)..\..\..\..\..\speex\include;$(ProjectDir)..\..\..\..\..\opus\include;$(ProjectDir)..\..\..\..\..\polarssl\include;$(ProjectDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>$(ProjectDir)..\..\..\include;$(ProjectDir)..\..\..\src\base;$(ProjectDir)..\..\..\src\utils;$(ProjectDir)..\..\..\src\voip;$(ProjectDir)..\..\..\src\audiofilters;$(ProjectDil)..\..\..\src\otherfilters;$(ProjectDir)..\..\..\src/videofilters;$(ProjectDir)..\..\..\..\oRTP\include;$(ProjectDir)..\..\..\..\oRTP\build\wp8\oRTP;$(ProjectDir)..\..\..\..\..\gsm\build\wp8\gsm\$(Platform)\$(Configuration);$(ProjectDir)..\..\..\..\..\srtp\include;$(ProjectDir)..\..\..\..\..\srtp\crypto\include;$(ProjectDir)..\..\..\..\..\srtp\build\wp8\srtp;$(ProjectDir)..\..\..\..\..\speex\include;$(ProjectDir)..\..\..\..\..\opus\include;$(ProjectDir)..\..\..\..\..\polarssl\include;$(ProjectDir);$(ProjectDir)..\..\..\..\..\libvpx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>__STDC_CONSTANT_MACROS;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;WIN32;MEDIASTREAMER2_EXPORTS;MEDIASTREAMER2_INTERNAL_EXPORTS;HAVE_SPEEXDSP;ORTP_INET6;HAVE_SRTP;WINDOW_NATIVE;_TRUE_TIME;MS2_INTERNAL;MS2_FILTERS;VIDEO_ENABLED;NO_FFMPEG;UNICODE;HAVE_CONFIG_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>Default</BasicRuntimeChecks>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
......@@ -64,8 +64,8 @@
<SubSystem>Console</SubSystem>
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
<GenerateWindowsMetadata>false</GenerateWindowsMetadata>
<AdditionalDependencies>ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(SolutionDir)$(Platform)\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>ws2_32.lib;vpxmd.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(SolutionDir)$(Platform)\$(Configuration);$(ProjectDir)..\..\..\..\..\libvpx_build\$(Platform)\Release;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<ImportLibrary>$(TargetDir)$(TargetName).lib</ImportLibrary>
</Link>
<PreBuildEvent>
......@@ -96,7 +96,7 @@
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Platform)'=='ARM'">
<ClCompile>
<PreprocessorDefinitions>__ARMEL__;HAVE_POLARSSL_SSL_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>__ARMEL__;HAVE_POLARSSL_SSL_H;__ARM_NEON__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup>
......@@ -138,9 +138,11 @@
<ClInclude Include="..\..\..\src\utils\kiss_fftr.h" />
<ClInclude Include="..\..\..\src\utils\_kiss_fft_guts.h" />
<ClInclude Include="..\..\..\src\voip\layouts.h" />
<ClInclude Include="..\..\..\src\voip\msvideo_neon.h" />
<ClInclude Include="..\..\..\src\voip\nowebcam.h" />
<ClInclude Include="..\..\..\src\voip\private.h" />
<ClInclude Include="..\..\..\src\voip\rfc2429.h" />
<ClInclude Include="..\..\..\src\voip\vp8rtpfmt.h" />
<ClInclude Include="basedescs.h" />
<ClInclude Include="gitversion.h" />
<ClInclude Include="mediastreamer-config.h" />
......@@ -194,6 +196,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" />
......@@ -203,6 +206,7 @@
<ClCompile Include="..\..\..\src\voip\mediastream.c" />
<ClCompile Include="..\..\..\src\voip\msmediaplayer.c" />
<ClCompile Include="..\..\..\src\voip\msvideo.c" />
<ClCompile Include="..\..\..\src\voip\msvideo_neon.c" />
<ClCompile Include="..\..\..\src\voip\msvoip.c" />
<ClCompile Include="..\..\..\src\voip\qosanalyzer.c" />
<ClCompile Include="..\..\..\src\voip\qualityindicator.c" />
......@@ -212,6 +216,7 @@
<ClCompile Include="..\..\..\src\voip\stun_udp.c" />
<ClCompile Include="..\..\..\src\voip\videostarter.c" />
<ClCompile Include="..\..\..\src\voip\videostream.c" />
<ClCompile Include="..\..\..\src\voip\vp8rtpfmt.c" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\..\..\gsm\build\wp8\gsm\gsm.vcxproj">
......
......@@ -91,6 +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,
#endif
NULL
};
......
......@@ -114,7 +114,7 @@ static void ms_opus_enc_preprocess(MSFilter *f) {
}
/* set complexity to 0 for single processor arm devices */
#ifdef __arm__
#if defined(__arm__) || defined(_M_ARM)
if (ms_factory_get_cpu_count(f->factory)==1){
opus_encoder_ctl(d->state, OPUS_SET_COMPLEXITY(0));
}else{
......
......@@ -63,7 +63,7 @@ static void resample_data_destroy(ResampleData *obj){
static void resample_init(MSFilter *obj){
ResampleData* data=resample_data_new();
#ifdef SPEEX_LIB_SET_CPU_FEATURES
#ifdef __arm__
#if defined(__arm__) || defined(_M_ARM)
#ifdef ANDROID
if (android_getCpuFamily() == ANDROID_CPU_FAMILY_ARM
&& (android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_NEON) != 0) {
......@@ -108,14 +108,14 @@ static int resample_channel_adapt(int in_nchannels, int out_nchannels, mblk_t *i
static void resample_init_speex(ResampleData *dt){
int err=0;
int quality=SPEEX_RESAMPLER_QUALITY_VOIP; /*default value is voip*/
#if __arm__ /*on ARM, NEON optimization are mandatory to support this quality, else using basic mode*/
#if defined(__arm__) || defined(_M_ARM) /*on ARM, NEON optimization are mandatory to support this quality, else using basic mode*/
#if SPEEX_LIB_SET_CPU_FEATURES
if (dt->cpuFeatures != SPEEX_LIB_CPU_FEATURE_NEON)
quality=SPEEX_RESAMPLER_QUALITY_MIN;
#elif !__ARM_NEON__
#elif !defined(__ARM_NEON__)
quality=SPEEX_RESAMPLER_QUALITY_MIN;
#endif /*SPEEX_LIB_SET_CPU_FEATURES*/
#endif /*__arm__*/
#endif /*defined(__arm__) || defined(_M_ARM)*/
ms_message("Initializing speex resampler in mode [%s] ",(quality==SPEEX_RESAMPLER_QUALITY_VOIP?"voip":"min"));
dt->handle=speex_resampler_init(dt->in_nchannels, dt->input_rate, dt->output_rate, quality, &err);
}
......
......@@ -39,7 +39,7 @@
{ required_bitrate, bitrate_limit, { MS_VIDEO_SIZE_ ## resolution ## _W, MS_VIDEO_SIZE_ ## resolution ## _H }, fps, cpus, NULL }
static const MSVideoConfiguration vp8_conf_list[] = {
#if defined(ANDROID) || (TARGET_OS_IPHONE == 1) || defined(__arm__)
#if defined(ANDROID) || (TARGET_OS_IPHONE == 1) || defined(__arm__) || defined(_M_ARM)
MS_VP8_CONF(2048000, 2560000, UXGA, 12, 2),
MS_VP8_CONF(1024000, 1536000, SXGA_MINUS, 12, 2),
MS_VP8_CONF( 750000, 1024000, XGA, 12, 2),
......
......@@ -21,7 +21,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "mediastreamer2/msvideo.h"
#if defined(__arm__) || defined(__arm64__)
#if defined(__arm__) || defined(__arm64__) || defined(_M_ARM)
#define MS_HAS_ARM 1
#endif
......@@ -31,7 +31,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <arm_neon.h>
#endif
#ifdef __arm__
#if defined(__arm__)
#define MATRIX_LOAD_8X8 \
/*load 8x8 pixel \
......@@ -190,7 +190,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
"vld2.8 {d7,d8},[r4] \n\t"
static inline void rotate_block_8x8_clockwise(unsigned char* src, int src_width, unsigned char* dest,int dest_width) {
static MS2_INLINE void rotate_block_8x8_clockwise(unsigned char* src, int src_width, unsigned char* dest,int dest_width) {
#ifdef __ARM_NEON__
__asm (MATRIX_LOAD_8X8
MATRIX_TRANSPOSE_8X8
......@@ -203,7 +203,7 @@ static inline void rotate_block_8x8_clockwise(unsigned char* src, int src_width,
#endif
}
/*rotate and scale down blocks of 16x16 into 8x8*/
static inline void rotate_and_scale_down_block_16x16_clockwise(unsigned char* src, int src_width, unsigned char* dest,int dest_width) {
static MS2_INLINE void rotate_and_scale_down_block_16x16_clockwise(unsigned char* src, int src_width, unsigned char* dest,int dest_width) {
#ifdef __ARM_NEON__
__asm (
......@@ -219,7 +219,7 @@ static inline void rotate_and_scale_down_block_16x16_clockwise(unsigned char* sr
}
/*rotate and scale down blocks of 16x16 into 8x8*/
static inline void rotate_and_scale_down_block_8x8_anticlockwise(unsigned char* src, int src_width, unsigned char* dest,int dest_width) {
static MS2_INLINE void rotate_and_scale_down_block_8x8_anticlockwise(unsigned char* src, int src_width, unsigned char* dest,int dest_width) {
#ifdef __ARM_NEON__
__asm (
......@@ -233,7 +233,7 @@ static inline void rotate_and_scale_down_block_8x8_anticlockwise(unsigned char*
#endif
}
static inline void rotate_block_8x8_anticlockwise(unsigned char* src, int src_width, unsigned char* dest,int dest_width) {
static MS2_INLINE void rotate_block_8x8_anticlockwise(unsigned char* src, int src_width, unsigned char* dest,int dest_width) {
#ifdef __ARM_NEON__
__asm (MATRIX_LOAD_8X8
MATRIX_TRANSPOSE_8X8
......
......@@ -466,7 +466,7 @@ static void configure_video_source(VideoStream *stream){
vsize=cam_vsize;
ms_message("Output video size adjusted to match camera resolution (%ix%i)",vsize.width,vsize.height);
} else {
#if TARGET_IPHONE_SIMULATOR || defined(__arm__)
#if TARGET_IPHONE_SIMULATOR || defined(__arm__) || defined(_M_ARM)
ms_error("Camera is proposing a size bigger than encoder's suggested size (%ix%i > %ix%i) "
"Using the camera size as fallback because cropping or resizing is not implemented for arm.",
cam_vsize.width,cam_vsize.height,vsize.width,vsize.height);
......
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