ref: f771347483c39dabbffba72991ddf56a34f9f51a
parent: 819f37983735482275d1747f377cb2bca2754efa
parent: 8abe601d33598f17b5ac829596594ba7cc631084
author: sijchen <[email protected]>
date: Tue Apr 7 06:52:41 EDT 2015
Merge pull request #1888 from shihuade/WP8V4.1 add Codec demo and auto build script for WP8
--- /dev/null
+++ b/build/AutoBuildForWP8VC2013.bat
@@ -1,0 +1,239 @@
+@echo off
+rem *************************************************************************************************
+rem usage:
+rem AutoBuildForWP8VC2013.bat % Configuration %
+rem --For debug version:
+rem C-Only:AutoBuildForWP8VC2013.bat Debug-C
+rem ASM: AutoBuildForWP8VC2013.bat Debug-ASM
+rem --For release version:
+rem C-Only: AutoBuildForWP8VC2013.bat Release-C
+rem ASM: AutoBuildForWP8VC2013.bat Release-ASM
+rem --For debug and release version:
+rem C-Only: AutoBuildForWP8VC2013.bat All-C
+rem ASM: AutoBuildForWP8VC2013.bat All-ASM
+rem --For default:
+rem AutoBuildForWP8VC2013.bat
+rem both debug and release with ASM=Yes
+rem
+rem Environment:
+rem ----gas - preprocessor
+rem --you can clone it from git://git.libav.org/gas-preprocessor.git
+rem --for more detail, please refer to https : //git.libav.org/?p=gas-preprocessor.git
+rem -- and then set gas - preprocessor path to the % GasPrePath % variable in this script
+rem or just copy to VC2013 bin's path,you can refer to variable %VC2013Path%
+rem
+rem ----MinGW
+rem --install MinGW tools
+rem --more detail, please refer to http://www.mingw.org/
+rem
+rem 2015/03/15 [email protected]
+rem *************************************************************************************************
+
+
+call :BasicSetting
+call :PathSetting
+call :EnvSetting
+call :BuildSetting %1
+call :BuildResultInit
+call :RunBuild
+call :OutputBuildResult
+call :GetFinalReturnCode
+echo ReturnCode is %ReturnCode%
+cd %WorkingDir%
+goto :End
+
+:RunBuild
+ for %%j in ( %aConfigurationList% ) do (
+ echo Configuration is %%j
+ echo ASMFlag is %ASMFlag%
+ set BuildFlag=0
+ echo start build
+ call :Build %%j
+ call :BuildCheck %%j
+ call :CopyDll %%j
+ )
+goto :EOF
+
+rem function for setting
+rem ***********************************************
+:BasicSetting
+ set DllFile=openh264.dll
+ set LibFile=openh264.lib
+ set PDBFile=openh264.pdb
+goto :EOF
+
+:PathSetting
+ set WorkingDir=%cd%
+ cd ..
+ set RootDir=%cd%
+ set BinDir=%RootDir%\bin\ARM
+ cd %WorkingDir%
+goto :EOF
+
+:EnvSetting
+ set MinGWPath=C:\MinGW\bin
+ set MsysPath=C:\MinGW\msys\1.0\bin
+ set VC2013Path=C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin
+ set GasPrePath=C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin
+ rem set PATH=%MinGWPath%;%MsysPath%;%VC2013Path%;%GasPrePath%;%PATH%
+ set PATH=C:\MinGW\bin;C:\MinGW\msys\1.0\bin;C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin;%PATH%
+
+ call "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" x86_arm
+
+ set VC12ArmLib01=C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\lib\store\arm
+ set VC12ArmLib02=C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\lib\arm
+ set WP8KitLib=C:\Program Files (x86)\Windows Phone Kits\8.1\lib\arm
+ set LIB=%VC12ArmLib01%;%VC12ArmLib02%;%WP8KitLib%
+
+ echo PATH is %PATH%
+ echo LIB is %LIB%
+ goto :EOF
+
+:BuildSetting
+ rem default setting
+ if "aaa%1"=="aaa" (
+ set aConfigurationList=Debug Release
+ set ASMFlag=Yes
+ echo default setting
+ ) else if "%1"=="All-C" (
+ set aConfigurationList=Debug Release
+ set ASMFlag=No
+ echo All-C setting
+ ) else if "%1"=="All-ASM" (
+ set aConfigurationList=Debug Release
+ set ASMFlag=Yes
+ echo All-ASM setting
+ ) else if "%1"=="Debug-C" (
+ set aConfigurationList=Debug
+ set ASMFlag=No
+ echo Debug-C setting
+ ) else if "%1"=="Debug-ASM" (
+ set aConfigurationList=Debug
+ set ASMFlag=Yes
+ echo Debug-ASM setting
+ ) else if "%1"=="Release-C" (
+ set aConfigurationList=Release
+ set ASMFlag=No
+ echo Release-C setting
+ ) else if "%1"=="Release-ASM" (
+ set aConfigurationList=Release
+ set ASMFlag=Yes
+ echo Release-ASM setting
+ ) else (
+ call :help
+ goto :ErrorReturn
+ )
+ echo aConfigurationList is %aConfigurationList%
+ echo ASMFlag is %ASMFlag%
+goto :EOF
+
+rem function for build result
+rem ***********************************************
+:BuildResultInit
+ set BuildDebugFlag=0
+ set BuildReleaseFlag=0
+ set BuildDebugInfo=NULL
+ set BuildReleaseInfo=NULL
+goto :EOF
+
+:OutputBuildResult
+ echo BuildDebugFlag =%BuildDebugFlag%
+ echo BuildReleaseFlag =%BuildReleaseFlag%
+ echo BuildDebugInfo =%BuildDebugInfo%
+ echo BuildReleaseInfo =%BuildReleaseInfo%
+ goto :EOF
+
+:BuildCheck
+ set vConfiguration=%1
+ if not %BuildFlag%==0 (
+ if "%vConfiguration%"=="Debug" (
+ set BuildDebugFlag=1
+ set BuildDebugInfo="build debug--failed"
+ ) else (
+ set BuildReleaseFlag=1
+ set BuildReleaseInfo="build release--failed"
+ )
+ ) else (
+ if "%vConfiguration%"=="Debug" (
+ set BuildDebugFlag=0
+ set BuildDebugInfo="build debug--succeed"
+ ) else (
+ set BuildReleaseFlag=0
+ set BuildReleaseInfo="build release--succeed"
+ )
+ )
+goto :EOF
+
+:GetFinalReturnCode
+ set aBuildFlagList=%BuildDebugFlag% %BuildReleaseFlag%
+ echo aBuildFlagList is %aBuildFlagList%
+ set ReturnCode=0
+ for %%k in (%aBuildFlagList%) do (
+ if not %%k == 0 (
+ set ReturnCode=1
+ )
+ )
+goto :EOF
+
+rem function for help
+rem ***********************************************
+:help
+ echo *****************************************************************
+ echo --For debug version:
+ echo C-Only: AutoBuildForWP8VC2013.bat Debug-C
+ echo ASM: AutoBuildForWP8VC2013.bat Debug-ASM
+ echo --For release version:
+ echo C-Only: AutoBuildForWP8VC2013.bat Release-C
+ echo ASM: AutoBuildForWP8VC2013.bat Release-ASM
+ echo --For debug and release version:
+ echo C-Only: AutoBuildForWP8VC2013.bat All-C
+ echo ASM: AutoBuildForWP8VC2013.bat All-ASM
+ echo --For default:
+ echo AutoBuildForWP8VC2013.bat
+ echo both debug and release with ASM=Yes
+ echo *****************************************************************
+goto :EOF
+
+rem function for build
+rem ***********************************************
+:Build
+ set vConfiguration=%1
+ cd %RootDir%
+ bash -c "make OS=msvc-wp ARCH=arm USE_ASM=%ASMFlag% clean"
+ bash -c "make OS=msvc-wp ARCH=arm USE_ASM=%ASMFlag% BUILDTYPE=%vConfiguration%"
+ echo bash -c "make OS=msvc-wp ARCH=arm USE_ASM=%ASMFlag% clean"
+ echo bash -c "make OS=msvc-wp ARCH=arm USE_ASM=%ASMFlag% BUILDTYPE=%vConfiguration%"
+ if not %ERRORLEVEL%==0 (
+ set BuildFlag=1
+ )
+ cd %WorkingDir%
+goto :EOF
+
+:CopyDll
+ set vConfiguration=%1
+ cd %RootDir%
+ set FullDesDir=%BinDir%\%vConfiguration%
+ echo copying dll files to destination folder...
+ echo FullDesDir is %FullDesDir%
+ if exist %FullDesDir% (
+ rd /s /q %FullDesDir%
+ )
+ md %FullDesDir%
+
+ echo current dir is:
+ cd
+ set DestDir=bin/ARM/%vConfiguration%
+ echo DestDir is %DestDir%
+ bash -c "cp -f %DllFile% %DestDir%"
+ bash -c "cp -f %LibFile% %DestDir%"
+ bash -c "cp -f %PDBFile% %DestDir%"
+ cd %WorkingDir%
+goto :EOF
+
+:ErrorReturn
+ endlocal
+exit /b 2
+
+:End
+ endlocal
+exit /b %ReturnCode%
--- /dev/null
+++ b/codec/build/windowsphone/all/CodecApp.sln
@@ -1,0 +1,76 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 2013
+VisualStudioVersion = 12.0.31101.0
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CodecApp", "CodecApp\CodecApp.csproj", "{5424CF29-908E-417E-93F3-F1CD81E5372C}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CodecRTComponent", "CodecRTComponent.vcxproj", "{FE5BF241-F4EA-4B94-B36A-23511E5908EC}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Debug|ARM = Debug|ARM
+ Debug|Mixed Platforms = Debug|Mixed Platforms
+ Debug|Win32 = Debug|Win32
+ Debug|x86 = Debug|x86
+ Release|Any CPU = Release|Any CPU
+ Release|ARM = Release|ARM
+ Release|Mixed Platforms = Release|Mixed Platforms
+ Release|Win32 = Release|Win32
+ Release|x86 = Release|x86
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {5424CF29-908E-417E-93F3-F1CD81E5372C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {5424CF29-908E-417E-93F3-F1CD81E5372C}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {5424CF29-908E-417E-93F3-F1CD81E5372C}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
+ {5424CF29-908E-417E-93F3-F1CD81E5372C}.Debug|ARM.ActiveCfg = Debug|ARM
+ {5424CF29-908E-417E-93F3-F1CD81E5372C}.Debug|ARM.Build.0 = Debug|ARM
+ {5424CF29-908E-417E-93F3-F1CD81E5372C}.Debug|ARM.Deploy.0 = Debug|ARM
+ {5424CF29-908E-417E-93F3-F1CD81E5372C}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
+ {5424CF29-908E-417E-93F3-F1CD81E5372C}.Debug|Mixed Platforms.Build.0 = Debug|x86
+ {5424CF29-908E-417E-93F3-F1CD81E5372C}.Debug|Mixed Platforms.Deploy.0 = Debug|x86
+ {5424CF29-908E-417E-93F3-F1CD81E5372C}.Debug|Win32.ActiveCfg = Debug|x86
+ {5424CF29-908E-417E-93F3-F1CD81E5372C}.Debug|Win32.Build.0 = Debug|x86
+ {5424CF29-908E-417E-93F3-F1CD81E5372C}.Debug|Win32.Deploy.0 = Debug|x86
+ {5424CF29-908E-417E-93F3-F1CD81E5372C}.Debug|x86.ActiveCfg = Debug|x86
+ {5424CF29-908E-417E-93F3-F1CD81E5372C}.Debug|x86.Build.0 = Debug|x86
+ {5424CF29-908E-417E-93F3-F1CD81E5372C}.Debug|x86.Deploy.0 = Debug|x86
+ {5424CF29-908E-417E-93F3-F1CD81E5372C}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {5424CF29-908E-417E-93F3-F1CD81E5372C}.Release|Any CPU.Build.0 = Release|Any CPU
+ {5424CF29-908E-417E-93F3-F1CD81E5372C}.Release|Any CPU.Deploy.0 = Release|Any CPU
+ {5424CF29-908E-417E-93F3-F1CD81E5372C}.Release|ARM.ActiveCfg = Release|ARM
+ {5424CF29-908E-417E-93F3-F1CD81E5372C}.Release|ARM.Build.0 = Release|ARM
+ {5424CF29-908E-417E-93F3-F1CD81E5372C}.Release|ARM.Deploy.0 = Release|ARM
+ {5424CF29-908E-417E-93F3-F1CD81E5372C}.Release|Mixed Platforms.ActiveCfg = Release|x86
+ {5424CF29-908E-417E-93F3-F1CD81E5372C}.Release|Mixed Platforms.Build.0 = Release|x86
+ {5424CF29-908E-417E-93F3-F1CD81E5372C}.Release|Mixed Platforms.Deploy.0 = Release|x86
+ {5424CF29-908E-417E-93F3-F1CD81E5372C}.Release|Win32.ActiveCfg = Release|x86
+ {5424CF29-908E-417E-93F3-F1CD81E5372C}.Release|Win32.Build.0 = Release|x86
+ {5424CF29-908E-417E-93F3-F1CD81E5372C}.Release|Win32.Deploy.0 = Release|x86
+ {5424CF29-908E-417E-93F3-F1CD81E5372C}.Release|x86.ActiveCfg = Release|x86
+ {5424CF29-908E-417E-93F3-F1CD81E5372C}.Release|x86.Build.0 = Release|x86
+ {5424CF29-908E-417E-93F3-F1CD81E5372C}.Release|x86.Deploy.0 = Release|x86
+ {FE5BF241-F4EA-4B94-B36A-23511E5908EC}.Debug|Any CPU.ActiveCfg = Debug|Win32
+ {FE5BF241-F4EA-4B94-B36A-23511E5908EC}.Debug|ARM.ActiveCfg = Debug|ARM
+ {FE5BF241-F4EA-4B94-B36A-23511E5908EC}.Debug|ARM.Build.0 = Debug|ARM
+ {FE5BF241-F4EA-4B94-B36A-23511E5908EC}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
+ {FE5BF241-F4EA-4B94-B36A-23511E5908EC}.Debug|Mixed Platforms.Build.0 = Debug|Win32
+ {FE5BF241-F4EA-4B94-B36A-23511E5908EC}.Debug|Win32.ActiveCfg = Debug|Win32
+ {FE5BF241-F4EA-4B94-B36A-23511E5908EC}.Debug|Win32.Build.0 = Debug|Win32
+ {FE5BF241-F4EA-4B94-B36A-23511E5908EC}.Debug|x86.ActiveCfg = Debug|Win32
+ {FE5BF241-F4EA-4B94-B36A-23511E5908EC}.Debug|x86.Build.0 = Debug|Win32
+ {FE5BF241-F4EA-4B94-B36A-23511E5908EC}.Release|Any CPU.ActiveCfg = Release|Win32
+ {FE5BF241-F4EA-4B94-B36A-23511E5908EC}.Release|ARM.ActiveCfg = Release|ARM
+ {FE5BF241-F4EA-4B94-B36A-23511E5908EC}.Release|ARM.Build.0 = Release|ARM
+ {FE5BF241-F4EA-4B94-B36A-23511E5908EC}.Release|Mixed Platforms.ActiveCfg = Release|Win32
+ {FE5BF241-F4EA-4B94-B36A-23511E5908EC}.Release|Mixed Platforms.Build.0 = Release|Win32
+ {FE5BF241-F4EA-4B94-B36A-23511E5908EC}.Release|Win32.ActiveCfg = Release|Win32
+ {FE5BF241-F4EA-4B94-B36A-23511E5908EC}.Release|Win32.Build.0 = Release|Win32
+ {FE5BF241-F4EA-4B94-B36A-23511E5908EC}.Release|x86.ActiveCfg = Release|Win32
+ {FE5BF241-F4EA-4B94-B36A-23511E5908EC}.Release|x86.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
--- /dev/null
+++ b/codec/build/windowsphone/all/CodecApp/App.xaml
@@ -1,0 +1,20 @@
+<Application
+ x:Class="CodecApp.App"
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
+ xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone">
+
+ <!--Application Resources-->
+ <Application.Resources>
+ <local:LocalizedStrings xmlns:local="clr-namespace:CodecApp" x:Key="LocalizedStrings"/>
+ </Application.Resources>
+
+ <Application.ApplicationLifetimeObjects>
+ <!--Required object that handles lifetime events for the application-->
+ <shell:PhoneApplicationService
+ Launching="Application_Launching" Closing="Application_Closing"
+ Activated="Application_Activated" Deactivated="Application_Deactivated"/>
+ </Application.ApplicationLifetimeObjects>
+
+</Application>
\ No newline at end of file
--- /dev/null
+++ b/codec/build/windowsphone/all/CodecApp/App.xaml.cs
@@ -1,0 +1,223 @@
+using System;
+using System.Diagnostics;
+using System.Resources;
+using System.Windows;
+using System.Windows.Markup;
+using System.Windows.Navigation;
+using Microsoft.Phone.Controls;
+using Microsoft.Phone.Shell;
+using CodecApp.Resources;
+
+namespace CodecApp
+{
+ public partial class App : Application
+ {
+ /// <summary>
+ /// Provides easy access to the root frame of the Phone Application.
+ /// </summary>
+ /// <returns>The root frame of the Phone Application.</returns>
+ public static PhoneApplicationFrame RootFrame { get; private set; }
+
+ /// <summary>
+ /// Constructor for the Application object.
+ /// </summary>
+ public App()
+ {
+ // Global handler for uncaught exceptions.
+ UnhandledException += Application_UnhandledException;
+
+ // Standard XAML initialization
+ InitializeComponent();
+
+ // Phone-specific initialization
+ InitializePhoneApplication();
+
+ // Language display initialization
+ InitializeLanguage();
+
+ // Show graphics profiling information while debugging.
+ if (Debugger.IsAttached)
+ {
+ // Display the current frame rate counters.
+ Application.Current.Host.Settings.EnableFrameRateCounter = true;
+
+ // Show the areas of the app that are being redrawn in each frame.
+ //Application.Current.Host.Settings.EnableRedrawRegions = true;
+
+ // Enable non-production analysis visualization mode,
+ // which shows areas of a page that are handed off to GPU with a colored overlay.
+ //Application.Current.Host.Settings.EnableCacheVisualization = true;
+
+ // Prevent the screen from turning off while under the debugger by disabling
+ // the application's idle detection.
+ // Caution:- Use this under debug mode only. Application that disables user idle detection will continue to run
+ // and consume battery power when the user is not using the phone.
+ PhoneApplicationService.Current.UserIdleDetectionMode = IdleDetectionMode.Disabled;
+ }
+
+ }
+
+ // Code to execute when the application is launching (eg, from Start)
+ // This code will not execute when the application is reactivated
+ private void Application_Launching(object sender, LaunchingEventArgs e)
+ {
+ }
+
+ // Code to execute when the application is activated (brought to foreground)
+ // This code will not execute when the application is first launched
+ private void Application_Activated(object sender, ActivatedEventArgs e)
+ {
+ }
+
+ // Code to execute when the application is deactivated (sent to background)
+ // This code will not execute when the application is closing
+ private void Application_Deactivated(object sender, DeactivatedEventArgs e)
+ {
+ }
+
+ // Code to execute when the application is closing (eg, user hit Back)
+ // This code will not execute when the application is deactivated
+ private void Application_Closing(object sender, ClosingEventArgs e)
+ {
+ }
+
+ // Code to execute if a navigation fails
+ private void RootFrame_NavigationFailed(object sender, NavigationFailedEventArgs e)
+ {
+ if (Debugger.IsAttached)
+ {
+ // A navigation has failed; break into the debugger
+ Debugger.Break();
+ }
+ }
+
+ // Code to execute on Unhandled Exceptions
+ private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e)
+ {
+ if (Debugger.IsAttached)
+ {
+ // An unhandled exception has occurred; break into the debugger
+ Debugger.Break();
+ }
+ }
+
+ #region Phone application initialization
+
+ // Avoid double-initialization
+ private bool phoneApplicationInitialized = false;
+
+ // Do not add any additional code to this method
+ private void InitializePhoneApplication()
+ {
+ if (phoneApplicationInitialized)
+ return;
+
+ // Create the frame but don't set it as RootVisual yet; this allows the splash
+ // screen to remain active until the application is ready to render.
+ RootFrame = new PhoneApplicationFrame();
+ RootFrame.Navigated += CompleteInitializePhoneApplication;
+
+ // Handle navigation failures
+ RootFrame.NavigationFailed += RootFrame_NavigationFailed;
+
+ // Handle reset requests for clearing the backstack
+ RootFrame.Navigated += CheckForResetNavigation;
+
+ // Ensure we don't initialize again
+ phoneApplicationInitialized = true;
+ }
+
+ // Do not add any additional code to this method
+ private void CompleteInitializePhoneApplication(object sender, NavigationEventArgs e)
+ {
+ // Set the root visual to allow the application to render
+ if (RootVisual != RootFrame)
+ RootVisual = RootFrame;
+
+ // Remove this handler since it is no longer needed
+ RootFrame.Navigated -= CompleteInitializePhoneApplication;
+ }
+
+ private void CheckForResetNavigation(object sender, NavigationEventArgs e)
+ {
+ // If the app has received a 'reset' navigation, then we need to check
+ // on the next navigation to see if the page stack should be reset
+ if (e.NavigationMode == NavigationMode.Reset)
+ RootFrame.Navigated += ClearBackStackAfterReset;
+ }
+
+ private void ClearBackStackAfterReset(object sender, NavigationEventArgs e)
+ {
+ // Unregister the event so it doesn't get called again
+ RootFrame.Navigated -= ClearBackStackAfterReset;
+
+ // Only clear the stack for 'new' (forward) and 'refresh' navigations
+ if (e.NavigationMode != NavigationMode.New && e.NavigationMode != NavigationMode.Refresh)
+ return;
+
+ // For UI consistency, clear the entire page stack
+ while (RootFrame.RemoveBackEntry() != null)
+ {
+ ; // do nothing
+ }
+ }
+
+ #endregion
+
+ // Initialize the app's font and flow direction as defined in its localized resource strings.
+ //
+ // To ensure that the font of your application is aligned with its supported languages and that the
+ // FlowDirection for each of those languages follows its traditional direction, ResourceLanguage
+ // and ResourceFlowDirection should be initialized in each resx file to match these values with that
+ // file's culture. For example:
+ //
+ // AppResources.es-ES.resx
+ // ResourceLanguage's value should be "es-ES"
+ // ResourceFlowDirection's value should be "LeftToRight"
+ //
+ // AppResources.ar-SA.resx
+ // ResourceLanguage's value should be "ar-SA"
+ // ResourceFlowDirection's value should be "RightToLeft"
+ //
+ // For more info on localizing Windows Phone apps see http://go.microsoft.com/fwlink/?LinkId=262072.
+ //
+ private void InitializeLanguage()
+ {
+ try
+ {
+ // Set the font to match the display language defined by the
+ // ResourceLanguage resource string for each supported language.
+ //
+ // Fall back to the font of the neutral language if the Display
+ // language of the phone is not supported.
+ //
+ // If a compiler error is hit then ResourceLanguage is missing from
+ // the resource file.
+ RootFrame.Language = XmlLanguage.GetLanguage(AppResources.ResourceLanguage);
+
+ // Set the FlowDirection of all elements under the root frame based
+ // on the ResourceFlowDirection resource string for each
+ // supported language.
+ //
+ // If a compiler error is hit then ResourceFlowDirection is missing from
+ // the resource file.
+ FlowDirection flow = (FlowDirection)Enum.Parse(typeof(FlowDirection), AppResources.ResourceFlowDirection);
+ RootFrame.FlowDirection = flow;
+ }
+ catch
+ {
+ // If an exception is caught here it is most likely due to either
+ // ResourceLangauge not being correctly set to a supported language
+ // code or ResourceFlowDirection is set to a value other than LeftToRight
+ // or RightToLeft.
+
+ if (Debugger.IsAttached)
+ {
+ Debugger.Break();
+ }
+
+ throw;
+ }
+ }
+ }
+}
\ No newline at end of file
binary files /dev/null b/codec/build/windowsphone/all/CodecApp/Assets/AlignmentGrid.png differ
binary files /dev/null b/codec/build/windowsphone/all/CodecApp/Assets/ApplicationIcon.png differ
binary files /dev/null b/codec/build/windowsphone/all/CodecApp/Assets/BadgeLogo.png differ
binary files /dev/null b/codec/build/windowsphone/all/CodecApp/Assets/Logo.png differ
binary files /dev/null b/codec/build/windowsphone/all/CodecApp/Assets/SplashScreen.png differ
binary files /dev/null b/codec/build/windowsphone/all/CodecApp/Assets/SquareTile150x150.png differ
binary files /dev/null b/codec/build/windowsphone/all/CodecApp/Assets/SquareTile71x71.png differ
binary files /dev/null b/codec/build/windowsphone/all/CodecApp/Assets/StoreLogo.png differ
binary files /dev/null b/codec/build/windowsphone/all/CodecApp/Assets/Tiles/FlipCycleTileLarge.png differ
binary files /dev/null b/codec/build/windowsphone/all/CodecApp/Assets/Tiles/FlipCycleTileMedium.png differ
binary files /dev/null b/codec/build/windowsphone/all/CodecApp/Assets/Tiles/FlipCycleTileSmall.png differ
binary files /dev/null b/codec/build/windowsphone/all/CodecApp/Assets/Tiles/IconicTileMediumLarge.png differ
binary files /dev/null b/codec/build/windowsphone/all/CodecApp/Assets/Tiles/IconicTileSmall.png differ
binary files /dev/null b/codec/build/windowsphone/all/CodecApp/Assets/WideLogo.png differ
--- /dev/null
+++ b/codec/build/windowsphone/all/CodecApp/CodecApp.csproj
@@ -1,0 +1,210 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>10.0.20506</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{5424CF29-908E-417E-93F3-F1CD81E5372C}</ProjectGuid>
+ <ProjectTypeGuids>{C089C8C0-30E0-4E22-80C0-CE093F111A43};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>CodecApp</RootNamespace>
+ <AssemblyName>CodecApp</AssemblyName>
+ <TargetFrameworkIdentifier>WindowsPhone</TargetFrameworkIdentifier>
+ <TargetFrameworkVersion>v8.1</TargetFrameworkVersion>
+ <SilverlightVersion>
+ </SilverlightVersion>
+ <SilverlightApplication>true</SilverlightApplication>
+ <SupportedCultures>
+ </SupportedCultures>
+ <XapOutputs>true</XapOutputs>
+ <GenerateSilverlightManifest>true</GenerateSilverlightManifest>
+ <XapFilename>CodecApp_$(Configuration)_$(Platform).xap</XapFilename>
+ <SilverlightManifestTemplate>Properties\AppManifest.xml</SilverlightManifestTemplate>
+ <SilverlightAppEntry>CodecApp.App</SilverlightAppEntry>
+ <ValidateXaml>true</ValidateXaml>
+ <MinimumVisualStudioVersion>12.0</MinimumVisualStudioVersion>
+ <ThrowErrorsInValidation>true</ThrowErrorsInValidation>
+ <TargetFrameworkProfile />
+ <DefaultLanguage>en-US</DefaultLanguage>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>Bin\Debug</OutputPath>
+ <DefineConstants>DEBUG;TRACE;SILVERLIGHT;WINDOWS_PHONE</DefineConstants>
+ <NoStdLib>true</NoStdLib>
+ <NoConfig>true</NoConfig>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>Bin\Release</OutputPath>
+ <DefineConstants>TRACE;SILVERLIGHT;WINDOWS_PHONE</DefineConstants>
+ <NoStdLib>true</NoStdLib>
+ <NoConfig>true</NoConfig>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>Bin\x86\Debug</OutputPath>
+ <DefineConstants>DEBUG;TRACE;SILVERLIGHT;WINDOWS_PHONE</DefineConstants>
+ <NoStdLib>true</NoStdLib>
+ <NoConfig>true</NoConfig>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <PlatformTarget />
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>Bin\x86\Release</OutputPath>
+ <DefineConstants>TRACE;SILVERLIGHT;WINDOWS_PHONE</DefineConstants>
+ <NoStdLib>true</NoStdLib>
+ <NoConfig>true</NoConfig>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <PlatformTarget />
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|ARM' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>Bin\ARM\Debug</OutputPath>
+ <DefineConstants>DEBUG;TRACE;SILVERLIGHT;WINDOWS_PHONE</DefineConstants>
+ <NoStdLib>true</NoStdLib>
+ <NoConfig>true</NoConfig>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <PlatformTarget />
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|ARM' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>Bin\ARM\Release</OutputPath>
+ <DefineConstants>TRACE;SILVERLIGHT;WINDOWS_PHONE</DefineConstants>
+ <NoStdLib>true</NoStdLib>
+ <NoConfig>true</NoConfig>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <PlatformTarget />
+ </PropertyGroup>
+ <ItemGroup>
+ <Compile Include="App.xaml.cs">
+ <DependentUpon>App.xaml</DependentUpon>
+ </Compile>
+ <Compile Include="LocalizedStrings.cs" />
+ <Compile Include="MainPage.xaml.cs">
+ <DependentUpon>MainPage.xaml</DependentUpon>
+ </Compile>
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ <Compile Include="Resources\AppResources.Designer.cs">
+ <AutoGen>True</AutoGen>
+ <DesignTime>True</DesignTime>
+ <DependentUpon>AppResources.resx</DependentUpon>
+ </Compile>
+ </ItemGroup>
+ <ItemGroup>
+ <ApplicationDefinition Include="App.xaml">
+ <SubType>Designer</SubType>
+ <Generator>MSBuild:Compile</Generator>
+ </ApplicationDefinition>
+ <Page Include="MainPage.xaml">
+ <SubType>Designer</SubType>
+ <Generator>MSBuild:Compile</Generator>
+ </Page>
+ </ItemGroup>
+ <ItemGroup>
+ <Content Include="Assets\BadgeLogo.png" />
+ <Content Include="Assets\Logo.png" />
+ <Content Include="Assets\SplashScreen.png" />
+ <Content Include="Assets\SquareTile150x150.png" />
+ <Content Include="Assets\SquareTile71x71.png" />
+ <Content Include="Assets\StoreLogo.png" />
+ <Content Include="Assets\WideLogo.png" />
+ <Content Include="BAMQ1_JVC_C.264">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </Content>
+ <Content Include="BA1_FT_C.264">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </Content>
+ <Content Include="BA_MW_D.264">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </Content>
+ <None Include="CiscoVT2people_160x96_6fps.yuv">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </None>
+ <None Include="layer2.cfg">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </None>
+ <AppxManifest Include="Package.appxmanifest">
+ <SubType>Designer</SubType>
+ </AppxManifest>
+ <None Include="Properties\AppManifest.xml" />
+ <None Include="Properties\WMAppManifest.xml">
+ <SubType>Designer</SubType>
+ </None>
+ <Content Include="openh264.dll">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </Content>
+ <Content Include="welsenc.cfg">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </Content>
+ </ItemGroup>
+ <ItemGroup>
+ <Content Include="Assets\AlignmentGrid.png" />
+ <Content Include="Assets\ApplicationIcon.png">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
+ <Content Include="Assets\Tiles\FlipCycleTileLarge.png">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
+ <Content Include="Assets\Tiles\FlipCycleTileMedium.png">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
+ <Content Include="Assets\Tiles\FlipCycleTileSmall.png">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
+ <Content Include="Assets\Tiles\IconicTileMediumLarge.png">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
+ <Content Include="Assets\Tiles\IconicTileSmall.png">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
+ </ItemGroup>
+ <ItemGroup>
+ <EmbeddedResource Include="Resources\AppResources.resx">
+ <Generator>PublicResXFileCodeGenerator</Generator>
+ <LastGenOutput>AppResources.Designer.cs</LastGenOutput>
+ </EmbeddedResource>
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\CodecRTComponent.vcxproj">
+ <Project>{fe5bf241-f4ea-4b94-b36a-23511e5908ec}</Project>
+ <Name>CodecRTComponent</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <Import Project="$(MSBuildExtensionsPath)\Microsoft\$(TargetFrameworkIdentifier)\$(TargetFrameworkVersion)\Microsoft.$(TargetFrameworkIdentifier).$(TargetFrameworkVersion).Overrides.targets" />
+ <Import Project="$(MSBuildExtensionsPath)\Microsoft\$(TargetFrameworkIdentifier)\$(TargetFrameworkVersion)\Microsoft.$(TargetFrameworkIdentifier).CSharp.targets" />
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+ <ProjectExtensions />
+ <PropertyGroup>
+ <PreBuildEvent>copy /y ..\..\..\..\..\..\..\..\bin\$(Platform)\$(Configuration)\openh264.dll ..\..\..\
+copy /y ..\..\..\..\..\..\..\..\res\*.yuv ..\..\..\
+copy /y ..\..\..\..\..\..\..\..\res\B*.264 ..\..\..\
+</PreBuildEvent>
+ </PropertyGroup>
+</Project>
\ No newline at end of file
--- /dev/null
+++ b/codec/build/windowsphone/all/CodecApp/LocalizedStrings.cs
@@ -1,0 +1,14 @@
+using CodecApp.Resources;
+
+namespace CodecApp
+{
+ /// <summary>
+ /// Provides access to string resources.
+ /// </summary>
+ public class LocalizedStrings
+ {
+ private static AppResources _localizedResources = new AppResources();
+
+ public AppResources LocalizedResources { get { return _localizedResources; } }
+ }
+}
\ No newline at end of file
--- /dev/null
+++ b/codec/build/windowsphone/all/CodecApp/MainPage.xaml
@@ -1,0 +1,66 @@
+<phone:PhoneApplicationPage
+ x:Class="CodecApp.MainPage"
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
+ xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
+ xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+ mc:Ignorable="d"
+ FontFamily="{StaticResource PhoneFontFamilyNormal}"
+ FontSize="{StaticResource PhoneFontSizeNormal}"
+ Foreground="{StaticResource PhoneForegroundBrush}"
+ SupportedOrientations="Portrait" Orientation="Portrait"
+ shell:SystemTray.IsVisible="True">
+
+ <!--LayoutRoot is the root grid where all page content is placed-->
+ <Grid x:Name="LayoutRoot" Background="Transparent">
+ <Grid.RowDefinitions>
+ <RowDefinition Height="Auto"/>
+ <RowDefinition Height="*"/>
+ </Grid.RowDefinitions>
+
+ <!-- LOCALIZATION NOTE:
+ To localize the displayed strings copy their values to appropriately named
+ keys in the app's neutral language resource file (AppResources.resx) then
+ replace the hard-coded text value between the attributes' quotation marks
+ with the binding clause whose path points to that string name.
+
+ For example:
+
+ Text="{Binding Path=LocalizedResources.ApplicationTitle, Source={StaticResource LocalizedStrings}}"
+
+ This binding points to the template's string resource named "ApplicationTitle".
+
+ Adding supported languages in the Project Properties tab will create a
+ new resx file per language that can carry the translated values of your
+ UI strings. The binding in these examples will cause the value of the
+ attributes to be drawn from the .resx file that matches the
+ CurrentUICulture of the app at run time.
+ -->
+
+ <!--TitlePanel contains the name of the application and page title-->
+ <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28">
+ <TextBlock Text="MY APPLICATION" Style="{StaticResource PhoneTextNormalStyle}" Margin="12,0"/>
+ <TextBlock Text="page name" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>
+ </StackPanel>
+
+ <!--ContentPanel - place additional content here-->
+ <Grid x:Name="ContentPanel" Grid.Row="1" Margin="14,10,10,-10">
+ <Button Content="CallEncoder" HorizontalAlignment="Left" Margin="49,10,0,0" VerticalAlignment="Top" Width="340" Click="Button_Click_CallEncoder"/>
+ <Button Content="CallDecoder" HorizontalAlignment="Left" Margin="63,297,0,0" VerticalAlignment="Top" Width="326" Click="Button_Click__CallDecoder"/>
+ <TextBox x:Name="DecoderInfo" HorizontalAlignment="Left" Height="183" Margin="37,374,0,0" TextWrapping="Wrap" Text="Decoder info" VerticalAlignment="Top" Width="397"/>
+ <TextBox x:Name="EncoderInfo" HorizontalAlignment="Left" Height="191" Margin="37,82,0,0" TextWrapping="Wrap" Text="Encoder info" VerticalAlignment="Top" Width="397"/>
+
+ </Grid>
+
+ <!--Uncomment to see an alignment grid to help ensure your controls are
+ aligned on common boundaries. The image has a top margin of -32px to
+ account for the System Tray. Set this to 0 (or remove the margin altogether)
+ if the System Tray is hidden.
+
+ Before shipping remove this XAML and the image itself.-->
+ <!--<Image Source="/Assets/AlignmentGrid.png" VerticalAlignment="Top" Height="800" Width="480" Margin="0,-32,0,0" Grid.Row="0" Grid.RowSpan="2" IsHitTestVisible="False" />-->
+ </Grid>
+
+</phone:PhoneApplicationPage>
\ No newline at end of file
--- /dev/null
+++ b/codec/build/windowsphone/all/CodecApp/MainPage.xaml.cs
@@ -1,0 +1,86 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Net;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Navigation;
+using Microsoft.Phone.Controls;
+using Microsoft.Phone.Shell;
+using CodecApp.Resources;
+using CodecRTComponent;
+
+namespace CodecApp {
+public partial class MainPage : PhoneApplicationPage {
+ // Constructor
+ private CodecRunTimeComponent vRTCCodec;
+ // Constructor
+ public MainPage() {
+ InitializeComponent();
+
+ vRTCCodec = new CodecRunTimeComponent();
+ // Sample code to localize the ApplicationBar
+ //BuildLocalizedApplicationBar();
+ }
+
+ private void Button_Click_CallEncoder (object sender, RoutedEventArgs e) {
+ int iRetVal = 0;
+ float fFPS = 0.0F;
+ double dEncoderTime = 0.0;
+ int iEncodedFrame = 0;
+ string sEncoderInfo = "Encoder performance: \n";
+
+ iRetVal = vRTCCodec.Encode();
+
+ if (0 == iRetVal) {
+ fFPS = vRTCCodec.GetEncFPS();
+ dEncoderTime = vRTCCodec.GetEncTime();
+ iEncodedFrame = vRTCCodec.GetEncodedFrameNum();
+ sEncoderInfo += "FPS : " + fFPS.ToString() + "\n";
+ sEncoderInfo += "EncTime(sec): " + dEncoderTime.ToString() + "\n";
+ sEncoderInfo += "EncodedNum : " + iEncodedFrame.ToString() + "\n";
+ EncoderInfo.Text = sEncoderInfo;
+ } else {
+ EncoderInfo.Text = "ebcoded failed!...";
+ }
+ }
+
+ private void Button_Click__CallDecoder (object sender, RoutedEventArgs e) {
+ int iRetVal = 0;
+ float fFPS = 0.0F;
+ double dDecoderTime = 0.0;
+ int iDecodedFrame = 0;
+ string sDecoderInfo = "Decoder performance: \n";
+
+ iRetVal = vRTCCodec.Decode();
+
+ if (0 == iRetVal) {
+ fFPS = vRTCCodec.GetDecFPS();
+ dDecoderTime = vRTCCodec.GetDecTime();
+ iDecodedFrame = vRTCCodec.GetDecodedFrameNum();
+ sDecoderInfo += "FPS : " + fFPS.ToString() + "\n";
+ sDecoderInfo += "DecTime(sec): " + dDecoderTime.ToString() + "\n";
+ sDecoderInfo += "DecodedNum : " + iDecodedFrame.ToString() + "\n";
+ DecoderInfo.Text = sDecoderInfo;
+ } else {
+ DecoderInfo.Text = "decoded failed!...";
+ }
+ }
+
+ // Sample code for building a localized ApplicationBar
+ //private void BuildLocalizedApplicationBar()
+ //{
+ // // Set the page's ApplicationBar to a new instance of ApplicationBar.
+ // ApplicationBar = new ApplicationBar();
+
+ // // Create a new button and set the text value to the localized string from AppResources.
+ // ApplicationBarIconButton appBarButton = new ApplicationBarIconButton(new Uri("/Assets/AppBar/appbar.add.rest.png", UriKind.Relative));
+ // appBarButton.Text = AppResources.AppBarButtonText;
+ // ApplicationBar.Buttons.Add(appBarButton);
+
+ // // Create a new menu item with the localized string from AppResources.
+ // ApplicationBarMenuItem appBarMenuItem = new ApplicationBarMenuItem(AppResources.AppBarMenuItemText);
+ // ApplicationBar.MenuItems.Add(appBarMenuItem);
+ //}
+}
+}
\ No newline at end of file
--- /dev/null
+++ b/codec/build/windowsphone/all/CodecApp/Package.appxmanifest
@@ -1,0 +1,58 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Package xmlns="http://schemas.microsoft.com/appx/2010/manifest" xmlns:m2="http://schemas.microsoft.com/appx/2013/manifest" xmlns:m3="http://schemas.microsoft.com/appx/2014/manifest" xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest">
+
+ <Identity Name="f99aa5a5-a6ee-47ec-a093-390b78afba3c"
+ Publisher="CN=Openh264"
+ Version="1.0.0.0" />
+
+ <mp:PhoneIdentity PhoneProductId="5424cf29-908e-417e-93f3-f1cd81e5372c" PhonePublisherId="cb9bed24-05fd-451a-8736-6dad92946a6e"/>
+
+ <Properties>
+ <DisplayName>CodecApp</DisplayName>
+ <PublisherDisplayName>Openh264</PublisherDisplayName>
+ <Logo>Assets\StoreLogo.png</Logo>
+ </Properties>
+
+ <Prerequisites>
+ <OSMinVersion>6.3.1</OSMinVersion>
+ <OSMaxVersionTested>6.3.1</OSMaxVersionTested>
+ </Prerequisites>
+
+ <Resources>
+ <Resource Language="x-generate"/>
+ </Resources>
+
+ <Applications>
+ <Application Id="x5424cf29y908ey417ey93f3yf1cd81e5372cx"
+ Executable="AGHost.exe"
+ EntryPoint="MainPage.xaml">
+ <m3:VisualElements
+ DisplayName="CodecApp"
+ Square150x150Logo="Assets\SquareTile150x150.png"
+ Square44x44Logo="Assets\Logo.png"
+ Description="CodecApp"
+ ForegroundText="light"
+ BackgroundColor="#464646">
+ <m3:DefaultTile Square71x71Logo="Assets\SquareTile71x71.png"/>
+ <m3:SplashScreen Image="Assets\Splashscreen.png" />
+ </m3:VisualElements>
+ <Extensions>
+ <Extension Category="windows.backgroundTasks" EntryPoint="AgHost.BackgroundTask">
+ <BackgroundTasks>
+ <Task Type="systemEvent" />
+ </BackgroundTasks>
+ </Extension>
+ </Extensions>
+ </Application>
+ </Applications>
+ <Capabilities>
+ </Capabilities>
+ <Extensions>
+ <Extension Category="windows.activatableClass.inProcessServer">
+ <InProcessServer>
+ <Path>AgHostSvcs.dll</Path>
+ <ActivatableClass ActivatableClassId="AgHost.BackgroundTask" ThreadingModel="both" />
+ </InProcessServer>
+ </Extension>
+ </Extensions>
+</Package>
\ No newline at end of file
--- /dev/null
+++ b/codec/build/windowsphone/all/CodecApp/Properties/AppManifest.xml
@@ -1,0 +1,6 @@
+<Deployment xmlns="http://schemas.microsoft.com/client/2007/deployment"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+>
+ <Deployment.Parts>
+ </Deployment.Parts>
+</Deployment>
--- /dev/null
+++ b/codec/build/windowsphone/all/CodecApp/Properties/AssemblyInfo.cs
@@ -1,0 +1,37 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Resources;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle ("CodecApp")]
+[assembly: AssemblyDescription ("")]
+[assembly: AssemblyConfiguration ("")]
+[assembly: AssemblyCompany ("")]
+[assembly: AssemblyProduct ("CodecApp")]
+[assembly: AssemblyCopyright ("Copyright © 2015")]
+[assembly: AssemblyTrademark ("")]
+[assembly: AssemblyCulture ("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible (false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid ("2bac46db-63e8-4c33-9be3-8e6b4638045c")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Revision and Build Numbers
+// by using the '*' as shown below:
+[assembly: AssemblyVersion ("1.0.0.0")]
+[assembly: AssemblyFileVersion ("1.0.0.0")]
+[assembly: NeutralResourcesLanguageAttribute ("en-US")]
--- /dev/null
+++ b/codec/build/windowsphone/all/CodecApp/Properties/WMAppManifest.xml
@@ -1,0 +1,37 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Deployment xmlns="http://schemas.microsoft.com/windowsphone/2014/deployment" AppPlatformVersion="8.1">
+ <DefaultLanguage xmlns="" code="en-US" />
+ <App xmlns="" ProductID="{5424cf29-908e-417e-93f3-f1cd81e5372c}" Title="CodecApp" RuntimeType="Silverlight" Version="1.0.0.0" Genre="apps.normal" Author="CodecApp author" Description="Sample description" Publisher="CodecApp" PublisherID="{cb9bed24-05fd-451a-8736-6dad92946a6e}">
+ <IconPath IsRelative="true" IsResource="false">Assets\ApplicationIcon.png</IconPath>
+ <Capabilities>
+ <Capability Name="ID_CAP_NETWORKING" />
+ <Capability Name="ID_CAP_MEDIALIB_AUDIO" />
+ <Capability Name="ID_CAP_MEDIALIB_PLAYBACK" />
+ <Capability Name="ID_CAP_SENSORS" />
+ <Capability Name="ID_CAP_WEBBROWSERCOMPONENT" />
+ </Capabilities>
+ <Tasks>
+ <DefaultTask Name="_default" NavigationPage="MainPage.xaml" />
+ </Tasks>
+ <Tokens>
+ <PrimaryToken TokenID="CodecAppToken" TaskName="_default">
+ <TemplateFlip>
+ <SmallImageURI IsRelative="true" IsResource="false">Assets\Tiles\FlipCycleTileSmall.png</SmallImageURI>
+ <Count>0</Count>
+ <BackgroundImageURI IsRelative="true" IsResource="false">Assets\Tiles\FlipCycleTileMedium.png</BackgroundImageURI>
+ <Title>CodecApp</Title>
+ <BackContent></BackContent>
+ <BackBackgroundImageURI></BackBackgroundImageURI>
+ <BackTitle></BackTitle>
+ <DeviceLockImageURI></DeviceLockImageURI>
+ <HasLarge></HasLarge>
+ </TemplateFlip>
+ </PrimaryToken>
+ </Tokens>
+ <ScreenResolutions>
+ <ScreenResolution Name="ID_RESOLUTION_WVGA" />
+ <ScreenResolution Name="ID_RESOLUTION_WXGA" />
+ <ScreenResolution Name="ID_RESOLUTION_HD720P" />
+ </ScreenResolutions>
+ </App>
+</Deployment>
\ No newline at end of file
--- /dev/null
+++ b/codec/build/windowsphone/all/CodecApp/Resources/AppResources.Designer.cs
@@ -1,0 +1,110 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.34014
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace CodecApp.Resources {
+using System;
+
+
+/// <summary>
+/// A strongly-typed resource class, for looking up localized strings, etc.
+/// </summary>
+// This class was auto-generated by the StronglyTypedResourceBuilder
+// class via a tool like ResGen or Visual Studio.
+// To add or remove a member, edit your .ResX file then rerun ResGen
+// with the /str option, or rebuild your VS project.
+[global::System.CodeDom.Compiler.GeneratedCodeAttribute ("System.Resources.Tools.StronglyTypedResourceBuilder",
+ "4.0.0.0")]
+[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+public class AppResources {
+
+ private static global::System.Resources.ResourceManager resourceMan;
+
+ private static global::System.Globalization.CultureInfo resourceCulture;
+
+ [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute ("Microsoft.Performance",
+ "CA1811:AvoidUncalledPrivateCode")]
+ internal AppResources() {
+ }
+
+ /// <summary>
+ /// Returns the cached ResourceManager instance used by this class.
+ /// </summary>
+ [global::System.ComponentModel.EditorBrowsableAttribute (global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ public static global::System.Resources.ResourceManager ResourceManager {
+ get {
+ if (object.ReferenceEquals (resourceMan, null)) {
+ global::System.Resources.ResourceManager temp = new
+ global::System.Resources.ResourceManager ("CodecApp.Resources.AppResources", typeof (AppResources).Assembly);
+ resourceMan = temp;
+ }
+ return resourceMan;
+ }
+ }
+
+ /// <summary>
+ /// Overrides the current thread's CurrentUICulture property for all
+ /// resource lookups using this strongly typed resource class.
+ /// </summary>
+ [global::System.ComponentModel.EditorBrowsableAttribute (global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ public static global::System.Globalization.CultureInfo Culture {
+ get {
+ return resourceCulture;
+ } set {
+ resourceCulture = value;
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to add.
+ /// </summary>
+ public static string AppBarButtonText {
+ get {
+ return ResourceManager.GetString ("AppBarButtonText", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Menu Item.
+ /// </summary>
+ public static string AppBarMenuItemText {
+ get {
+ return ResourceManager.GetString ("AppBarMenuItemText", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to MY APPLICATION.
+ /// </summary>
+ public static string ApplicationTitle {
+ get {
+ return ResourceManager.GetString ("ApplicationTitle", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to LeftToRight.
+ /// </summary>
+ public static string ResourceFlowDirection {
+ get {
+ return ResourceManager.GetString ("ResourceFlowDirection", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to en-US.
+ /// </summary>
+ public static string ResourceLanguage {
+ get {
+ return ResourceManager.GetString ("ResourceLanguage", resourceCulture);
+ }
+ }
+}
+}
--- /dev/null
+++ b/codec/build/windowsphone/all/CodecApp/Resources/AppResources.resx
@@ -1,0 +1,137 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+ <!--
+ Microsoft ResX Schema
+
+ Version 2.0
+
+ The primary goals of this format is to allow a simple XML format
+ that is mostly human readable. The generation and parsing of the
+ various data types are done through the TypeConverter classes
+ associated with the data types.
+
+ Example:
+
+ ... ado.net/XML headers & schema ...
+ <resheader name="resmimetype">text/microsoft-resx</resheader>
+ <resheader name="version">2.0</resheader>
+ <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+ <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+ <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+ <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+ <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+ <value>[base64 mime encoded serialized .NET Framework object]</value>
+ </data>
+ <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+ <comment>This is a comment</comment>
+ </data>
+
+ There are any number of "resheader" rows that contain simple
+ name/value pairs.
+
+ Each data row contains a name, and value. The row also contains a
+ type or mimetype. Type corresponds to a .NET class that support
+ text/value conversion through the TypeConverter architecture.
+ Classes that don't support this are serialized and stored with the
+ mimetype set.
+
+ The mimetype is used for serialized objects, and tells the
+ ResXResourceReader how to depersist the object. This is currently not
+ extensible. For a given mimetype the value must be set accordingly:
+
+ Note - application/x-microsoft.net.object.binary.base64 is the format
+ that the ResXResourceWriter will generate, however the reader can
+ read any of the formats listed below.
+
+ mimetype: application/x-microsoft.net.object.binary.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.soap.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.bytearray.base64
+ value : The object must be serialized into a byte array
+ : using a System.ComponentModel.TypeConverter
+ : and then encoded with base64 encoding.
+ -->
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="metadata">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" use="required" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="assembly">
+ <xsd:complexType>
+ <xsd:attribute name="alias" type="xsd:string" />
+ <xsd:attribute name="name" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <value>2.0</value>
+ </resheader>
+ <resheader name="reader">
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <data name="ResourceFlowDirection" xml:space="preserve">
+ <value>LeftToRight</value>
+ <comment>Controls the FlowDirection for all elements in the RootFrame. Set to the traditional direction of this resource file's language</comment>
+ </data>
+ <data name="ResourceLanguage" xml:space="preserve">
+ <value>en-US</value>
+ <comment>Controls the Language and ensures that the font for all elements in the RootFrame aligns with the app's language. Set to the language code of this resource file's language.</comment>
+ </data>
+ <data name="ApplicationTitle" xml:space="preserve">
+ <value>MY APPLICATION</value>
+ </data>
+ <data name="AppBarButtonText" xml:space="preserve">
+ <value>add</value>
+ </data>
+ <data name="AppBarMenuItemText" xml:space="preserve">
+ <value>Menu Item</value>
+ </data>
+</root>
\ No newline at end of file
--- /dev/null
+++ b/codec/build/windowsphone/all/CodecApp/layer2.cfg
@@ -1,0 +1,39 @@
+# Layer Configuration File
+
+
+#============================== INPUT / OUTPUT ==============================
+FrameWidth 160 # Input frame width
+FrameHeight 96 # Input frame height
+FrameRateOut 12 # Output frame rate [Hz]
+ReconFile rec_layer2.yuv # Reconstructed file
+
+#============================== CODING ==============================
+ProfileIdc 66 # value of profile_idc (or 0 for auto detection)
+
+InitialQP 24 # Quantization parameters for base quality layer
+#================================ RATE CONTROL ===============================
+SpatialBitrate 600 # Unit: kbps, controled by DisableRC also
+MaxSpatialBitrate 800 # Unit: kbps, max bitrate for current layer
+#============================== MultiSlice Slice Argument ==============================
+# for S/M Slice(s) mode settings
+SliceMode 0 # 0: sigle slice mode; >0: multiple slices mode, see below;
+SliceSize 1500
+SliceNum 1 # multiple slices number specified
+
+SlicesAssign0 960 # count number of MBs in slice #0
+SlicesAssign1 0 # count number of MBs in slice #1
+SlicesAssign2 0 # count number of MBs in slice #2
+SlicesAssign3 0 # count number of MBs in slice #3 -- seting here is for better testing
+SlicesAssign4 0 # count number of MBs in slice #4
+SlicesAssign5 0 # count number of MBs in slice #5
+SlicesAssign6 0 # count number of MBs in slice #6
+SlicesAssign7 0 # count number of MBs in slice #7
+
+### DESIGN OF SLICE MODE ####
+# 0 SM_SINGLE_SLICE | SliceNum==1
+# 1 SM_FIXEDSLCNUM_SLICE | according to SliceNum | Enabled dynamic slicing for multi-thread
+# 2 SM_RASTER_SLICE | according to SlicesAssign | Need input of MB numbers each slice. In addition, if other constraint in slice_argument is presented, need to follow the constraints. Typically if MB num and slice size are both constrained, re-encoding may be involved.
+# 3 SM_ROWMB_SLICE | according to PictureMBHeight | Typical of single row of mbs each slice?+ slice size constraint which including re-encoding
+# 4 SM_DYN_SLICE | according to SliceSize | Dynamic slicing (have no idea about slice_nums until encoding current frame)
+# 5 SM_AUTO_SLICE | according to thread number | the number of slices is decided by the number of threads,SliceNum is ignored
+
--- /dev/null
+++ b/codec/build/windowsphone/all/CodecApp/welsenc.cfg
@@ -1,0 +1,62 @@
+# Cisco Scalable H.264/AVC Extension Encoder Configuration File
+
+#============================== GENERAL ==============================
+UsageType 0 #0: camera video 1:screen content
+SourceWidth 160 #input video width
+SourceHeight 96 #input video height
+InputFile CiscoVT2people_160x96_6fps.yuv # Input file
+OutputFile test.264 # Bitstream file
+MaxFrameRate 30 # Maximum frame rate [Hz]
+FramesToBeEncoded - 1 # Number of frames (at input frame rate)
+
+TemporalLayerNum 2 # temporal layer number(1--4)
+IntraPeriod 0 # Intra Period ( multipler of GoP size or -1)
+EnableSpsPpsIDAddition 1
+
+EnableFrameCropping 1 # enable frame cropping flag
+EntropyCodingModeFlag 0 #0:cavlc 1:cabac
+MaxNalSize 0 # Unit:Byte, Maximum Nal size
+#============================== LOOP FILTER ==============================
+LoopFilterDisableIDC 0 # Loop filter idc (0: on, 1: off,
+# 2: on except for slice boundaries,
+# 3: two stage. slice boundries on in second stage
+# 4: Luma on but Chroma off (w.r.t. idc=0)
+# 5: Luma on except on slice boundaries, but Chroma off in enh. layer (w.r.t. idc=2)
+# 6: Luma on in two stage. slice boundries on in second stage, but Chroma off (w.r.t. idc=3)
+ LoopFilterAlphaC0Offset 0 # AlphaOffset(-6..+6): valid range
+ LoopFilterBetaOffset 0 # BetaOffset (-6..+6): valid range
+#============================== SOFTWARE IMPLEMENTATION ==============================
+ MultipleThreadIdc 1
+# 0: auto(dynamic imp. internal encoder); 1: multiple threads imp. disabled; > 1: count number of threads;
+
+#============================== RATE CONTROL ==============================
+ RCMode 0
+# 0: quality mode; 1: bitrate mode; # 2: buffer based mode,can't control bitrate; -1: rc off mode;
+ TargetBitrate 5000 # Unit: kbps, controled by EnableRC also
+ MaxOverallBitrate 6000 # Unit: kbps, max bitrate overall
+ EnableFrameSkip 1 #Enable Frame Skip
+
+#============================== DENOISE CONTROL ==============================
+ EnableDenoise 0 # Enable Denoise (1: enable, 0: disable)
+
+#============================== SCENE CHANGE DETECTION CONTROL =======================
+ EnableSceneChangeDetection 1 # Enable Scene Change Detection (1: enable, 0: disable)
+
+#============================== BACKGROUND DETECTION CONTROL ==============================
+ EnableBackgroundDetection 1 # BGD control(1: enable, 0: disable)
+
+#============================== ADAPTIVE QUANTIZATION CONTROL =======================
+ EnableAdaptiveQuantization 1 # Enable Adaptive Quantization (1: enable, 0: disable)
+
+#============================== LONG TERM REFERENCE CONTROL ==============================
+ EnableLongTermReference 1 # Enable Long Term Reference (1: enable, 0: disable)
+ LtrMarkPeriod 30 # Long Term Reference Marking Period
+
+#============================== LAYER DEFINITION ==============================
+ PrefixNALAddingCtrl 0 # Control flag of adding prefix unit (0: off, 1: on)
+# It shall always be on in SVC contexts (i.e. when there are CGS/MGS/spatial enhancement layers)
+# Can be disabled when no inter spatial layer prediction in case of its value as 0
+ NumLayers 1 # Number of layers
+ //LayerCfg layer0.cfg # Layer 0 configuration file
+ //LayerCfg layer1.cfg # Layer 1 configuration file
+ LayerCfg layer2.cfg # Layer 2 configuration file
--- /dev/null
+++ b/codec/build/windowsphone/all/CodecRTComponent.cpp
@@ -1,0 +1,181 @@
+// CodecRTComponent.cpp
+#include <string.h>
+#include <iostream>
+#include "typedefs.h"
+#include "CodecRTComponent.h"
+
+using namespace CodecRTComponent;
+using namespace Platform;
+using namespace Windows::Storage;
+
+extern "C" int EncMain (int argc, char** argv);
+extern int32_t DecMain (int32_t iArgC, char* pArgV[]);
+//encoder info
+extern float g_fFPS;
+extern double g_dEncoderTime;
+extern int g_iEncodedFrame;
+
+//decoder info
+extern double g_dDecTime;
+extern float g_fDecFPS;
+extern int g_iDecodedFrameNum;
+
+
+CodecRunTimeComponent::CodecRunTimeComponent() {
+}
+
+float CodecRunTimeComponent::GetEncFPS() {
+ return g_fFPS;
+}
+double CodecRunTimeComponent::GetEncTime() {
+ return g_dEncoderTime;
+}
+int CodecRunTimeComponent::GetEncodedFrameNum() {
+ return g_iEncodedFrame;
+}
+
+int CodecRunTimeComponent::Encode() {
+ int iRet = 0;
+ int argc = 6;
+ char* argv[6];
+ int iSize = 0;
+
+ //App test data files' path
+ char InputPath[256] = { 0 };
+ char InputWelsEncCfgPath[256] = { 0 };
+ char InputCfgPath[256] = { 0 };
+ char InputYUVPath[256] = { 0 };
+ char OutputPath[256] = { 0 };
+ char Output264Path[256] = { 0 };
+
+ //App data location
+ Windows::Storage::StorageFolder^ InputLocation;
+ Platform::String^ InputLocationPath;
+ Windows::Storage::StorageFolder^ OutputLocation;
+ Platform::String^ OutputLocationPath;
+
+ //set input file path
+ InputLocation = Windows::ApplicationModel::Package::Current->InstalledLocation;
+ InputLocationPath = Platform::String::Concat (InputLocation->Path, "\\");
+ const wchar_t* pWcharInputFile = InputLocationPath->Data();
+
+ iSize = wcslen (pWcharInputFile);
+ InputPath[iSize] = 0;
+ for (int y = 0; y < iSize; y++) {
+ InputPath[y] = (char)pWcharInputFile[y];
+ }
+
+ //set output file path
+ OutputLocation = ApplicationData::Current->LocalFolder;
+ OutputLocationPath = Platform::String::Concat (OutputLocation->Path, "\\");
+ const wchar_t* pWcharOutputFile = OutputLocationPath->Data();
+
+ iSize = wcslen (pWcharOutputFile);
+ OutputPath[iSize] = 0;
+ for (int y = 0; y < iSize; y++) {
+ OutputPath[y] = (char)pWcharOutputFile[y];
+ }
+
+ //App
+ strcpy (InputWelsEncCfgPath, InputPath);
+ strcat (InputWelsEncCfgPath, "welsenc.cfg");
+
+ strcpy (InputYUVPath, InputPath);
+ strcat (InputYUVPath, "CiscoVT2people_160x96_6fps.yuv");
+
+ // single layer only
+ strcpy (InputCfgPath, InputPath);
+ strcat (InputCfgPath, "layer2.cfg");
+ // for multiple layers
+ /*
+ strcpy(InputCfg0Path, InputPath);
+ strcat(InputCfg0Path, "layer0.cfg");
+ strcpy(InputCfg1Path, InputPath);
+ strcat(InputCfg1Path, "layer1.cfg");
+ ...
+ */
+
+ strcpy (Output264Path, OutputPath);
+ strcat (Output264Path, "WP8_Test_CiscoVT2people_160x96_6fps.264");
+
+ argv[0] = (char*) ("EncoderApp");
+ argv[1] = InputWelsEncCfgPath;
+ argv[2] = (char*) ("-org");
+ argv[3] = InputYUVPath;
+ argv[4] = (char*) ("-bf");
+ argv[5] = Output264Path;
+
+ argc = 6;
+ iRet = EncMain (argc, argv);
+
+ return iRet;
+}
+
+
+float CodecRunTimeComponent::GetDecFPS() {
+ return g_fDecFPS;
+}
+double CodecRunTimeComponent::GetDecTime() {
+ return g_dDecTime;
+}
+int CodecRunTimeComponent::GetDecodedFrameNum() {
+ return g_iDecodedFrameNum;
+}
+
+int CodecRunTimeComponent::Decode() {
+ int iRet = 0;
+ int argc = 3;
+ char* argv[3];
+ int size = 0;
+
+ //App data files' path
+ char InputPath[256] = { 0 };
+ char OutputPath[256] = { 0 };
+ char InputBitstreamPath[256] = { 0 };
+ char OutputYUVPath[256] = { 0 };
+
+ //App data location
+ Windows::Storage::StorageFolder^ InputLocation;
+ Platform::String^ InputLocationPath;
+
+ Windows::Storage::StorageFolder^ OutputLocation;
+ Platform::String^ OutputLocationPath;
+
+ //set input file path
+ InputLocation = Windows::ApplicationModel::Package::Current->InstalledLocation;
+ InputLocationPath = Platform::String::Concat (InputLocation->Path, "\\");
+ const wchar_t* pWcharInputFile = InputLocationPath->Data();
+
+ size = wcslen (pWcharInputFile);
+ InputPath[size] = 0;
+ for (int y = 0; y < size; y++) {
+ InputPath[y] = (char)pWcharInputFile[y];
+ }
+
+ //set output file path
+ OutputLocation = ApplicationData::Current->LocalFolder;
+ OutputLocationPath = Platform::String::Concat (OutputLocation->Path, "\\");
+ const wchar_t* pWcharOutputFile = OutputLocationPath->Data();
+
+ size = wcslen (pWcharOutputFile);
+ OutputPath[size] = 0;
+ for (int y = 0; y < size; y++) {
+ OutputPath[y] = (char)pWcharOutputFile[y];
+ }
+
+ //App test setting
+ strcpy_s (InputBitstreamPath, InputPath);
+ strcat_s (InputBitstreamPath, "BA_MW_D.264");
+
+ strcpy_s (OutputYUVPath, OutputPath);
+ strcat_s (OutputYUVPath, "WP8_Dec_BA_MW_D.yuv");
+
+ argv[0] = (char*) ("DecoderApp");
+ argv[1] = InputBitstreamPath;
+ argv[2] = OutputYUVPath;
+
+ argc = 3;
+ iRet = DecMain (argc, argv);
+
+ return iRet;
+}
--- /dev/null
+++ b/codec/build/windowsphone/all/CodecRTComponent.h
@@ -1,0 +1,22 @@
+#pragma once
+
+namespace CodecRTComponent {
+// public ref class WindowsPhoneRuntimeComponent sealed
+public ref class CodecRunTimeComponent sealed {
+ public:
+ CodecRunTimeComponent();
+ int Encode();
+ int Decode();
+
+ //Get encoder info
+ float GetEncFPS();
+ double GetEncTime();
+ int GetEncodedFrameNum();
+
+ //get decoder info
+ float GetDecFPS();
+ double GetDecTime();
+ int GetDecodedFrameNum();
+
+};
+}
\ No newline at end of file
--- /dev/null
+++ b/codec/build/windowsphone/all/CodecRTComponent.vcxproj
@@ -1,0 +1,154 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|ARM">
+ <Configuration>Debug</Configuration>
+ <Platform>ARM</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|ARM">
+ <Configuration>Release</Configuration>
+ <Platform>ARM</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{fe5bf241-f4ea-4b94-b36a-23511e5908ec}</ProjectGuid>
+ <RootNamespace>CodecRTComponent</RootNamespace>
+ <DefaultLanguage>en-US</DefaultLanguage>
+ <MinimumVisualStudioVersion>12.0</MinimumVisualStudioVersion>
+ <WinMDAssembly>true</WinMDAssembly>
+ <ApplicationType>Windows Phone Silverlight</ApplicationType>
+ <ApplicationTypeRevision>8.1</ApplicationTypeRevision>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v120</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v120</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <PlatformToolset>v120</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <PlatformToolset>v120</PlatformToolset>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup>
+ <GenerateManifest>false</GenerateManifest>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
+ <OutDir>..\..\..\..\bin\$(Platform)\$(Configuration)\</OutDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
+ <OutDir>..\..\..\..\bin\$(Platform)\$(Configuration)\</OutDir>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <PreprocessorDefinitions>_WINRT_DLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PrecompiledHeader>Use</PrecompiledHeader>
+ <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
+ <AdditionalUsingDirectories>$(WindowsSDK_MetadataPath);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
+ <CompileAsWinRT>true</CompileAsWinRT>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
+ <IgnoreSpecificDefaultLibraries>ole32.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <GenerateWindowsMetadata>true</GenerateWindowsMetadata>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <PreprocessorDefinitions>_WINRT_DLL;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PrecompiledHeader>Use</PrecompiledHeader>
+ <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
+ <AdditionalUsingDirectories>$(WindowsSDK_MetadataPath);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
+ <CompileAsWinRT>true</CompileAsWinRT>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
+ <IgnoreSpecificDefaultLibraries>ole32.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <GenerateWindowsMetadata>true</GenerateWindowsMetadata>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
+ <ClCompile>
+ <PreprocessorDefinitions>_WINRT_DLL;WINDOWS_PHONE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
+ <AdditionalUsingDirectories>$(WindowsSDK_MetadataPath);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
+ <CompileAsWinRT>true</CompileAsWinRT>
+ <AdditionalIncludeDirectories>..\..\..\console\dec\inc;..\..\..\console\common\inc;..\..\..\api\svc;..\..\..\common\inc;..\..\..\console\enc\inc;..\..\..\encoder\core\inc;..\..\..\processing\interface</AdditionalIncludeDirectories>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
+ <IgnoreSpecificDefaultLibraries>ole32.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <GenerateWindowsMetadata>true</GenerateWindowsMetadata>
+ <AdditionalLibraryDirectories>$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+ <AdditionalDependencies>openh264.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
+ <ClCompile>
+ <PreprocessorDefinitions>_WINRT_DLL;WINDOWS_PHONE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
+ <AdditionalUsingDirectories>$(WindowsSDK_MetadataPath);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
+ <CompileAsWinRT>true</CompileAsWinRT>
+ <AdditionalIncludeDirectories>..\..\..\console\dec\inc;..\..\..\console\common\inc;..\..\..\api\svc;..\..\..\common\inc;..\..\..\console\enc\inc;..\..\..\encoder\core\inc;..\..\..\processing\interface</AdditionalIncludeDirectories>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
+ <IgnoreSpecificDefaultLibraries>ole32.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <GenerateWindowsMetadata>true</GenerateWindowsMetadata>
+ <AdditionalLibraryDirectories>$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+ <AdditionalDependencies>openh264.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <Reference Include="platform.winmd">
+ <IsWinMDFile>true</IsWinMDFile>
+ <Private>false</Private>
+ </Reference>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\console\common\inc\read_config.h" />
+ <ClInclude Include="CodecRTComponent.h" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\console\common\src\read_config.cpp" />
+ <ClCompile Include="..\..\..\console\dec\src\d3d9_utils.cpp" />
+ <ClCompile Include="..\..\..\console\dec\src\h264dec.cpp" />
+ <ClCompile Include="..\..\..\console\enc\src\welsenc.cpp" />
+ <ClCompile Include="CodecRTComponent.cpp" />
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsPhone\v$(TargetPlatformVersion)\Microsoft.Cpp.WindowsPhone.$(TargetPlatformVersion).targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project>
\ No newline at end of file
--- /dev/null
+++ b/codec/build/windowsphone/all/CodecRTComponent.vcxproj.filters
@@ -1,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Encoder">
+ <UniqueIdentifier>{c79b8670-dc32-4fcc-9e17-780c1ba6e72e}</UniqueIdentifier>
+ </Filter>
+ <Filter Include="Decoder">
+ <UniqueIdentifier>{798a0155-92f2-4321-9d5f-47ddb62db8c7}</UniqueIdentifier>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="CodecRTComponent.cpp" />
+ <ClCompile Include="..\..\..\console\enc\src\welsenc.cpp">
+ <Filter>Encoder</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\console\common\src\read_config.cpp" />
+ <ClCompile Include="..\..\..\console\dec\src\d3d9_utils.cpp">
+ <Filter>Decoder</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\console\dec\src\h264dec.cpp">
+ <Filter>Decoder</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="CodecRTComponent.h" />
+ <ClInclude Include="..\..\..\console\common\inc\read_config.h" />
+ </ItemGroup>
+</Project>
\ No newline at end of file
--- a/codec/console/dec/src/h264dec.cpp
+++ b/codec/console/dec/src/h264dec.cpp
@@ -54,6 +54,13 @@
using namespace std;
+
+#if defined (WINDOWS_PHONE)
+double g_dDecTime = 0.0;
+float g_fDecFPS = 0.0;
+int g_iDecodedFrameNum = 0;
+#endif
+
#if defined(ANDROID_NDK)
#define LOG_TAG "welsdec"
#define LOGI(...) __android_log_print(ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__)
@@ -296,6 +303,12 @@
iWidth, iHeight, iFrameCount, dElapsed, (iFrameCount * 1.0) / dElapsed);
fprintf (stderr, "-------------------------------------------------------\n");
+#if defined (WINDOWS_PHONE)
+ g_dDecTime = dElapsed;
+ g_fDecFPS = (iFrameCount * 1.0) / dElapsed;
+ g_iDecodedFrameNum = iFrameCount;
+#endif
+
// coverity scan uninitial
label_exit:
if (pBuf) {
@@ -316,7 +329,7 @@
}
}
-#if (defined(ANDROID_NDK)||defined(APPLE_IOS))
+#if (defined(ANDROID_NDK)||defined(APPLE_IOS) || defined (WINDOWS_PHONE))
int32_t DecMain (int32_t iArgC, char* pArgV[]) {
#else
int32_t main (int32_t iArgC, char* pArgV[]) {
--- a/codec/console/enc/src/welsenc.cpp
+++ b/codec/console/enc/src/welsenc.cpp
@@ -44,6 +44,12 @@
#endif//ONLY_ENC_FRAMES_NUM
#define ONLY_ENC_FRAMES_NUM INT_MAX // 2, INT_MAX // type the num you try to encode here, 2, 10, etc
+#if defined (WINDOWS_PHONE)
+float g_fFPS = 0.0;
+double g_dEncoderTime = 0.0;
+int g_iEncodedFrame = 0;
+#endif
+
#if defined (ANDROID_NDK)
#define LOG_TAG "welsenc"
#define LOGI(...) __android_log_print(ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__)
@@ -912,6 +918,11 @@
printf ("Width: %d\nHeight: %d\nFrames: %d\nencode time: %f sec\nFPS: %f fps\n",
sSvcParam.iPicWidth, sSvcParam.iPicHeight,
iActualFrameEncodedCount, dElapsed, (iActualFrameEncodedCount * 1.0) / dElapsed);
+#if defined (WINDOWS_PHONE)
+ g_fFPS = (iActualFrameEncodedCount * 1.0) / dElapsed;
+ g_dEncoderTime = dElapsed;
+ g_iEncodedFrame = iActualFrameEncodedCount;
+#endif
}
INSIDE_MEM_FREE:
if (pFpBs) {
@@ -987,7 +998,7 @@
/****************************************************************************
* main:
****************************************************************************/
-#if defined(ANDROID_NDK) || defined(APPLE_IOS)
+#if defined(ANDROID_NDK) || defined(APPLE_IOS) || defined (WINDOWS_PHONE)
extern "C" int EncMain (int argc, char** argv)
#else
int main (int argc, char** argv)