Skip to content
This repository has been archived by the owner on Feb 12, 2021. It is now read-only.

Commit

Permalink
Major rework to bump up the framerate.
Browse files Browse the repository at this point in the history
Changed the interface between the Native and Managed, simplified the usage of the buffers.
  • Loading branch information
Berthier Lemieux committed Apr 13, 2013
1 parent f93eaf0 commit 10b339b
Show file tree
Hide file tree
Showing 23 changed files with 724 additions and 236 deletions.
126 changes: 112 additions & 14 deletions .gitignore
@@ -1,16 +1,114 @@
ipch/*
Debug/*
ARM/*
*/Debug/*
*/ARM/*
*/ipch/*
*/Generated Files/*
*/Bin/*
*/PerfLogs/*
*/obj/*
*.sdf
*.bak
# Build Folders (you can keep bin if you'd like, to store dlls and pdbs)
[Bb]in/
[Oo]bj/

# mstest test results
TestResults

## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.

# User-specific files
*.suo
*.opensdf
*.user
*.pfx
*.sln.docstates

# Build results
[Dd]ebug/
[Rr]elease/
x64/
*_i.c
*_p.c
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.log
*.vspscc
*.vssscc
.builds

# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opensdf
*.sdf

# Visual Studio profiler
*.psess
*.vsp
*.vspx

# Guidance Automation Toolkit
*.gpState

# ReSharper is a .NET coding add-in
_ReSharper*

# Mindbench SASS cache
.sass-cache/

# NCrunch
*.ncrunch*
.*crunch*.local.xml

# Installshield output folder
[Ee]xpress

# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html

# Click-Once directory
publish

# Publish Web Output
*.Publish.xml

# NuGet Packages Directory
packages

# Windows Azure Build Output
csx
*.build.csdef

# Windows Store app package directory
AppPackages/

# Others
sql
TestResults
[Tt]est[Rr]esult*
*.Cache
ClientBin
[Ss]tyle[Cc]op.*
~$*
*.dbmdl
Generated_Code #added for RIA/Silverlight projects

# Backup & report files from converting an old project file to a newer
# Visual Studio version. Backup files are not needed, because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML

# SQL Server files
App_Data/*.mdf
App_Data/*.ldf

136 changes: 136 additions & 0 deletions CameraEffectInterface/CameraEffectInterface.vcxproj
@@ -0,0 +1,136 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.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>{b54d292c-6154-413f-9c4c-d4a08cdb7edf}</ProjectGuid>
<RootNamespace>CameraEffectInterface</RootNamespace>
<DefaultLanguage>en-US</DefaultLanguage>
<MinimumVisualStudioVersion>11.0</MinimumVisualStudioVersion>
<WinMDAssembly>true</WinMDAssembly>
<ProjectName>CameraEffectInterface</ProjectName>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v110_wp80</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v110_wp80</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v110_wp80</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v110_wp80</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>
<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;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeader>NotUsing</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|ARM'">
<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>
<ItemGroup>
<Reference Include="platform.winmd">
<IsWinMDFile>true</IsWinMDFile>
<Private>false</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<ClInclude Include="ICameraEffect.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="ICameraEffect.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>
6 changes: 6 additions & 0 deletions CameraEffectInterface/ICameraEffect.cpp
@@ -0,0 +1,6 @@
// ICameraEffect.cpp
#include "ICameraEffect.h"

using namespace CameraEffectInterface;
using namespace Platform;

51 changes: 51 additions & 0 deletions CameraEffectInterface/ICameraEffect.h
@@ -0,0 +1,51 @@
#pragma once

namespace CameraEffectInterface
{
/// <summary>
/// The ICameraEffect interface definition
/// This interface can be implemented either from managed or from native code.
/// </summary>

public interface class ICameraEffect {

/// <summary>
/// The camera device, the effect will poll the preview frames from it
/// </summary>
property Windows::Phone::Media::Capture::PhotoCaptureDevice^ CaptureDevice
{
void set( Windows::Phone::Media::Capture::PhotoCaptureDevice^ captureDevice);
}

/// <summary>
/// The buffer where image data is written once the effect has been applied.
/// </summary>
property Windows::Storage::Streams::IBuffer^ OutputBuffer
{
void set( Windows::Storage::Streams::IBuffer^ OutputBuffer );
}

/// <summary>
/// The dimensions of the output buffer
/// </summary>
property Windows::Foundation::Size OutputBufferSize
{
void set( Windows::Foundation::Size outputBufferSize);
}

/// <summary>
/// Get a frame from the camera and apply an effect on it
/// </summary>
/// <param name="processedBuffer">A buffer with the camera data with the effect applied</param>
/// <returns>A task that completes when effect has been applied</returns>
Windows::Foundation::IAsyncAction^ GetNewFrameAndApplyEffect();


/// <summary>
/// Change the type of effect
/// </summary>
void ChangeEffectType();

};

}
15 changes: 15 additions & 0 deletions CameraEffectInterface/ICameraEffect.vcxproj.filters
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Resources">
<UniqueIdentifier>5fd0e509-b6ae-4f29-bd2a-4d2cc10f3aa0</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="ICameraEffect.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="ICameraEffect.h" />
</ItemGroup>
</Project>
20 changes: 20 additions & 0 deletions Native Filter Demo.sln
Expand Up @@ -5,6 +5,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NativeFilterDemo", "NativeF
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "NativeComponent", "NativeComponent\NativeComponent.vcxproj", "{ECCD1443-9EAA-4666-BC16-6AA5B5C11BA2}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CameraEffectInterface", "CameraEffectInterface\CameraEffectInterface.vcxproj", "{B54D292C-6154-413F-9C4C-D4A08CDB7EDF}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -67,6 +69,24 @@ Global
{ECCD1443-9EAA-4666-BC16-6AA5B5C11BA2}.Release|Win32.Build.0 = Release|Win32
{ECCD1443-9EAA-4666-BC16-6AA5B5C11BA2}.Release|x86.ActiveCfg = Release|Win32
{ECCD1443-9EAA-4666-BC16-6AA5B5C11BA2}.Release|x86.Build.0 = Release|Win32
{B54D292C-6154-413F-9C4C-D4A08CDB7EDF}.Debug|Any CPU.ActiveCfg = Debug|Win32
{B54D292C-6154-413F-9C4C-D4A08CDB7EDF}.Debug|ARM.ActiveCfg = Debug|ARM
{B54D292C-6154-413F-9C4C-D4A08CDB7EDF}.Debug|ARM.Build.0 = Debug|ARM
{B54D292C-6154-413F-9C4C-D4A08CDB7EDF}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
{B54D292C-6154-413F-9C4C-D4A08CDB7EDF}.Debug|Mixed Platforms.Build.0 = Debug|Win32
{B54D292C-6154-413F-9C4C-D4A08CDB7EDF}.Debug|Win32.ActiveCfg = Debug|Win32
{B54D292C-6154-413F-9C4C-D4A08CDB7EDF}.Debug|Win32.Build.0 = Debug|Win32
{B54D292C-6154-413F-9C4C-D4A08CDB7EDF}.Debug|x86.ActiveCfg = Debug|Win32
{B54D292C-6154-413F-9C4C-D4A08CDB7EDF}.Debug|x86.Build.0 = Debug|Win32
{B54D292C-6154-413F-9C4C-D4A08CDB7EDF}.Release|Any CPU.ActiveCfg = Release|Win32
{B54D292C-6154-413F-9C4C-D4A08CDB7EDF}.Release|ARM.ActiveCfg = Release|ARM
{B54D292C-6154-413F-9C4C-D4A08CDB7EDF}.Release|ARM.Build.0 = Release|ARM
{B54D292C-6154-413F-9C4C-D4A08CDB7EDF}.Release|Mixed Platforms.ActiveCfg = Release|Win32
{B54D292C-6154-413F-9C4C-D4A08CDB7EDF}.Release|Mixed Platforms.Build.0 = Release|Win32
{B54D292C-6154-413F-9C4C-D4A08CDB7EDF}.Release|Win32.ActiveCfg = Release|Win32
{B54D292C-6154-413F-9C4C-D4A08CDB7EDF}.Release|Win32.Build.0 = Release|Win32
{B54D292C-6154-413F-9C4C-D4A08CDB7EDF}.Release|x86.ActiveCfg = Release|Win32
{B54D292C-6154-413F-9C4C-D4A08CDB7EDF}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down

0 comments on commit 10b339b

Please sign in to comment.