├── .github └── FUNDING.yml ├── .gitignore ├── LICENSE ├── Plugin ├── .vscode │ ├── c_cpp_properties.json │ ├── launch.json │ └── settings.json ├── Android │ ├── GStreamer │ │ ├── Android.mk │ │ ├── Application.mk │ │ ├── build.bat │ │ ├── cleanup.bat │ │ ├── output │ │ │ └── libgstreamer_android.so │ │ └── src │ │ │ ├── main │ │ │ └── assets │ │ │ │ ├── fontconfig │ │ │ │ ├── fonts.conf │ │ │ │ └── fonts │ │ │ │ │ └── truetype │ │ │ │ │ └── Ubuntu-R.ttf │ │ │ │ └── ssl │ │ │ │ └── certs │ │ │ │ └── ca-certificates.crt │ │ │ └── org │ │ │ └── freedesktop │ │ │ └── gstreamer │ │ │ ├── GStreamer.java │ │ │ └── androidmedia │ │ │ ├── GstAhcCallback.java │ │ │ ├── GstAhsCallback.java │ │ │ └── GstAmcOnFrameAvailableListener.java │ ├── build.bat │ ├── cleanup.bat │ ├── gst-build-armeabi-v7a │ │ ├── gstreamer_android.c │ │ └── gstreamer_android.o │ ├── jni │ │ ├── Android - Copy.mk │ │ ├── Android.mk │ │ ├── Application - Copy.mk │ │ └── Application.mk │ ├── libs │ │ ├── armeabi-v7a │ │ │ ├── libGStreamerUnityPlugin.so │ │ │ └── libc++_shared.so │ │ └── x86 │ │ │ ├── libGStreamerUnityPlugin.so │ │ │ └── libc++_shared.so │ ├── output │ │ └── libmrayGStreamerUnity.so │ └── src │ │ ├── main │ │ └── assets │ │ │ ├── fontconfig │ │ │ ├── fonts.conf │ │ │ └── fonts │ │ │ │ └── truetype │ │ │ │ └── Ubuntu-R.ttf │ │ │ └── ssl │ │ │ └── certs │ │ │ └── ca-certificates.crt │ │ └── org │ │ └── freedesktop │ │ └── gstreamer │ │ ├── GStreamer.java │ │ └── androidmedia │ │ ├── GstAhcCallback.java │ │ ├── GstAhsCallback.java │ │ └── GstAmcOnFrameAvailableListener.java ├── CMakeLists.txt ├── Externals │ └── gstreamer │ │ └── Project │ │ └── Android │ │ └── jni │ │ ├── Android.mk │ │ └── Application.mk ├── VS │ ├── .gitignore │ ├── GStreamerUnityPlugin.sln │ ├── GStreamerUnityPlugin.vcxproj │ └── GStreamerUnityPlugin.vcxproj.filters ├── XCode │ ├── ASimplePlugin-Info.plist │ ├── English.lproj │ │ └── InfoPlist.strings │ ├── GStreamerUnityPlugin.xcodeproj │ │ ├── project.pbxproj │ │ ├── project.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ └── xcuserdata │ │ │ │ ├── avatarin.xcuserdatad │ │ │ │ ├── UserInterfaceState.xcuserstate │ │ │ │ └── WorkspaceSettings.xcsettings │ │ │ │ └── yamen.s.xcuserdatad │ │ │ │ ├── UserInterfaceState.xcuserstate │ │ │ │ ├── WorkspaceSettings.xcsettings │ │ │ │ └── xcdebugger │ │ │ │ └── Expressions.xcexplist │ │ └── xcuserdata │ │ │ ├── avatarin.xcuserdatad │ │ │ └── xcschemes │ │ │ │ └── xcschememanagement.plist │ │ │ └── yamen.s.xcuserdatad │ │ │ ├── xcdebugger │ │ │ └── Breakpoints_v2.xcbkptlist │ │ │ └── xcschemes │ │ │ ├── ASimplePlugin.xcscheme │ │ │ └── xcschememanagement.plist │ ├── Info.plist │ └── gl.h ├── buildmac.sh ├── includes │ ├── Android │ │ ├── AndroidMutex.cpp │ │ ├── AndroidMutex.h │ │ ├── AndroidNetwork.cpp │ │ ├── AndroidNetwork.h │ │ ├── AndroidThread.cpp │ │ ├── AndroidThread.h │ │ ├── AndroidThreadManager.cpp │ │ ├── AndroidThreadManager.h │ │ ├── AndroidUDPClient.cpp │ │ └── AndroidUDPClient.h │ ├── GLEW │ │ ├── glew.c │ │ ├── glew.h │ │ ├── glxew.h │ │ └── wglew.h │ ├── GraphicsInclude.h │ ├── GstCustomDataReceiver.h │ ├── IGstBaseAudioStreamer.h │ ├── IMutex.h │ ├── INetwork.h │ ├── ISingleton.h │ ├── IThread.h │ ├── IThreadFunction.h │ ├── IThreadManager.cpp │ ├── IThreadManager.h │ ├── IUDPClient.h │ ├── IVideoGrabber.h │ ├── ImageInfo.cpp │ ├── ImageInfo.h │ ├── ListenerContainer.h │ ├── MutexLocks.h │ ├── NetAddress.cpp │ ├── NetAddress.h │ ├── OSX │ │ ├── OSXMutex.cpp │ │ ├── OSXMutex.h │ │ ├── OSXThread.cpp │ │ ├── OSXThread.h │ │ ├── OSXThreadManager.cpp │ │ └── OSXThreadManager.h │ ├── PixelUtil.cpp │ ├── PixelUtil.h │ ├── PlatformBase.h │ ├── RenderAPI.cpp │ ├── RenderAPI.h │ ├── RenderAPI_D3D11.cpp │ ├── RenderAPI_D3D12.cpp │ ├── RenderAPI_D3D9.cpp │ ├── RenderAPI_Metal.mm │ ├── RenderAPI_OpenGL2.cpp │ ├── RenderAPI_OpenGLCoreES.cpp │ ├── RenderAPI_Vulkan.cpp │ ├── Unity │ │ ├── IUnityGraphics.h │ │ ├── IUnityGraphics.h.meta │ │ ├── IUnityGraphicsD3D11.h │ │ ├── IUnityGraphicsD3D11.h.meta │ │ ├── IUnityGraphicsD3D12.h │ │ ├── IUnityGraphicsD3D12.h.meta │ │ ├── IUnityGraphicsD3D9.h │ │ ├── IUnityGraphicsD3D9.h.meta │ │ ├── IUnityGraphicsMetal.h │ │ ├── IUnityGraphicsMetal.h.meta │ │ ├── IUnityGraphicsVulkan.h │ │ ├── IUnityGraphicsVulkan.h.meta │ │ ├── IUnityInterface.h │ │ └── IUnityInterface.h.meta │ ├── UnityGraphicsDevice.cpp │ ├── UnityGraphicsDevice.h │ ├── Win32 │ │ ├── Win32Network.cpp │ │ ├── Win32Network.h │ │ ├── Win32UDPClient.cpp │ │ ├── Win32UDPClient.h │ │ ├── WinMutex.cpp │ │ ├── WinMutex.h │ │ ├── WinThread.cpp │ │ ├── WinThread.h │ │ ├── WinThreadManager.cpp │ │ └── WinThreadManager.h │ ├── common.h │ ├── mTypes.h │ ├── old │ │ ├── PixelUtil.cpp │ │ ├── PixelUtil.h │ │ └── videoCommon.h │ ├── videoCommon.h │ └── zlib │ │ ├── ChangeLog │ │ ├── FAQ │ │ ├── INDEX │ │ ├── README │ │ ├── adler32.c │ │ ├── algorithm.txt │ │ ├── compress.c │ │ ├── crc32.c │ │ ├── crc32.h │ │ ├── deflate.c │ │ ├── deflate.h │ │ ├── gzio.c │ │ ├── infback.c │ │ ├── inffast.c │ │ ├── inffast.h │ │ ├── inffixed.h │ │ ├── inflate.c │ │ ├── inflate.h │ │ ├── inftrees.c │ │ ├── inftrees.h │ │ ├── trees.c │ │ ├── trees.h │ │ ├── uncompr.c │ │ ├── zconf.h │ │ ├── zlib.3 │ │ ├── zlib.h │ │ ├── zutil.c │ │ └── zutil.h ├── lib │ └── zlib.lib └── sources │ ├── AudioAppSinkHandler.cpp │ ├── AudioAppSinkHandler.h │ ├── CMyListener.cpp │ ├── CMyListener.h │ ├── CMySink.cpp │ ├── CMySink.h │ ├── CMySrc.cpp │ ├── CMySrc.h │ ├── CoreAPI.cpp │ ├── CoreAPI.h │ ├── CustomAudioGrabber.cpp │ ├── CustomAudioGrabber.h │ ├── GStreamerCore.cpp │ ├── GStreamerCore.h │ ├── GstAppAudioPlayer.cpp │ ├── GstAppAudioPlayer.h │ ├── GstAppNetAudioStreamer.cpp │ ├── GstAppNetAudioStreamer.h │ ├── GstAudioSampler.cpp │ ├── GstAudioSampler.h │ ├── GstCustomDataPlayer.cpp │ ├── GstCustomDataPlayer.h │ ├── GstCustomDataReceiver.cpp │ ├── GstCustomDataStreamer.cpp │ ├── GstCustomDataStreamer.h │ ├── GstCustomVideoPlayer.cpp │ ├── GstCustomVideoPlayer.h │ ├── GstCustomVideoStreamer.cpp │ ├── GstCustomVideoStreamer.h │ ├── GstNetworkAudioPlayer.cpp │ ├── GstNetworkAudioPlayer.h │ ├── GstNetworkAudioStreamer.cpp │ ├── GstNetworkAudioStreamer.h │ ├── GstNetworkMultipleVideoPlayer.cpp │ ├── GstNetworkMultipleVideoPlayer.h │ ├── GstNetworkVideoPlayer.cpp │ ├── GstNetworkVideoPlayer.h │ ├── GstNetworkVideoStreamer.cpp │ ├── GstNetworkVideoStreamer.h │ ├── GstPipelineHandler.cpp │ ├── GstPipelineHandler.h │ ├── GstPlayerBin.cpp │ ├── GstPlayerBin.h │ ├── IAppSinkHandler.cpp │ ├── IAppSinkHandler.h │ ├── IAudioGrabber.h │ ├── IGStreamerPlayer.cpp │ ├── IGStreamerPlayer.h │ ├── IGStreamerStreamer.cpp │ ├── IGStreamerStreamer.h │ ├── IStreamListener.h │ ├── LocalAudioGrabber.cpp │ ├── LocalAudioGrabber.h │ ├── NetworkAudioGrabber.cpp │ ├── NetworkAudioGrabber.h │ ├── PlayersAPI.cpp │ ├── PlayersAPI.h │ ├── StreamersAPI.cpp │ ├── StreamersAPI.h │ ├── UnityAudioGrabber.cpp │ ├── UnityAudioGrabber.h │ ├── UnityHelpers.cpp │ ├── UnityHelpers.h │ ├── UnityImageGrabber.cpp │ ├── UnityImageGrabber.h │ ├── VideoAppSinkHandler.cpp │ ├── VideoAppSinkHandler.h │ ├── rtp.cpp │ ├── rtp.h │ └── stdafx.h ├── README.md ├── StreamTest.txt └── Unity └── UnityTests ├── .gitignore ├── .vs └── UnityTests │ └── xs │ ├── UserPrefs.xml │ └── project-cache │ ├── Assembly-CSharp-Debug.json │ └── Assembly-CSharp-Editor-Debug.json ├── .vscode └── settings.json ├── Assets ├── .videos │ ├── big_buck_bunny.mp4 │ └── small.mp4 ├── GStreamerUnity.meta ├── GStreamerUnity │ ├── Components.meta │ ├── Components │ │ ├── BaseVideoPlayer.cs │ │ ├── BaseVideoPlayer.cs.meta │ │ ├── CameraCapture.cs │ │ ├── CameraCapture.cs.meta │ │ ├── CustomPipelinePlayer.cs │ │ ├── CustomPipelinePlayer.cs.meta │ │ ├── CustomSBSPipelinePlayer.cs │ │ ├── CustomSBSPipelinePlayer.cs.meta │ │ ├── CustomVideoStreamer.cs │ │ ├── CustomVideoStreamer.cs.meta │ │ ├── FileVideoPlayer.cs │ │ ├── FileVideoPlayer.cs.meta │ │ ├── LocalCameraVideoPlayer.cs │ │ ├── LocalCameraVideoPlayer.cs.meta │ │ ├── NetworkVideoPlayer.cs │ │ └── NetworkVideoPlayer.cs.meta │ ├── Resources.meta │ ├── Resources │ │ ├── I420ToRGB.shader │ │ └── I420ToRGB.shader.meta │ ├── Scripts.meta │ ├── Scripts │ │ ├── Dependency.cs │ │ ├── Dependency.cs.meta │ │ ├── FrameCounterHelper.cs │ │ ├── FrameCounterHelper.cs.meta │ │ ├── GStreamerCore.cs │ │ ├── GStreamerCore.cs.meta │ │ ├── GstBaseTexture.cs │ │ ├── GstBaseTexture.cs.meta │ │ ├── GstCustomPlayer.cs │ │ ├── GstCustomPlayer.cs.meta │ │ ├── GstCustomTexture.cs │ │ ├── GstCustomTexture.cs.meta │ │ ├── GstCustomVideoStreamer.cs │ │ ├── GstCustomVideoStreamer.cs.meta │ │ ├── GstImageInfo.cs │ │ ├── GstImageInfo.cs.meta │ │ ├── GstMultipleNetworkVideoPlayer.cs │ │ ├── GstMultipleNetworkVideoPlayer.cs.meta │ │ ├── GstNetworkAudioPlayer.cs │ │ ├── GstNetworkAudioPlayer.cs.meta │ │ ├── GstNetworkAudioStreamer.cs │ │ ├── GstNetworkAudioStreamer.cs.meta │ │ ├── GstNetworkImageStreamer.cs │ │ ├── GstNetworkImageStreamer.cs.meta │ │ ├── GstNetworkMultipleTexture.cs │ │ ├── GstNetworkMultipleTexture.cs.meta │ │ ├── GstNetworkPlayer.cs │ │ ├── GstNetworkPlayer.cs.meta │ │ ├── GstNetworkTexture.cs │ │ ├── GstNetworkTexture.cs.meta │ │ ├── GstUnityImageGrabber.cs │ │ ├── GstUnityImageGrabber.cs.meta │ │ ├── IGstAudioPlayer.cs │ │ ├── IGstAudioPlayer.cs.meta │ │ ├── IGstPlayer.cs │ │ ├── IGstPlayer.cs.meta │ │ ├── IGstStreamer.cs │ │ ├── IGstStreamer.cs.meta │ │ ├── IImageProcessor.cs │ │ ├── IImageProcessor.cs.meta │ │ ├── ImageSampler.cs │ │ ├── ImageSampler.cs.meta │ │ ├── NativeDLL.cs │ │ ├── NativeDLL.cs.meta │ │ ├── OffscreenProcessor.cs │ │ ├── OffscreenProcessor.cs.meta │ │ ├── ThreadJob.cs │ │ └── ThreadJob.cs.meta │ ├── Tests.meta │ └── Tests │ │ ├── GStreamerTest0.cs │ │ ├── GStreamerTest0.cs.meta │ │ ├── GStreamerTest1.cs │ │ └── GStreamerTest1.cs.meta ├── Plugins.meta ├── Plugins │ ├── macOS.meta │ ├── macOS │ │ ├── GStreamerUnityPlugin.bundle.meta │ │ └── GStreamerUnityPlugin.bundle │ │ │ ├── Contents.meta │ │ │ └── Contents │ │ │ ├── Info.plist │ │ │ ├── Info.plist.meta │ │ │ ├── MacOS.meta │ │ │ ├── MacOS │ │ │ ├── GStreamerUnityPlugin │ │ │ └── GStreamerUnityPlugin.meta │ │ │ ├── _CodeSignature.meta │ │ │ └── _CodeSignature │ │ │ ├── CodeResources │ │ │ └── CodeResources.meta │ ├── x86_64.meta │ └── x86_64 │ │ ├── GStreamerUnityPlugin.dll │ │ ├── GStreamerUnityPlugin.dll.meta │ │ ├── UnityWebcam.dll │ │ └── UnityWebcam.dll.meta ├── Resources.meta ├── Resources │ ├── BlitMtrl.mat │ ├── BlitMtrl.mat.meta │ ├── RedMtrl.mat │ ├── RedMtrl.mat.meta │ ├── SimpleChromakey.shader │ ├── SimpleChromakey.shader.meta │ ├── WhiteMtrl.mat │ └── WhiteMtrl.mat.meta ├── Scenes.meta ├── Scenes │ ├── CubeMaterial.mat │ ├── CubeMaterial.mat.meta │ ├── Scripts.meta │ ├── Scripts │ │ ├── Bloom.cs │ │ ├── Bloom.cs.meta │ │ ├── CubeGenerator.cs │ │ ├── CubeGenerator.cs.meta │ │ ├── ImageEffectBase.cs │ │ ├── ImageEffectBase.cs.meta │ │ ├── JitterMotion.cs │ │ ├── JitterMotion.cs.meta │ │ ├── MotionBlur.cs │ │ ├── MotionBlur.cs.meta │ │ ├── ObjectMotion.cs │ │ ├── ObjectMotion.cs.meta │ │ ├── Perlin.cs │ │ ├── Perlin.cs.meta │ │ ├── PostEffectsBase.cs │ │ └── PostEffectsBase.cs.meta │ ├── Test 1.unity │ ├── Test 1.unity.meta │ ├── Test 1Settings.lighting │ ├── Test 1Settings.lighting.meta │ ├── Test 2.unity │ ├── Test 2.unity.meta │ ├── Test 3.unity │ ├── Test 3.unity.meta │ ├── Test 4.unity │ ├── Test 4.unity.meta │ ├── Test 5.unity │ └── Test 5.unity.meta ├── UnityCam.meta └── UnityCam │ ├── Editor.meta │ ├── Editor │ ├── UnityCamEditor.cs │ └── UnityCamEditor.cs.meta │ ├── Resources.meta │ ├── Resources │ ├── Blitter.shader │ └── Blitter.shader.meta │ ├── Scripts.meta │ └── Scripts │ ├── TextureWrapper.cs │ ├── TextureWrapper.cs.meta │ ├── UnityCam.cs │ ├── UnityCam.cs.meta │ ├── UnityCamPostRenderer.cs │ └── UnityCamPostRenderer.cs.meta ├── GStreamerLog.txt ├── ProjectSettings ├── AudioManager.asset ├── ClusterInputManager.asset ├── DynamicsManager.asset ├── EditorBuildSettings.asset ├── EditorSettings.asset ├── GraphicsSettings.asset ├── InputManager.asset ├── MemorySettings.asset ├── NavMeshAreas.asset ├── NetworkManager.asset ├── PackageManagerSettings.asset ├── Physics2DSettings.asset ├── PresetManager.asset ├── ProjectSettings.asset ├── ProjectVersion.txt ├── QualitySettings.asset ├── SceneTemplateSettings.json ├── TagManager.asset ├── TimeManager.asset ├── UnityConnectSettings.asset ├── VFXManager.asset ├── VersionControlSettings.asset ├── XRSettings.asset └── boot.config └── UserSettings ├── EditorUserSettings.asset └── Layouts └── default-2021.dwlt /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: mrayy 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | #OS junk files 2 | [Tt]humbs.db 3 | *.DS_Store 4 | 5 | #Visual Studio files 6 | *.[Oo]bj 7 | *.user 8 | *.aps 9 | *.pch 10 | *.vspscc 11 | *.vssscc 12 | *_i.c 13 | *_p.c 14 | *.ncb 15 | *.idb 16 | *.suo 17 | *.tlb 18 | *.tlh 19 | *.bak 20 | *.[Cc]ache 21 | *.ilk 22 | *.log 23 | #*.lib 24 | *.sbr 25 | *.sdf 26 | *.opensdf 27 | *.unsuccessfulbuild 28 | ipch/ 29 | [Oo]bj/ 30 | [Bb]in 31 | [Dd]ebug*/ 32 | [Rr]elease*/ 33 | Ankh.NoLoad 34 | 35 | #MonoDevelop 36 | *.pidb 37 | *.userprefs 38 | 39 | #Tooling 40 | _ReSharper*/ 41 | *.resharper 42 | [Tt]est[Rr]esult* 43 | *.sass-cache 44 | 45 | #Project files 46 | [Bb]uild/ 47 | 48 | #Subversion files 49 | .svn 50 | 51 | # Office Temp Files 52 | ~$* 53 | 54 | # vim Temp Files 55 | *~ 56 | 57 | #NuGet 58 | packages/ 59 | *.nupkg 60 | 61 | #ncrunch 62 | *ncrunch* 63 | *crunch*.local.xml 64 | 65 | # visual studio database projects 66 | *.dbmdl 67 | 68 | #Test files 69 | *.testsettings 70 | 71 | Obj/* 72 | Lib/* 73 | ipch/* 74 | Bin/* 75 | Dependencies/* 76 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 MHD Yamen Saraiji 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Plugin/.vscode/c_cpp_properties.json: -------------------------------------------------------------------------------- 1 | { 2 | "configurations": [ 3 | { 4 | "name": "OSX", 5 | "includePath": [ 6 | "${workspaceFolder}/**", 7 | "${GST_SDK_PATH}/include/**", 8 | "${workspaceFolder}/includes/", 9 | "${workspaceFolder}/sources/" 10 | ], 11 | "defines": [], 12 | "cStandard": "c11", 13 | "cppStandard": "c++17", 14 | "intelliSenseMode": "clang-x64", 15 | "configurationProvider": "go2sh.cmake-integration" 16 | } 17 | ], 18 | "version": 4 19 | } -------------------------------------------------------------------------------- /Plugin/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": "(gdb) Launch", 9 | "type": "cppdbg", 10 | "request": "launch", 11 | "program": "${command:cmake.launchTargetPath}", 12 | "args": ["RTP"], 13 | "stopAtEntry": false, 14 | "cwd": "${workspaceFolder}/release/bin/x86_64_Darwin", 15 | "environment": [], 16 | "externalConsole": false, 17 | "setupCommands": [ 18 | { 19 | "description": "Enable pretty-printing for gdb", 20 | "text": "-enable-pretty-printing", 21 | "ignoreFailures": true 22 | } 23 | ], 24 | "launchCompleteCommand": "exec-run", 25 | "linux": { 26 | "MIMode": "gdb", 27 | "miDebuggerPath": "/usr/bin/gdb" 28 | }, 29 | "osx": { 30 | "MIMode": "lldb", 31 | "terminal":"console" 32 | }, 33 | "windows": { 34 | "MIMode": "gdb", 35 | "miDebuggerPath": "C:\\MinGw\\bin\\gdb.exe" 36 | }, 37 | "visualizerFile": "/Users/yamen/Library/Application Support/Code/User/workspaceStorage/703e77232154842d683e7d44f2628f3c/tonka3000.qtvsctools/qt.natvis.xml" 38 | } 39 | ] 40 | } 41 | -------------------------------------------------------------------------------- /Plugin/Android/GStreamer/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | include $(CLEAR_VARS) 3 | 4 | 5 | GSTREAMER_ROOT_ANDROID := $(abspath $(LOCAL_PATH)/../armv7) 6 | #SYSROOT := $(abspath $(LOCAL_PATH)) 7 | 8 | 9 | ifndef GSTREAMER_ROOT 10 | ifndef GSTREAMER_ROOT_ANDROID 11 | $(error GSTREAMER_ROOT_ANDROID is not defined!) 12 | endif 13 | GSTREAMER_ROOT := $(GSTREAMER_ROOT_ANDROID) 14 | endif 15 | 16 | GSTREAMER_NDK_BUILD_PATH := $(GSTREAMER_ROOT)/share/gst-android/ndk-build/ 17 | 18 | include $(GSTREAMER_NDK_BUILD_PATH)/plugins.mk 19 | GSTREAMER_PLUGINS := $(GSTREAMER_PLUGINS_CORE) \ 20 | $(GSTREAMER_PLUGINS_PLAYBACK) \ 21 | $(GSTREAMER_PLUGINS_CODECS) \ 22 | $(GSTREAMER_PLUGINS_NET) \ 23 | $(GSTREAMER_PLUGINS_SYS) \ 24 | $(GSTREAMER_PLUGINS_EFFECTS) \ 25 | $(GSTREAMER_PLUGINS_CAPTURE) \ 26 | $(GSTREAMER_PLUGINS_ENCODING) \ 27 | $(GSTREAMER_PLUGINS_CODECS_RESTRICTED) 28 | G_IO_MODULES := gnutls 29 | GSTREAMER_EXTRA_DEPS := gstreamer-video-1.0 gstreamer-net-1.0 30 | include $(GSTREAMER_NDK_BUILD_PATH)/gstreamer-1.0.mk 31 | -------------------------------------------------------------------------------- /Plugin/Android/GStreamer/Application.mk: -------------------------------------------------------------------------------- 1 | APP_STL := c++_static 2 | APP_PLATFORM := $(NDK_TARGET_LEVEL) 3 | APP_ABI := armeabi-v7a 4 | NDK_TARGET_LEVEL := android-23 5 | APP_OPTIM := release 6 | APP_BUILD_SCRIPT := Android.mk 7 | -------------------------------------------------------------------------------- /Plugin/Android/GStreamer/build.bat: -------------------------------------------------------------------------------- 1 | echo use ndk r17c to compile on windows 2 | 3 | %ANDROID_NDK_ROOT%/ndk-build NDK_PROJECT_PATH=. NDK_APPLICATION_MK=Application.mk 4 | -------------------------------------------------------------------------------- /Plugin/Android/GStreamer/cleanup.bat: -------------------------------------------------------------------------------- 1 | echo off 2 | 3 | 4 | mkdir output 5 | move libs\armeabi-v7a\libgstreamer_android.so output\libgstreamer_android.so 6 | 7 | echo 8 | echo Cleaning up / removing build folders... 9 | RD /S /Q libs 10 | RD /S /Q obj 11 | 12 | echo 13 | echo Done! 14 | -------------------------------------------------------------------------------- /Plugin/Android/GStreamer/output/libgstreamer_android.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mrayy/mrayGStreamerUnity/bb81bc3ed54d0a2a13e6b744db738ebbf56180b4/Plugin/Android/GStreamer/output/libgstreamer_android.so -------------------------------------------------------------------------------- /Plugin/Android/GStreamer/src/main/assets/fontconfig/fonts/truetype/Ubuntu-R.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mrayy/mrayGStreamerUnity/bb81bc3ed54d0a2a13e6b744db738ebbf56180b4/Plugin/Android/GStreamer/src/main/assets/fontconfig/fonts/truetype/Ubuntu-R.ttf -------------------------------------------------------------------------------- /Plugin/Android/GStreamer/src/org/freedesktop/gstreamer/androidmedia/GstAmcOnFrameAvailableListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015, Collabora Ltd. 3 | * Author: Matthieu Bouron 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation 8 | * version 2.1 of the License. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 | * 19 | */ 20 | 21 | package org.freedesktop.gstreamer.androidmedia; 22 | 23 | import android.graphics.SurfaceTexture; 24 | import android.graphics.SurfaceTexture.OnFrameAvailableListener; 25 | 26 | public class GstAmcOnFrameAvailableListener implements OnFrameAvailableListener 27 | { 28 | private long context = 0; 29 | 30 | public synchronized void onFrameAvailable (SurfaceTexture surfaceTexture) { 31 | native_onFrameAvailable(context, surfaceTexture); 32 | } 33 | 34 | public synchronized long getContext () { 35 | return context; 36 | } 37 | 38 | public synchronized void setContext (long c) { 39 | context = c; 40 | } 41 | 42 | private native void native_onFrameAvailable (long context, SurfaceTexture surfaceTexture); 43 | } 44 | -------------------------------------------------------------------------------- /Plugin/Android/build.bat: -------------------------------------------------------------------------------- 1 | echo use ndk r17c to compile on windows 2 | 3 | %ANDROID_NDK_ROOT%/ndk-build NDK_PROJECT_PATH=. NDK_APPLICATION_MK=jni/Application.mk 4 | -------------------------------------------------------------------------------- /Plugin/Android/cleanup.bat: -------------------------------------------------------------------------------- 1 | echo off 2 | 3 | mkdir output 4 | move libs\armeabi-v7a\libmrayGStreamerUnity.so output\libmrayGStreamerUnity.so 5 | 6 | echo 7 | echo Cleaning up / removing build folders... 8 | RD /S /Q libs 9 | RD /S /Q obj 10 | 11 | echo 12 | echo Done! 13 | -------------------------------------------------------------------------------- /Plugin/Android/gst-build-armeabi-v7a/gstreamer_android.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mrayy/mrayGStreamerUnity/bb81bc3ed54d0a2a13e6b744db738ebbf56180b4/Plugin/Android/gst-build-armeabi-v7a/gstreamer_android.o -------------------------------------------------------------------------------- /Plugin/Android/jni/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | include $(CLEAR_VARS) 3 | 4 | LOCAL_ARM_MODE := arm 5 | 6 | IMMERSIATV_PLAYER_ROOT := $(abspath $(LOCAL_PATH)/../../) 7 | PLUGIN_SOURCE_PATH := $(IMMERSIATV_PLAYER_ROOT)/sources 8 | EXT_SOURCE_PATH := $(IMMERSIATV_PLAYER_ROOT)/includes 9 | 10 | ifndef GSTREAMER_ROOT_ANDROID 11 | $(error GSTREAMER_ROOT_ANDROID is not defined!) 12 | 13 | endif 14 | 15 | GSTREAMER_PROJECT_PATH := $(GSTREAMER_ROOT_ANDROID)/Android 16 | 17 | 18 | LOCAL_MODULE := GStreamerUnityPlugin 19 | LOCAL_C_INCLUDES := $(PLUGIN_SOURCE_PATH) $(EXT_SOURCE_PATH) 20 | LOCAL_SRC_FILES := $(EXT_SOURCE_PATH)/Android/AndroidMutex.cpp 21 | 22 | 23 | LOCAL_LDLIBS := -llog -lGLESv2 24 | include $(BUILD_SHARED_LIBRARY) 25 | 26 | -------------------------------------------------------------------------------- /Plugin/Android/jni/Application - Copy.mk: -------------------------------------------------------------------------------- 1 | 2 | APP_PLATFORM := android-9 3 | APP_ABI := armeabi-v7a 4 | APP_STL := gnustl_static 5 | APP_CPPFLAGS += -std=c++11 6 | NDK_TOOLCHAIN_VERSION := clang 7 | APP_CPPFLAGS += -frtti 8 | APP_CPPFLAGS += -fexceptions 9 | -------------------------------------------------------------------------------- /Plugin/Android/jni/Application.mk: -------------------------------------------------------------------------------- 1 | APP_ABI := armeabi-v7a x86 2 | APP_PLATFORM := android-9 3 | APP_STL := gnustl_static 4 | APP_CPPFLAGS += -std=c++11 5 | NDK_TOOLCHAIN_VERSION := clang 6 | APP_STL := c++_shared 7 | -------------------------------------------------------------------------------- /Plugin/Android/libs/armeabi-v7a/libGStreamerUnityPlugin.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mrayy/mrayGStreamerUnity/bb81bc3ed54d0a2a13e6b744db738ebbf56180b4/Plugin/Android/libs/armeabi-v7a/libGStreamerUnityPlugin.so -------------------------------------------------------------------------------- /Plugin/Android/libs/armeabi-v7a/libc++_shared.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mrayy/mrayGStreamerUnity/bb81bc3ed54d0a2a13e6b744db738ebbf56180b4/Plugin/Android/libs/armeabi-v7a/libc++_shared.so -------------------------------------------------------------------------------- /Plugin/Android/libs/x86/libGStreamerUnityPlugin.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mrayy/mrayGStreamerUnity/bb81bc3ed54d0a2a13e6b744db738ebbf56180b4/Plugin/Android/libs/x86/libGStreamerUnityPlugin.so -------------------------------------------------------------------------------- /Plugin/Android/libs/x86/libc++_shared.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mrayy/mrayGStreamerUnity/bb81bc3ed54d0a2a13e6b744db738ebbf56180b4/Plugin/Android/libs/x86/libc++_shared.so -------------------------------------------------------------------------------- /Plugin/Android/output/libmrayGStreamerUnity.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mrayy/mrayGStreamerUnity/bb81bc3ed54d0a2a13e6b744db738ebbf56180b4/Plugin/Android/output/libmrayGStreamerUnity.so -------------------------------------------------------------------------------- /Plugin/Android/src/main/assets/fontconfig/fonts/truetype/Ubuntu-R.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mrayy/mrayGStreamerUnity/bb81bc3ed54d0a2a13e6b744db738ebbf56180b4/Plugin/Android/src/main/assets/fontconfig/fonts/truetype/Ubuntu-R.ttf -------------------------------------------------------------------------------- /Plugin/Android/src/org/freedesktop/gstreamer/androidmedia/GstAmcOnFrameAvailableListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015, Collabora Ltd. 3 | * Author: Matthieu Bouron 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation 8 | * version 2.1 of the License. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 | * 19 | */ 20 | 21 | package org.freedesktop.gstreamer.androidmedia; 22 | 23 | import android.graphics.SurfaceTexture; 24 | import android.graphics.SurfaceTexture.OnFrameAvailableListener; 25 | 26 | public class GstAmcOnFrameAvailableListener implements OnFrameAvailableListener 27 | { 28 | private long context = 0; 29 | 30 | public synchronized void onFrameAvailable (SurfaceTexture surfaceTexture) { 31 | native_onFrameAvailable(context, surfaceTexture); 32 | } 33 | 34 | public synchronized long getContext () { 35 | return context; 36 | } 37 | 38 | public synchronized void setContext (long c) { 39 | context = c; 40 | } 41 | 42 | private native void native_onFrameAvailable (long context, SurfaceTexture surfaceTexture); 43 | } 44 | -------------------------------------------------------------------------------- /Plugin/Externals/gstreamer/Project/Android/jni/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | include $(CLEAR_VARS) 3 | 4 | ifndef GSTREAMER_ROOT 5 | ifndef GSTREAMER_ROOT_ANDROID 6 | $(error GSTREAMER_ROOT_ANDROID is not defined!) 7 | endif 8 | GSTREAMER_ROOT := $(GSTREAMER_ROOT_ANDROID) 9 | endif 10 | 11 | GSTREAMER_NDK_BUILD_PATH := $(GSTREAMER_ROOT)/share/gst-android/ndk-build/ 12 | 13 | include $(GSTREAMER_NDK_BUILD_PATH)/plugins.mk 14 | GSTREAMER_PLUGINS := $(GSTREAMER_PLUGINS_CORE) \ 15 | $(GSTREAMER_PLUGINS_PLAYBACK) \ 16 | $(GSTREAMER_PLUGINS_CODECS) \ 17 | $(GSTREAMER_PLUGINS_NET) \ 18 | $(GSTREAMER_PLUGINS_SYS) \ 19 | $(GSTREAMER_PLUGINS_EFFECTS) \ 20 | $(GSTREAMER_PLUGINS_CAPTURE) \ 21 | $(GSTREAMER_PLUGINS_ENCODING) \ 22 | $(GSTREAMER_PLUGINS_CODECS_RESTRICTED) 23 | G_IO_MODULES := gnutls 24 | GSTREAMER_EXTRA_DEPS := gstreamer-video-1.0 gstreamer-net-1.0 25 | include $(GSTREAMER_NDK_BUILD_PATH)/gstreamer-1.0.mk 26 | -------------------------------------------------------------------------------- /Plugin/Externals/gstreamer/Project/Android/jni/Application.mk: -------------------------------------------------------------------------------- 1 | APP_PLATFORM := $(NDK_TARGET_LEVEL) 2 | APP_ABI := $(NDK_APP_ABI) 3 | -------------------------------------------------------------------------------- /Plugin/VS/GStreamerUnityPlugin.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.25420.1 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GStreamerUnityPlugin", "GStreamerUnityPlugin.vcxproj", "{8FB9AD24-E1C7-4C44-BD0E-CA167AF44482}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|X64 = Debug|X64 11 | Debug|x86 = Debug|x86 12 | Release|X64 = Release|X64 13 | Release|x86 = Release|x86 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {8FB9AD24-E1C7-4C44-BD0E-CA167AF44482}.Debug|X64.ActiveCfg = Debug|X64 17 | {8FB9AD24-E1C7-4C44-BD0E-CA167AF44482}.Debug|X64.Build.0 = Debug|X64 18 | {8FB9AD24-E1C7-4C44-BD0E-CA167AF44482}.Debug|x86.ActiveCfg = Debug|Win32 19 | {8FB9AD24-E1C7-4C44-BD0E-CA167AF44482}.Debug|x86.Build.0 = Debug|Win32 20 | {8FB9AD24-E1C7-4C44-BD0E-CA167AF44482}.Release|X64.ActiveCfg = Release|X64 21 | {8FB9AD24-E1C7-4C44-BD0E-CA167AF44482}.Release|X64.Build.0 = Release|X64 22 | {8FB9AD24-E1C7-4C44-BD0E-CA167AF44482}.Release|x86.ActiveCfg = Release|Win32 23 | {8FB9AD24-E1C7-4C44-BD0E-CA167AF44482}.Release|x86.Build.0 = Release|Win32 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | EndGlobal 29 | -------------------------------------------------------------------------------- /Plugin/XCode/ASimplePlugin-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleSignature 16 | ???? 17 | CFBundleVersion 18 | 1.0 19 | CSResourcesFileMapped 20 | yes 21 | 22 | 23 | -------------------------------------------------------------------------------- /Plugin/XCode/English.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mrayy/mrayGStreamerUnity/bb81bc3ed54d0a2a13e6b744db738ebbf56180b4/Plugin/XCode/English.lproj/InfoPlist.strings -------------------------------------------------------------------------------- /Plugin/XCode/GStreamerUnityPlugin.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Plugin/XCode/GStreamerUnityPlugin.xcodeproj/project.xcworkspace/xcuserdata/avatarin.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mrayy/mrayGStreamerUnity/bb81bc3ed54d0a2a13e6b744db738ebbf56180b4/Plugin/XCode/GStreamerUnityPlugin.xcodeproj/project.xcworkspace/xcuserdata/avatarin.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /Plugin/XCode/GStreamerUnityPlugin.xcodeproj/project.xcworkspace/xcuserdata/avatarin.xcuserdatad/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildLocationStyle 6 | UseTargetSettings 7 | 8 | 9 | -------------------------------------------------------------------------------- /Plugin/XCode/GStreamerUnityPlugin.xcodeproj/project.xcworkspace/xcuserdata/yamen.s.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mrayy/mrayGStreamerUnity/bb81bc3ed54d0a2a13e6b744db738ebbf56180b4/Plugin/XCode/GStreamerUnityPlugin.xcodeproj/project.xcworkspace/xcuserdata/yamen.s.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /Plugin/XCode/GStreamerUnityPlugin.xcodeproj/project.xcworkspace/xcuserdata/yamen.s.xcuserdatad/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildLocationStyle 6 | UseTargetSettings 7 | 8 | 9 | -------------------------------------------------------------------------------- /Plugin/XCode/GStreamerUnityPlugin.xcodeproj/project.xcworkspace/xcuserdata/yamen.s.xcuserdatad/xcdebugger/Expressions.xcexplist: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 7 | 8 | 10 | 11 | 13 | 14 | 15 | 16 | 18 | 19 | 21 | 22 | 24 | 25 | 26 | 27 | 29 | 30 | 32 | 33 | 35 | 36 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /Plugin/XCode/GStreamerUnityPlugin.xcodeproj/xcuserdata/avatarin.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | ASimplePlugin.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Plugin/XCode/GStreamerUnityPlugin.xcodeproj/xcuserdata/yamen.s.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | ASimplePlugin.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 6A3F7F7D10AC146D00948A73 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /Plugin/XCode/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | com.apple.${PRODUCT_NAME:identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | BNDL 19 | CFBundleShortVersionString 20 | 1.01 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.0 25 | CSResourcesFileMapped 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /Plugin/buildmac.sh: -------------------------------------------------------------------------------- 1 | cmake -H. -Bbuild -GXcode 2 | cmake --build build --parallel 5 --config MinSizeRel -------------------------------------------------------------------------------- /Plugin/includes/Android/AndroidMutex.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | 3 | 4 | #include "AndroidMutex.h" 5 | 6 | 7 | namespace mray{ 8 | namespace OS{ 9 | 10 | AndroidMutex::AndroidMutex(){ 11 | 12 | memset(&m_mutex, 0, sizeof(m_mutex)); 13 | int res = pthread_mutex_init(&m_mutex, NULL); 14 | if (res != 0) 15 | { 16 | //ALOGE("Mutex::Mutex: fail init; error=0x%X", res); 17 | } 18 | } 19 | AndroidMutex::~AndroidMutex(){ 20 | int res = pthread_mutex_destroy(&m_mutex); 21 | if (res != 0) 22 | { 23 | //ALOGE("Mutex::~Mutex: fail destroy; error=0x%X", res); 24 | } 25 | 26 | } 27 | 28 | void AndroidMutex::lock(){ 29 | int res = pthread_mutex_lock(&m_mutex); 30 | if (res != 0) 31 | { 32 | // ALOGE("Mutex::lock: fail lock; error=0x%X", res); 33 | } 34 | 35 | } 36 | 37 | bool AndroidMutex::tryLock() 38 | { 39 | int res = pthread_mutex_trylock(&m_mutex); 40 | if ((res != 0) && (res != EBUSY)) 41 | { 42 | //ALOGE("Mutex::tryLock: error=0x%X", res); 43 | } 44 | return res == 0; 45 | } 46 | 47 | void AndroidMutex::unlock(){ 48 | int res = pthread_mutex_unlock(&m_mutex); 49 | if (res != 0) 50 | { 51 | //ALOGE("Mutex::unlock: fail unlock; error=0x%X", res); 52 | } 53 | } 54 | 55 | 56 | 57 | 58 | } 59 | } 60 | 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /Plugin/includes/Android/AndroidMutex.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | #ifndef ___AndroidMutex___ 4 | #define ___AndroidMutex___ 5 | 6 | #include "IMutex.h" 7 | #include 8 | 9 | namespace mray{ 10 | namespace OS{ 11 | 12 | class AndroidMutex:public IMutex 13 | { 14 | pthread_mutex_t m_mutex; 15 | public: 16 | AndroidMutex(); 17 | virtual~AndroidMutex(); 18 | 19 | virtual void lock(); 20 | virtual bool tryLock(); 21 | virtual void unlock(); 22 | }; 23 | 24 | 25 | } 26 | } 27 | 28 | 29 | #endif 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /Plugin/includes/Android/AndroidThread.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | #ifndef ___AndroidThread___ 4 | #define ___AndroidThread___ 5 | 6 | 7 | #include 8 | #include 9 | 10 | namespace mray{ 11 | namespace OS{ 12 | 13 | class AndroidThread:public IThread 14 | { 15 | public : 16 | AndroidThread(IThreadFunction*f); 17 | virtual~AndroidThread(); 18 | virtual void*start(void*arg); 19 | virtual void terminate(); 20 | virtual bool isActive(); 21 | 22 | virtual void setThreadPriority(EThreadPriority priority); 23 | virtual EThreadPriority getThreadPriority(); 24 | 25 | virtual bool sleep(uint milliseconds); 26 | virtual bool suspend(); 27 | virtual bool resume(); 28 | 29 | IThreadFunction*getThreadFunction(); 30 | 31 | virtual void setThreadFunction(IThreadFunction*f); 32 | 33 | protected: 34 | void run(void*arg); 35 | void*arg()const{return _Arg;} 36 | void arg(void*a){_Arg=a;} 37 | static void *entryPoint(void*arg); 38 | private: 39 | void*_Arg; 40 | bool active; 41 | IThreadFunction* m_threadFunction; 42 | EThreadPriority m_priority; 43 | 44 | pthread_t threadHandle; 45 | ulong threadID; 46 | /* 47 | */ 48 | }; 49 | 50 | 51 | 52 | };//OS 53 | };//mray 54 | 55 | #endif 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /Plugin/includes/Android/AndroidThreadManager.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | 3 | 4 | #include "AndroidThreadManager.h" 5 | #include "AndroidThread.h" 6 | #include "AndroidMutex.h" 7 | #include 8 | 9 | namespace mray{ 10 | namespace OS{ 11 | 12 | 13 | 14 | AndroidThreadManager::AndroidThreadManager(){ 15 | } 16 | AndroidThreadManager::~AndroidThreadManager(){ 17 | } 18 | IThread* AndroidThreadManager::createThread(IThreadFunction*f,EThreadPriority priority){ 19 | IThread* t= new AndroidThread(f); 20 | t->setThreadPriority(priority); 21 | m_threads.push_back(t); 22 | return t; 23 | } 24 | IMutex* AndroidThreadManager::createMutex(){ 25 | return new AndroidMutex(); 26 | } 27 | void AndroidThreadManager::sleep(uint ms){ 28 | ::sleep(ms); 29 | } 30 | 31 | IThread*AndroidThreadManager::getCurrentThread(){ 32 | pid_t data= gettid(); 33 | if(!data) 34 | return 0; 35 | return (IThread*)data; 36 | } 37 | 38 | 39 | } 40 | } 41 | 42 | -------------------------------------------------------------------------------- /Plugin/includes/Android/AndroidThreadManager.h: -------------------------------------------------------------------------------- 1 | 2 | /******************************************************************** 3 | created: 2009/02/26 4 | created: 26:2:2009 22:36 5 | filename: i:\Programing\GameEngine\mrayEngine\mrayEngine\include\AndroidThreadManager.h 6 | file path: i:\Programing\GameEngine\mrayEngine\mrayEngine\include 7 | file base: AndroidThreadManager 8 | file ext: h 9 | author: Mohamad Yamen Saraiji 10 | 11 | purpose: 12 | *********************************************************************/ 13 | 14 | #ifndef ___AndroidThreadManager___ 15 | #define ___AndroidThreadManager___ 16 | 17 | #include 18 | 19 | namespace mray{ 20 | namespace OS{ 21 | 22 | class AndroidThreadManager:public IThreadManager 23 | { 24 | public: 25 | AndroidThreadManager(); 26 | ~AndroidThreadManager(); 27 | IThread* createThread(IThreadFunction*f,EThreadPriority priority=ETP_Normal); 28 | IMutex* createMutex(); 29 | ICondition* createCondition(); 30 | IThreadEvent* createEvent(); 31 | 32 | IThread*getCurrentThread(); 33 | 34 | void sleep(uint ms); 35 | 36 | }; 37 | 38 | } 39 | } 40 | 41 | 42 | #endif //___AndroidThreadManager___ 43 | -------------------------------------------------------------------------------- /Plugin/includes/GraphicsInclude.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #if SUPPORT_D3D9 4 | #include 5 | #endif 6 | #if SUPPORT_D3D11 7 | #include 8 | #endif 9 | #if SUPPORT_OPENGL 10 | #if UNITY_WIN 11 | #include 12 | #else 13 | #include 14 | #endif 15 | #endif -------------------------------------------------------------------------------- /Plugin/includes/GstCustomDataReceiver.h: -------------------------------------------------------------------------------- 1 | 2 | #include "IGStreamerPlayer.h" 3 | #include "IVideoGrabber.h" 4 | 5 | 6 | namespace mray 7 | { 8 | namespace video 9 | { 10 | 11 | class GstCustomDataReceiverImpl; 12 | 13 | extern "C" class UNITY_INTERFACE_EXPORT GstCustomDataReceiver :public IGStreamerPlayer 14 | { 15 | protected: 16 | GstCustomDataReceiverImpl* m_impl; 17 | friend class GstCustomDataReceiverImpl; 18 | 19 | 20 | GstPipelineHandler* GetPipeline(); 21 | public: 22 | GstCustomDataReceiver(); 23 | virtual ~GstCustomDataReceiver(); 24 | 25 | //set ip address for the target host 26 | // videoport: port for the video stream, video rtcp is allocated as videoPort+1 and videoPort+2 27 | void SetIPAddress(const std::string& ip, uint baseVideoPort, uint count, uint clockPort, bool rtcp); 28 | bool CreateStream(); 29 | 30 | //add custom elements to pipeline. Should be set before calling CreateStream 31 | void AddIntermidateElement(const std::string& elems); 32 | 33 | uint GetDataPort(int i); 34 | 35 | virtual bool IsStream(); 36 | 37 | void SetVolume(float vol); 38 | 39 | virtual void Play(); 40 | virtual void Pause(); 41 | virtual void Stop(); 42 | virtual bool IsLoaded(); 43 | virtual bool IsPlaying(); 44 | virtual void Close(); 45 | 46 | 47 | int GetFramesCount(); 48 | virtual bool GrabFrame(int i); 49 | virtual bool HasNewFrame(int i); 50 | virtual ulong GetBufferID(int i);// incremented once per frame 51 | virtual int GetPort(int i); 52 | 53 | virtual const ImageInfo* GetLastFrame(int i); 54 | virtual const GstImageFrame* GetLastDataFrame(int i); 55 | virtual unsigned long GetLastFrameTimestamp(int i); 56 | virtual void* GetLastFrameRTPMeta(int i); 57 | 58 | 59 | virtual ulong GetNetworkUsage(); 60 | 61 | }; 62 | 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /Plugin/includes/IGstBaseAudioStreamer.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mrayy/mrayGStreamerUnity/bb81bc3ed54d0a2a13e6b744db738ebbf56180b4/Plugin/includes/IGstBaseAudioStreamer.h -------------------------------------------------------------------------------- /Plugin/includes/IMutex.h: -------------------------------------------------------------------------------- 1 | 2 | /******************************************************************** 3 | created: 2009/01/02 4 | created: 2:1:2009 16:52 5 | filename: i:\Programing\GameEngine\mrayEngine\mrayEngine\include\IMutex.h 6 | file path: i:\Programing\GameEngine\mrayEngine\mrayEngine\include 7 | file base: IMutex 8 | file ext: h 9 | author: Mohamad Yamen Saraiji 10 | 11 | purpose: 12 | *********************************************************************/ 13 | 14 | #ifndef ___IMutex___ 15 | #define ___IMutex___ 16 | 17 | 18 | 19 | namespace mray{ 20 | namespace OS{ 21 | 22 | class IMutex 23 | { 24 | public: 25 | IMutex(){} 26 | virtual~IMutex(){} 27 | 28 | virtual void lock()=0; 29 | virtual bool tryLock()=0; 30 | virtual void unlock()=0; 31 | }; 32 | 33 | } 34 | } 35 | 36 | 37 | #endif //___IMutex___ 38 | -------------------------------------------------------------------------------- /Plugin/includes/INetwork.h: -------------------------------------------------------------------------------- 1 | 2 | /******************************************************************** 3 | created: 2009/05/24 4 | created: 24:5:2009 23:30 5 | filename: i:\Programing\GameEngine\mrayEngine\mrayNet\INetwork.h 6 | file path: i:\Programing\GameEngine\mrayEngine\mrayNet 7 | file base: INetwork 8 | file ext: h 9 | author: Mohamad Yamen Saraiji 10 | 11 | purpose: 12 | *********************************************************************/ 13 | 14 | #ifndef ___INetwork___ 15 | #define ___INetwork___ 16 | 17 | #include "ISingleton.h" 18 | #include "NetAddress.h" 19 | 20 | namespace mray{ 21 | namespace network{ 22 | 23 | class ISocket; 24 | class IWebRequest; 25 | class IUDPClient; 26 | class IReliableSocket; 27 | 28 | class INetwork:public ISingleton 29 | { 30 | public: 31 | virtual~INetwork(){} 32 | virtual int getSyncNumber()=0; 33 | 34 | 35 | virtual IUDPClient* createUDPClient()=0; 36 | 37 | virtual bool getHostAddress(const char*name,NetAddress &addr)=0; 38 | 39 | virtual bool getHostIP(const NetAddress &addr,char*name,int maxLen)=0; 40 | virtual bool getHostName(const NetAddress &addr,char*name,int maxLen)=0; 41 | 42 | //get all ip addresses for this pc 43 | virtual int getLocalIPs(char ipLst[8][16])=0; 44 | 45 | virtual ulong getLocalAddress()=0; 46 | 47 | }; 48 | 49 | } 50 | } 51 | 52 | 53 | #endif //___INetwork___ 54 | -------------------------------------------------------------------------------- /Plugin/includes/ISingleton.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | #ifndef ___ISingleton___ 4 | #define ___ISingleton___ 5 | 6 | #include "UnityHelpers.h" 7 | #include 8 | 9 | namespace mray{ 10 | 11 | template 12 | class ISingleton 13 | { 14 | protected: 15 | static T*m_instance; 16 | public: 17 | ISingleton(){ 18 | if (m_instance != 0) 19 | { 20 | LogMessage("Instance is already created!", ELL_ERROR); 21 | //throw new std::exception("Instance is already created"); 22 | } 23 | 24 | #if defined( _MSC_VER ) && _MSC_VER < 1200 25 | int offset = (int)(T*)1 - (int)(ISingleton *)(T*)1; 26 | m_instance = (T*)((int)this + offset); 27 | #else 28 | m_instance = static_cast< T* >( this ); 29 | #endif 30 | } 31 | virtual~ISingleton(){ 32 | m_instance=0; 33 | } 34 | static T&getInstance(){ 35 | if (m_instance == 0) 36 | { 37 | LogMessage("Instance object not created!", ELL_ERROR); 38 | //throw new std::exception("Instance object not created"); 39 | } 40 | return *m_instance; 41 | } 42 | static bool isExist(){ 43 | return m_instance!=0; 44 | } 45 | static T*getInstancePtr(){ 46 | return m_instance; 47 | } 48 | }; 49 | template T* ISingleton ::m_instance = 0; 50 | 51 | } 52 | 53 | 54 | #endif 55 | 56 | -------------------------------------------------------------------------------- /Plugin/includes/IThread.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mrayy/mrayGStreamerUnity/bb81bc3ed54d0a2a13e6b744db738ebbf56180b4/Plugin/includes/IThread.h -------------------------------------------------------------------------------- /Plugin/includes/IThreadFunction.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | /******************************************************************** 4 | created: 2009/01/02 5 | created: 2:1:2009 16:27 6 | filename: i:\Programing\GameEngine\mrayEngine\mrayEngine\include\IThreadFunction.h 7 | file path: i:\Programing\GameEngine\mrayEngine\mrayEngine\include 8 | file base: IThreadFunction 9 | file ext: h 10 | author: Mohamad Yamen Saraiji 11 | 12 | purpose: 13 | *********************************************************************/ 14 | 15 | #ifndef ___IThreadFunction___ 16 | #define ___IThreadFunction___ 17 | 18 | 19 | namespace mray{ 20 | namespace OS{ 21 | 22 | class IThread; 23 | //! abstract class, just override the methods (setup,execute) to your own use 24 | class IThreadFunction 25 | { 26 | public: 27 | virtual~IThreadFunction(){} 28 | virtual void setup(){} 29 | virtual void execute(IThread*caller,void*arg)=0; 30 | }; 31 | 32 | } 33 | } 34 | 35 | 36 | #endif //___IThreadFunction___ -------------------------------------------------------------------------------- /Plugin/includes/IThreadManager.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | 3 | #include "IThreadManager.h" 4 | 5 | 6 | 7 | namespace mray{ 8 | namespace OS{ 9 | 10 | IThreadManager::IThreadManager(){ 11 | } 12 | IThreadManager::~IThreadManager(){ 13 | // traceFunction(OS); 14 | shutdown(); 15 | } 16 | 17 | void IThreadManager::killThread(IThread* thread){ 18 | if(!thread) 19 | return; 20 | ThreadsList::iterator it=m_threads.begin(); 21 | for (;it!=m_threads.end();++it) 22 | { 23 | if((*it)==thread){ 24 | m_threads.erase(it); 25 | break; 26 | } 27 | } 28 | thread->terminate(); 29 | } 30 | 31 | void IThreadManager::shutdown(){ 32 | ThreadsList::iterator it=m_threads.begin(); 33 | bool isDone=false; 34 | while(!isDone) 35 | { 36 | isDone=true; 37 | for (;it!=m_threads.end();++it) 38 | { 39 | if((*it)->isActive()){ 40 | (*it)->terminate(); 41 | isDone=false; 42 | } 43 | } 44 | } 45 | m_threads.clear(); 46 | } 47 | 48 | 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /Plugin/includes/IThreadManager.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | /******************************************************************** 4 | created: 2009/02/26 5 | created: 26:2:2009 15:38 6 | filename: i:\Programing\GameEngine\mrayEngine\mrayEngine\include\IThreadManager.h 7 | file path: i:\Programing\GameEngine\mrayEngine\mrayEngine\include 8 | file base: IThreadManager 9 | file ext: h 10 | author: Mohamad Yamen Saraiji 11 | 12 | purpose: 13 | *********************************************************************/ 14 | 15 | #ifndef ___IThreadManager___ 16 | #define ___IThreadManager___ 17 | 18 | #include "ISingleton.h" 19 | #include "IThread.h" 20 | #include 21 | 22 | namespace mray{ 23 | namespace OS{ 24 | 25 | class IMutex; 26 | class ICondition; 27 | class MultiThreadListener; 28 | class IThreadFunction; 29 | class IThreadEvent; 30 | 31 | class IThreadManager:public ISingleton 32 | { 33 | public: 34 | IThreadManager(); 35 | virtual~IThreadManager(); 36 | virtual IThread* createThread(IThreadFunction*f,EThreadPriority priority=ETP_Normal)=0; 37 | virtual IMutex* createMutex()=0; 38 | 39 | virtual void killThread(IThread* thread); 40 | 41 | virtual IThread*getCurrentThread()=0; 42 | 43 | virtual void sleep(uint ms)=0; 44 | 45 | virtual void shutdown(); 46 | 47 | protected: 48 | typedef std::list ThreadsList; 49 | ThreadsList m_threads; 50 | typedef std::list ThreadsListenerList; 51 | ThreadsListenerList m_listener; 52 | 53 | }; 54 | 55 | } 56 | } 57 | 58 | 59 | #endif //___IThreadManager___ 60 | -------------------------------------------------------------------------------- /Plugin/includes/IVideoGrabber.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | /******************************************************************** 4 | created: 2012/07/27 5 | created: 27:7:2012 13:54 6 | filename: d:\Development\mrayEngine\Engine\mrayEngine\include\IVideoGrabber.h 7 | file path: d:\Development\mrayEngine\Engine\mrayEngine\include 8 | file base: IVideoGrabber 9 | file ext: h 10 | author: MHD YAMEN SARAIJI 11 | 12 | purpose: 13 | *********************************************************************/ 14 | #ifndef ___IVideoGrabber___ 15 | #define ___IVideoGrabber___ 16 | 17 | #include "ImageInfo.h" 18 | 19 | namespace mray 20 | { 21 | namespace video 22 | { 23 | 24 | class IVideoGrabber 25 | { 26 | protected: 27 | 28 | public: 29 | IVideoGrabber(){} 30 | virtual~IVideoGrabber(){} 31 | 32 | virtual void SetFrameSize(int w,int h)=0; 33 | virtual const Vector2d& GetFrameSize()=0; 34 | 35 | virtual void SetImageFormat(video::EPixelFormat fmt)=0; 36 | virtual video::EPixelFormat GetImageFormat()=0; 37 | 38 | virtual bool GrabFrame()=0; 39 | virtual bool HasNewFrame()=0; 40 | virtual ulong GetBufferID() = 0;// incremented once per frame 41 | 42 | 43 | virtual const ImageInfo* GetLastFrame()=0; 44 | 45 | virtual void Lock(){} 46 | virtual void Unlock(){} 47 | 48 | }; 49 | 50 | } 51 | } 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /Plugin/includes/ImageInfo.h: -------------------------------------------------------------------------------- 1 | 2 | /******************************************************************** 3 | created: 2009/04/27 4 | created: 27:4:2009 19:17 5 | filename: i:\Programing\GameEngine\mrayEngine\mrayEngine\include\ImageInfo.h 6 | file path: i:\Programing\GameEngine\mrayEngine\mrayEngine\include 7 | file base: ImageInfo 8 | file ext: h 9 | author: Mohamad Yamen Saraiji 10 | 11 | purpose: 12 | *********************************************************************/ 13 | 14 | #ifndef ___ImageInfo___ 15 | #define ___ImageInfo___ 16 | 17 | //#include "CompileConfig.h" 18 | #include "mTypes.h" 19 | #include "videoCommon.h" 20 | #include "UnityHelpers.h" 21 | //#include 22 | 23 | namespace mray{ 24 | namespace video{ 25 | 26 | class ImageInfo 27 | { 28 | private: 29 | protected: 30 | 31 | void _copyCroppedFromI420(const ImageInfo* i, Vector2d pos, Vector2d size, bool clamp, EPixelFormat targetFormat); 32 | 33 | 34 | public: 35 | ImageInfo(); 36 | virtual~ImageInfo(); 37 | 38 | int getPitch()const; 39 | 40 | void clear(); 41 | void setData(const void*data, const Vector2d&size, EPixelFormat format); 42 | void createData(const Vector2d& size,EPixelFormat format); 43 | void copyFrom(const ImageInfo* i); 44 | void copyCroppedFrom(const ImageInfo* i,Vector2d pos,Vector2d size,bool clamp,EPixelFormat targetFormat); 45 | 46 | void FlipImage(bool horizontal,bool vertical); 47 | 48 | uchar*getSurface(int d); 49 | const uchar*getSurface(int d)const; 50 | 51 | public: 52 | 53 | bool autoDel; 54 | 55 | Vector2d Size; 56 | EPixelFormat format; 57 | ulong imageDataSize; 58 | uchar* imageData; 59 | 60 | ImageInfo* tmpBuffer; 61 | }; 62 | 63 | 64 | } 65 | } 66 | 67 | 68 | #endif //___ImageInfo___ 69 | -------------------------------------------------------------------------------- /Plugin/includes/ListenerContainer.h: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | created: 2011/04/18 3 | created: 18:4:2011 12:25 4 | filename: d:\Development\mrayEngine\Engine\mrayEngine\include\ListenerContainer.h 5 | file path: d:\Development\mrayEngine\Engine\mrayEngine\include 6 | file base: ListenerContainer 7 | file ext: h 8 | author: MHD Yamen Saraiji 9 | 10 | purpose: 11 | *********************************************************************/ 12 | 13 | 14 | 15 | 16 | 17 | #ifndef __ListenerContainer__ 18 | #define __ListenerContainer__ 19 | 20 | #include 21 | 22 | namespace mray 23 | { 24 | 25 | template 26 | class ListenerContainer 27 | { 28 | public: 29 | typedef T ListenerType; 30 | private: 31 | protected: 32 | std::list m_listeners; 33 | public: 34 | 35 | 36 | ListenerContainer(){} 37 | virtual~ListenerContainer() 38 | { 39 | ClearListeners(); 40 | } 41 | 42 | void ClearListeners() 43 | { 44 | /* 45 | std::list::iterator it= m_listeners.begin(); 46 | for(;it!=m_listeners.end();++it) 47 | { 48 | delete *it; 49 | }*/ 50 | 51 | m_listeners.clear(); 52 | } 53 | void AddListener(const ListenerType &l) 54 | { 55 | m_listeners.push_back(l); 56 | } 57 | void RemoveListener(const ListenerType&l) 58 | { 59 | typename std::list::iterator it= m_listeners.begin(); 60 | for(;it!=m_listeners.end();++it) 61 | { 62 | if(*it==l) 63 | { 64 | m_listeners.erase(it); 65 | return; 66 | } 67 | } 68 | } 69 | 70 | #define DECLARE_FIRE_METHOD(funcname,paramsDef,paramsCall)\ 71 | void __FIRE_##funcname paramsDef\ 72 | {\ 73 | std::list::iterator it= m_listeners.begin();\ 74 | for(;it!=m_listeners.end();++it)\ 75 | {\ 76 | (*it)->funcname paramsCall;\ 77 | }\ 78 | } 79 | 80 | #define FIRE_LISTENR_METHOD(funcname,paramsCall)\ 81 | __FIRE_##funcname paramsCall; 82 | }; 83 | 84 | 85 | } 86 | 87 | #endif 88 | -------------------------------------------------------------------------------- /Plugin/includes/MutexLocks.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | /******************************************************************** 5 | created: 2011/02/06 6 | created: 6:2:2011 23:45 7 | filename: i:\Programing\GameEngine\mrayEngine\mrayEngine\include\MutexLocks.h 8 | file path: i:\Programing\GameEngine\mrayEngine\mrayEngine\include 9 | file base: MutexLocks 10 | file ext: h 11 | author: Mohamad Yamen Saraiji 12 | 13 | purpose: 14 | *********************************************************************/ 15 | 16 | #ifndef MutexLocks_h__ 17 | #define MutexLocks_h__ 18 | 19 | #include "IMutex.h" 20 | 21 | namespace mray 22 | { 23 | namespace OS 24 | { 25 | 26 | class ScopedLock 27 | { 28 | private: 29 | ScopedLock(const ScopedLock&){} 30 | ScopedLock& operator=(const ScopedLock&){} 31 | protected: 32 | IMutex* m_mutex; 33 | public: 34 | explicit ScopedLock(IMutex* m):m_mutex(m) 35 | { 36 | m->lock(); 37 | } 38 | ~ScopedLock() 39 | { 40 | m_mutex->unlock(); 41 | } 42 | }; 43 | class ReverseScopedLock 44 | { 45 | private: 46 | ReverseScopedLock(const ScopedLock&){} 47 | ReverseScopedLock& operator=(const ScopedLock&){} 48 | protected: 49 | IMutex* m_mutex; 50 | public: 51 | explicit ReverseScopedLock(IMutex* m):m_mutex(m) 52 | { 53 | m->unlock(); 54 | } 55 | ~ReverseScopedLock() 56 | { 57 | m_mutex->lock(); 58 | } 59 | }; 60 | 61 | } 62 | } 63 | #endif // MutexLocks_h__ 64 | -------------------------------------------------------------------------------- /Plugin/includes/NetAddress.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef ___NetAddress___ 3 | #define ___NetAddress___ 4 | 5 | 6 | #include 7 | #include 8 | 9 | 10 | 11 | namespace mray{ 12 | namespace network{ 13 | 14 | 15 | enum EAdressType 16 | { 17 | EAT_BroadCast, 18 | EAT_Localhost, 19 | EAT_None, 20 | EAT_Any 21 | }; 22 | 23 | 24 | class NetAddress{ 25 | protected: 26 | public: 27 | ulong address; 28 | int port; 29 | 30 | NetAddress(); 31 | NetAddress(EAdressType type,int port=0); 32 | NetAddress(const std::string& ipStr,int port=0); 33 | 34 | bool operator == (const NetAddress &o)const; 35 | bool operator < (const NetAddress &o)const; 36 | 37 | 38 | void getIP(int ip[4]) const; 39 | void setIP(int ip[4]); 40 | void setIP(const std::string& ipStr); 41 | 42 | std::string toString() const; 43 | 44 | 45 | static const NetAddress BroadcastAddr; 46 | static const NetAddress LocalHostAddr; 47 | static const NetAddress NoneAddr; 48 | static const NetAddress AnyAddr; 49 | }; 50 | 51 | 52 | } 53 | } 54 | 55 | 56 | 57 | 58 | #endif 59 | 60 | 61 | -------------------------------------------------------------------------------- /Plugin/includes/OSX/OSXMutex.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | 3 | 4 | #include "OSXMutex.h" 5 | 6 | 7 | namespace mray{ 8 | namespace OS{ 9 | 10 | OSXMutex::OSXMutex(){ 11 | 12 | } 13 | OSXMutex::~OSXMutex(){ 14 | 15 | } 16 | 17 | void OSXMutex::lock(){ 18 | m_mutex.lock(); 19 | } 20 | 21 | bool OSXMutex::tryLock() 22 | { 23 | return m_mutex.try_lock(); 24 | } 25 | 26 | void OSXMutex::unlock(){ 27 | m_mutex.unlock(); 28 | } 29 | 30 | 31 | 32 | 33 | } 34 | } 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /Plugin/includes/OSX/OSXMutex.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | #ifndef ___OSXMutex___ 4 | #define ___OSXMutex___ 5 | 6 | #include "IMutex.h" 7 | #include 8 | 9 | namespace mray{ 10 | namespace OS{ 11 | 12 | class OSXMutex:public IMutex 13 | { 14 | std::mutex m_mutex; 15 | public: 16 | OSXMutex(); 17 | virtual~OSXMutex(); 18 | 19 | virtual void lock(); 20 | virtual bool tryLock(); 21 | virtual void unlock(); 22 | }; 23 | 24 | 25 | } 26 | } 27 | 28 | 29 | #endif 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /Plugin/includes/OSX/OSXThread.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | #ifndef ___OSXThread___ 4 | #define ___OSXThread___ 5 | 6 | #include 7 | #include 8 | #include // pthread_kill 9 | 10 | namespace mray{ 11 | namespace OS{ 12 | 13 | class OSXThread:public IThread 14 | { 15 | public : 16 | OSXThread(IThreadFunction*f); 17 | virtual~OSXThread(); 18 | virtual void*start(void*arg); 19 | virtual void terminate(); 20 | virtual bool isActive(); 21 | 22 | virtual void setThreadPriority(EThreadPriority priority); 23 | virtual EThreadPriority getThreadPriority(); 24 | 25 | virtual bool sleep(uint milliseconds); 26 | virtual bool suspend(); 27 | virtual bool resume(); 28 | 29 | IThreadFunction*getThreadFunction(); 30 | 31 | virtual void setThreadFunction(IThreadFunction*f); 32 | 33 | //HANDLE getCancelEvent(){return m_cancelEvent;} 34 | 35 | protected: 36 | void run(void*arg); 37 | void*arg()const{return _Arg;} 38 | void arg(void*a){_Arg=a;} 39 | static void* entryPoint(void*arg); 40 | private: 41 | bool active; 42 | int _thread; 43 | pthread_t _threadHandle; 44 | void*_Arg; 45 | EThreadPriority m_priority; 46 | 47 | IThreadFunction* m_threadFunction; 48 | }; 49 | 50 | 51 | 52 | };//OS 53 | };//mray 54 | 55 | #endif 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /Plugin/includes/OSX/OSXThreadManager.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | 3 | 4 | #include "OSXThreadManager.h" 5 | #include "OSXThread.h" 6 | #include "OSXMutex.h" 7 | #include 8 | 9 | namespace mray{ 10 | namespace OS{ 11 | 12 | 13 | 14 | OSXThreadManager::OSXThreadManager(){} 15 | OSXThreadManager::~OSXThreadManager(){} 16 | IThread* OSXThreadManager::createThread(IThreadFunction*f,EThreadPriority priority){ 17 | IThread* t= new OSXThread(f); 18 | t->setThreadPriority(priority); 19 | m_threads.push_back(t); 20 | return t; 21 | } 22 | IMutex* OSXThreadManager::createMutex(){ 23 | return new OSXMutex(); 24 | } 25 | void OSXThreadManager::sleep(uint ms){ 26 | ::sleep(ms); 27 | } 28 | 29 | IThread*OSXThreadManager::getCurrentThread(){ 30 | return 0; 31 | } 32 | 33 | 34 | } 35 | } 36 | 37 | -------------------------------------------------------------------------------- /Plugin/includes/OSX/OSXThreadManager.h: -------------------------------------------------------------------------------- 1 | 2 | /******************************************************************** 3 | created: 2009/02/26 4 | created: 26:2:2009 22:36 5 | filename: i:\Programing\GameEngine\mrayEngine\mrayEngine\include\OSXThreadManager.h 6 | file path: i:\Programing\GameEngine\mrayEngine\mrayEngine\include 7 | file base: OSXThreadManager 8 | file ext: h 9 | author: Mohamad Yamen Saraiji 10 | 11 | purpose: 12 | *********************************************************************/ 13 | 14 | #ifndef ___OSXThreadManager___ 15 | #define ___OSXThreadManager___ 16 | 17 | #include 18 | 19 | namespace mray{ 20 | namespace OS{ 21 | 22 | class OSXThreadManager:public IThreadManager 23 | { 24 | ulong m_tlsID; 25 | public: 26 | OSXThreadManager(); 27 | ~OSXThreadManager(); 28 | IThread* createThread(IThreadFunction*f,EThreadPriority priority=ETP_Normal); 29 | IMutex* createMutex(); 30 | ICondition* createCondition(); 31 | IThreadEvent* createEvent(); 32 | 33 | IThread*getCurrentThread(); 34 | 35 | void sleep(uint ms); 36 | 37 | ulong getTlsID(){return m_tlsID;} 38 | 39 | }; 40 | 41 | } 42 | } 43 | 44 | 45 | #endif //___OSXThreadManager___ 46 | -------------------------------------------------------------------------------- /Plugin/includes/PixelUtil.h: -------------------------------------------------------------------------------- 1 | 2 | /******************************************************************** 3 | created: 2009/05/22 4 | created: 22:5:2009 1:13 5 | filename: i:\Programing\GameEngine\mrayEngine\mrayEngine\include\PixelUtil.h 6 | file path: i:\Programing\GameEngine\mrayEngine\mrayEngine\include 7 | file base: PixelUtil 8 | file ext: h 9 | author: Mohamad Yamen Saraiji 10 | 11 | purpose: 12 | *********************************************************************/ 13 | 14 | #ifndef ___PixelUtil___ 15 | #define ___PixelUtil___ 16 | 17 | #include 18 | #include // memcpy 19 | #include "mTypes.h" 20 | #include "videoCommon.h" 21 | 22 | namespace mray{ 23 | namespace video{ 24 | 25 | struct PixelDescriptor 26 | { 27 | std::string name; 28 | uchar elemSizeB; //element Size in Bytes 29 | 30 | uint flags;//see EPixelFlags 31 | EPixel_TYPE type; 32 | uchar componentsCount; 33 | uchar RBits, GBits, BBits, ABits; 34 | uint RMask, GMask, BMask, AMask; 35 | uchar RShift, GShift, BShift, AShift; 36 | 37 | }; 38 | 39 | class PixelUtil 40 | { 41 | private: 42 | protected: 43 | static PixelDescriptor m_pixelDescription[EPixelFormat_Count]; 44 | public: 45 | static EPixel_TYPE getPixelType(EPixelFormat f); 46 | 47 | static int getMaxMipmaps(uint w, uint h, uint d); 48 | 49 | static const PixelDescriptor& getPixelDescription(EPixelFormat f); 50 | 51 | //get a color from src data based on pixel format and return number of bytes 52 | //that reprsents the color size 53 | static int unpackColor(const uchar*src, EPixelFormat f, float &r, float &g, float&b, float&a); 54 | 55 | }; 56 | 57 | } 58 | } 59 | 60 | 61 | #endif //___PixelUtil___ 62 | -------------------------------------------------------------------------------- /Plugin/includes/PlatformBase.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Standard base includes, defines that indicate our current platform, etc. 4 | 5 | #include 6 | 7 | // Which platform we are on? 8 | // UNITY_WIN - Windows (regular win32) 9 | // UNITY_OSX - Mac OS X 10 | // UNITY_LINUX - Linux 11 | // UNITY_IPHONE - iOS 12 | // UNITY_ANDROID - Android 13 | // UNITY_METRO - WSA or UWP 14 | // UNITY_WEBGL - WebGL 15 | #if _MSC_VER 16 | #define UNITY_WIN 1 17 | #elif defined(__APPLE__) 18 | #define UNITY_OSX 1 19 | 20 | //#if defined(__arm__) || defined(__arm64__) 21 | // #define UNITY_IPHONE 1 22 | // #else 23 | // #define UNITY_OSX 1 24 | // #endif 25 | #elif defined(__ANDROID__) 26 | #define UNITY_ANDROID 1 27 | #elif defined(UNITY_METRO) || defined(UNITY_LINUX) || defined(UNITY_WEBGL) 28 | // these are defined externally 29 | #elif defined(__EMSCRIPTEN__) 30 | // this is already defined in Unity 5.6 31 | #define UNITY_WEBGL 1 32 | #elif defined(__linux__) 33 | #define UNITY_LINUX 1 34 | #else 35 | #error "Unknown platform!" 36 | #endif 37 | 38 | // Which graphics device APIs we possibly support? 39 | #if UNITY_METRO 40 | #define SUPPORT_D3D11 1 41 | #if WINDOWS_UWP 42 | #define SUPPORT_D3D12 1 43 | #endif 44 | #elif UNITY_WIN 45 | #define SUPPORT_D3D11 \ 46 | 1 // comment this out if you don't have D3D11 header/library files 47 | #define SUPPORT_D3D12 \ 48 | 0 // comment this out if you don't have D3D12 header/library files 49 | #define SUPPORT_OPENGL_UNIFIED 0 50 | #define SUPPORT_OPENGL_CORE 1 51 | #define SUPPORT_VULKAN 0 // Requires Vulkan SDK to be installed 52 | #elif UNITY_IPHONE || UNITY_ANDROID || UNITY_WEBGL 53 | #ifndef SUPPORT_OPENGL_ES 54 | #define SUPPORT_OPENGL_ES 1 55 | #endif 56 | #define SUPPORT_OPENGL_UNIFIED SUPPORT_OPENGL_ES 57 | #ifndef SUPPORT_VULKAN 58 | #define SUPPORT_VULKAN 0 59 | #endif 60 | #elif UNITY_OSX || UNITY_LINUX 61 | #define SUPPORT_OPENGL_UNIFIED 1 62 | #define SUPPORT_OPENGL_CORE 1 63 | #endif 64 | 65 | #if UNITY_IPHONE || UNITY_OSX 66 | #define SUPPORT_METAL 1 67 | #endif 68 | 69 | // COM-like Release macro 70 | #ifndef SAFE_RELEASE 71 | #define SAFE_RELEASE(a) \ 72 | if (a) { \ 73 | a->Release(); \ 74 | a = NULL; \ 75 | } 76 | #endif 77 | -------------------------------------------------------------------------------- /Plugin/includes/RenderAPI.cpp: -------------------------------------------------------------------------------- 1 | #include "RenderAPI.h" 2 | 3 | #include "PlatformBase.h" 4 | #include "Unity/IUnityGraphics.h" 5 | #include "UnityHelpers.h" 6 | 7 | RenderAPI* CreateRenderAPI(UnityGfxRenderer apiType) { 8 | LogMessage("Render API: " + std::to_string(apiType), ELL_INFO); 9 | #if SUPPORT_D3D11 10 | if (apiType == kUnityGfxRendererD3D11) { 11 | extern RenderAPI* CreateRenderAPI_D3D11(); 12 | return CreateRenderAPI_D3D11(); 13 | } 14 | #endif // if SUPPORT_D3D11 15 | 16 | #if SUPPORT_D3D9 17 | if (apiType == kUnityGfxRendererD3D9) { 18 | extern RenderAPI* CreateRenderAPI_D3D9(); 19 | return CreateRenderAPI_D3D9(); 20 | } 21 | #endif // if SUPPORT_D3D9 22 | 23 | #if SUPPORT_D3D12 24 | if (apiType == kUnityGfxRendererD3D12) { 25 | extern RenderAPI* CreateRenderAPI_D3D12(); 26 | return CreateRenderAPI_D3D12(); 27 | } 28 | #endif // if SUPPORT_D3D9 29 | 30 | #if SUPPORT_OPENGL_UNIFIED 31 | if (apiType == kUnityGfxRendererOpenGLCore || 32 | apiType == kUnityGfxRendererOpenGLES20 || 33 | apiType == kUnityGfxRendererOpenGLES30) { 34 | extern RenderAPI* CreateRenderAPI_OpenGLCoreES( 35 | UnityGfxRenderer apiType); 36 | return CreateRenderAPI_OpenGLCoreES(apiType); 37 | } 38 | #endif // if SUPPORT_OPENGL_UNIFIED 39 | 40 | #if SUPPORT_OPENGL_LEGACY 41 | if (apiType == kUnityGfxRendererOpenGL) { 42 | extern RenderAPI* CreateRenderAPI_OpenGL2(); 43 | return CreateRenderAPI_OpenGL2(); 44 | } 45 | #endif // if SUPPORT_OPENGL_LEGACY 46 | 47 | #if SUPPORT_METAL 48 | if (apiType == kUnityGfxRendererMetal) { 49 | extern RenderAPI* CreateRenderAPI_Metal(); 50 | return CreateRenderAPI_Metal(); 51 | } 52 | #endif // if SUPPORT_METAL 53 | 54 | // Unknown or unsupported graphics API 55 | return NULL; 56 | } 57 | -------------------------------------------------------------------------------- /Plugin/includes/Unity/IUnityGraphics.h.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fda4aca1386b2c64ab4e934ae7aa9e99 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Plugin/includes/Unity/IUnityGraphicsD3D11.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "IUnityInterface.h" 3 | 4 | 5 | // Should only be used on the rendering thread unless noted otherwise. 6 | UNITY_DECLARE_INTERFACE(IUnityGraphicsD3D11) 7 | { 8 | ID3D11Device* (UNITY_INTERFACE_API * GetDevice)(); 9 | 10 | ID3D11Resource* (UNITY_INTERFACE_API * TextureFromRenderBuffer)(UnityRenderBuffer buffer); 11 | ID3D11Resource* (UNITY_INTERFACE_API * TextureFromNativeTexture)(UnityTextureID texture); 12 | 13 | ID3D11RenderTargetView* (UNITY_INTERFACE_API * RTVFromRenderBuffer)(UnityRenderBuffer surface); 14 | ID3D11ShaderResourceView* (UNITY_INTERFACE_API * SRVFromNativeTexture)(UnityTextureID texture); 15 | }; 16 | 17 | UNITY_REGISTER_INTERFACE_GUID(0xAAB37EF87A87D748ULL, 0xBF76967F07EFB177ULL, IUnityGraphicsD3D11) 18 | -------------------------------------------------------------------------------- /Plugin/includes/Unity/IUnityGraphicsD3D11.h.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bdb8bf7d6eb8d324cab9f741d746232d 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Plugin/includes/Unity/IUnityGraphicsD3D12.h.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 146eaa4399d8fc448ad038b987462363 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Plugin/includes/Unity/IUnityGraphicsD3D9.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "IUnityInterface.h" 3 | 4 | // Should only be used on the rendering thread unless noted otherwise. 5 | UNITY_DECLARE_INTERFACE(IUnityGraphicsD3D9) 6 | { 7 | IDirect3D9* (UNITY_INTERFACE_API * GetD3D)(); 8 | IDirect3DDevice9* (UNITY_INTERFACE_API * GetDevice)(); 9 | }; 10 | UNITY_REGISTER_INTERFACE_GUID(0xE90746A523D53C4CULL, 0xAC825B19B6F82AC3ULL, IUnityGraphicsD3D9) 11 | -------------------------------------------------------------------------------- /Plugin/includes/Unity/IUnityGraphicsD3D9.h.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 74e43e8aa623ed348b07905d9bfd7b06 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Plugin/includes/Unity/IUnityGraphicsMetal.h.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 911498616f885714ba59d75995303b07 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Plugin/includes/Unity/IUnityGraphicsVulkan.h.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5e43e2ebfe46ab64ea423e41f2da3dd3 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Plugin/includes/Unity/IUnityInterface.h.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 730d2d5eb61937d40905922b5cbf609c 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Plugin/includes/UnityGraphicsDevice.h: -------------------------------------------------------------------------------- 1 | // 2 | // UnityGraphicsDevice.h 3 | // GStreamerUnityPlugin 4 | // 5 | // Created by MHD Yamen Saraiji on 12/16/16. 6 | // 7 | // 8 | 9 | #ifndef UnityGraphicsDevice_h 10 | #define UnityGraphicsDevice_h 11 | 12 | #include "RenderAPI.h" 13 | 14 | RenderAPI* GetRenderer(); 15 | UnityGfxRenderer GetDeviceType(); 16 | 17 | #endif /* UnityGraphicsDevice_h */ 18 | -------------------------------------------------------------------------------- /Plugin/includes/Win32/WinMutex.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | 3 | #define _WIN32_WINNT 0x0501 4 | 5 | #include "WinMutex.h" 6 | 7 | 8 | namespace mray{ 9 | namespace OS{ 10 | 11 | WinMutex::WinMutex(){ 12 | InitializeCriticalSection(&m_mutex); 13 | } 14 | WinMutex::~WinMutex(){ 15 | DeleteCriticalSection(&m_mutex); 16 | } 17 | 18 | void WinMutex::lock(){ 19 | EnterCriticalSection(&m_mutex); 20 | } 21 | 22 | bool WinMutex::tryLock() 23 | { 24 | return TryEnterCriticalSection(&m_mutex) ? true : false; 25 | } 26 | 27 | void WinMutex::unlock(){ 28 | LeaveCriticalSection(&m_mutex); 29 | } 30 | 31 | 32 | 33 | 34 | } 35 | } 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /Plugin/includes/Win32/WinMutex.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | #ifndef ___WinMutex___ 4 | #define ___WinMutex___ 5 | 6 | #define WIN32_LEAN_AND_MEAN 7 | #include 8 | #include "IMutex.h" 9 | 10 | namespace mray{ 11 | namespace OS{ 12 | 13 | class WinMutex:public IMutex 14 | { 15 | CRITICAL_SECTION m_mutex; 16 | public: 17 | WinMutex(); 18 | virtual~WinMutex(); 19 | 20 | virtual void lock(); 21 | virtual bool tryLock(); 22 | virtual void unlock(); 23 | }; 24 | 25 | 26 | } 27 | } 28 | 29 | 30 | #endif 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /Plugin/includes/Win32/WinThread.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | #ifndef ___WinThread___ 4 | #define ___WinThread___ 5 | 6 | 7 | #define WIN32_LEAN_AND_MEAN 8 | #include 9 | 10 | #include 11 | 12 | 13 | namespace mray{ 14 | namespace OS{ 15 | 16 | class WinThread:public IThread 17 | { 18 | public : 19 | WinThread(IThreadFunction*f); 20 | virtual~WinThread(); 21 | virtual void*start(void*arg); 22 | virtual void terminate(); 23 | virtual bool isActive(); 24 | 25 | virtual void setThreadPriority(EThreadPriority priority); 26 | virtual EThreadPriority getThreadPriority(); 27 | 28 | virtual bool sleep(uint milliseconds); 29 | virtual bool suspend(); 30 | virtual bool resume(); 31 | 32 | IThreadFunction*getThreadFunction(); 33 | 34 | virtual void setThreadFunction(IThreadFunction*f); 35 | 36 | HANDLE getCancelEvent(){return m_cancelEvent;} 37 | 38 | protected: 39 | void run(void*arg); 40 | void*arg()const{return _Arg;} 41 | void arg(void*a){_Arg=a;} 42 | static DWORD WINAPI entryPoint(void*arg); 43 | private: 44 | bool active; 45 | DWORD threadID; 46 | HANDLE threadHandle; 47 | void*_Arg; 48 | EThreadPriority m_priority; 49 | 50 | HANDLE m_cancelEvent; 51 | 52 | IThreadFunction* m_threadFunction; 53 | }; 54 | 55 | 56 | 57 | };//OS 58 | };//mray 59 | 60 | #endif 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /Plugin/includes/Win32/WinThreadManager.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | 3 | 4 | #include "WinThreadManager.h" 5 | #include "WinThread.h" 6 | #include "WinMutex.h" 7 | 8 | namespace mray{ 9 | namespace OS{ 10 | 11 | 12 | 13 | WinThreadManager::WinThreadManager(){ 14 | m_tlsID=TlsAlloc(); 15 | } 16 | WinThreadManager::~WinThreadManager(){ 17 | TlsFree(m_tlsID); 18 | } 19 | IThread* WinThreadManager::createThread(IThreadFunction*f,EThreadPriority priority){ 20 | IThread* t= new WinThread(f); 21 | t->setThreadPriority(priority); 22 | m_threads.push_back(t); 23 | return t; 24 | } 25 | IMutex* WinThreadManager::createMutex(){ 26 | return new WinMutex(); 27 | } 28 | void WinThreadManager::sleep(uint ms){ 29 | Sleep(ms); 30 | } 31 | 32 | IThread*WinThreadManager::getCurrentThread(){ 33 | void*data= TlsGetValue(m_tlsID); 34 | if(!data) 35 | return 0; 36 | return (IThread*)data; 37 | } 38 | 39 | 40 | } 41 | } 42 | 43 | -------------------------------------------------------------------------------- /Plugin/includes/Win32/WinThreadManager.h: -------------------------------------------------------------------------------- 1 | 2 | /******************************************************************** 3 | created: 2009/02/26 4 | created: 26:2:2009 22:36 5 | filename: i:\Programing\GameEngine\mrayEngine\mrayEngine\include\WinThreadManager.h 6 | file path: i:\Programing\GameEngine\mrayEngine\mrayEngine\include 7 | file base: WinThreadManager 8 | file ext: h 9 | author: Mohamad Yamen Saraiji 10 | 11 | purpose: 12 | *********************************************************************/ 13 | 14 | #ifndef ___WinThreadManager___ 15 | #define ___WinThreadManager___ 16 | 17 | #include 18 | 19 | namespace mray{ 20 | namespace OS{ 21 | 22 | class WinThreadManager:public IThreadManager 23 | { 24 | ulong m_tlsID; 25 | public: 26 | WinThreadManager(); 27 | ~WinThreadManager(); 28 | IThread* createThread(IThreadFunction*f,EThreadPriority priority=ETP_Normal); 29 | IMutex* createMutex(); 30 | ICondition* createCondition(); 31 | IThreadEvent* createEvent(); 32 | 33 | IThread*getCurrentThread(); 34 | 35 | void sleep(uint ms); 36 | 37 | ulong getTlsID(){return m_tlsID;} 38 | 39 | }; 40 | 41 | } 42 | } 43 | 44 | 45 | #endif //___WinThreadManager___ 46 | -------------------------------------------------------------------------------- /Plugin/includes/common.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | #ifndef __H_common___ 4 | #define __H_common___ 5 | 6 | 7 | 8 | 9 | namespace mray{ 10 | 11 | #define BIT(x) (1<<(x)) 12 | 13 | 14 | enum EEngineCatagories 15 | { 16 | eEngine = BIT(0), 17 | eRender= BIT(1), 18 | eAI= BIT(2), 19 | eScene= BIT(3), 20 | eGUI= BIT(4), 21 | eOS= BIT(5), 22 | eSound= BIT(6), 23 | ePhysics= BIT(7), 24 | eVideo= BIT(8), 25 | eScript= BIT(9), 26 | eOther= BIT(10) 27 | }; 28 | 29 | 30 | } 31 | 32 | 33 | 34 | 35 | 36 | #endif 37 | 38 | -------------------------------------------------------------------------------- /Plugin/includes/mTypes.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | #ifndef ___m_typeS___ 4 | #define ___m_typeS___ 5 | 6 | namespace mray{ 7 | 8 | typedef unsigned char uchar; 9 | typedef signed char schar; 10 | 11 | typedef unsigned int uint; 12 | typedef signed int sint; 13 | 14 | typedef unsigned short ushort; 15 | typedef signed short sshort; 16 | 17 | typedef unsigned long ulong; 18 | typedef unsigned long long ullong; 19 | typedef signed long slong; 20 | 21 | typedef uchar utf8; 22 | typedef uint utf32; 23 | 24 | 25 | #define mT(X) (X) 26 | 27 | #ifdef UNICODE 28 | 29 | typedef wchar_t mchar; 30 | 31 | #else 32 | 33 | typedef char mchar; 34 | 35 | #endif 36 | 37 | };//mray 38 | 39 | 40 | 41 | #endif -------------------------------------------------------------------------------- /Plugin/includes/old/PixelUtil.h: -------------------------------------------------------------------------------- 1 | 2 | /******************************************************************** 3 | created: 2009/05/22 4 | created: 22:5:2009 1:13 5 | filename: i:\Programing\GameEngine\mrayEngine\mrayEngine\include\PixelUtil.h 6 | file path: i:\Programing\GameEngine\mrayEngine\mrayEngine\include 7 | file base: PixelUtil 8 | file ext: h 9 | author: Mohamad Yamen Saraiji 10 | 11 | purpose: 12 | *********************************************************************/ 13 | 14 | #ifndef ___PixelUtil___ 15 | #define ___PixelUtil___ 16 | 17 | #include 18 | #include "mtypes.h" 19 | #include "videoCommon.h" 20 | 21 | namespace mray{ 22 | namespace video{ 23 | 24 | struct PixelDescriptor 25 | { 26 | std::string name; 27 | uchar elemSizeB; //element Size in Bytes 28 | 29 | uint flags;//see EPixelFlags 30 | EPixel_TYPE type; 31 | uchar componentsCount; 32 | uchar RBits,GBits,BBits,ABits; 33 | uint RMask,GMask,BMask,AMask; 34 | uchar RShift,GShift,BShift,AShift; 35 | 36 | }; 37 | 38 | class PixelUtil 39 | { 40 | private: 41 | protected: 42 | static PixelDescriptor m_pixelDescription[EPixelFormat_Count]; 43 | public: 44 | static EPixel_TYPE getPixelType(EPixelFormat f); 45 | 46 | static int getMaxMipmaps(uint w,uint h,uint d); 47 | 48 | static const PixelDescriptor& getPixelDescription(EPixelFormat f); 49 | 50 | //get a color from src data based on pixel format and return number of bytes 51 | //that reprsents the color size 52 | static int unpackColor(const uchar*src,EPixelFormat f,float &r,float &g,float&b,float&a); 53 | 54 | }; 55 | 56 | } 57 | } 58 | 59 | 60 | #endif //___PixelUtil___ 61 | -------------------------------------------------------------------------------- /Plugin/includes/zlib/ChangeLog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mrayy/mrayGStreamerUnity/bb81bc3ed54d0a2a13e6b744db738ebbf56180b4/Plugin/includes/zlib/ChangeLog -------------------------------------------------------------------------------- /Plugin/includes/zlib/INDEX: -------------------------------------------------------------------------------- 1 | ChangeLog history of changes 2 | FAQ Frequently Asked Questions about zlib 3 | INDEX this file 4 | Makefile makefile for Unix (generated by configure) 5 | Makefile.in makefile for Unix (template for configure) 6 | README guess what 7 | algorithm.txt description of the (de)compression algorithm 8 | configure configure script for Unix 9 | zconf.in.h template for zconf.h (used by configure) 10 | 11 | amiga/ makefiles for Amiga SAS C 12 | as400/ makefiles for IBM AS/400 13 | msdos/ makefiles for MSDOS 14 | old/ makefiles for various architectures and zlib documentation 15 | files that have not yet been updated for zlib 1.2.x 16 | projects/ projects for various Integrated Development Environments 17 | qnx/ makefiles for QNX 18 | win32/ makefiles for Windows 19 | 20 | zlib public header files (must be kept): 21 | zconf.h 22 | zlib.h 23 | 24 | private source files used to build the zlib library: 25 | adler32.c 26 | compress.c 27 | crc32.c 28 | crc32.h 29 | deflate.c 30 | deflate.h 31 | gzio.c 32 | infback.c 33 | inffast.c 34 | inffast.h 35 | inffixed.h 36 | inflate.c 37 | inflate.h 38 | inftrees.c 39 | inftrees.h 40 | trees.c 41 | trees.h 42 | uncompr.c 43 | zutil.c 44 | zutil.h 45 | 46 | source files for sample programs: 47 | example.c 48 | minigzip.c 49 | 50 | unsupported contribution by third parties 51 | See contrib/README.contrib 52 | -------------------------------------------------------------------------------- /Plugin/includes/zlib/inffast.h: -------------------------------------------------------------------------------- 1 | /* inffast.h -- header to use inffast.c 2 | * Copyright (C) 1995-2003 Mark Adler 3 | * For conditions of distribution and use, see copyright notice in zlib.h 4 | */ 5 | 6 | /* WARNING: this file should *not* be used by applications. It is 7 | part of the implementation of the compression library and is 8 | subject to change. Applications should only use zlib.h. 9 | */ 10 | 11 | void inflate_fast OF((z_streamp strm, unsigned start)); 12 | -------------------------------------------------------------------------------- /Plugin/lib/zlib.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mrayy/mrayGStreamerUnity/bb81bc3ed54d0a2a13e6b744db738ebbf56180b4/Plugin/lib/zlib.lib -------------------------------------------------------------------------------- /Plugin/sources/CMyListener.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | /******************************************************************** 4 | created: 2013/12/08 5 | created: 8:12:2013 0:07 6 | filename: C:\Development\mrayEngine\Projects\TelubeeRobotAgent\CMyListener.h 7 | file path: C:\Development\mrayEngine\Projects\TelubeeRobotAgent 8 | file base: CMyListener 9 | file ext: h 10 | author: MHD Yamen Saraiji 11 | 12 | purpose: 13 | *********************************************************************/ 14 | 15 | #ifndef __CMyListener__ 16 | #define __CMyListener__ 17 | 18 | #include 19 | #include "ListenerContainer.h" 20 | 21 | G_BEGIN_DECLS 22 | 23 | /* #defines don't like whitespacey bits */ 24 | #define GST_TYPE_MyListener \ 25 | (gst_my_listener_get_type()) 26 | #define GST_MyListener(obj) \ 27 | (G_TYPE_CHECK_INSTANCE_CAST((obj), GST_TYPE_MyListener, GstMyListener)) 28 | #define GST_MyListener_CLASS(klass) \ 29 | (G_TYPE_CHECK_CLASS_CAST((klass), GST_TYPE_MyListener, GstMyListenerClass)) 30 | #define GST_IS_MyListener(obj) \ 31 | (G_TYPE_CHECK_INSTANCE_TYPE((obj), GST_TYPE_MyListener)) 32 | #define GST_IS_MyListener_CLASS(klass) \ 33 | (G_TYPE_CHECK_CLASS_TYPE((klass), GST_TYPE_MyListener)) 34 | 35 | typedef struct _GstMyListener GstMyListener; 36 | typedef struct _GstMyListenerClass GstMyListenerClass; 37 | 38 | class IMyListenerCallback 39 | { 40 | public: 41 | virtual void ListenerOnDataChained(_GstMyListener* src, GstBuffer * buffer){} 42 | }; 43 | 44 | class MyListenerContainer :public mray::ListenerContainer 45 | { 46 | public: 47 | DECLARE_FIRE_METHOD(ListenerOnDataChained, (_GstMyListener* src, GstBuffer * buffer), (src, buffer)); 48 | }; 49 | struct _GstMyListener 50 | { 51 | GstElement element; 52 | 53 | GstPad *sinkpad, *srcpad; 54 | 55 | gboolean silent; 56 | 57 | MyListenerContainer *listeners; 58 | }; 59 | 60 | struct _GstMyListenerClass 61 | { 62 | GstElementClass parent_class; 63 | static gboolean plugin_init(GstPlugin * plugin); 64 | }; 65 | 66 | GType gst_my_listener_get_type(void); 67 | 68 | 69 | G_END_DECLS 70 | 71 | 72 | #endif /* __GST_MyListener_H__ */ 73 | 74 | 75 | 76 | -------------------------------------------------------------------------------- /Plugin/sources/CMySink.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | /******************************************************************** 4 | created: 2013/12/07 5 | created: 7:12:2013 14:47 6 | filename: C:\Development\mrayEngine\Projects\TelubeeRobotAgent\CMySink.h 7 | file path: C:\Development\mrayEngine\Projects\TelubeeRobotAgent 8 | file base: CMySink 9 | file ext: h 10 | author: MHD Yamen Saraiji 11 | 12 | purpose: 13 | *********************************************************************/ 14 | 15 | #ifndef __CMySink__ 16 | #define __CMySink__ 17 | 18 | 19 | #include 20 | 21 | #include 22 | #include 23 | 24 | 25 | G_BEGIN_DECLS 26 | 27 | 28 | #define GST_TYPE_MYSINK (gst_mysink_get_type()) 29 | #define GST_MYSINK(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_MYSINK,GstMySink)) 30 | #define GST_MYSINK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_MYSINK,GstMySinkClass)) 31 | #define GST_IS_MYSINK(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_MYSINK)) 32 | #define GST_IS_MYSINK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_MYSINK)) 33 | 34 | typedef struct _GstMySink GstMySink; 35 | typedef struct _GstMySinkClass GstMySinkClass; 36 | 37 | struct _GstMySink { 38 | GstBaseSink parent; 39 | 40 | gpointer data; 41 | GstFlowReturn(*new_buffer)(GstMySink * sink, gpointer data,GstBuffer * buffer); 42 | }; 43 | 44 | struct _GstMySinkClass { 45 | GstBaseSinkClass parent_class; 46 | /* element methods */ 47 | 48 | static gboolean plugin_init(GstPlugin * plugin); 49 | }; 50 | 51 | GType gst_mysink_get_type(void); 52 | 53 | 54 | G_END_DECLS 55 | 56 | 57 | 58 | #endif 59 | -------------------------------------------------------------------------------- /Plugin/sources/CMySrc.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | /******************************************************************** 4 | created: 2013/12/08 5 | created: 8:12:2013 0:07 6 | filename: C:\Development\mrayEngine\Projects\TelubeeRobotAgent\CMySrc.h 7 | file path: C:\Development\mrayEngine\Projects\TelubeeRobotAgent 8 | file base: CMySrc 9 | file ext: h 10 | author: MHD Yamen Saraiji 11 | 12 | purpose: 13 | *********************************************************************/ 14 | 15 | #ifndef __CMySrc__ 16 | #define __CMySrc__ 17 | 18 | #include 19 | #include 20 | #include 21 | 22 | G_BEGIN_DECLS 23 | 24 | 25 | #define GST_TYPE_MySRC (gst_mysrc_get_type()) 26 | #define GST_MySRC(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GST_TYPE_MySRC, GstMySrc)) 27 | #define GST_MySRC_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GST_TYPE_MySRC, GstMySrcClass)) 28 | #define GST_IS_MySRC(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GST_TYPE_MySRC)) 29 | #define GST_IS_MySRC_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), GST_TYPE_MySRC)) 30 | #define GST_MySRC_CAST(obj) ((GstMySrc *)(obj)) 31 | 32 | typedef struct _GstMySrc GstMySrc; 33 | typedef struct _GstMySrcClass GstMySrcClass; 34 | 35 | struct _GstMySrc { 36 | GstPushSrc parent; 37 | 38 | GstCaps* caps; 39 | gpointer data; 40 | GstFlowReturn(*need_buffer)(GstMySrc * sink, gpointer data, GstBuffer ** buffer); 41 | 42 | }; 43 | 44 | struct _GstMySrcClass { 45 | GstPushSrcClass parent_class; 46 | static gboolean plugin_init(GstPlugin * plugin); 47 | }; 48 | 49 | GType gst_mysrc_get_type(void); 50 | 51 | G_END_DECLS 52 | 53 | 54 | #endif /* __GST_MySRC_H__ */ 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /Plugin/sources/CoreAPI.h: -------------------------------------------------------------------------------- 1 | 2 | #pragma once 3 | 4 | #include "GStreamerCore.h" 5 | #include "Unity/IUnityInterface.h" 6 | #include "ImageInfo.h" 7 | 8 | using namespace mray; 9 | 10 | 11 | 12 | extern "C" UNITY_INTERFACE_EXPORT bool mray_gstreamer_initialize(); 13 | 14 | extern "C" UNITY_INTERFACE_EXPORT void mray_gstreamer_shutdown(); 15 | 16 | extern "C" UNITY_INTERFACE_EXPORT bool mray_gstreamer_isActive(); 17 | 18 | 19 | extern "C" UNITY_INTERFACE_EXPORT video::ImageInfo* mray_createImageData(int width,int height,video::EPixelFormat format); 20 | extern "C" UNITY_INTERFACE_EXPORT void mray_resizeImageData(video::ImageInfo* ifo,int width,int height,video::EPixelFormat format); 21 | extern "C" UNITY_INTERFACE_EXPORT void mray_getImageDataInfo(video::ImageInfo* ifo,int& width,int& height,video::EPixelFormat& format); 22 | extern "C" UNITY_INTERFACE_EXPORT void* mray_getImageDataPtr(video::ImageInfo* ifo); 23 | 24 | extern "C" UNITY_INTERFACE_EXPORT void mray_cloneImageData(video::ImageInfo* ifo, video::ImageInfo* dst); 25 | extern "C" UNITY_INTERFACE_EXPORT void mray_copyCroppedImageData(video::ImageInfo* ifo, video::ImageInfo* dst, int x, int y, int width, int height, bool clamp); 26 | extern "C" UNITY_INTERFACE_EXPORT void mray_deleteImageData(video::ImageInfo* ifo); 27 | extern "C" UNITY_INTERFACE_EXPORT void mray_BlitImageDataInfo(video::ImageInfo* ifo,void* _TextureNativePtr); 28 | extern "C" UNITY_INTERFACE_EXPORT void mray_FlipImageData(video::ImageInfo* ifo,bool horizontal,bool vertical); 29 | -------------------------------------------------------------------------------- /Plugin/sources/CustomAudioGrabber.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | #ifndef __CustomAudioGrabber__ 4 | #define __CustomAudioGrabber__ 5 | 6 | #include "IAudioGrabber.h" 7 | #include 8 | 9 | 10 | namespace mray 11 | { 12 | namespace video 13 | { 14 | class GstPipelineHandler; 15 | class CustomAudioGrabberImpl; 16 | class CustomAudioGrabber :public IAudioGrabber 17 | { 18 | protected: 19 | CustomAudioGrabberImpl* m_impl; 20 | public: 21 | CustomAudioGrabber(); 22 | virtual ~CustomAudioGrabber(); 23 | 24 | virtual void Init(const std::string &pipeline, int channels, int samplingrate); 25 | 26 | virtual GstPipelineHandler* GetPipelineHandler(); 27 | 28 | virtual bool Start(); 29 | virtual void Pause(); 30 | virtual void Close(); 31 | virtual void Resume() ; 32 | virtual void Restart() ; 33 | virtual bool IsStarted(); 34 | 35 | virtual uint GetSamplingRate(); 36 | virtual uint GetChannelsCount(); 37 | 38 | virtual bool GrabFrame(); 39 | virtual float* GetAudioFrame(); 40 | virtual uint GetAudioFrameSize(); 41 | 42 | virtual void SetVolume(float vol); 43 | }; 44 | 45 | } 46 | } 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /Plugin/sources/GStreamerCore.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | /******************************************************************** 4 | created: 2014/02/22 5 | created: 22:2:2014 18:02 6 | filename: C:\Development\mrayEngine\Plugins\mrayGStreamer\GStreamerCore.h 7 | file path: C:\Development\mrayEngine\Plugins\mrayGStreamer 8 | file base: GStreamerCore 9 | file ext: h 10 | author: MHD Yamen Saraiji 11 | 12 | purpose: 13 | *********************************************************************/ 14 | 15 | #ifndef __GStreamerCore__ 16 | #define __GStreamerCore__ 17 | 18 | #include 19 | #include "mTypes.h" 20 | 21 | 22 | namespace mray 23 | { 24 | namespace video 25 | { 26 | 27 | class GStreamerCore 28 | { 29 | protected: 30 | static GStreamerCore* m_instance; 31 | static uint m_refCount; 32 | 33 | //OS::IThread* m_mainLoopThread; 34 | //OS::IThreadFunction* m_threadFunc; 35 | 36 | GThread *gub_main_loop_thread ; 37 | GMainLoop *gub_main_loop ; 38 | 39 | GStreamerCore(); 40 | 41 | 42 | void _Init(); 43 | 44 | void _StartLoop(); 45 | void _StopLoop(); 46 | 47 | public: 48 | 49 | virtual~GStreamerCore(); 50 | 51 | static void Ref(); 52 | static void Unref(); 53 | static uint RefCount(){ return m_refCount; } 54 | 55 | static GStreamerCore* Instance(); 56 | 57 | void _loopFunction(); 58 | }; 59 | 60 | } 61 | } 62 | 63 | 64 | #endif 65 | -------------------------------------------------------------------------------- /Plugin/sources/GstAppAudioPlayer.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | #ifndef GstAppAudioPlayer_h__ 4 | #define GstAppAudioPlayer_h__ 5 | 6 | 7 | 8 | #include "IGStreamerPlayer.h" 9 | #include "mTypes.h" 10 | 11 | namespace mray 12 | { 13 | namespace video 14 | { 15 | class IAudioGrabber; 16 | 17 | class GstAppAudioPlayerImpl; 18 | 19 | class GstAppAudioPlayer :public IGStreamerPlayer 20 | { 21 | protected: 22 | GstAppAudioPlayerImpl* m_impl; 23 | GstPipelineHandler* GetPipeline(); 24 | public: 25 | GstAppAudioPlayer(); 26 | virtual ~GstAppAudioPlayer(); 27 | 28 | 29 | void SetAudioGrabber(IAudioGrabber* g); 30 | void Init(int audioInterface,int samplingRate); 31 | bool CreateStream(); 32 | 33 | virtual bool IsStream(); 34 | 35 | void SetVolume(float vol); 36 | 37 | virtual void Play(); 38 | virtual void Pause(); 39 | virtual void Stop(); 40 | virtual bool IsLoaded(); 41 | virtual bool IsPlaying(); 42 | virtual void Close(); 43 | virtual bool GrabFrame(int i = 0) { return false; } 44 | virtual const ImageInfo* GetLastFrame(int i = 0){ return 0; } 45 | virtual unsigned long GetLastFrameTimestamp(int i = 0){ return 0; } 46 | virtual void* GetLastFrameRTPMeta(int i = 0){return 0;} 47 | 48 | virtual bool SetPosition(signed long pos) { return false; } 49 | virtual signed long GetPosition(){ return -1; } 50 | virtual signed long GetDuration() { return -1; } 51 | 52 | 53 | }; 54 | 55 | } 56 | } 57 | #endif // GstAppAudioPlayer_h__ 58 | -------------------------------------------------------------------------------- /Plugin/sources/GstAppNetAudioStreamer.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | #ifndef GstAppNetAudioStreamer_h__ 5 | #define GstAppNetAudioStreamer_h__ 6 | 7 | #include "IGStreamerStreamer.h" 8 | #include "IAudioGrabber.h" 9 | 10 | namespace mray 11 | { 12 | namespace video 13 | { 14 | 15 | class GstAppNetAudioStreamerImpl; 16 | 17 | 18 | class GstAppNetAudioStreamer :public IGStreamerStreamer 19 | { 20 | protected: 21 | GstAppNetAudioStreamerImpl* m_impl; 22 | GstPipelineHandler* GetPipeline(); 23 | 24 | public: 25 | GstAppNetAudioStreamer(); 26 | virtual ~GstAppNetAudioStreamer(); 27 | 28 | // addr: target address to stream video to 29 | // audioport: port for the audio stream , audio rtcp is allocated as audioPort+1 and audioPort+2 30 | void BindPorts(const std::string& addr, uint *port, uint count, bool rtcp); 31 | 32 | void SetAudioGrabber(IAudioGrabber* g); 33 | 34 | bool CreateStream(); 35 | void Stream(); 36 | bool IsStreaming(); 37 | void Stop(); 38 | virtual void Close(); 39 | 40 | virtual void SetPaused(bool paused); 41 | virtual bool IsPaused(); 42 | }; 43 | 44 | } 45 | } 46 | 47 | #endif // GstAppNetAudioStreamer_h__ 48 | -------------------------------------------------------------------------------- /Plugin/sources/GstAudioSampler.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | #ifndef GstAudioSampler_h__ 4 | #define GstAudioSampler_h__ 5 | 6 | 7 | 8 | #include "IGStreamerPlayer.h" 9 | #include "mTypes.h" 10 | 11 | namespace mray 12 | { 13 | namespace video 14 | { 15 | class IAudioGrabber; 16 | 17 | class GstAudioSamplerImpl; 18 | 19 | class GstAudioSampler :public IGStreamerPlayer 20 | { 21 | protected: 22 | GstAudioSamplerImpl* m_impl; 23 | GstPipelineHandler* GetPipeline(); 24 | public: 25 | GstAudioSampler(); 26 | virtual ~GstAudioSampler(); 27 | 28 | 29 | void SetAudioGrabber(IAudioGrabber* g); 30 | void Init(int audioInterface, int samplingRate); 31 | bool CreateStream(); 32 | 33 | virtual bool IsStream(); 34 | 35 | void SetVolume(float vol); 36 | 37 | virtual void Play(); 38 | virtual void Pause(); 39 | virtual void Stop(); 40 | virtual bool IsLoaded(); 41 | virtual bool IsPlaying(); 42 | virtual void Close(); 43 | virtual const ImageInfo* GetLastFrame(int i = 0) { return 0; } 44 | virtual unsigned long GetLastFrameTimestamp(int i = 0) { return 0; } 45 | virtual void* GetLastFrameRTPMeta(int i = 0) { return 0; } 46 | 47 | virtual bool SetPosition(signed long pos) { return false; } 48 | virtual signed long GetPosition() { return -1; } 49 | virtual signed long GetDuration() { return -1; } 50 | 51 | void SetSampleRate(int Rate); 52 | int GetSampleRate(); 53 | bool GrabFrame(); 54 | int GetFrameSize(); 55 | bool CopyAudioFrame(float* output); 56 | int ChannelsCount(); 57 | 58 | 59 | }; 60 | 61 | } 62 | } 63 | #endif // GstAudioSampler_h__ 64 | -------------------------------------------------------------------------------- /Plugin/sources/GstCustomDataPlayer.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | #ifndef __GstCustomDataPlayer__ 4 | #define __GstCustomDataPlayer__ 5 | 6 | #include "IGStreamerPlayer.h" 7 | #include "IVideoGrabber.h" 8 | 9 | namespace mray 10 | { 11 | namespace video 12 | { 13 | 14 | class GstCustomDataPlayerImpl; 15 | 16 | class GstCustomDataPlayer :public IGStreamerPlayer 17 | { 18 | protected: 19 | GstCustomDataPlayerImpl* m_impl; 20 | 21 | GstPipelineHandler* GetPipeline(); 22 | 23 | public: 24 | GstCustomDataPlayer(); 25 | virtual ~GstCustomDataPlayer(); 26 | 27 | void SetApplicationDataType(const std::string& dataType, bool autotimestamp, int payload = 98);// application/x-"dataType" 28 | 29 | void SetPort(int port); 30 | 31 | bool CreateStream(); 32 | 33 | virtual bool IsStream(); 34 | 35 | void SetVolume(float vol); 36 | 37 | virtual void Play(); 38 | virtual void Pause(); 39 | virtual void Stop(); 40 | virtual bool IsLoaded(); 41 | virtual bool IsPlaying(); 42 | virtual void Close(); 43 | 44 | virtual int GetPort(int i); 45 | 46 | bool GrabFrame(int i=0); 47 | virtual bool HasNewFrame(); 48 | virtual ulong GetBufferID();// incremented once per frame 49 | 50 | virtual bool SetPosition(signed long pos) { return false; } 51 | virtual signed long GetPosition() { return 0; } 52 | virtual signed long GetDuration() { return 0; } 53 | virtual const ImageInfo* GetLastFrame(int i = 0) { return 0; } 54 | virtual unsigned long GetLastFrameTimestamp(int i = 0) { return 0; } 55 | virtual void* GetLastFrameRTPMeta(int i = 0) { return 0; } 56 | int GetDataLength(); 57 | int GetData(void* data,int length); 58 | 59 | }; 60 | 61 | } 62 | } 63 | 64 | 65 | #endif 66 | -------------------------------------------------------------------------------- /Plugin/sources/GstCustomDataStreamer.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | #ifndef __GSTCUSTOMDATASTREAMER__ 4 | #define __GSTCUSTOMDATASTREAMER__ 5 | 6 | #include "IGStreamerStreamer.h" 7 | #include 8 | 9 | namespace mray 10 | { 11 | namespace video 12 | { 13 | 14 | class GstCustomDataStreamerImpl; 15 | class GstCustomDataStreamer :public IGStreamerStreamer 16 | { 17 | protected: 18 | GstCustomDataStreamerImpl* m_impl; 19 | virtual GstPipelineHandler* GetPipeline(); 20 | public: 21 | GstCustomDataStreamer(); 22 | virtual ~GstCustomDataStreamer(); 23 | 24 | virtual void BindPorts(const std::string& addr, uint *port, uint count, bool rtcp); 25 | void SetApplicationDataType(const std::string& dataType,bool autotimestamp,int payload=98);// application/x-"dataType" 26 | 27 | void AddDataFrame(uchar* data,int length); 28 | 29 | virtual bool CreateStream() ; 30 | virtual void Stream() ; 31 | virtual bool IsStreaming() ; 32 | virtual void Stop() ; 33 | virtual void Close() ; 34 | 35 | int CompressRatio(); 36 | 37 | virtual void SetPaused(bool paused) ; 38 | virtual bool IsPaused() ; 39 | }; 40 | 41 | } 42 | } 43 | 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /Plugin/sources/GstCustomVideoPlayer.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | #ifndef __GSTCUSTOMVIDEOPLAYER__ 4 | #define __GSTCUSTOMVIDEOPLAYER__ 5 | 6 | #include 7 | 8 | #include "IGStreamerPlayer.h" 9 | #include "IVideoGrabber.h" 10 | #include "UnityHelpers.h" 11 | namespace mray { 12 | 13 | namespace video { 14 | 15 | class GstCustomVideoPlayerImpl; 16 | 17 | class GstCustomVideoPlayer : public IGStreamerPlayer { 18 | protected: 19 | GstCustomVideoPlayerImpl* m_impl; 20 | GstPipelineHandler* GetPipeline(); 21 | 22 | public: 23 | GstCustomVideoPlayer(); 24 | virtual ~GstCustomVideoPlayer(); 25 | 26 | void SetPipelineString(const std::string& pipeline); 27 | bool CreateStream(); 28 | 29 | virtual bool IsStream(); 30 | 31 | void SetVolume(float vol); 32 | 33 | virtual void Play(); 34 | virtual void Pause(); 35 | virtual void Stop(); 36 | virtual void SetLoop(bool loop); 37 | virtual bool IsLoop(); 38 | virtual bool IsLoaded(); 39 | virtual bool IsPlaying(); 40 | virtual void Close(); 41 | virtual bool SetPosition(signed long pos); 42 | virtual signed long GetPosition(); 43 | virtual signed long GetDuration(); 44 | 45 | // defined by the source video stream 46 | virtual void SetFrameSize(int w, int h) {} 47 | virtual const Vector2d& GetFrameSize(); 48 | 49 | // defined by the source video stream 50 | virtual void SetImageFormat(video::EPixelFormat fmt) {} 51 | virtual video::EPixelFormat GetImageFormat(); 52 | 53 | virtual bool GrabFrame(int i = 0); 54 | virtual bool GrabAudioFrame(); 55 | virtual bool HasNewFrame(); 56 | virtual ulong GetBufferID(); // incremented once per frame 57 | 58 | virtual const ImageInfo* GetLastFrame(int i = 0); 59 | virtual unsigned long GetLastFrameTimestamp(int i = 0); 60 | virtual void* GetLastFrameRTPMeta(int i = 0); 61 | virtual float GetCaptureFrameRate(); 62 | 63 | int GetAudioFrameSize(); 64 | bool CopyAudioFrame(float* output); 65 | int GetAudioChannelsCount(); 66 | 67 | virtual int GetPort(int i) { return 0; } 68 | }; 69 | 70 | } // namespace video 71 | } // namespace mray 72 | 73 | #endif 74 | -------------------------------------------------------------------------------- /Plugin/sources/GstCustomVideoStreamer.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | /******************************************************************** 9 | created: 2013/12/05 10 | created: 5:12:2013 20:26 11 | filename: C:\Development\mrayEngine\Plugins\mrayGStreamer\GstCustomVideoStreamer 12 | file base: GstCustomVideoStreamer 13 | file ext: h 14 | author: MHD Yamen Saraiji 15 | 16 | purpose: 17 | *********************************************************************/ 18 | 19 | #ifndef GstCustomVideoStreamer_h__ 20 | #define GstCustomVideoStreamer_h__ 21 | 22 | #include "IGStreamerStreamer.h" 23 | #include 24 | 25 | namespace mray 26 | { 27 | namespace video 28 | { 29 | 30 | class GstCustomVideoStreamerImpl; 31 | class IVideoGrabber; 32 | 33 | class GstCustomVideoStreamer :public IGStreamerStreamer 34 | { 35 | protected: 36 | GstCustomVideoStreamerImpl* m_impl; 37 | 38 | friend class GstCustomVideoStreamerImpl; 39 | GstPipelineHandler* GetPipeline(); 40 | public: 41 | GstCustomVideoStreamer(); 42 | virtual ~GstCustomVideoStreamer(); 43 | 44 | void SetPipeline(const std::string& pipeline); 45 | bool CreateStream(); 46 | 47 | void Stream(); 48 | bool IsStreaming(); 49 | void Stop(); 50 | virtual void Close(); 51 | 52 | void SetVideoGrabber(IVideoGrabber* grabber0); 53 | void SetResolution(int width, int height, int fps); 54 | 55 | virtual void SetPaused(bool paused); 56 | virtual bool IsPaused(); 57 | }; 58 | 59 | } 60 | } 61 | 62 | #endif // GstCustomVideoStreamer_h__ 63 | 64 | -------------------------------------------------------------------------------- /Plugin/sources/GstNetworkAudioPlayer.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | #ifndef GstNetworkAudioPlayer_h__ 4 | #define GstNetworkAudioPlayer_h__ 5 | 6 | 7 | 8 | #include "IGStreamerPlayer.h" 9 | #include "mTypes.h" 10 | 11 | namespace mray 12 | { 13 | namespace video 14 | { 15 | 16 | class GstNetworkAudioPlayerImpl; 17 | 18 | class GstNetworkAudioPlayer :public IGStreamerPlayer 19 | { 20 | protected: 21 | GstNetworkAudioPlayerImpl* m_impl; 22 | GstPipelineHandler* GetPipeline(); 23 | public: 24 | GstNetworkAudioPlayer(); 25 | virtual ~GstNetworkAudioPlayer(); 26 | 27 | //set ip address for the target host 28 | // audioport: port for the audio stream , audio rtcp is allocated as audioPort+1 and audioPort+2 29 | void SetIPAddress(const std::string& ip, uint audioPort,uint clockPort, bool rtcp); 30 | bool CreateStream(); 31 | 32 | uint GetAudioPort(); 33 | 34 | virtual bool IsStream(); 35 | 36 | void SetVolume(float vol); 37 | 38 | virtual void Play(); 39 | virtual void Pause(); 40 | virtual void Stop(); 41 | virtual bool IsLoaded(); 42 | virtual bool IsPlaying(); 43 | virtual void Close(); 44 | virtual const ImageInfo* GetLastFrame(int i = 0){ return 0; } 45 | virtual unsigned long GetLastFrameTimestamp(int i = 0){ return 0; } 46 | virtual void* GetLastFrameRTPMeta(int i = 0){return 0;} 47 | //if it set to false, then the audio will be played using directsound 48 | virtual void UseCustomAudioInterface(bool use); 49 | virtual bool IsUsingCustomAudioInterface(); 50 | 51 | virtual bool SetPosition(signed long pos) { return false; } 52 | virtual signed long GetPosition(){ return -1; } 53 | virtual signed long GetDuration() { return -1; } 54 | 55 | void SetSampleRate(int Rate); 56 | int GetSampleRate(); 57 | bool GrabFrame(int i=0); 58 | int GetFrameSize(); 59 | bool CopyAudioFrame(float* output); 60 | int ChannelsCount(); 61 | 62 | virtual int GetPort(int i); 63 | 64 | }; 65 | 66 | } 67 | } 68 | #endif // GstNetworkAudioPlayer_h__ 69 | -------------------------------------------------------------------------------- /Plugin/sources/GstNetworkAudioStreamer.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | #ifndef GstNetworkAudioStreamer_h__ 5 | #define GstNetworkAudioStreamer_h__ 6 | 7 | #include "IGStreamerStreamer.h" 8 | 9 | namespace mray 10 | { 11 | namespace video 12 | { 13 | 14 | class GstNetworkAudioStreamerImpl; 15 | 16 | 17 | class GstNetworkAudioStreamer:public IGStreamerStreamer 18 | { 19 | protected: 20 | GstNetworkAudioStreamerImpl* m_impl; 21 | GstPipelineHandler* GetPipeline(); 22 | public: 23 | GstNetworkAudioStreamer(); 24 | virtual ~GstNetworkAudioStreamer(); 25 | 26 | // addr: target address to stream video to 27 | // audioport: port for the audio stream , audio rtcp is allocated as audioPort+1 and audioPort+2 28 | void AddClient(const std::string& addr, uint port, uint clockPort, bool rtcp); 29 | void ClearClients(); 30 | void RemoveClient(int i); 31 | int GetClientCount(); 32 | std::string GetClientAddress(int i); 33 | 34 | void SetChannels(int channels); 35 | 36 | bool CreateStream(); 37 | void Stream(); 38 | bool IsStreaming(); 39 | void Stop(); 40 | virtual void Close(); 41 | 42 | void SetVolume(int i,float v); 43 | 44 | virtual void SetPaused(bool paused) ; 45 | virtual bool IsPaused() ; 46 | }; 47 | 48 | } 49 | } 50 | 51 | #endif // GstNetworkAudioStreamer_h__ 52 | -------------------------------------------------------------------------------- /Plugin/sources/GstNetworkVideoStreamer.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | /******************************************************************** 7 | created: 2013/12/05 8 | created: 5:12:2013 20:26 9 | filename: C:\Development\mrayEngine\Plugins\mrayGStreamer\GstNetworkVideoStreamer 10 | file base: GstNetworkVideoStreamer 11 | file ext: h 12 | author: MHD Yamen Saraiji 13 | 14 | purpose: 15 | *********************************************************************/ 16 | 17 | #ifndef GstNetworkVideoStreamer_h__ 18 | #define GstNetworkVideoStreamer_h__ 19 | 20 | #include "IGStreamerStreamer.h" 21 | 22 | namespace mray 23 | { 24 | namespace video 25 | { 26 | 27 | class GstNetworkVideoStreamerImpl; 28 | class IVideoGrabber; 29 | 30 | class GstNetworkVideoStreamer :public IGStreamerStreamer 31 | { 32 | protected: 33 | GstNetworkVideoStreamerImpl* m_impl; 34 | 35 | friend class GstNetworkVideoStreamerImpl; 36 | GstPipelineHandler* GetPipeline(); 37 | public: 38 | GstNetworkVideoStreamer(); 39 | virtual ~GstNetworkVideoStreamer(); 40 | 41 | // addr: target address to stream video to 42 | // videoport: port for the video stream, video rtcp is allocated as videoPort+1/videoPort+2 43 | void BindPorts(const std::string& addr, uint videoPort,uint clockPort, bool rtcp); 44 | void SetBitRate(int bitRate, int quality); 45 | void SetResolution(int width, int height,int fps); 46 | 47 | void SetEncoderSettings(const std::string& param, const std::string& value); 48 | 49 | bool CreateStream(); 50 | void Stream(); 51 | bool IsStreaming(); 52 | void Stop(); 53 | virtual void Close(); 54 | 55 | void SetVideoGrabber(IVideoGrabber* grabber0); 56 | 57 | virtual void SetPaused(bool paused); 58 | virtual bool IsPaused(); 59 | }; 60 | 61 | } 62 | } 63 | 64 | #endif // GstNetworkVideoStreamer_h__ 65 | -------------------------------------------------------------------------------- /Plugin/sources/GstPlayerBin.cpp: -------------------------------------------------------------------------------- 1 | 2 | 3 | #include "stdafx.h" 4 | #include "GstPlayerBin.h" 5 | 6 | 7 | namespace mray 8 | { 9 | namespace video 10 | { 11 | 12 | 13 | GstPlayerBin::GstPlayerBin() 14 | { 15 | } 16 | GstPlayerBin::~GstPlayerBin() 17 | { 18 | ClearPlayers(true); 19 | } 20 | 21 | void GstPlayerBin::AddPlayer(IGStreamerPlayer* player, const std::string& name) 22 | { 23 | m_players[name] = player; 24 | } 25 | IGStreamerPlayer* GstPlayerBin::GetPlayer(const std::string& name) 26 | { 27 | PlayerMap::iterator it = m_players.find(name); 28 | if (it == m_players.end()) 29 | return 0; 30 | return it->second; 31 | } 32 | void GstPlayerBin::StartPlayer(const std::string& name) 33 | { 34 | PlayerMap::iterator it = m_players.find(name); 35 | if (it == m_players.end()) 36 | return ; 37 | it->second->Play(); 38 | } 39 | void GstPlayerBin::StopPlayer(const std::string& name) 40 | { 41 | PlayerMap::iterator it = m_players.find(name); 42 | if (it == m_players.end()) 43 | return; 44 | it->second->Stop(); 45 | } 46 | void GstPlayerBin::Play() 47 | { 48 | PlayerMap::iterator it = m_players.begin(); 49 | for (; it != m_players.end(); ++it) 50 | { 51 | it->second->Play(); 52 | } 53 | 54 | } 55 | void GstPlayerBin::Stop() 56 | { 57 | PlayerMap::iterator it = m_players.begin(); 58 | for (; it != m_players.end(); ++it) 59 | { 60 | it->second->Stop(); 61 | } 62 | 63 | } 64 | void GstPlayerBin::CloseAll() 65 | { 66 | 67 | PlayerMap::iterator it = m_players.begin(); 68 | for (; it != m_players.end(); ++it) 69 | { 70 | it->second->Close(); 71 | } 72 | } 73 | IGStreamerPlayer* GstPlayerBin::RemovePlayer(const std::string& name,bool close) 74 | { 75 | PlayerMap::iterator it = m_players.find(name); 76 | if (it == m_players.end()) 77 | return 0; 78 | IGStreamerPlayer* ret = it->second; 79 | if (close) 80 | ret->Close(); 81 | m_players.erase(it); 82 | return ret; 83 | } 84 | void GstPlayerBin::ClearPlayers(bool stop) 85 | { 86 | if (stop) 87 | { 88 | PlayerMap::iterator it = m_players.begin(); 89 | for (; it != m_players.end(); ++it) 90 | { 91 | it->second->Close(); 92 | } 93 | } 94 | m_players.clear(); 95 | } 96 | 97 | } 98 | } 99 | 100 | 101 | -------------------------------------------------------------------------------- /Plugin/sources/GstPlayerBin.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | #ifndef GstPlayerBin_h__ 4 | #define GstPlayerBin_h__ 5 | 6 | #include "IGStreamerPlayer.h" 7 | #include 8 | #include 9 | 10 | namespace mray 11 | { 12 | namespace video 13 | { 14 | 15 | class GstPlayerBin 16 | { 17 | protected: 18 | typedef std::map PlayerMap; 19 | PlayerMap m_players; 20 | public: 21 | GstPlayerBin(); 22 | virtual ~GstPlayerBin(); 23 | 24 | void AddPlayer(IGStreamerPlayer* player, const std::string& name); 25 | IGStreamerPlayer* GetPlayer(const std::string& name); 26 | 27 | void Play(); 28 | void Stop(); 29 | void CloseAll(); 30 | 31 | void StartPlayer(const std::string& name); 32 | void StopPlayer(const std::string& name); 33 | IGStreamerPlayer* RemovePlayer(const std::string& name, bool close); 34 | void ClearPlayers(bool stop); 35 | }; 36 | 37 | } 38 | } 39 | 40 | #endif // GstPlayerBin_h__ 41 | -------------------------------------------------------------------------------- /Plugin/sources/IAppSinkHandler.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "stdafx.h" 3 | #include "IAppSinkHandler.h" 4 | 5 | namespace mray 6 | { 7 | namespace video 8 | { 9 | 10 | 11 | IAppSinkHandler::IAppSinkHandler() 12 | { 13 | m_sink = 0; 14 | } 15 | IAppSinkHandler::~IAppSinkHandler() 16 | { 17 | Close(); 18 | } 19 | void IAppSinkHandler::Close() 20 | { 21 | } 22 | 23 | 24 | GstFlowReturn IAppSinkHandler::preroll_cb(std::shared_ptr sample) 25 | { 26 | GstFlowReturn ret = process_sample(sample,true); 27 | if (ret == GST_FLOW_OK){ 28 | return GST_FLOW_OK; 29 | } 30 | else{ 31 | return ret; 32 | } 33 | } 34 | GstFlowReturn IAppSinkHandler::buffer_cb(std::shared_ptr sample) 35 | { 36 | 37 | 38 | GstFlowReturn ret = process_sample(sample,false); 39 | if (ret == GST_FLOW_OK){ 40 | return GST_FLOW_OK; 41 | } 42 | else{ 43 | return ret; 44 | } 45 | } 46 | void IAppSinkHandler::eos_cb() 47 | { 48 | } 49 | 50 | 51 | GstFlowReturn IAppSinkHandler::on_new_buffer_from_source(GstAppSink * elt, void * data){ 52 | #if GST_VERSION_MAJOR==0 53 | shared_ptr buffer(gst_app_sink_pull_buffer(GST_APP_SINK(elt)), &gst_buffer_unref); 54 | #else 55 | std::shared_ptr buffer(gst_app_sink_pull_sample(GST_APP_SINK(elt)), &gst_sample_unref); 56 | #endif 57 | return ((IAppSinkHandler*)data)->buffer_cb(buffer); 58 | } 59 | 60 | GstFlowReturn IAppSinkHandler::on_new_preroll_from_source(GstAppSink * elt, void * data){ 61 | #if GST_VERSION_MAJOR==0 62 | shared_ptr buffer(gst_app_sink_pull_preroll(GST_APP_SINK(elt)), &gst_buffer_unref); 63 | #else 64 | std::shared_ptr buffer(gst_app_sink_pull_preroll(GST_APP_SINK(elt)), &gst_sample_unref); 65 | #endif 66 | return ((IAppSinkHandler*)data)->preroll_cb(buffer); 67 | } 68 | 69 | void IAppSinkHandler::on_eos_from_source(GstAppSink * elt, void * data){ 70 | ((IAppSinkHandler*)data)->eos_cb(); 71 | } 72 | 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /Plugin/sources/IAppSinkHandler.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | #ifndef __IAPPSINKHANDLER__ 4 | #define __IAPPSINKHANDLER__ 5 | 6 | #include 7 | #include 8 | 9 | #include 10 | 11 | #include "ListenerContainer.h" 12 | 13 | namespace mray { 14 | namespace video { 15 | class IAppSinkHandler; 16 | 17 | class IAppSinkHandlerListener { 18 | public: 19 | virtual void OnStreamPrepared(IAppSinkHandler*){}; 20 | virtual void OnNewSample(IAppSinkHandler*){}; 21 | }; 22 | 23 | class IAppSinkHandler : public ListenerContainer { 24 | protected: 25 | GstAppSink* m_sink; 26 | DECLARE_FIRE_METHOD(OnStreamPrepared, (IAppSinkHandler * v), (v)); 27 | DECLARE_FIRE_METHOD(OnNewSample, (IAppSinkHandler * v), (v)); 28 | 29 | public: 30 | IAppSinkHandler(); 31 | ~IAppSinkHandler(); 32 | 33 | virtual void SetSink(GstAppSink* s) { m_sink = s; } 34 | 35 | virtual void Close(); 36 | 37 | virtual GstFlowReturn process_sample(std::shared_ptr sample, 38 | bool preroll) = 0; 39 | virtual GstFlowReturn preroll_cb(std::shared_ptr buffer); 40 | virtual GstFlowReturn buffer_cb(std::shared_ptr buffer); 41 | virtual void eos_cb(); 42 | 43 | static GstFlowReturn on_new_buffer_from_source(GstAppSink* elt, void* data); 44 | static GstFlowReturn on_new_preroll_from_source(GstAppSink* elt, void* data); 45 | static void on_eos_from_source(GstAppSink* elt, void* data); 46 | }; 47 | 48 | } // namespace video 49 | } // namespace mray 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /Plugin/sources/IAudioGrabber.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | #ifndef __IAUDIOGRABBER__ 4 | #define __IAUDIOGRABBER__ 5 | 6 | #include "mTypes.h" 7 | 8 | namespace mray 9 | { 10 | namespace video 11 | { 12 | 13 | class IAudioGrabber 14 | { 15 | protected: 16 | public: 17 | IAudioGrabber(){} 18 | virtual ~IAudioGrabber(){} 19 | 20 | virtual bool Start() = 0; 21 | virtual void Pause() = 0; 22 | virtual void Resume() = 0; 23 | virtual void Close() = 0; 24 | virtual void Restart() {}; 25 | virtual bool IsStarted() = 0; 26 | 27 | virtual uint GetSamplingRate() = 0; 28 | virtual uint GetChannelsCount() = 0; 29 | 30 | virtual bool GrabFrame() = 0; 31 | virtual float* GetAudioFrame() = 0; 32 | virtual uint GetAudioFrameSize() = 0; 33 | 34 | virtual void SetVolume(float vol) = 0; 35 | 36 | }; 37 | 38 | } 39 | } 40 | 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /Plugin/sources/IGStreamerPlayer.cpp: -------------------------------------------------------------------------------- 1 | 2 | 3 | #include "stdafx.h" 4 | #include "IGStreamerPlayer.h" 5 | #include "GstPipelineHandler.h" 6 | 7 | 8 | 9 | namespace mray 10 | { 11 | namespace video 12 | { 13 | 14 | bool IGStreamerPlayer::QueryLatency(bool &isLive, ulong& minLatency, ulong& maxLatency) 15 | { 16 | return GetPipeline()->QueryLatency(isLive, minLatency, maxLatency); 17 | } 18 | 19 | 20 | void IGStreamerPlayer::SetClockBase(ulong c) 21 | { 22 | 23 | GetPipeline()->SetClockBaseTime(c); 24 | } 25 | ulong IGStreamerPlayer::GetClockBase() 26 | { 27 | return GetPipeline()->GetClockBaseTime(); 28 | } 29 | 30 | 31 | } 32 | } -------------------------------------------------------------------------------- /Plugin/sources/IGStreamerStreamer.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "stdafx.h" 3 | #include "IGStreamerStreamer.h" 4 | #include "GstPipelineHandler.h" 5 | 6 | 7 | 8 | namespace mray 9 | { 10 | namespace video 11 | { 12 | 13 | bool IGStreamerStreamer::QueryLatency(bool &isLive, ulong& minLatency, ulong& maxLatency) 14 | { 15 | GstPipelineHandler* p = GetPipeline(); 16 | return p->QueryLatency(isLive, minLatency, maxLatency); 17 | } 18 | 19 | 20 | void IGStreamerStreamer::SetClockBase(ulong c) 21 | { 22 | GstPipelineHandler* p = GetPipeline(); 23 | p->SetClockBaseTime(c); 24 | 25 | } 26 | 27 | ulong IGStreamerStreamer::GetClockBase() 28 | { 29 | GstPipelineHandler* p = GetPipeline(); 30 | return p->GetClockBaseTime(); 31 | 32 | } 33 | 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Plugin/sources/IGStreamerStreamer.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | #ifndef IGStreamerStreamer_h__ 4 | #define IGStreamerStreamer_h__ 5 | 6 | #include "IStreamListener.h" 7 | #include "ListenerContainer.h" 8 | #include "mTypes.h" 9 | #include 10 | 11 | namespace mray 12 | { 13 | namespace video 14 | { 15 | class GstPipelineHandler; 16 | class IGStreamerStreamer:public ListenerContainer 17 | { 18 | protected: 19 | 20 | DECLARE_FIRE_METHOD(OnStreamerStarted, (IGStreamerStreamer* s),(s)); 21 | DECLARE_FIRE_METHOD(OnStreamerStopped, (IGStreamerStreamer* s), (s)); 22 | DECLARE_FIRE_METHOD(OnStreamerReady, (IGStreamerStreamer* s), (s)); 23 | 24 | virtual GstPipelineHandler* GetPipeline() = 0; 25 | 26 | public: 27 | IGStreamerStreamer(){} 28 | virtual ~IGStreamerStreamer(){} 29 | 30 | virtual bool CreateStream() = 0; 31 | virtual void Stream() = 0; 32 | virtual bool IsStreaming() = 0; 33 | virtual void Stop() = 0; 34 | virtual void Close()=0; 35 | 36 | virtual void SetPaused(bool paused) = 0; 37 | virtual bool IsPaused() = 0; 38 | 39 | virtual bool QueryLatency(bool &isLive, ulong& minLatency, ulong& maxLatency); 40 | 41 | virtual void SetClockBase(ulong c) ; 42 | virtual ulong GetClockBase() ; 43 | }; 44 | 45 | } 46 | } 47 | 48 | #endif // IGStreamerStreamer_h__ 49 | -------------------------------------------------------------------------------- /Plugin/sources/IStreamListener.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef __ISTREAMLISTENER__ 3 | #define __ISTREAMLISTENER__ 4 | 5 | namespace mray 6 | { 7 | namespace video 8 | { 9 | 10 | class IGStreamerStreamer; 11 | class IGStreamerPlayer; 12 | 13 | class IGStreamerStreamerListener 14 | { 15 | public: 16 | virtual void OnStreamerReady(IGStreamerStreamer* s){} 17 | virtual void OnStreamerStarted(IGStreamerStreamer* s){} 18 | virtual void OnStreamerStopped(IGStreamerStreamer* s){} 19 | }; 20 | 21 | class IGStreamerPlayerListener 22 | { 23 | public: 24 | virtual void OnPlayerReady(IGStreamerPlayer* s){} 25 | virtual void OnPlayerStarted(IGStreamerPlayer* s){} 26 | virtual void OnPlayerStopped(IGStreamerPlayer* s){} 27 | }; 28 | 29 | 30 | } 31 | } 32 | 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /Plugin/sources/LocalAudioGrabber.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | #ifndef __LOCALAUDIOGRABBER__ 4 | #define __LOCALAUDIOGRABBER__ 5 | 6 | #include "CustomAudioGrabber.h" 7 | 8 | namespace mray 9 | { 10 | namespace video 11 | { 12 | class LocalAudioGrabber:public CustomAudioGrabber 13 | { 14 | protected: 15 | std::string deviceGUID; 16 | public: 17 | LocalAudioGrabber(); 18 | virtual ~LocalAudioGrabber(); 19 | 20 | void Init(const std::string &deviceGUID, int channels, int samplingrate); 21 | 22 | static int GetInputInterfacesCount(); 23 | static const char* GetInputInterfaceName(int i); 24 | static const char* GetInputInterfaceGUID(int i); 25 | 26 | 27 | static int GetOutputInterfacesCount(); 28 | static const char* GetOutputInterfaceName(int i); 29 | static const char* GetOutputInterfaceGUID(int i); 30 | }; 31 | 32 | } 33 | } 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /Plugin/sources/NetworkAudioGrabber.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | #ifndef __NetworkAudioGrabber__ 4 | #define __NetworkAudioGrabber__ 5 | 6 | #include "CustomAudioGrabber.h" 7 | 8 | namespace mray 9 | { 10 | namespace video 11 | { 12 | 13 | class NetworkAudioGrabberData; 14 | class NetworkAudioGrabber:public CustomAudioGrabber 15 | { 16 | protected: 17 | NetworkAudioGrabberData* m_data; 18 | public: 19 | NetworkAudioGrabber(); 20 | virtual ~NetworkAudioGrabber(); 21 | 22 | void Init( uint audioPort, int channels, int samplingrate); 23 | 24 | void SetPort( uint audioPort); 25 | 26 | uint GetAudioPort(); 27 | }; 28 | 29 | } 30 | } 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /Plugin/sources/PlayersAPI.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | #pragma once 5 | 6 | #include "Unity/IUnityInterface.h" 7 | #include "GstNetworkVideoPlayer.h" 8 | #include "GstCustomVideoPlayer.h" 9 | #include "GstNetworkMultipleVideoPlayer.h" 10 | #include "GstNetworkAudioPlayer.h" 11 | 12 | 13 | using namespace mray; 14 | using namespace video; 15 | 16 | extern "C" UNITY_INTERFACE_EXPORT void mray_gst_playerBlitImage(IGStreamerPlayer* p, void* _TextureNativePtr, int _UnityTextureWidth, int _UnityTextureHeight, int index); 17 | extern "C" UNITY_INTERFACE_EXPORT UnityRenderNative mray_gst_customPlayerBlitImageNativeGLCall(GstCustomVideoPlayer* p, void* _TextureNativePtr, int _UnityTextureWidth, int _UnityTextureHeight); 18 | extern "C" UNITY_INTERFACE_EXPORT void mray_gst_customPlayerBlitImage(GstCustomVideoPlayer* p, void* _TextureNativePtr, int _UnityTextureWidth, int _UnityTextureHeight); 19 | 20 | -------------------------------------------------------------------------------- /Plugin/sources/StreamersAPI.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | #pragma once 5 | 6 | #include "Unity/IUnityInterface.h" 7 | #ifdef USE_UNITY_GRABBER 8 | #include "UnityImageGrabber.h" 9 | #endif 10 | #include "GstCustomVideoStreamer.h" 11 | #include "GstNetworkAudioStreamer.h" 12 | 13 | 14 | 15 | using namespace mray; 16 | using namespace video; 17 | -------------------------------------------------------------------------------- /Plugin/sources/UnityAudioGrabber.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | #ifndef __UnityAudioGrabber__ 4 | #define __UnityAudioGrabber__ 5 | 6 | #include "CustomAudioGrabber.h" 7 | #include "IMutex.h" 8 | #include 9 | 10 | namespace mray 11 | { 12 | namespace video 13 | { 14 | 15 | class UnityAudioGrabber :public IAudioGrabber 16 | { 17 | protected: 18 | int _channels; 19 | int _samplingRate; 20 | int _bufferLength; 21 | bool _started; 22 | OS::IMutex* m_mutex; 23 | std::list _samples; 24 | std::list _graveyard; 25 | public: 26 | UnityAudioGrabber(); 27 | virtual ~UnityAudioGrabber(); 28 | 29 | void Init(int bufferLength, int channels, int samplingrate); 30 | 31 | void AddFrame(float* data); 32 | 33 | virtual bool Start(); 34 | virtual void Pause(); 35 | virtual void Close(); 36 | virtual void Resume(){}; 37 | virtual void Restart(){}; 38 | virtual bool IsStarted(); 39 | 40 | virtual uint GetSamplingRate(); 41 | virtual uint GetChannelsCount(); 42 | 43 | 44 | virtual bool GrabFrame(); 45 | virtual float* GetAudioFrame(); 46 | virtual uint GetAudioFrameSize(); 47 | 48 | virtual void SetVolume(float vol); 49 | }; 50 | 51 | } 52 | } 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /Plugin/sources/UnityHelpers.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | #ifndef __UNITYHELPERS__ 4 | #define __UNITYHELPERS__ 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include "mTypes.h" 11 | #include "Unity/IUnityInterface.h" 12 | 13 | #ifdef __ANDROID__ 14 | #define __stdcall 15 | #endif 16 | 17 | #ifdef __linux__ 18 | #define __stdcall 19 | #endif 20 | 21 | namespace mray 22 | { 23 | namespace video 24 | { 25 | class ImageInfo; 26 | } 27 | } 28 | 29 | enum ELogLevel{ 30 | ELL_INFO, 31 | ELL_SUCCESS, 32 | ELL_WARNING, 33 | ELL_ERROR 34 | }; 35 | 36 | extern void LogMessage(const std::string& msg, ELogLevel level); 37 | extern float GetEngineTime(); 38 | extern void BlitImage(const mray::video::ImageInfo* ifo, void* _TextureNativePtr, int _UnityTextureWidth, int _UnityTextureHeight); 39 | 40 | typedef void(__stdcall * UnityRenderNative)(int eventID); 41 | 42 | typedef void(*FuncPtr)(const char*); 43 | typedef float(*FuncFloatRetPtr)(); 44 | 45 | 46 | extern "C" class UNITY_INTERFACE_EXPORT LogManager 47 | { 48 | static LogManager* s_instance;; 49 | std::mutex m_mutex; 50 | FILE* m_logFile; 51 | std::string logFilePath; 52 | 53 | std::string DetermineLogFilePath(const std::string& fileName); 54 | 55 | public: 56 | LogManager(); 57 | ~LogManager(); 58 | void LogMessage(const std::string& msg); 59 | 60 | static LogManager* Instance(); 61 | }; 62 | 63 | struct Vector2d 64 | { 65 | int x, y; 66 | Vector2d() :x(0), y(0){} 67 | Vector2d(int a,int b) :x(a), y(b){} 68 | 69 | bool operator ==(const Vector2d& o) 70 | { 71 | return x == o.x && y == o.y; 72 | } 73 | bool operator !=(const Vector2d& o) 74 | { 75 | return x != o.x || y != o.y; 76 | } 77 | }; 78 | 79 | template 80 | static void Swap(T &a, T &b) 81 | { 82 | T tmp = a; 83 | a = b; 84 | b = tmp; 85 | } 86 | 87 | #endif 88 | -------------------------------------------------------------------------------- /Plugin/sources/UnityImageGrabber.cpp: -------------------------------------------------------------------------------- 1 | 2 | 3 | #include "stdafx.h" 4 | #include "UnityImageGrabber.h" 5 | #include "IThreadManager.h" 6 | 7 | 8 | 9 | namespace mray 10 | { 11 | namespace video 12 | { 13 | 14 | 15 | UnityImageGrabber::UnityImageGrabber() 16 | { 17 | m_hasNewFrame = false; 18 | m_bufferID = 0; 19 | m_mutex=OS::IThreadManager::getInstance().createMutex(); 20 | } 21 | 22 | UnityImageGrabber::~UnityImageGrabber() 23 | { 24 | delete m_mutex; 25 | } 26 | 27 | 28 | void UnityImageGrabber::SetFrameSize(int w, int h) 29 | { 30 | } 31 | 32 | const Vector2d& UnityImageGrabber::GetFrameSize() 33 | { 34 | return m_imageInfo.Size; 35 | } 36 | 37 | 38 | void UnityImageGrabber::SetImageFormat(video::EPixelFormat fmt) 39 | { 40 | } 41 | 42 | video::EPixelFormat UnityImageGrabber::GetImageFormat() 43 | { 44 | return m_imageInfo.format; 45 | } 46 | 47 | 48 | bool UnityImageGrabber::GrabFrame() 49 | { 50 | if (HasNewFrame()) 51 | { 52 | Lock(); 53 | uchar* ptr = m_imageInfo.imageData; 54 | m_imageInfo.imageData = m_backBuffer.imageData; 55 | m_backBuffer.imageData = ptr; 56 | ++m_bufferID; 57 | m_hasNewFrame = false; 58 | Unlock(); 59 | return true; 60 | } 61 | return false; 62 | } 63 | 64 | bool UnityImageGrabber::HasNewFrame() 65 | { 66 | return m_hasNewFrame; 67 | } 68 | 69 | ulong UnityImageGrabber::GetBufferID() 70 | { 71 | return m_bufferID; 72 | } 73 | 74 | 75 | const ImageInfo* UnityImageGrabber::GetLastFrame() 76 | { 77 | return &m_imageInfo; 78 | } 79 | 80 | 81 | void UnityImageGrabber::SetData(void* ptr, int w, int h,int FORMAT) 82 | { 83 | Lock(); 84 | 85 | m_backBuffer.setData(ptr, Vector2d(w, h), (video::EPixelFormat)FORMAT); 86 | m_imageInfo.createData(Vector2d(w, h), (video::EPixelFormat)FORMAT); 87 | m_hasNewFrame = true; 88 | Unlock(); 89 | } 90 | 91 | void UnityImageGrabber::SetImageInfo(ImageInfo* ifo) 92 | { 93 | SetData(ifo->imageData, ifo->Size.x, ifo->Size.y, ifo->format); 94 | } 95 | 96 | 97 | } 98 | } 99 | 100 | -------------------------------------------------------------------------------- /Plugin/sources/UnityImageGrabber.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | #ifndef __UNITYIMAGEGRABBER__ 4 | #define __UNITYIMAGEGRABBER__ 5 | 6 | #include "IVideoGrabber.h" 7 | #include "IMutex.h" 8 | 9 | namespace mray 10 | { 11 | namespace video 12 | { 13 | 14 | class UnityImageGrabber:public video::IVideoGrabber 15 | { 16 | protected: 17 | OS::IMutex* m_mutex; 18 | ImageInfo m_backBuffer; 19 | ImageInfo m_imageInfo; 20 | bool m_hasNewFrame; 21 | ulong m_bufferID; 22 | public: 23 | UnityImageGrabber(); 24 | virtual ~UnityImageGrabber(); 25 | 26 | virtual void SetFrameSize(int w, int h) ; 27 | virtual const Vector2d& GetFrameSize() ; 28 | 29 | virtual void SetImageFormat(video::EPixelFormat fmt) ; 30 | virtual video::EPixelFormat GetImageFormat() ; 31 | 32 | virtual bool GrabFrame() ; 33 | virtual bool HasNewFrame() ; 34 | virtual ulong GetBufferID() ;// incremented once per frame 35 | 36 | 37 | virtual const ImageInfo* GetLastFrame(); 38 | 39 | void SetData(void* ptr, int w, int h, int FORMAT); 40 | void SetImageInfo(ImageInfo* ifo); 41 | 42 | virtual void Lock(){ m_mutex->lock(); } 43 | virtual void Unlock(){ m_mutex->unlock(); } 44 | }; 45 | 46 | } 47 | } 48 | 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /Plugin/sources/rtp.h: -------------------------------------------------------------------------------- 1 | #ifndef __RTP__ 2 | #define __RTP__ 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | extern "C" uint32_t rtp_timestamp(void *src); 9 | extern "C" unsigned short rtp_padding_payload(unsigned char *src, int len, unsigned char *data); 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /Plugin/sources/stdafx.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mrayy/mrayGStreamerUnity/bb81bc3ed54d0a2a13e6b744db738ebbf56180b4/Plugin/sources/stdafx.h -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # mrayGStreamerUnity 2 | GStreamer Integration with Unity using a Native plugin 3 | 4 | Updated 11/June/2022: 5 | 6 | Major update to this version includes: 7 | 8 | - Use CMake to generate project for cross-platform building 9 | - Support for GStreamer 1.20.1 10 | - Tested against latest Unity3D 2021.3.4f1 11 | 12 | Currently only built for windows, but building for macOS should be straight forward. I will try to update the repo once I have some time to compile for MacOS 13 | 14 | All scenes were tested and working fine! 15 | 16 | --------------------------------------- 17 | 18 | Updated 29/April/2020: 19 | 20 | The current plugin uses GStreamer 1.16.2: 21 | 22 | https://gstreamer.freedesktop.org/data/pkg/windows/1.16.2/ 23 | 24 | If you had run time issues of missing libraries, make sure to install 1.16.2, and add the bin folder to the PATH environment. 25 | 26 | Updated 11/April/2017: 27 | 28 | Currently designed to run under Unity 64bit version - Windows 29 | The current integration implements a GStreamer H264 UDP receiver texture inside Unity. 30 | 31 | To compile the plugin: 32 | 33 | 1- Download and install (Complete, preferebly to C:\) gstreamer 1.0 runtimes 64bit (tested on 1.11.x - x86_64) 34 | 35 | http://gstreamer.freedesktop.org/data/pkg/windows/ 36 | 37 | 2- Install Visual studio runtimes x64 version: 38 | > VS 2010: 39 | https://www.microsoft.com/en-US/Download/confirmation.aspx?id=14632 40 | > VS 2013: 41 | https://www.microsoft.com/en-us/download/details.aspx?id=40784 42 | 43 | 44 | 3- [Important] Add gstreamer binary folder path to System Environment Variables: 45 | 46 | Computer -> System properties -> Advanced System Settings -> Advanced Tab -> Environment Variables... -> System Variables -> Variable: Path -> Edit -> New -> C:\gstreamer\1.0\x86_64\bin 47 | 48 | New Variable: GST_SDK_PATH= C:\gstreamer\1.0\x86_64\ 49 | 50 | GStreamer path should be similar to this (depending on installation directory): 51 | C:\gstreamer\1.0\x86_64\bin 52 | 53 | 4- [Optional] Compile using Visual studio 2013 and put the result dll into Plugins/x86_64 Unity folder (or use the already compiled dll in the Plugins/x86_64 folder) 54 | 55 | 5- Open test scenes and check the info text 56 | -------------------------------------------------------------------------------- /StreamTest.txt: -------------------------------------------------------------------------------- 1 | gst-launch-1.0 videomixer name=mix sink_0::xpos=0 sink_0::ypos=0 sink_0::alpha=1 sink_0::zorder=0 sink_1::xpos=0 sink_1::ypos=0 sink_1::zorder=1 sink_2::xpos=640 sink_2::ypos=0 sink_2::zorder=1 videotestsrc pattern=\"black\" ! video/x-raw,format=I420,width=1280,height=720 ! mix.sink_0 ksvideosrc device-index=0 ! video/x-raw,format=I420,width=1280,height=720,framerate=30/1 ! videoconvert ! videoflip method=4 ! videoscale ! video/x-raw,format=I420,width=640,height=720 ! mix.sink_1 ksvideosrc device-index=1 ! video/x-raw,format=I420,width=1280,height=720,framerate=30/1 ! videoconvert ! videoflip method=4 ! videoscale ! video/x-raw,format=I420,width=640,height=720 ! mix.sink_2 mix. ! x264enc name=videoEncbitrate=2000 tune=zerolatency pass=qual ! rtph264pay ! udpsink host=127.0.0.1 port=7000 sync=false -v -------------------------------------------------------------------------------- /Unity/UnityTests/.gitignore: -------------------------------------------------------------------------------- 1 | /[Ll]ibrary/ 2 | /[Tt]emp/ 3 | /[Oo]bj/ 4 | /[Bb]uild/ 5 | 6 | # Autogenerated VS/MD solution and project files 7 | *.csproj 8 | *.unityproj 9 | *.sln 10 | *.suo 11 | *.tmp 12 | *.user 13 | *.userprefs 14 | *.pidb 15 | *.booproj 16 | 17 | # Unity3D generated meta files 18 | *.pidb.meta 19 | 20 | # Unity3D Generated File On Crash Reports 21 | sysinfo.txt -------------------------------------------------------------------------------- /Unity/UnityTests/.vs/UnityTests/xs/UserPrefs.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /Unity/UnityTests/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "files.exclude": 3 | { 4 | "**/.DS_Store":true, 5 | "**/.git":true, 6 | "**/.gitignore":true, 7 | "**/.gitmodules":true, 8 | "**/*.booproj":true, 9 | "**/*.pidb":true, 10 | "**/*.suo":true, 11 | "**/*.user":true, 12 | "**/*.userprefs":true, 13 | "**/*.unityproj":true, 14 | "**/*.dll":true, 15 | "**/*.exe":true, 16 | "**/*.pdf":true, 17 | "**/*.mid":true, 18 | "**/*.midi":true, 19 | "**/*.wav":true, 20 | "**/*.gif":true, 21 | "**/*.ico":true, 22 | "**/*.jpg":true, 23 | "**/*.jpeg":true, 24 | "**/*.png":true, 25 | "**/*.psd":true, 26 | "**/*.tga":true, 27 | "**/*.tif":true, 28 | "**/*.tiff":true, 29 | "**/*.3ds":true, 30 | "**/*.3DS":true, 31 | "**/*.fbx":true, 32 | "**/*.FBX":true, 33 | "**/*.lxo":true, 34 | "**/*.LXO":true, 35 | "**/*.ma":true, 36 | "**/*.MA":true, 37 | "**/*.obj":true, 38 | "**/*.OBJ":true, 39 | "**/*.asset":true, 40 | "**/*.cubemap":true, 41 | "**/*.flare":true, 42 | "**/*.mat":true, 43 | "**/*.meta":true, 44 | "**/*.prefab":true, 45 | "**/*.unity":true, 46 | "build/":true, 47 | "Build/":true, 48 | "Library/":true, 49 | "library/":true, 50 | "obj/":true, 51 | "Obj/":true, 52 | "ProjectSettings/":true, 53 | "temp/":true, 54 | "Temp/":true 55 | } 56 | } -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/.videos/big_buck_bunny.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mrayy/mrayGStreamerUnity/bb81bc3ed54d0a2a13e6b744db738ebbf56180b4/Unity/UnityTests/Assets/.videos/big_buck_bunny.mp4 -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/.videos/small.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mrayy/mrayGStreamerUnity/bb81bc3ed54d0a2a13e6b744db738ebbf56180b4/Unity/UnityTests/Assets/.videos/small.mp4 -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/GStreamerUnity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cd87db51b88c98243bf270b0aac455d7 3 | folderAsset: yes 4 | timeCreated: 1430453495 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/GStreamerUnity/Components.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 60968bbbdb7ff074ba6495b1539a69a7 3 | folderAsset: yes 4 | timeCreated: 1491883172 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/GStreamerUnity/Components/BaseVideoPlayer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3d5cdce84e8e2469baa926887be41a72 3 | timeCreated: 1483682721 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/GStreamerUnity/Components/CameraCapture.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e0d930d23b638be408c68c5c768d4b72 3 | timeCreated: 1491904831 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/GStreamerUnity/Components/CustomPipelinePlayer.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using System; 4 | using UnityEngine.UI; 5 | 6 | [RequireComponent(typeof(GstCustomTexture))] 7 | public class CustomPipelinePlayer : BaseVideoPlayer { 8 | 9 | public string pipeline = ""; 10 | 11 | // Use this for initialization 12 | protected override string _GetPipeline() 13 | { 14 | string P = pipeline + " ! video/x-raw,format=I420 ! videoconvert ! appsink name=videoSink"; 15 | 16 | return P; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/GStreamerUnity/Components/CustomPipelinePlayer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ab2ae4c1116ce2446993760ea0c4f6f6 3 | timeCreated: 1430486089 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/GStreamerUnity/Components/CustomSBSPipelinePlayer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e8e7c08c98ab9ba40be9822ef9c8f341 3 | timeCreated: 1497857460 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/GStreamerUnity/Components/CustomVideoStreamer.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using System.Threading; 5 | 6 | public class CustomVideoStreamer : MonoBehaviour,IDependencyNode { 7 | 8 | public CameraCapture camCap; 9 | public string Pipeline; 10 | 11 | public int fps=30; 12 | 13 | public bool _created=false; 14 | 15 | GstCustomVideoStreamer _streamer; 16 | public void OnDependencyStart(DependencyRoot root) 17 | { 18 | Debug.Log ("node start"); 19 | _streamer.SetGrabber (camCap._grabber); 20 | _streamer.SetPipelineString (Pipeline); 21 | _streamer.SetResolution(camCap.Width,camCap.Height,fps); 22 | } 23 | public void OnDependencyDestroyed(DependencyRoot root) 24 | { 25 | Debug.Log ("node destroyed"); 26 | Destroy (); 27 | } 28 | 29 | void Destroy() 30 | { 31 | _streamer.SetGrabber (null); 32 | _streamer.Pause (); 33 | Thread.Sleep (100); 34 | _streamer.Stop (); 35 | _streamer.Close (); 36 | return; 37 | //_streamer.SetGrabber (null); 38 | _streamer.Destroy (); 39 | _streamer = null; 40 | } 41 | 42 | // Use this for initialization 43 | void Start () { 44 | 45 | Debug.Log ("start"); 46 | 47 | _streamer = new GstCustomVideoStreamer (); 48 | 49 | camCap.AddDependencyNode (this); 50 | } 51 | 52 | void OnDestroy() 53 | { 54 | Destroy (); 55 | } 56 | // Update is called once per frame 57 | void Update () { 58 | 59 | if (!_created && camCap._grabber!=null && camCap.HasData) { 60 | 61 | //important to create stream after data is confirmed 62 | _streamer.CreateStream (); 63 | _streamer.Stream (); 64 | _created = true; 65 | } 66 | 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/GStreamerUnity/Components/CustomVideoStreamer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5b207f1a492712749b56a7ce23891423 3 | timeCreated: 1491905164 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/GStreamerUnity/Components/FileVideoPlayer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 97a29d11a9547435ea181ce42bfbe2f1 3 | timeCreated: 1481916261 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/GStreamerUnity/Components/LocalCameraVideoPlayer.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | [RequireComponent(typeof(GstCustomTexture))] 6 | public class LocalCameraVideoPlayer : BaseVideoPlayer { 7 | 8 | public bool AudioSupport = false; 9 | public int CameraIndex=0; 10 | 11 | // Use this for initialization 12 | protected override string _GetPipeline () 13 | { 14 | // pipeline = "filesrc location=\""+VideoPath+"\" ! decodebin ! videoconvert ! video/x-raw,format=I420 ! appsink name=videoSink sync=true"; 15 | // pipeline = "filesrc location=~/Documents/Projects/BeyondAR/Equirectangular_projection_SW.jpg ! jpegdec ! videoconvert ! imagefreeze ! videoconvert ! imagefreeze ! videoconvert ! video/x-raw,format=I420 ! appsink name=videoSink sync=true"; 16 | string pipeline = "avfvideosrc device-index="+CameraIndex.ToString()+" ! videoconvert ! video/x-raw,format=I420 ! videoflip method=5 ! appsink name=videoSink sync=true"; 17 | 18 | 19 | pipeline = "autovideosrc ! videoconvert ! video/x-raw,format=I420 ! videoflip method=5 ! appsink name=videoSink sync=true"; 20 | 21 | return pipeline; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/GStreamerUnity/Components/LocalCameraVideoPlayer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 968bd47bb5b614beb83eae5859223cb5 3 | timeCreated: 1481916261 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/GStreamerUnity/Components/NetworkVideoPlayer.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | [RequireComponent(typeof(GstCustomTexture))] 6 | public class NetworkVideoPlayer : BaseVideoPlayer { 7 | 8 | /* To test video streaming, use this from command line: 9 | ./gst-launch-1.0 autovideosrc ! videoconvert ! \ 10 | x264enc speed-preset=superfast tune=zerolatency pass=qual ! rtph264pay ! udpsink host=127.0.0.1 port=5050 sync=false 11 | 12 | //Stream from mp4 file 13 | ./gst-launch-1.0 filesrc location=VideoFile.mp4 ! qtdemux ! queue \ 14 | ! h264parse ! rtph264pay config-interval=10 ! udpsink port=5050 host=127.0.0.1 sync=true -v 15 | 16 | // for Mac OS, the following element can allow to select camera source 17 | ./gst-launch-1.0 avfvideosrc device-index=1 ! videoconvert ! \ 18 | x264enc speed-preset=superfast tune=zerolatency pass=qual ! rtph264pay ! udpsink host=127.0.0.1 port=5050 sync=false 19 | */ 20 | 21 | 22 | public int Port=5050; 23 | 24 | public bool Audio=true; 25 | 26 | 27 | protected override string _GetPipeline () 28 | { 29 | string pipeline="udpsrc port=" + Port.ToString () + " ! application/x-rtp ! rtpjitterbuffer ! queue ! rtph264depay ! h264parse ! avdec_h264 " + 30 | "! videoconvert ! video/x-raw,format=I420 ! videoflip method=5 ! appsink name=videoSink sync=false "; 31 | if (Audio) 32 | pipeline += "udpsrc port=5052 ! application/x-rtp,media=audio,clock-rate=48000,encoding-name=OPUS,payload=96,encoding-params=2 ! rtpopusdepay ! opusdec ! audioconvert ! autoaudiosink sync=false -v"; 33 | //" autoaudiosrc ! audioconvert ! audioresample ! opusenc complexity=5 bitrate-type=vbr frame-size=5 ! rtpopuspay ! udpsink host=172.28.18.87 port=5052 sync=false" 34 | 35 | return pipeline; 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/GStreamerUnity/Components/NetworkVideoPlayer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ac031c903679849938a5e8eb6822a734 3 | timeCreated: 1481916261 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/GStreamerUnity/Resources.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5ff0457f949bc804a9beafbf1c77053f 3 | folderAsset: yes 4 | timeCreated: 1491886542 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/GStreamerUnity/Resources/I420ToRGB.shader: -------------------------------------------------------------------------------- 1 | Shader "Image/I420ToRGB" { 2 | Properties { 3 | _MainTex ("Base (RGB)", 2D) = "white" {} 4 | } 5 | SubShader { 6 | Pass{ 7 | ZTest Always Cull Off ZWrite Off 8 | Fog { Mode off } 9 | 10 | CGPROGRAM 11 | #pragma vertex vert_img 12 | #pragma fragment frag 13 | 14 | #include "UnityCG.cginc" 15 | 16 | sampler2D _MainTex; 17 | 18 | 19 | // YUV offset (reciprocals of 255 based offsets above) 20 | // half3 offset = half3(-0.0625, -0.5, -0.5); 21 | // RGB coefficients 22 | // half3 rCoeff = half3(1.164, 0.000, 1.596); 23 | // half3 gCoeff = half3(1.164, -0.391, -0.813); 24 | // half3 bCoeff = half3(1.164, 2.018, 0.000); 25 | 26 | 27 | float4 frag(v2f_img IN) :COLOR { 28 | half3 yuv, rgb; 29 | 30 | float2 texcoord= IN.uv.xy; 31 | texcoord.y=1-texcoord.y; 32 | //texcoord.x=1-texcoord.x; 33 | texcoord.y=texcoord.y*2.0f/3.0f; 34 | 35 | 36 | //return float4(texcoord.x,texcoord.y,0,1); 37 | 38 | half2 texSize=half2(1,1/1.5); 39 | 40 | // lookup Y 41 | yuv.r = tex2D(_MainTex, texcoord).a; 42 | //return float4(yuv.r,yuv.r,yuv.r,1); 43 | 44 | // lookup U 45 | // co-ordinate conversion algorithm for i420: 46 | // x /= 2.0; if modulo2(y) then x += width/2.0; 47 | texcoord.x /= 2.0; 48 | if((texcoord.y - floor(texcoord.y)) == 0.0) 49 | { 50 | texcoord.x += (texSize.x/2.0); 51 | } 52 | texcoord.y = texSize.y+(texcoord.y/4.0); 53 | yuv.g = tex2D(_MainTex, texcoord.xy).a; 54 | // lookup V 55 | texcoord.y += texSize.y/4.0; 56 | yuv.b = tex2D(_MainTex, texcoord.xy).a; 57 | 58 | // Convert 59 | yuv += half3(-0.0625, -0.5, -0.5); 60 | rgb.r = dot(yuv, half3(1.164, 0.000, 1.596));//rCoeff); 61 | rgb.g = dot(yuv, half3(1.164, -0.391, -0.813));//gCoeff); 62 | rgb.b = dot(yuv, half3(1.164, 2.018, 0.000));//bCoeff); 63 | 64 | 65 | return float4(rgb,1); 66 | 67 | } 68 | 69 | ENDCG 70 | } 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/GStreamerUnity/Resources/I420ToRGB.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2a071c0ac14b5fb44b3c14b338aac361 3 | timeCreated: 1491886546 4 | licenseType: Free 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/GStreamerUnity/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3e6a019ccfc769248bdd894ec1dc0753 3 | folderAsset: yes 4 | timeCreated: 1430394555 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/GStreamerUnity/Scripts/Dependency.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | 5 | 6 | public class DependencyRoot:MonoBehaviour 7 | { 8 | bool _isStarted=false; 9 | bool _isDestroyed=false; 10 | List _nodes=new List(); 11 | protected void _OnStarted() 12 | { 13 | _isStarted=true; 14 | 15 | foreach (IDependencyNode n in _nodes) { 16 | n.OnDependencyStart(this); 17 | } 18 | } 19 | protected void _OnDestroyed() 20 | { 21 | _isDestroyed=true; 22 | 23 | foreach (IDependencyNode n in _nodes) { 24 | n.OnDependencyDestroyed(this); 25 | } 26 | } 27 | public void AddDependencyNode(IDependencyNode node) 28 | { 29 | _nodes.Add (node); 30 | if (_isStarted) 31 | node.OnDependencyStart (this); 32 | if (_isDestroyed) 33 | node.OnDependencyDestroyed (this); 34 | } 35 | 36 | protected virtual void Start() 37 | { 38 | _OnStarted (); 39 | } 40 | protected virtual void OnDestroy() 41 | { 42 | _OnDestroyed (); 43 | } 44 | } 45 | 46 | public interface IDependencyNode { 47 | 48 | void OnDependencyStart(DependencyRoot root); 49 | void OnDependencyDestroyed(DependencyRoot root); 50 | } 51 | -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/GStreamerUnity/Scripts/Dependency.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 46a260e10d34f454588c3dbaf8c78b51 3 | timeCreated: 1491883248 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/GStreamerUnity/Scripts/FrameCounterHelper.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using System; 4 | 5 | public class FrameCounterHelper { 6 | 7 | int m_frameCounter = 0; 8 | float m_lastFramerate = 0; 9 | public float UpdateTime = 1; 10 | float dt=0; 11 | long _lastTime=0; 12 | 13 | public float FPS 14 | { 15 | get{ 16 | return m_lastFramerate; 17 | } 18 | } 19 | public FrameCounterHelper() 20 | { 21 | _lastTime = DateTime.Now.Ticks; 22 | } 23 | 24 | public void AddFrame() 25 | { 26 | m_frameCounter++; 27 | long t = DateTime.Now.Ticks; 28 | dt = (t - _lastTime)/10000000.0f; 29 | if( dt>UpdateTime ) 30 | { 31 | m_lastFramerate = (m_frameCounter); 32 | m_frameCounter = 0; 33 | _lastTime = t; 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/GStreamerUnity/Scripts/FrameCounterHelper.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 45a07e99ebbead247bdb13bb37212032 3 | timeCreated: 1491883318 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/GStreamerUnity/Scripts/GStreamerCore.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1777c5008498f9640b02357e91488a4c 3 | timeCreated: 1430394586 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/GStreamerUnity/Scripts/GstBaseTexture.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f6397e299e49f47f08dbbf3f0480af86 3 | timeCreated: 1481879658 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/GStreamerUnity/Scripts/GstCustomPlayer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f224e8e4a76382b4cb97b70179a559f7 3 | timeCreated: 1430485793 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/GStreamerUnity/Scripts/GstCustomTexture.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 12f47a03a48502248b37b02fa56fb056 3 | timeCreated: 1430485947 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/GStreamerUnity/Scripts/GstCustomVideoStreamer.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using System.Runtime.InteropServices; 4 | 5 | public class GstCustomVideoStreamer:IGstStreamer { 6 | 7 | 8 | [DllImport(DllName, CallingConvention = CallingConvention.Cdecl)] 9 | extern static private System.IntPtr mray_gst_createCustomImageStreamer(); 10 | 11 | [DllImport(DllName, CallingConvention = CallingConvention.Cdecl)] 12 | extern static private void mray_gst_customImageStreamerSetPipeline(System.IntPtr p, [MarshalAs(UnmanagedType.LPStr)]string ip); 13 | 14 | [DllImport(DllName, CallingConvention = CallingConvention.Cdecl)] 15 | extern static private int mray_gst_customImageStreamerSetGrabber(System.IntPtr p,System.IntPtr g); 16 | 17 | [DllImport(DllName, CallingConvention = CallingConvention.Cdecl)] 18 | extern static private int mray_gst_customImageStreamerSetResolution(System.IntPtr p,int width, int height, int fps); 19 | 20 | GstUnityImageGrabber _grabber; 21 | 22 | public GstCustomVideoStreamer() 23 | { 24 | GStreamerCore.Ref(); 25 | m_Instance = mray_gst_createCustomImageStreamer(); 26 | } 27 | 28 | 29 | public void SetPipelineString(string pipeline) 30 | { 31 | mray_gst_customImageStreamerSetPipeline (m_Instance, pipeline); 32 | } 33 | 34 | public void SetGrabber(GstUnityImageGrabber grabber) 35 | { 36 | _grabber = grabber; 37 | if(grabber!=null) 38 | mray_gst_customImageStreamerSetGrabber (m_Instance, grabber.Instance); 39 | else 40 | mray_gst_customImageStreamerSetGrabber (m_Instance, System.IntPtr.Zero); 41 | } 42 | 43 | public void SetResolution(int w,int h,int fps) 44 | { 45 | mray_gst_customImageStreamerSetResolution (m_Instance, w,h,fps); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/GStreamerUnity/Scripts/GstCustomVideoStreamer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8862685b7e1b3064a98bc05dffbfc623 3 | timeCreated: 1491904904 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/GStreamerUnity/Scripts/GstImageInfo.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3df3b7bcdb93e4041b62ab9de1458fcd 3 | timeCreated: 1486016069 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/GStreamerUnity/Scripts/GstMultipleNetworkVideoPlayer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 828185ce08aa4d24a9a8c0b084c525ae 3 | timeCreated: 1486015822 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/GStreamerUnity/Scripts/GstNetworkAudioPlayer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 02254c9a4ab23a54bacb1fa49935f561 3 | timeCreated: 1486015822 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/GStreamerUnity/Scripts/GstNetworkAudioStreamer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 222198817ca337b479ad67756afd7d41 3 | timeCreated: 1486015822 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/GStreamerUnity/Scripts/GstNetworkImageStreamer.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using System.Runtime.InteropServices; 4 | 5 | public class GstNetworkImageStreamer:IGstStreamer { 6 | 7 | 8 | [DllImport(DllName, CallingConvention = CallingConvention.Cdecl)] 9 | extern static private System.IntPtr mray_gst_createNetworkStreamer(); 10 | 11 | [DllImport(DllName, CallingConvention = CallingConvention.Cdecl)] 12 | extern static private void mray_gst_netStreamerSetIP(System.IntPtr p, [MarshalAs(UnmanagedType.LPStr)]string ip, int videoPort, bool rtcp); 13 | 14 | [DllImport(DllName, CallingConvention = CallingConvention.Cdecl)] 15 | extern static private int mray_gst_netStreamerSetGrabber(System.IntPtr p,System.IntPtr g); 16 | 17 | [DllImport(DllName, CallingConvention = CallingConvention.Cdecl)] 18 | extern static private int mray_gst_netStreamerSetBitRate(System.IntPtr p,int bitRate); 19 | 20 | [DllImport(DllName, CallingConvention = CallingConvention.Cdecl)] 21 | extern static private int mray_gst_netStreamerSetResolution(System.IntPtr p,int width, int height, int fps); 22 | 23 | GstUnityImageGrabber _grabber; 24 | 25 | public GstNetworkImageStreamer() 26 | { 27 | m_Instance = mray_gst_createNetworkStreamer(); 28 | } 29 | 30 | 31 | public void SetIP(string ip,int videoPort,bool rtcp) 32 | { 33 | mray_gst_netStreamerSetIP (m_Instance, ip, videoPort, rtcp); 34 | } 35 | 36 | public void SetGrabber(GstUnityImageGrabber grabber) 37 | { 38 | _grabber = grabber; 39 | mray_gst_netStreamerSetGrabber (m_Instance, grabber.Instance); 40 | } 41 | 42 | public void SetBitRate(int bitrate) 43 | { 44 | mray_gst_netStreamerSetBitRate (m_Instance, bitrate); 45 | } 46 | public void SetResolution(int w,int h,int fps) 47 | { 48 | mray_gst_netStreamerSetResolution (m_Instance, w,h,fps); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/GStreamerUnity/Scripts/GstNetworkImageStreamer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8a2fa3e83df49214cb6f9ddc13a13817 3 | timeCreated: 1486015822 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/GStreamerUnity/Scripts/GstNetworkMultipleTexture.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6a560eeee68f05b41814bc437ca244f7 3 | timeCreated: 1486015822 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/GStreamerUnity/Scripts/GstNetworkPlayer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c816ee1f4f132c54086d8a82b0926845 3 | timeCreated: 1486015822 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/GStreamerUnity/Scripts/GstNetworkTexture.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class GstNetworkTexture : GstBaseTexture { 5 | 6 | 7 | public string TargetIP="127.0.0.1"; 8 | public int TargetPort=7000; 9 | 10 | private GstNetworkPlayer _player; 11 | 12 | 13 | public GstNetworkPlayer Player 14 | { 15 | get 16 | { 17 | return _player; 18 | } 19 | set 20 | { 21 | if (value != null) 22 | _player = value; 23 | } 24 | } 25 | 26 | 27 | public override int GetTextureCount () 28 | { 29 | return 1; 30 | } 31 | /*public override int GetCaptureRate (int index) 32 | { 33 | return _player.GetCaptureRate (index); 34 | }*/ 35 | 36 | public override IGstPlayer GetPlayer(){ 37 | return _player; 38 | } 39 | 40 | protected override void _initialize() 41 | { 42 | _player = new GstNetworkPlayer (); 43 | } 44 | 45 | 46 | // Use this for initialization 47 | void Start () { 48 | 49 | } 50 | 51 | // Update is called once per frame 52 | void Update () { 53 | 54 | } 55 | public void ConnectToHost(string ip,int port) 56 | { 57 | TargetIP = ip; 58 | TargetPort = port; 59 | if(_player.IsLoaded || _player.IsPlaying) 60 | _player.Close (); 61 | _player.SetIP (TargetIP, TargetPort,false); 62 | _player.CreateStream(); 63 | } 64 | 65 | public override void Destroy () 66 | { 67 | base.Destroy (); 68 | _player = null; 69 | } 70 | 71 | void OnGUI() 72 | { 73 | // This function should do input injection (if enabled), and drawing. 74 | if (_player == null) 75 | return; 76 | 77 | Event e = Event.current; 78 | 79 | switch (e.type) { 80 | case EventType.Repaint: 81 | { 82 | Vector2 sz; 83 | int components; 84 | if (_player.GrabFrame (out sz,out components)) { 85 | Resize ((int)sz.x,(int) sz.y,components,0); 86 | OnFrameCaptured(0); 87 | if (m_Texture[0] == null) 88 | Debug.LogError ("The GstTexture does not have a texture assigned and will not paint."); 89 | else 90 | _player.BlitTexture (m_Texture[0].GetNativeTexturePtr (), m_Texture[0].width, m_Texture[0].height); 91 | } 92 | break; 93 | } 94 | } 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/GStreamerUnity/Scripts/GstNetworkTexture.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4346f1773ff03cc4ba035482a28e65c7 3 | timeCreated: 1486015822 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/GStreamerUnity/Scripts/GstUnityImageGrabber.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9e0e09f851b505a489a3d74508a148ab 3 | timeCreated: 1486016115 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/GStreamerUnity/Scripts/IGstAudioPlayer.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using System.Runtime.InteropServices; 4 | 5 | public interface IGstCommonPlayer 6 | { 7 | bool IsLoaded(); 8 | bool IsPlaying(); 9 | void Play (); 10 | void Pause(); 11 | void Stop(); 12 | void Destroy(); 13 | void Close(); 14 | bool GrabFrame(); 15 | } 16 | public interface IGstAudioPlayer:IGstCommonPlayer { 17 | 18 | int ChannelsCount(); 19 | int SampleRate(); 20 | bool IsUsingCustomOutput(); 21 | int GetFrameSize(); 22 | bool CopyAudioFrame([In,Out]float[] data); 23 | 24 | } 25 | -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/GStreamerUnity/Scripts/IGstAudioPlayer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c8ebf542c70c84e2dba4b73b9b71d0e9 3 | timeCreated: 1481879648 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/GStreamerUnity/Scripts/IGstPlayer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 47f6d828269505442992b477fdfd30ed 3 | timeCreated: 1430402383 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/GStreamerUnity/Scripts/IGstStreamer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 56177f36261cc4840acc77e852b41f06 3 | timeCreated: 1486015877 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/GStreamerUnity/Scripts/IImageProcessor.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public abstract class IImageProcessor : MonoBehaviour { 5 | 6 | public abstract Texture ProcessTexture (Texture InputTexture, ref RenderTexture ResultTexture, int downSample = 0); 7 | } 8 | -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/GStreamerUnity/Scripts/IImageProcessor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9241ed4c31d63d84a908da9fbcaeb9db 3 | timeCreated: 1491883301 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/GStreamerUnity/Scripts/ImageSampler.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3a764f015e6452247baaefb3c6e98d41 3 | timeCreated: 1486108924 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/GStreamerUnity/Scripts/NativeDLL.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using System; 4 | using System.Runtime.InteropServices; 5 | 6 | //credits: http://runningdimensions.com/blog/?p=5 7 | public class NativeDLL : MonoBehaviour { 8 | public static T Invoke(IntPtr library, params object[] pars) 9 | { 10 | IntPtr funcPtr = GetProcAddress(library, typeof(T2).Name); 11 | if (funcPtr == IntPtr.Zero) 12 | { 13 | Debug.LogWarning("Could not gain reference to method address."); 14 | return default(T); 15 | } 16 | 17 | var func = Marshal.GetDelegateForFunctionPointer(GetProcAddress(library, typeof(T2).Name), typeof(T2)); 18 | return (T)func.DynamicInvoke(pars); 19 | } 20 | 21 | public static void Invoke(IntPtr library, params object[] pars) 22 | { 23 | IntPtr funcPtr = GetProcAddress(library, typeof(T).Name); 24 | if (funcPtr == IntPtr.Zero) 25 | { 26 | Debug.LogWarning("Could not gain reference to method address."); 27 | return; 28 | } 29 | 30 | var func = Marshal.GetDelegateForFunctionPointer(funcPtr, typeof(T)); 31 | func.DynamicInvoke(pars); 32 | } 33 | 34 | public static void UnloadModule(string name) 35 | { 36 | foreach (System.Diagnostics.ProcessModule m in System.Diagnostics.Process.GetCurrentProcess().Modules) { 37 | if (m.ModuleName == name) { 38 | FreeLibrary (m.BaseAddress); 39 | } 40 | } 41 | } 42 | 43 | [DllImport("kernel32", SetLastError = true)] 44 | [return: MarshalAs(UnmanagedType.Bool)] 45 | public static extern bool FreeLibrary(IntPtr hModule); 46 | 47 | [DllImport("kernel32", SetLastError = true, CharSet = CharSet.Unicode)] 48 | public static extern IntPtr LoadLibrary(string lpFileName); 49 | 50 | [DllImport("kernel32")] 51 | public static extern IntPtr GetProcAddress(IntPtr hModule, string procedureName); 52 | 53 | } 54 | -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/GStreamerUnity/Scripts/NativeDLL.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 15c1c312004acf94d82fa33e801ce833 3 | timeCreated: 1430448552 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/GStreamerUnity/Scripts/OffscreenProcessor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cad8feac51c252544a2c4fc00cca6a01 3 | timeCreated: 1491883301 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/GStreamerUnity/Scripts/ThreadJob.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class ThreadJob 5 | { 6 | private bool m_IsDone = false; 7 | private object m_Handle = new object(); 8 | protected System.Threading.Thread m_Thread = null; 9 | 10 | public delegate void ThreadHandlerDeleg(ThreadJob t); 11 | public ThreadHandlerDeleg ThreadHandler; 12 | 13 | public bool IsDone 14 | { 15 | get 16 | { 17 | bool tmp; 18 | lock (m_Handle) 19 | { 20 | tmp = m_IsDone; 21 | } 22 | return tmp; 23 | } 24 | set 25 | { 26 | lock (m_Handle) 27 | { 28 | m_IsDone = value; 29 | } 30 | } 31 | } 32 | 33 | public virtual void Start() 34 | { 35 | m_Thread = new System.Threading.Thread(Run); 36 | m_Thread.Start(); 37 | // Debug.Log (m_Thread.ManagedThreadId.ToString()+" has started"); 38 | } 39 | public virtual void Abort() 40 | { 41 | IsDone = true; 42 | if (m_Thread != null) { 43 | m_Thread.Abort (); 44 | m_Thread.Join (); 45 | m_Thread = null; 46 | } 47 | } 48 | 49 | protected virtual void ThreadFunction() { } 50 | 51 | protected virtual void OnFinished() { } 52 | 53 | public virtual bool Update() 54 | { 55 | if (IsDone) 56 | { 57 | OnFinished(); 58 | return true; 59 | } 60 | return false; 61 | } 62 | IEnumerator WaitFor() 63 | { 64 | while(!Update()) 65 | { 66 | yield return null; 67 | } 68 | } 69 | private void Run() 70 | { 71 | if (ThreadHandler != null) 72 | ThreadHandler (this); 73 | ThreadFunction(); 74 | //Debug.Log (m_Thread.ManagedThreadId.ToString()+" has stopped"); 75 | IsDone = true; 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/GStreamerUnity/Scripts/ThreadJob.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4291ed80d2ed390458ae07fe0eb32aaa 3 | timeCreated: 1491883260 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/GStreamerUnity/Tests.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fdba8d7d7f5a3dd4b977f6772d825cf0 3 | folderAsset: yes 4 | timeCreated: 1430395133 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/GStreamerUnity/Tests/GStreamerTest0.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | [RequireComponent(typeof(GstNetworkTexture))] 5 | public class GStreamerTest0 : MonoBehaviour { 6 | 7 | private GstNetworkTexture m_Texture = null; 8 | 9 | public string Host = "127.0.0.1"; 10 | public int port=7000; 11 | // Use this for initialization 12 | void Start () { 13 | m_Texture = gameObject.GetComponent(); 14 | 15 | // Check to make sure we have an instance. 16 | if (m_Texture == null) 17 | { 18 | DestroyImmediate(this); 19 | } 20 | 21 | m_Texture.Initialize (); 22 | 23 | m_Texture.ConnectToHost (Host, port); 24 | m_Texture.Play (); 25 | } 26 | 27 | // Update is called once per frame 28 | void Update () { 29 | 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/GStreamerUnity/Tests/GStreamerTest0.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b32bdfec248852b46961324ac2f54684 3 | timeCreated: 1430395145 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/GStreamerUnity/Tests/GStreamerTest1.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | [RequireComponent(typeof(GstCustomTexture))] 5 | public class GStreamerTest1 : MonoBehaviour { 6 | 7 | private GstCustomTexture m_Texture = null; 8 | 9 | public string Pipeline = "autovideosrc"; 10 | // Use this for initialization 11 | void Start () { 12 | m_Texture = gameObject.GetComponent(); 13 | 14 | // Check to make sure we have an instance. 15 | if (m_Texture == null) 16 | { 17 | DestroyImmediate(this); 18 | } 19 | 20 | m_Texture.Initialize (); 21 | 22 | m_Texture.SetPipeline (Pipeline); 23 | m_Texture.Play (); 24 | } 25 | 26 | // Update is called once per frame 27 | void Update () { 28 | 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/GStreamerUnity/Tests/GStreamerTest1.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 74b5b877c76c2024c9ba13714b31dbf3 3 | timeCreated: 1430486089 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/Plugins.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c1c43dfc82c3bb5419f5a880291a771b 3 | folderAsset: yes 4 | timeCreated: 1430453565 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/Plugins/macOS.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 835a8ed0c30d646359d8a5df3f8b63df 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/Plugins/macOS/GStreamerUnityPlugin.bundle.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 62db74f9e345840f084ca6da473fc0b3 3 | folderAsset: yes 4 | PluginImporter: 5 | externalObjects: {} 6 | serializedVersion: 2 7 | iconMap: {} 8 | executionOrder: {} 9 | defineConstraints: [] 10 | isPreloaded: 0 11 | isOverridable: 0 12 | isExplicitlyReferenced: 0 13 | validateReferences: 1 14 | platformData: 15 | - first: 16 | Any: 17 | second: 18 | enabled: 0 19 | settings: {} 20 | - first: 21 | Editor: Editor 22 | second: 23 | enabled: 1 24 | settings: 25 | DefaultValueInitialized: true 26 | - first: 27 | Standalone: OSXUniversal 28 | second: 29 | enabled: 1 30 | settings: {} 31 | userData: 32 | assetBundleName: 33 | assetBundleVariant: 34 | -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/Plugins/macOS/GStreamerUnityPlugin.bundle/Contents.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: eddf9fab0f86746e29d1e8c25461219b 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/Plugins/macOS/GStreamerUnityPlugin.bundle/Contents/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildMachineOSBuild 6 | 19H114 7 | CFBundleDevelopmentRegion 8 | English 9 | CFBundleExecutable 10 | GStreamerUnityPlugin 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleLongVersionString 14 | 15 | CFBundlePackageType 16 | APPL 17 | CFBundleSignature 18 | ???? 19 | CFBundleSupportedPlatforms 20 | 21 | MacOSX 22 | 23 | CSResourcesFileMapped 24 | 25 | DTCompiler 26 | com.apple.compilers.llvm.clang.1_0 27 | DTPlatformBuild 28 | 12C33 29 | DTPlatformName 30 | macosx 31 | DTPlatformVersion 32 | 11.1 33 | DTSDKBuild 34 | 20C63 35 | DTSDKName 36 | macosx11.1 37 | DTXcode 38 | 1230 39 | DTXcodeBuild 40 | 12C33 41 | LSMinimumSystemVersion 42 | 10.15 43 | NSHumanReadableCopyright 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/Plugins/macOS/GStreamerUnityPlugin.bundle/Contents/Info.plist.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b988d9ee4007a4525abda2dc64fce163 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/Plugins/macOS/GStreamerUnityPlugin.bundle/Contents/MacOS.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 366b6219251e44fb299f11a571a217c5 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/Plugins/macOS/GStreamerUnityPlugin.bundle/Contents/MacOS/GStreamerUnityPlugin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mrayy/mrayGStreamerUnity/bb81bc3ed54d0a2a13e6b744db738ebbf56180b4/Unity/UnityTests/Assets/Plugins/macOS/GStreamerUnityPlugin.bundle/Contents/MacOS/GStreamerUnityPlugin -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/Plugins/macOS/GStreamerUnityPlugin.bundle/Contents/MacOS/GStreamerUnityPlugin.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 51f027896e1bc4935aaa6dc17abc23c0 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/Plugins/macOS/GStreamerUnityPlugin.bundle/Contents/_CodeSignature.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 081e4f6d91a444bbe9bfd09299219839 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/Plugins/macOS/GStreamerUnityPlugin.bundle/Contents/_CodeSignature/CodeResources.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e9ecd96250aca4dfca88655de18d7bde 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/Plugins/x86_64.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7b800cdd399172b498977562979d9b83 3 | folderAsset: yes 4 | timeCreated: 1491882967 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/Plugins/x86_64/GStreamerUnityPlugin.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mrayy/mrayGStreamerUnity/bb81bc3ed54d0a2a13e6b744db738ebbf56180b4/Unity/UnityTests/Assets/Plugins/x86_64/GStreamerUnityPlugin.dll -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/Plugins/x86_64/GStreamerUnityPlugin.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0431433b4df831f4292416da03cfc042 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 0 10 | isOverridable: 0 11 | isExplicitlyReferenced: 0 12 | validateReferences: 1 13 | platformData: 14 | - first: 15 | '': Linux 16 | second: 17 | enabled: 0 18 | settings: 19 | CPU: None 20 | - first: 21 | '': LinuxUniversal 22 | second: 23 | enabled: 1 24 | settings: 25 | CPU: x86_64 26 | - first: 27 | '': OSXIntel 28 | second: 29 | enabled: 0 30 | settings: 31 | CPU: None 32 | - first: 33 | '': OSXIntel64 34 | second: 35 | enabled: 1 36 | settings: 37 | CPU: AnyCPU 38 | - first: 39 | Any: 40 | second: 41 | enabled: 1 42 | settings: {} 43 | - first: 44 | Editor: Editor 45 | second: 46 | enabled: 0 47 | settings: 48 | CPU: x86_64 49 | DefaultValueInitialized: true 50 | - first: 51 | Facebook: Win 52 | second: 53 | enabled: 0 54 | settings: 55 | CPU: None 56 | - first: 57 | Facebook: Win64 58 | second: 59 | enabled: 1 60 | settings: 61 | CPU: AnyCPU 62 | - first: 63 | Standalone: Linux64 64 | second: 65 | enabled: 1 66 | settings: 67 | CPU: AnyCPU 68 | - first: 69 | Standalone: OSXUniversal 70 | second: 71 | enabled: 0 72 | settings: 73 | CPU: x86_64 74 | - first: 75 | Standalone: Win 76 | second: 77 | enabled: 0 78 | settings: 79 | CPU: None 80 | - first: 81 | Standalone: Win64 82 | second: 83 | enabled: 1 84 | settings: 85 | CPU: AnyCPU 86 | userData: 87 | assetBundleName: 88 | assetBundleVariant: 89 | -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/Plugins/x86_64/UnityWebcam.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mrayy/mrayGStreamerUnity/bb81bc3ed54d0a2a13e6b744db738ebbf56180b4/Unity/UnityTests/Assets/Plugins/x86_64/UnityWebcam.dll -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/Plugins/x86_64/UnityWebcam.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: defc7a2ddbc80f946851a27c0ecfdb70 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 0 10 | isOverridable: 0 11 | isExplicitlyReferenced: 0 12 | validateReferences: 1 13 | platformData: 14 | - first: 15 | '': Linux 16 | second: 17 | enabled: 0 18 | settings: 19 | CPU: None 20 | - first: 21 | '': LinuxUniversal 22 | second: 23 | enabled: 1 24 | settings: 25 | CPU: x86_64 26 | - first: 27 | '': OSXIntel 28 | second: 29 | enabled: 0 30 | settings: 31 | CPU: None 32 | - first: 33 | '': OSXIntel64 34 | second: 35 | enabled: 1 36 | settings: 37 | CPU: AnyCPU 38 | - first: 39 | Any: 40 | second: 41 | enabled: 1 42 | settings: {} 43 | - first: 44 | Editor: Editor 45 | second: 46 | enabled: 0 47 | settings: 48 | CPU: x86_64 49 | DefaultValueInitialized: true 50 | - first: 51 | Facebook: Win 52 | second: 53 | enabled: 0 54 | settings: 55 | CPU: None 56 | - first: 57 | Facebook: Win64 58 | second: 59 | enabled: 1 60 | settings: 61 | CPU: AnyCPU 62 | - first: 63 | Standalone: Linux64 64 | second: 65 | enabled: 1 66 | settings: 67 | CPU: AnyCPU 68 | - first: 69 | Standalone: OSXUniversal 70 | second: 71 | enabled: 0 72 | settings: 73 | CPU: x86_64 74 | - first: 75 | Standalone: Win 76 | second: 77 | enabled: 0 78 | settings: 79 | CPU: None 80 | - first: 81 | Standalone: Win64 82 | second: 83 | enabled: 1 84 | settings: 85 | CPU: AnyCPU 86 | userData: 87 | assetBundleName: 88 | assetBundleVariant: 89 | -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/Resources.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: aa59ef3afedbbe84a92c63f8c667301c 3 | folderAsset: yes 4 | timeCreated: 1493011745 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/Resources/BlitMtrl.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mrayy/mrayGStreamerUnity/bb81bc3ed54d0a2a13e6b744db738ebbf56180b4/Unity/UnityTests/Assets/Resources/BlitMtrl.mat -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/Resources/BlitMtrl.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 56b55489c9086f64badd3b38e9768518 3 | timeCreated: 1493011752 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/Resources/RedMtrl.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mrayy/mrayGStreamerUnity/bb81bc3ed54d0a2a13e6b744db738ebbf56180b4/Unity/UnityTests/Assets/Resources/RedMtrl.mat -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/Resources/RedMtrl.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 00297690289d162438ac1575435f1306 3 | timeCreated: 1493011752 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/Resources/SimpleChromakey.shader: -------------------------------------------------------------------------------- 1 | Shader "Custom/ChromaKey" { 2 | Properties { 3 | _MainTex ("Base (RGB)", 2D) = "white" {} 4 | _thresh ("Threshold", Range (0, 16)) = 0.8 5 | _slope ("Slope", Range (0, 1)) = 0.2 6 | _keyingColor ("Key Colour", Color) = (1,1,1,1) 7 | } 8 | SubShader { 9 | Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"} 10 | LOD 100 11 | Lighting Off 12 | ZWrite Off 13 | AlphaTest Off 14 | Blend SrcAlpha OneMinusSrcAlpha 15 | Pass { 16 | CGPROGRAM 17 | #pragma vertex vert_img 18 | #pragma fragment frag 19 | #pragma fragmentoption ARB_precision_hint_fastest 20 | sampler2D _MainTex; 21 | float3 _keyingColor=float3(0,1,0); 22 | float _thresh=0.9; // 0.8 23 | float _slope=0.8; // 0.2 24 | 25 | #include "UnityCG.cginc" 26 | 27 | float4 frag(v2f_img i) : COLOR { 28 | _keyingColor=float3(0,1,0); 29 | _thresh=0.9; // 0.8 30 | _slope=0.6; // 0.2 31 | float3 input_color = tex2D(_MainTex, i.uv).rgb; 32 | float d = abs(length(abs(_keyingColor.rgb - input_color.rgb))); 33 | float edge0 = _thresh * (1.0-_slope); 34 | float alpha = smoothstep(edge0, _thresh, d); 35 | return float4(input_color, alpha); 36 | } 37 | ENDCG 38 | } 39 | } 40 | } -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/Resources/SimpleChromakey.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3ff64800cb1ca564e8f5f3233103232d 3 | timeCreated: 1493019951 4 | licenseType: Free 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/Resources/WhiteMtrl.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mrayy/mrayGStreamerUnity/bb81bc3ed54d0a2a13e6b744db738ebbf56180b4/Unity/UnityTests/Assets/Resources/WhiteMtrl.mat -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/Resources/WhiteMtrl.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0e5f96f409aa3624ba6c896f847147df 3 | timeCreated: 1493011752 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/Scenes.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1c66e6216533af8478b45f89d43f120a 3 | folderAsset: yes 4 | timeCreated: 1430453526 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/Scenes/CubeMaterial.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mrayy/mrayGStreamerUnity/bb81bc3ed54d0a2a13e6b744db738ebbf56180b4/Unity/UnityTests/Assets/Scenes/CubeMaterial.mat -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/Scenes/CubeMaterial.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 503e580573feebf4ba95df30b77ac450 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 2100000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/Scenes/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b1fae0f4c5a970c4c8919a1865630d98 3 | folderAsset: yes 4 | timeCreated: 1493012711 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/Scenes/Scripts/Bloom.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0a06c208bba794b458de7d55f7afb205 3 | timeCreated: 1463487675 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/Scenes/Scripts/CubeGenerator.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class CubeGenerator : MonoBehaviour { 5 | 6 | public int Count=10; 7 | 8 | // Use this for initialization 9 | void Start () { 10 | for(int i=0;i (); 20 | } 21 | } 22 | 23 | // Update is called once per frame 24 | void Update () { 25 | 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/Scenes/Scripts/CubeGenerator.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2cd15ebaafd5aff498ea4803c2c745fb 3 | timeCreated: 1461153201 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/Scenes/Scripts/ImageEffectBase.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | namespace UnityStandardAssets.ImageEffects 5 | { 6 | [RequireComponent(typeof (Camera))] 7 | [AddComponentMenu("")] 8 | public class ImageEffectBase : MonoBehaviour 9 | { 10 | /// Provides a shader property that is set in the inspector 11 | /// and a material instantiated from the shader 12 | public Shader shader; 13 | 14 | private Material m_Material; 15 | 16 | 17 | protected virtual void Start() 18 | { 19 | // Disable if we don't support image effects 20 | if (!SystemInfo.supportsImageEffects) 21 | { 22 | enabled = false; 23 | return; 24 | } 25 | 26 | // Disable the image effect if the shader can't 27 | // run on the users graphics card 28 | if (!shader || !shader.isSupported) 29 | enabled = false; 30 | } 31 | 32 | 33 | protected Material material 34 | { 35 | get 36 | { 37 | if (m_Material == null) 38 | { 39 | m_Material = new Material(shader); 40 | m_Material.hideFlags = HideFlags.HideAndDontSave; 41 | } 42 | return m_Material; 43 | } 44 | } 45 | 46 | 47 | protected virtual void OnDisable() 48 | { 49 | if (m_Material) 50 | { 51 | DestroyImmediate(m_Material); 52 | } 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/Scenes/Scripts/ImageEffectBase.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 92f4c664a8d71d74987de89f94cb8cf3 3 | timeCreated: 1463487751 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/Scenes/Scripts/JitterMotion.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 70cec3f0490dff14fbf273abb6a3a72d 3 | timeCreated: 1461153401 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/Scenes/Scripts/MotionBlur.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 89c052e18f3d04e4f94e08044286f3b9 3 | timeCreated: 1463487675 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/Scenes/Scripts/ObjectMotion.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class ObjectMotion : MonoBehaviour { 5 | 6 | float _time; 7 | Vector3 _Speed; 8 | // Use this for initialization 9 | void Start () { 10 | _Speed = Random.insideUnitSphere * 50; 11 | } 12 | 13 | 14 | // Update is called once per frame 15 | void Update () { 16 | 17 | transform.localRotation = Quaternion.Euler (_Speed * _time); 18 | _time += Time.deltaTime; 19 | 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/Scenes/Scripts/ObjectMotion.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5f9f194e504baa74b9c03007f7a00772 3 | timeCreated: 1461153446 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/Scenes/Scripts/Perlin.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b654b51054ba6894f892494e84aeca0f 3 | timeCreated: 1461153409 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/Scenes/Scripts/PostEffectsBase.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7041d7ae6f5e53048928e254b1dd7f23 3 | timeCreated: 1463487751 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/Scenes/Test 1.unity: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mrayy/mrayGStreamerUnity/bb81bc3ed54d0a2a13e6b744db738ebbf56180b4/Unity/UnityTests/Assets/Scenes/Test 1.unity -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/Scenes/Test 1.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a40e5fb380322ff43b93edf10237ebcd 3 | timeCreated: 1430453526 4 | licenseType: Free 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/Scenes/Test 1Settings.lighting: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mrayy/mrayGStreamerUnity/bb81bc3ed54d0a2a13e6b744db738ebbf56180b4/Unity/UnityTests/Assets/Scenes/Test 1Settings.lighting -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/Scenes/Test 1Settings.lighting.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 52df524bc905743418323b95a0669c4c 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 4890085278179872738 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/Scenes/Test 2.unity: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mrayy/mrayGStreamerUnity/bb81bc3ed54d0a2a13e6b744db738ebbf56180b4/Unity/UnityTests/Assets/Scenes/Test 2.unity -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/Scenes/Test 2.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 88e6744f91a963e4e8f3a26bbf6beb4e 3 | timeCreated: 1430453526 4 | licenseType: Free 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/Scenes/Test 3.unity: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mrayy/mrayGStreamerUnity/bb81bc3ed54d0a2a13e6b744db738ebbf56180b4/Unity/UnityTests/Assets/Scenes/Test 3.unity -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/Scenes/Test 3.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bf614233d10691d4ead44820c1663fdf 3 | timeCreated: 1430453526 4 | licenseType: Free 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/Scenes/Test 4.unity: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mrayy/mrayGStreamerUnity/bb81bc3ed54d0a2a13e6b744db738ebbf56180b4/Unity/UnityTests/Assets/Scenes/Test 4.unity -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/Scenes/Test 4.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: eea5ec7e899a85d43814b54b70c0b8b7 3 | timeCreated: 1430453526 4 | licenseType: Free 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/Scenes/Test 5.unity: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mrayy/mrayGStreamerUnity/bb81bc3ed54d0a2a13e6b744db738ebbf56180b4/Unity/UnityTests/Assets/Scenes/Test 5.unity -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/Scenes/Test 5.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 795e3a48952b1d94180df111a325aa1d 3 | timeCreated: 1430453526 4 | licenseType: Free 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/UnityCam.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 98aac9fe8ef857a41b243ec3508a131a 3 | folderAsset: yes 4 | timeCreated: 1493184849 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/UnityCam/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 71524bf0a7afefe4995b59d487b2f1b0 3 | folderAsset: yes 4 | timeCreated: 1463485971 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/UnityCam/Editor/UnityCamEditor.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using UnityEditor; 4 | 5 | [CustomEditor(typeof(UnityCam))] 6 | public class HUGVRCamEditor : Editor 7 | { 8 | 9 | SerializedProperty _flipImage; 10 | SerializedProperty _blitLocaly; 11 | void OnEnable() 12 | { 13 | _flipImage=serializedObject.FindProperty("Flip"); 14 | _blitLocaly=serializedObject.FindProperty("BlitLocaly"); 15 | } 16 | 17 | 18 | public override void OnInspectorGUI() 19 | { 20 | serializedObject.Update(); 21 | EditorGUILayout.PropertyField(_flipImage); 22 | EditorGUILayout.PropertyField(_blitLocaly); 23 | 24 | serializedObject.ApplyModifiedProperties(); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/UnityCam/Editor/UnityCamEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 74e7297b37528034ca6e2b4a1f94ef21 3 | timeCreated: 1463485985 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/UnityCam/Resources.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 596a25b3925172d4689d0ea19279d560 3 | folderAsset: yes 4 | timeCreated: 1460973219 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/UnityCam/Resources/Blitter.shader: -------------------------------------------------------------------------------- 1 | Shader "UnityCam/Image/Blitter" { 2 | Properties { 3 | _MainTex ("Base (RGB)", 2D) = "white" {} 4 | TextureRect ("Texture Clip Rect",Vector) = (0,0,1,1) 5 | } 6 | SubShader { 7 | Pass{ 8 | ZTest Always Cull Off ZWrite Off 9 | Fog { Mode off } 10 | 11 | CGPROGRAM 12 | #pragma vertex vert 13 | #pragma fragment frag 14 | 15 | #include "UnityCG.cginc" 16 | 17 | sampler2D _MainTex; 18 | 19 | struct v2f 20 | { 21 | float4 position : SV_POSITION; 22 | float2 texCoord : TEXCOORD0; 23 | }; 24 | 25 | struct a2v 26 | { 27 | float4 vertex : POSITION; 28 | }; 29 | 30 | 31 | half4 TextureRect= half4(0,0,1,1); 32 | 33 | 34 | v2f vert(appdata_img IN) { 35 | 36 | v2f Out; 37 | Out.position.xy=2*sign(IN.vertex.xy)-1; 38 | Out.position.z = 1.0; 39 | Out.position.w = 1.0; 40 | Out.texCoord.xy =IN.texcoord.xy*TextureRect.zw+TextureRect.xy; 41 | Out.texCoord.x=1-Out.texCoord.x; 42 | return Out; 43 | } 44 | 45 | float4 frag(v2f IN) :COLOR { 46 | return tex2D(_MainTex, IN.texCoord.xy); 47 | } 48 | 49 | ENDCG 50 | } 51 | 52 | Pass{ 53 | ZTest Always Cull Off ZWrite Off 54 | Fog { Mode off } 55 | 56 | CGPROGRAM 57 | #pragma vertex vert 58 | #pragma fragment frag 59 | 60 | #include "UnityCG.cginc" 61 | 62 | sampler2D _MainTex; 63 | 64 | struct v2f 65 | { 66 | float4 position : SV_POSITION; 67 | float2 texCoord : TEXCOORD0; 68 | }; 69 | 70 | struct a2v 71 | { 72 | float4 vertex : POSITION; 73 | }; 74 | 75 | 76 | half4 TextureRect= half4(0,0,1,1); 77 | 78 | 79 | v2f vert(appdata_img IN) { 80 | 81 | v2f Out; 82 | Out.position.xy=2*sign(IN.vertex.xy)-1; 83 | Out.position.z = 1.0; 84 | Out.position.w = 1.0; 85 | Out.texCoord.xy =1-IN.texcoord.xy*TextureRect.zw+TextureRect.xy; 86 | return Out; 87 | } 88 | 89 | float4 frag(v2f IN) :COLOR { 90 | return tex2D(_MainTex, IN.texCoord.xy); 91 | } 92 | 93 | ENDCG 94 | } 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/UnityCam/Resources/Blitter.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7b07c0df157f9b04499e7deb94cd461c 3 | timeCreated: 1460983949 4 | licenseType: Free 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/UnityCam/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 62d816a67c6a3a84ab05b5a8befb4d14 3 | folderAsset: yes 4 | timeCreated: 1463485956 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/UnityCam/Scripts/TextureWrapper.cs: -------------------------------------------------------------------------------- 1 | // 2 | // UnityWebcam 3 | // 4 | // MHD Yamen Saraiji 5 | // yamen@myamens.com 6 | // 7 | // TextureWrapper 8 | // Convert almost any type of textures into Texture2D 9 | // Helpful to access texture pixels 10 | 11 | 12 | using UnityEngine; 13 | using System.Collections; 14 | 15 | public class TextureWrapper 16 | { 17 | 18 | 19 | Texture2D _wrappedTexture; 20 | 21 | public Texture2D WrappedTexture 22 | { 23 | get { return _wrappedTexture; } 24 | } 25 | 26 | 27 | public Texture2D ConvertTexture(Texture src) 28 | { 29 | if (src == null) 30 | return null; 31 | if (src as Texture2D != null) { 32 | _wrappedTexture = src as Texture2D; 33 | return _wrappedTexture; 34 | } 35 | if (_wrappedTexture == null || 36 | _wrappedTexture.width != src.width || 37 | _wrappedTexture.height != src.height) { 38 | _wrappedTexture = new Texture2D (src.width, src.height, TextureFormat.ARGB32, false); 39 | } 40 | 41 | if (src as WebCamTexture != null) { 42 | _wrappedTexture.SetPixels((src as WebCamTexture).GetPixels ()); 43 | _wrappedTexture.Apply (); 44 | return _wrappedTexture; 45 | } 46 | 47 | if (src as RenderTexture != null) { 48 | RenderTexture.active = src as RenderTexture; 49 | _wrappedTexture.ReadPixels (new Rect (0, 0, src.width, src.height), 0, 0); 50 | _wrappedTexture.Apply (); 51 | RenderTexture.active = null; 52 | return _wrappedTexture; 53 | } 54 | 55 | return null; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/UnityCam/Scripts/TextureWrapper.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7d793713874f6724a9ef611138c12ceb 3 | timeCreated: 1463485948 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/UnityCam/Scripts/UnityCam.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5f1106d3744ef824496276c8274506b2 3 | timeCreated: 1463481058 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/UnityCam/Scripts/UnityCamPostRenderer.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class UnityCamPostRenderer : MonoBehaviour { 5 | UnityCam _ownerCamera; 6 | 7 | // Use this for initialization 8 | void Start () { 9 | _ownerCamera = gameObject.GetComponent (); 10 | } 11 | 12 | 13 | // Update is called once per frame 14 | void Update () { 15 | 16 | } 17 | 18 | 19 | 20 | void OnRenderImage(RenderTexture source, RenderTexture destination) { 21 | _ownerCamera.RenderImage (source, destination); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Unity/UnityTests/Assets/UnityCam/Scripts/UnityCamPostRenderer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5912a2e4c076e3240a46b843a8c9aa4c 3 | timeCreated: 1463487094 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Unity/UnityTests/ProjectSettings/AudioManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mrayy/mrayGStreamerUnity/bb81bc3ed54d0a2a13e6b744db738ebbf56180b4/Unity/UnityTests/ProjectSettings/AudioManager.asset -------------------------------------------------------------------------------- /Unity/UnityTests/ProjectSettings/ClusterInputManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mrayy/mrayGStreamerUnity/bb81bc3ed54d0a2a13e6b744db738ebbf56180b4/Unity/UnityTests/ProjectSettings/ClusterInputManager.asset -------------------------------------------------------------------------------- /Unity/UnityTests/ProjectSettings/DynamicsManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mrayy/mrayGStreamerUnity/bb81bc3ed54d0a2a13e6b744db738ebbf56180b4/Unity/UnityTests/ProjectSettings/DynamicsManager.asset -------------------------------------------------------------------------------- /Unity/UnityTests/ProjectSettings/EditorBuildSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mrayy/mrayGStreamerUnity/bb81bc3ed54d0a2a13e6b744db738ebbf56180b4/Unity/UnityTests/ProjectSettings/EditorBuildSettings.asset -------------------------------------------------------------------------------- /Unity/UnityTests/ProjectSettings/EditorSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mrayy/mrayGStreamerUnity/bb81bc3ed54d0a2a13e6b744db738ebbf56180b4/Unity/UnityTests/ProjectSettings/EditorSettings.asset -------------------------------------------------------------------------------- /Unity/UnityTests/ProjectSettings/GraphicsSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mrayy/mrayGStreamerUnity/bb81bc3ed54d0a2a13e6b744db738ebbf56180b4/Unity/UnityTests/ProjectSettings/GraphicsSettings.asset -------------------------------------------------------------------------------- /Unity/UnityTests/ProjectSettings/InputManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mrayy/mrayGStreamerUnity/bb81bc3ed54d0a2a13e6b744db738ebbf56180b4/Unity/UnityTests/ProjectSettings/InputManager.asset -------------------------------------------------------------------------------- /Unity/UnityTests/ProjectSettings/MemorySettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!387306366 &1 4 | MemorySettings: 5 | m_ObjectHideFlags: 0 6 | m_EditorMemorySettings: 7 | m_MainAllocatorBlockSize: -1 8 | m_ThreadAllocatorBlockSize: -1 9 | m_MainGfxBlockSize: -1 10 | m_ThreadGfxBlockSize: -1 11 | m_CacheBlockSize: -1 12 | m_TypetreeBlockSize: -1 13 | m_ProfilerBlockSize: -1 14 | m_ProfilerEditorBlockSize: -1 15 | m_BucketAllocatorGranularity: -1 16 | m_BucketAllocatorBucketsCount: -1 17 | m_BucketAllocatorBlockSize: -1 18 | m_BucketAllocatorBlockCount: -1 19 | m_ProfilerBucketAllocatorGranularity: -1 20 | m_ProfilerBucketAllocatorBucketsCount: -1 21 | m_ProfilerBucketAllocatorBlockSize: -1 22 | m_ProfilerBucketAllocatorBlockCount: -1 23 | m_TempAllocatorSizeMain: -1 24 | m_JobTempAllocatorBlockSize: -1 25 | m_BackgroundJobTempAllocatorBlockSize: -1 26 | m_JobTempAllocatorReducedBlockSize: -1 27 | m_TempAllocatorSizeGIBakingWorker: -1 28 | m_TempAllocatorSizeNavMeshWorker: -1 29 | m_TempAllocatorSizeAudioWorker: -1 30 | m_TempAllocatorSizeCloudWorker: -1 31 | m_TempAllocatorSizeGfx: -1 32 | m_TempAllocatorSizeJobWorker: -1 33 | m_TempAllocatorSizeBackgroundWorker: -1 34 | m_TempAllocatorSizePreloadManager: -1 35 | m_PlatformMemorySettings: {} 36 | -------------------------------------------------------------------------------- /Unity/UnityTests/ProjectSettings/NavMeshAreas.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mrayy/mrayGStreamerUnity/bb81bc3ed54d0a2a13e6b744db738ebbf56180b4/Unity/UnityTests/ProjectSettings/NavMeshAreas.asset -------------------------------------------------------------------------------- /Unity/UnityTests/ProjectSettings/NetworkManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mrayy/mrayGStreamerUnity/bb81bc3ed54d0a2a13e6b744db738ebbf56180b4/Unity/UnityTests/ProjectSettings/NetworkManager.asset -------------------------------------------------------------------------------- /Unity/UnityTests/ProjectSettings/PackageManagerSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &1 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 61 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 13964, guid: 0000000000000000e000000000000000, type: 0} 13 | m_Name: 14 | m_EditorClassIdentifier: 15 | m_EnablePreReleasePackages: 0 16 | m_EnablePackageDependencies: 0 17 | m_AdvancedSettingsExpanded: 1 18 | m_ScopedRegistriesSettingsExpanded: 1 19 | m_SeeAllPackageVersions: 0 20 | oneTimeWarningShown: 0 21 | m_Registries: 22 | - m_Id: main 23 | m_Name: 24 | m_Url: https://packages.unity.com 25 | m_Scopes: [] 26 | m_IsDefault: 1 27 | m_Capabilities: 7 28 | m_UserSelectedRegistryName: 29 | m_UserAddingNewScopedRegistry: 0 30 | m_RegistryInfoDraft: 31 | m_Modified: 0 32 | m_ErrorMessage: 33 | m_UserModificationsInstanceId: -830 34 | m_OriginalInstanceId: -832 35 | m_LoadAssets: 0 36 | -------------------------------------------------------------------------------- /Unity/UnityTests/ProjectSettings/Physics2DSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mrayy/mrayGStreamerUnity/bb81bc3ed54d0a2a13e6b744db738ebbf56180b4/Unity/UnityTests/ProjectSettings/Physics2DSettings.asset -------------------------------------------------------------------------------- /Unity/UnityTests/ProjectSettings/PresetManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mrayy/mrayGStreamerUnity/bb81bc3ed54d0a2a13e6b744db738ebbf56180b4/Unity/UnityTests/ProjectSettings/PresetManager.asset -------------------------------------------------------------------------------- /Unity/UnityTests/ProjectSettings/ProjectSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mrayy/mrayGStreamerUnity/bb81bc3ed54d0a2a13e6b744db738ebbf56180b4/Unity/UnityTests/ProjectSettings/ProjectSettings.asset -------------------------------------------------------------------------------- /Unity/UnityTests/ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 2021.3.4f1 2 | m_EditorVersionWithRevision: 2021.3.4f1 (cb45f9cae8b7) 3 | -------------------------------------------------------------------------------- /Unity/UnityTests/ProjectSettings/QualitySettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mrayy/mrayGStreamerUnity/bb81bc3ed54d0a2a13e6b744db738ebbf56180b4/Unity/UnityTests/ProjectSettings/QualitySettings.asset -------------------------------------------------------------------------------- /Unity/UnityTests/ProjectSettings/TagManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mrayy/mrayGStreamerUnity/bb81bc3ed54d0a2a13e6b744db738ebbf56180b4/Unity/UnityTests/ProjectSettings/TagManager.asset -------------------------------------------------------------------------------- /Unity/UnityTests/ProjectSettings/TimeManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mrayy/mrayGStreamerUnity/bb81bc3ed54d0a2a13e6b744db738ebbf56180b4/Unity/UnityTests/ProjectSettings/TimeManager.asset -------------------------------------------------------------------------------- /Unity/UnityTests/ProjectSettings/UnityConnectSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mrayy/mrayGStreamerUnity/bb81bc3ed54d0a2a13e6b744db738ebbf56180b4/Unity/UnityTests/ProjectSettings/UnityConnectSettings.asset -------------------------------------------------------------------------------- /Unity/UnityTests/ProjectSettings/VFXManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mrayy/mrayGStreamerUnity/bb81bc3ed54d0a2a13e6b744db738ebbf56180b4/Unity/UnityTests/ProjectSettings/VFXManager.asset -------------------------------------------------------------------------------- /Unity/UnityTests/ProjectSettings/VersionControlSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!890905787 &1 4 | VersionControlSettings: 5 | m_ObjectHideFlags: 0 6 | m_Mode: Visible Meta Files 7 | m_CollabEditorSettings: 8 | inProgressEnabled: 1 9 | -------------------------------------------------------------------------------- /Unity/UnityTests/ProjectSettings/XRSettings.asset: -------------------------------------------------------------------------------- 1 | { 2 | "m_SettingKeys": [ 3 | "VR Device Disabled", 4 | "VR Device User Alert" 5 | ], 6 | "m_SettingValues": [ 7 | "False", 8 | "False" 9 | ] 10 | } -------------------------------------------------------------------------------- /Unity/UnityTests/ProjectSettings/boot.config: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mrayy/mrayGStreamerUnity/bb81bc3ed54d0a2a13e6b744db738ebbf56180b4/Unity/UnityTests/ProjectSettings/boot.config -------------------------------------------------------------------------------- /Unity/UnityTests/UserSettings/EditorUserSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!162 &1 4 | EditorUserSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 4 7 | m_ConfigSettings: 8 | RecentlyUsedSceneGuid-0: 9 | value: 0654555300565e5e5557552348765b44454f497e2e7d72327a791e63e0b8366f 10 | flags: 0 11 | RecentlyUsedSceneGuid-1: 12 | value: 0205040350530b08555e5f704225594445154179292c20617d7b4e64e7e2373c 13 | flags: 0 14 | RecentlyUsedSceneGuid-2: 15 | value: 5b09515052015d5d545f0d7b46705a44134f1e792d7a70322f2f4b31e7e2603d 16 | flags: 0 17 | RecentlyUsedSceneGuid-3: 18 | value: 0157025751075a08095f5c7449725b4413161c7e787074602e784b65b1e6303e 19 | flags: 0 20 | vcSharedLogLevel: 21 | value: 0d5e400f0650 22 | flags: 0 23 | m_VCAutomaticAdd: 1 24 | m_VCDebugCom: 0 25 | m_VCDebugCmd: 0 26 | m_VCDebugOut: 0 27 | m_SemanticMergeMode: 2 28 | m_DesiredImportWorkerCount: 2 29 | m_StandbyImportWorkerCount: 2 30 | m_IdleImportWorkerShutdownDelay: 60000 31 | m_VCShowFailedCheckout: 1 32 | m_VCOverwriteFailedCheckoutAssets: 1 33 | m_VCProjectOverlayIcons: 1 34 | m_VCHierarchyOverlayIcons: 1 35 | m_VCOtherOverlayIcons: 1 36 | m_VCAllowAsyncUpdate: 0 37 | m_ArtifactGarbageCollection: 1 38 | --------------------------------------------------------------------------------