Explorar el Código

Make examples in /media, /sfu-media, and /streamer work in UWP.

Hanseul Jun hace 4 años
padre
commit
6b21637dd5

+ 15 - 1
examples/media/CMakeLists.txt

@@ -1,6 +1,20 @@
 cmake_minimum_required(VERSION 3.7)
 
-add_executable(datachannel-media main.cpp)
+set(MEDIA_UWP_RESOURCES
+	uwp/Logo.png
+	uwp/package.appxManifest
+	uwp/SmallLogo.png
+	uwp/SmallLogo44x44.png
+	uwp/SplashScreen.png
+	uwp/StoreLogo.png
+	uwp/Windows_TemporaryKey.pfx
+)
+
+if(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
+	add_executable(datachannel-media main.cpp ${MEDIA_UWP_RESOURCES})
+else()
+	add_executable(datachannel-media main.cpp)
+endif()
 set_target_properties(datachannel-media PROPERTIES
         CXX_STANDARD 17
         OUTPUT_NAME media)

BIN
examples/media/uwp/Logo.png


BIN
examples/media/uwp/SmallLogo.png


BIN
examples/media/uwp/SmallLogo44x44.png


BIN
examples/media/uwp/SplashScreen.png


BIN
examples/media/uwp/StoreLogo.png


BIN
examples/media/uwp/Windows_TemporaryKey.pfx


+ 42 - 0
examples/media/uwp/package.appxManifest

@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Package
+	xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
+	xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest"
+	xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
+	xmlns:desktop4="http://schemas.microsoft.com/appx/manifest/desktop/windows10/4"
+	xmlns:iot2="http://schemas.microsoft.com/appx/manifest/iot/windows10/2"
+	IgnorableNamespaces="uap mp">
+
+	<Identity Name="6597869B-290B-3EC7-AC50-87D2B9B408A2" Publisher="CN=CMake" Version="1.0.0.0" />
+	<mp:PhoneIdentity PhoneProductId="6597869B-290B-3EC7-AC50-87D2B9B408A2" PhonePublisherId="00000000-0000-0000-0000-000000000000"/>
+	<Properties>
+		<DisplayName>datachannel-media</DisplayName>
+		<PublisherDisplayName>CMake</PublisherDisplayName>
+		<Logo>StoreLogo.png</Logo>
+	</Properties>
+	<Dependencies>
+		<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.0.0" MaxVersionTested="10.0.0.0" />
+	</Dependencies>
+	<Resources>
+		<Resource Language="x-generate" />
+	</Resources>
+	<Applications>
+		<Application
+			Id="App"
+			Executable="media.exe"
+			EntryPoint="datachannel-media.App"
+			desktop4:Subsystem="console"
+			desktop4:SupportsMultipleInstances="true"
+			iot2:Subsystem="console"
+			iot2:SupportsMultipleInstances="true">
+			<uap:VisualElements
+				DisplayName="datachannel-media"
+				Description="datachannel-media"
+				BackgroundColor="#336699"
+				Square150x150Logo="Logo.png"
+				Square44x44Logo="SmallLogo44x44.png">
+				<uap:SplashScreen Image="SplashScreen.png" />
+			</uap:VisualElements>
+		</Application>
+	</Applications>
+</Package>

+ 15 - 1
examples/sfu-media/CMakeLists.txt

@@ -1,6 +1,20 @@
 cmake_minimum_required(VERSION 3.7)
 
-add_executable(datachannel-sfu-media main.cpp)
+set(SFU_MEDIA_UWP_RESOURCES
+	uwp/Logo.png
+	uwp/package.appxManifest
+	uwp/SmallLogo.png
+	uwp/SmallLogo44x44.png
+	uwp/SplashScreen.png
+	uwp/StoreLogo.png
+	uwp/Windows_TemporaryKey.pfx
+)
+
+if(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
+	add_executable(datachannel-sfu-media main.cpp ${SFU_MEDIA_UWP_RESOURCES})
+else()
+	add_executable(datachannel-sfu-media main.cpp)
+endif()
 set_target_properties(datachannel-sfu-media PROPERTIES
 		CXX_STANDARD 17
 		OUTPUT_NAME sfu-media)

BIN
examples/sfu-media/uwp/Logo.png


BIN
examples/sfu-media/uwp/SmallLogo.png


BIN
examples/sfu-media/uwp/SmallLogo44x44.png


BIN
examples/sfu-media/uwp/SplashScreen.png


BIN
examples/sfu-media/uwp/StoreLogo.png


BIN
examples/sfu-media/uwp/Windows_TemporaryKey.pfx


+ 42 - 0
examples/sfu-media/uwp/package.appxManifest

@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Package
+	xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
+	xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest"
+	xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
+	xmlns:desktop4="http://schemas.microsoft.com/appx/manifest/desktop/windows10/4"
+	xmlns:iot2="http://schemas.microsoft.com/appx/manifest/iot/windows10/2"
+	IgnorableNamespaces="uap mp">
+
+	<Identity Name="A2137F64-F4DB-39E1-8A6E-19BF1A64645A" Publisher="CN=CMake" Version="1.0.0.0" />
+	<mp:PhoneIdentity PhoneProductId="A2137F64-F4DB-39E1-8A6E-19BF1A64645A" PhonePublisherId="00000000-0000-0000-0000-000000000000"/>
+	<Properties>
+		<DisplayName>datachannel-sfu-media</DisplayName>
+		<PublisherDisplayName>CMake</PublisherDisplayName>
+		<Logo>StoreLogo.png</Logo>
+	</Properties>
+	<Dependencies>
+		<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.0.0" MaxVersionTested="10.0.0.0" />
+	</Dependencies>
+	<Resources>
+		<Resource Language="x-generate" />
+	</Resources>
+	<Applications>
+		<Application
+			Id="App"
+			Executable="sfu-media.exe"
+			EntryPoint="datachannel-sfu-media.App"
+			desktop4:Subsystem="console"
+			desktop4:SupportsMultipleInstances="true"
+			iot2:Subsystem="console"
+			iot2:SupportsMultipleInstances="true">
+			<uap:VisualElements
+				DisplayName="datachannel-sfu-media"
+				Description="datachannel-sfu-media"
+				BackgroundColor="#336699"
+				Square150x150Logo="Logo.png"
+				Square44x44Logo="SmallLogo44x44.png">
+				<uap:SplashScreen Image="SplashScreen.png" />
+			</uap:VisualElements>
+		</Application>
+	</Applications>
+</Package>

+ 17 - 1
examples/streamer/CMakeLists.txt

@@ -3,7 +3,7 @@ if(POLICY CMP0079)
 	cmake_policy(SET CMP0079 NEW)
 endif()
 
-add_executable(streamer
+set(STREAMER_SOURCES
 	main.cpp
 	dispatchqueue.cpp
 	dispatchqueue.hpp
@@ -21,6 +21,22 @@ add_executable(streamer
 	ArgParser.hpp
 )
 
+set(STREAMER_UWP_RESOURCES
+	uwp/Logo.png
+	uwp/package.appxManifest
+	uwp/SmallLogo.png
+	uwp/SmallLogo44x44.png
+	uwp/SplashScreen.png
+	uwp/StoreLogo.png
+	uwp/Windows_TemporaryKey.pfx
+)
+
+if(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
+	add_executable(streamer ${STREAMER_SOURCES} ${STREAMER_UWP_RESOURCES})
+else()
+	add_executable(streamer ${STREAMER_SOURCES})
+endif()
+
 if(WIN32)
 	target_compile_definitions(streamer PUBLIC STATIC_GETOPT)
 endif()

+ 1 - 1
examples/streamer/fileparser.cpp

@@ -28,7 +28,7 @@ FileParser::FileParser(string directory, string extension, uint32_t samplesPerSe
 }
 
 void FileParser::start() {
-    sampleTime_us = -sampleDuration_us;
+	sampleTime_us = -sampleDuration_us;
     loadNextSample();
 }
 

BIN
examples/streamer/uwp/Logo.png


BIN
examples/streamer/uwp/SmallLogo.png


BIN
examples/streamer/uwp/SmallLogo44x44.png


BIN
examples/streamer/uwp/SplashScreen.png


BIN
examples/streamer/uwp/StoreLogo.png


BIN
examples/streamer/uwp/Windows_TemporaryKey.pfx


+ 42 - 0
examples/streamer/uwp/package.appxManifest

@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Package
+	xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
+	xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest"
+	xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
+	xmlns:desktop4="http://schemas.microsoft.com/appx/manifest/desktop/windows10/4"
+	xmlns:iot2="http://schemas.microsoft.com/appx/manifest/iot/windows10/2"
+	IgnorableNamespaces="uap mp">
+
+	<Identity Name="84B30BB9-5FF7-36A6-9F72-8BA5B2594C7F" Publisher="CN=CMake" Version="1.0.0.0" />
+	<mp:PhoneIdentity PhoneProductId="84B30BB9-5FF7-36A6-9F72-8BA5B2594C7F" PhonePublisherId="00000000-0000-0000-0000-000000000000"/>
+	<Properties>
+		<DisplayName>streamer</DisplayName>
+		<PublisherDisplayName>CMake</PublisherDisplayName>
+		<Logo>StoreLogo.png</Logo>
+	</Properties>
+	<Dependencies>
+		<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.0.0" MaxVersionTested="10.0.0.0" />
+	</Dependencies>
+	<Resources>
+		<Resource Language="x-generate" />
+	</Resources>
+	<Applications>
+		<Application
+			Id="App"
+			Executable="streamer.exe"
+			EntryPoint="streamer.App"
+			desktop4:Subsystem="console"
+			desktop4:SupportsMultipleInstances="true"
+			iot2:Subsystem="console"
+			iot2:SupportsMultipleInstances="true">
+			<uap:VisualElements
+				DisplayName="streamer"
+				Description="streamer"
+				BackgroundColor="#336699"
+				Square150x150Logo="Logo.png"
+				Square44x44Logo="SmallLogo44x44.png">
+				<uap:SplashScreen Image="SplashScreen.png" />
+			</uap:VisualElements>
+		</Application>
+	</Applications>
+</Package>