Commit 493d2194 authored by Ghislain MARY's avatar Ghislain MARY

Add video renderer.

parent 85038873
......@@ -6,8 +6,9 @@
*/ARM/
*/x86/
CoreProxyStub/Linphone.Core*
CoreProxyStub/Mediastreamer2.WP8Video*
CoreProxyStub/dlldata.c
ARM/
Linphone.sdf
Linphone.opensdf
Agents/RegistrationHelper.cs
\ No newline at end of file
Agents/RegistrationHelper.cs
using Linphone.Core;
using Linphone.Core.OutOfProcess;
using Mediastreamer2.WP8Video;
namespace Linphone.Agents
{
public static class AgentHost
{
static AgentHost()
{
AgentHost.videoRenderer = new VideoRenderer();
Globals.Instance.VideoRenderer = AgentHost.videoRenderer;
}
internal static void OnAgentStarted()
{
Globals.Instance.StartServer(RegistrationHelper.OutOfProcServerClassNames);
}
static VideoRenderer videoRenderer;
}
}
......@@ -83,6 +83,7 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Compile Include="AgentHost.cs" />
<Compile Include="BackgroundManager.cs" />
<Compile Include="LinphoneCallInProgressAgent.cs" />
<Compile Include="LinphoneForegroundLifeTimeAgent.cs" />
......@@ -90,12 +91,18 @@
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="RegistrationHelper.cs" />
<Compile Include="TileManager.cs" />
<Compile Include="$(ProjectDir)..\submodules\mswp8vid\VideoRenderer.cs" />
<Compile Include="$(ProjectDir)..\submodules\mswp8vid\VideoStreamSource.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Core\Core.vcxproj">
<Project>{C8D75245-FFCF-4932-A228-C9CC8BB60B03}</Project>
<Name>BackEnd</Name>
</ProjectReference>
<ProjectReference Include="..\submodules\mswp8vid\mswp8vid\mswp8vid\mswp8vid.vcxproj">
<Project>{0565952A-EA62-46A2-8261-F5B4B490DA42}</Project>
<Name>libmswp8vid</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Microsoft\$(TargetFrameworkIdentifier)\$(TargetFrameworkVersion)\Microsoft.$(TargetFrameworkIdentifier).$(TargetFrameworkVersion).Overrides.targets" />
<Import Project="$(MSBuildExtensionsPath)\Microsoft\$(TargetFrameworkIdentifier)\$(TargetFrameworkVersion)\Microsoft.$(TargetFrameworkIdentifier).CSharp.targets" />
......
......@@ -17,8 +17,7 @@ namespace Linphone.Agents
protected override void OnFirstCallStarting()
{
Debug.WriteLine("[LinphoneCallInProgressAgent] The first call has started.");
Globals.Instance.StartServer(RegistrationHelper.OutOfProcServerClassNames);
AgentHost.OnAgentStarted();
}
/// <summary>
......@@ -27,7 +26,6 @@ namespace Linphone.Agents
protected override void OnCancel()
{
Debug.WriteLine("[LinphoneCallInProgressAgent] The last call has ended. Calling NotifyComplete");
base.NotifyComplete();
}
}
......
......@@ -19,8 +19,7 @@ namespace Linphone.Agents
protected override void OnLaunched()
{
Debug.WriteLine("[LinphoneForegroundLifeTimeAgent] The UI has entered the foreground.");
Globals.Instance.StartServer(RegistrationHelper.OutOfProcServerClassNames);
AgentHost.OnAgentStarted();
//Force the callController to be initialized now to avoid creating it at the last moment (workaroud outgoing call crash after app started)
Globals.Instance.CallController.IncomingCallViewDismissed = null;
}
......
......@@ -20,9 +20,7 @@ namespace Linphone.Agents
protected override void OnInvoke(ScheduledTask task)
{
Debug.WriteLine("[LinphoneScheduledAgent] ScheduledAgentImpl has been invoked with argument of type {0}.", task.GetType());
Globals.Instance.StartServer(RegistrationHelper.OutOfProcServerClassNames);
AgentHost.OnAgentStarted();
VoipHttpIncomingCallTask incomingCallTask = task as VoipHttpIncomingCallTask;
if (incomingCallTask != null)
{
......
......@@ -87,17 +87,22 @@
<AdditionalLibraryDirectories>$(SolutionDir)$(Platform)\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link>
<CustomBuildStep>
<Command>pushd "$(OutDir)"
WinMdIdl.exe "$(OutDir)$(RootNamespace).winmd"
MIdl.exe /env $(MidlEnv) /winrt /ns_prefix /metadata_dir "$(FrameworkSdkDir)Windows Metadata" /out "$(SolutionDir)$(ProjectName)ProxyStub" "$(OutDir)$(RootNamespace).idl"
MIdl.exe /env $(MidlEnv) /winrt /ns_prefix /metadata_dir "$(FrameworkSdkDir)Windows Metadata" /out "$(SolutionDir)$(ProjectName)ProxyStub" "$(OutDir)$(RootNamespace).OutOfProcess.idl"
"$(ProjectDir)OopServerRegistrationHelper.exe" /winmd:"$(OutDir)$(RootNamespace).winmd" /dll_name:$(TargetName) /namespace:$(RootNamespace).OutOfProcess /app_manifest:"$(SolutionDir)Linphone\Properties\WMAppManifest.xml" /helper_dir:"$(SolutionDir)Agents"
popd</Command>
<Command>
pushd "$(OutDir)"
WinMdIdl.exe "$(OutDir)$(RootNamespace).winmd"
WinMdIdl.exe "$(OutDir)Mediastreamer2.WP8Video.winmd"
MIdl.exe /env $(MidlEnv) /winrt /ns_prefix /metadata_dir "$(FrameworkSdkDir)Windows Metadata" /out "$(SolutionDir)$(ProjectName)ProxyStub" "$(OutDir)$(RootNamespace).idl"
MIdl.exe /env $(MidlEnv) /winrt /ns_prefix /metadata_dir "$(FrameworkSdkDir)Windows Metadata" /out "$(SolutionDir)$(ProjectName)ProxyStub" "$(OutDir)Mediastreamer2.WP8Video.idl"
MIdl.exe /env $(MidlEnv) /winrt /ns_prefix /metadata_dir "$(FrameworkSdkDir)Windows Metadata" /out "$(SolutionDir)$(ProjectName)ProxyStub" "$(OutDir)$(RootNamespace).OutOfProcess.idl"
"$(ProjectDir)OopServerRegistrationHelper.exe" /winmd:"$(OutDir)$(RootNamespace).winmd" /dll_name:$(TargetName) /namespace:$(RootNamespace).OutOfProcess /app_manifest:"$(SolutionDir)Linphone\Properties\WMAppManifest.xml" /helper_dir:"$(SolutionDir)Agents"
popd</Command>
</CustomBuildStep>
<CustomBuildStep>
<Outputs>$(OutDir)$(RootNamespace).idl;$(OutDir)$(RootNamespace).OutOfProcess.idl;$(SolutionDir)$(ProjectName)ProxyStub\dlldata.c;$(SolutionDir)$(ProjectName)ProxyStub\$(RootNamespace)_i.c;$(SolutionDir)$(ProjectName)ProxyStub\$(RootNamespace)_p.c;$(SolutionDir)$(ProjectName)ProxyStub\$(RootNamespace).h;$(SolutionDir)$(ProjectName)ProxyStub\$(RootNamespace).OutOfProcess.h;$(SolutionDir)$(ProjectName)ProxyStub\$(RootNamespace).OutOfProcess_i.c;$(SolutionDir)$(ProjectName)ProxyStub\$(RootNamespace).OutOfProcess_p.c;$(SolutionDir)Agents\RegistrationHelper.cs;%(Outputs)</Outputs>
......@@ -166,6 +171,9 @@ popd</Command>
<ProjectReference Include="..\submodules\linphone\build\vsx\LibLinphone\LibLinphone.vcxproj">
<Project>{08dd0d38-d9b5-4626-b60d-b4d76b571142}</Project>
</ProjectReference>
<ProjectReference Include="..\submodules\mswp8vid\mswp8vid\mswp8vid\mswp8vid.vcxproj">
<Project>{0565952a-ea62-46a2-8261-f5b4b490da42}</Project>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsPhone\v$(TargetPlatformVersion)\Microsoft.Cpp.WindowsPhone.$(TargetPlatformVersion).targets" />
......
......@@ -190,6 +190,18 @@ Linphone::Core::BackgroundModeLogger^ Globals::BackgroundModeLogger::get()
return this->backgroundModeLogger;
}
Mediastreamer2::WP8Video::IVideoRenderer^ Globals::VideoRenderer::get()
{
return this->videoRenderer;
}
void Globals::VideoRenderer::set(Mediastreamer2::WP8Video::IVideoRenderer^ value)
{
gApiLock.Lock();
this->videoRenderer = value;
gApiLock.Unlock();
}
Globals::Globals() :
started(false),
serverRegistrationCookie(NULL),
......
......@@ -70,7 +70,16 @@ namespace Linphone
property CallController^ CallController
{
Linphone::Core::CallController^ get();
}
}
/// <summary>
/// Access the video renderer instance
/// </summary>
property Mediastreamer2::WP8Video::IVideoRenderer^ VideoRenderer
{
Mediastreamer2::WP8Video::IVideoRenderer^ get();
void set(Mediastreamer2::WP8Video::IVideoRenderer^ value);
}
private:
Globals();
......@@ -98,6 +107,8 @@ namespace Linphone
Linphone::Core::BackgroundModeLogger^ backgroundModeLogger;
Linphone::Core::CallController^ callController;
Mediastreamer2::WP8Video::IVideoRenderer^ videoRenderer;
};
}
}
......@@ -1483,7 +1483,10 @@ void Linphone::Core::LinphoneCore::Init()
this->lc = linphone_core_new_with_config(vtable, config ? config->config : NULL, NULL);
RefToPtrProxy<LinphoneCore^> *proxy = new RefToPtrProxy<LinphoneCore^>(this);
linphone_core_set_user_data(this->lc, proxy);
RefToPtrProxy<Mediastreamer2::WP8Video::IVideoRenderer^> *renderer = new RefToPtrProxy<Mediastreamer2::WP8Video::IVideoRenderer^>(Globals::Instance->VideoRenderer);
linphone_core_set_native_video_window_id(this->lc, (unsigned long)renderer);
// Launch iterate timer
TimeSpan period;
period.Duration = 20 * 10000;
......
......@@ -141,10 +141,13 @@
<ClCompile Include="Linphone.Core.OutOfProcess_p.c" />
<ClCompile Include="Linphone.Core_i.c" />
<ClCompile Include="Linphone.Core_p.c" />
<ClCompile Include="Mediastreamer2.WP8Video_i.c" />
<ClCompile Include="Mediastreamer2.WP8Video_p.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="Linphone.Core.h" />
<ClInclude Include="Linphone.Core.OutOfProcess.h" />
<ClInclude Include="Mediastreamer2.WP8Video.h" />
</ItemGroup>
<ItemGroup>
<None Include="CoreProxyStub.def" />
......
mswp8vid @ ff0a4df6
Subproject commit 19e89be6fb97353b1d192e807279a1505501c0cb
Subproject commit ff0a4df640071dbe1a84b7caf9742d7141c53b85
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