├── .gitattributes ├── .gitignore ├── COPYING ├── Plugin ├── DvbCssWc │ ├── .gitignore │ ├── Build │ │ └── .gitignore │ ├── Project │ │ ├── Android │ │ │ └── jni │ │ │ │ ├── Android.mk │ │ │ │ └── Application.mk │ │ ├── COPYING │ │ ├── Linux │ │ │ └── Makefile │ │ ├── README.md │ │ └── Windows │ │ │ ├── DvbCssWc.def │ │ │ ├── DvbCssWc.vcxproj │ │ │ └── DvbCssWc.vcxproj.filters │ └── Source │ │ ├── examples │ │ ├── dvbcsswc-client.c │ │ └── dvbcsswc-server.c │ │ ├── export.c │ │ ├── export.h │ │ ├── export │ │ ├── client-export.c │ │ ├── client-export.h │ │ ├── server-export.c │ │ └── server-export.h │ │ ├── gstdvbcsswcclient.c │ │ ├── gstdvbcsswcclient.h │ │ ├── gstdvbcsswccommon.h │ │ ├── gstdvbcsswcpacket.c │ │ ├── gstdvbcsswcpacket.h │ │ ├── gstdvbcsswcserver.c │ │ ├── gstdvbcsswcserver.h │ │ └── tests │ │ ├── dvbcsswc-sync.c │ │ ├── export-client.c │ │ └── gstdvbcsswcserver.c ├── Externals │ └── gstreamer │ │ └── Project │ │ └── Android │ │ └── jni │ │ ├── Android.mk │ │ └── Application.mk ├── GUB │ ├── .gitignore │ ├── Project │ │ ├── Android │ │ │ ├── .env │ │ │ ├── GUB │ │ │ │ ├── AndroidManifest.xml │ │ │ │ └── jni │ │ │ │ │ └── Android.mk │ │ │ ├── Readme.md │ │ │ ├── build.sh │ │ │ ├── build4DockerToolbox.sh │ │ │ └── docker │ │ │ │ ├── Dockerfile │ │ │ │ ├── docker-compose-toolbox.yml │ │ │ │ ├── docker-compose.yml │ │ │ │ ├── entrypoint │ │ │ │ ├── commands.sh │ │ │ │ └── docker-entrypoint.sh │ │ │ │ └── install.sh │ │ ├── Linux │ │ │ └── Makefile │ │ └── Windows │ │ │ ├── GstUnityBridge.VC.db │ │ │ ├── GstUnityBridge.sln │ │ │ └── GstUnityBridge.vcxproj │ └── Source │ │ ├── gub.h │ │ ├── gub_graphics.c │ │ ├── gub_graphics.h │ │ ├── gub_gstreamer.c │ │ ├── gub_gstreamer.h │ │ ├── gub_log.c │ │ ├── gub_log.h │ │ ├── gub_pipeline.c │ │ └── gub_pipeline.h └── README.md ├── README.md └── Unity ├── .gitignore ├── AssetStore ├── GMT-icon.png ├── GMT-large.png ├── GMT-small.png ├── screenshot-1.png ├── screenshot-2.png └── screenshot-3.png ├── Assets ├── GstUnityBridge.meta ├── GstUnityBridge │ ├── Materials.meta │ ├── Materials │ │ ├── ExternalAlphaBase.mat │ │ ├── ExternalAlphaBase.mat.meta │ │ ├── ExternalAlphaGuide.mat │ │ ├── ExternalAlphaGuide.mat.meta │ │ ├── ExternalAlphaOverlay.mat │ │ ├── ExternalAlphaOverlay.mat.meta │ │ ├── matShaderColorMask.mat │ │ ├── matShaderColorMask.mat.meta │ │ ├── matShaderMask.mat │ │ └── matShaderMask.mat.meta │ ├── Scripts.meta │ ├── Scripts │ │ ├── GstUnityBridge.meta │ │ └── GstUnityBridge │ │ │ ├── EventProcessor.cs │ │ │ ├── EventProcessor.cs.meta │ │ │ ├── GStreamer.cs │ │ │ ├── GStreamer.cs.meta │ │ │ ├── GstUnityBridgeCapture.cs │ │ │ ├── GstUnityBridgeCapture.cs.meta │ │ │ ├── GstUnityBridgePipeline.cs │ │ │ ├── GstUnityBridgePipeline.cs.meta │ │ │ ├── GstUnityBridgeStarter.cs │ │ │ ├── GstUnityBridgeStarter.cs.meta │ │ │ ├── GstUnityBridgeTexture.cs │ │ │ └── GstUnityBridgeTexture.cs.meta │ ├── Shaders.meta │ ├── Shaders │ │ ├── ExternalAlpha.shader │ │ ├── ExternalAlpha.shader.meta │ │ ├── ExternalAlphaColor.shader │ │ ├── ExternalAlphaColor.shader.meta │ │ ├── ExternalAlphaGuide.shader │ │ └── ExternalAlphaGuide.shader.meta │ ├── Test Scenes.meta │ └── Test Scenes │ │ ├── Experimental.meta │ │ ├── Experimental │ │ ├── ExperimentalTestCapture.cs │ │ ├── ExperimentalTestCapture.cs.meta │ │ ├── ExperimentalTestRotate.cs │ │ ├── ExperimentalTestRotate.cs.meta │ │ ├── TestAlphaCompositing.unity │ │ ├── TestAlphaCompositing.unity.meta │ │ ├── TestAnimatedAlpha.unity │ │ ├── TestAnimatedAlpha.unity.meta │ │ ├── TestCapture.unity │ │ ├── TestCapture.unity.meta │ │ ├── TestStaticAlpha.unity │ │ ├── TestStaticAlpha.unity.meta │ │ ├── readme_experimental.txt │ │ └── readme_experimental.txt.meta │ │ ├── Local-clip.unity │ │ ├── Local-clip.unity.meta │ │ ├── Multiple-remote-clips.unity │ │ ├── Multiple-remote-clips.unity.meta │ │ ├── Remote-clip.unity │ │ └── Remote-clip.unity.meta ├── Plugins.meta └── Plugins │ ├── GStreamer.meta │ ├── GStreamer │ ├── android_arm.meta │ └── android_arm │ │ ├── libgstreamer_android.so │ │ └── libgstreamer_android.so.meta │ ├── GstUnityBridge.meta │ └── GstUnityBridge │ ├── android_arm.meta │ ├── android_arm │ ├── gub.jar │ ├── gub.jar.meta │ ├── libDvbCssWc.so │ ├── libDvbCssWc.so.meta │ ├── libGstUnityBridge.so │ └── libGstUnityBridge.so.meta │ ├── x86.meta │ ├── x86 │ ├── DvbCssWc.dll │ ├── DvbCssWc.dll.meta │ ├── GstUnityBridge.dll │ └── GstUnityBridge.dll.meta │ ├── x86_64.meta │ └── x86_64 │ ├── DvbCssWc.dll │ ├── DvbCssWc.dll.meta │ ├── GstUnityBridge.dll │ └── GstUnityBridge.dll.meta ├── ProjectSettings ├── ClusterInputManager.asset ├── EditorBuildSettings.asset ├── GraphicsSettings.asset ├── InputManager.asset ├── NavMeshAreas.asset ├── Physics2DSettings.asset ├── ProjectSettings.asset ├── ProjectVersion.txt ├── QualitySettings.asset ├── TagManager.asset ├── TimeManager.asset └── UnityConnectSettings.asset ├── README.md └── readme_unity.md /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.sdf 2 | *.opendb 3 | .vs 4 | -------------------------------------------------------------------------------- /COPYING: -------------------------------------------------------------------------------- 1 | GNU LESSER GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | 9 | This version of the GNU Lesser General Public License incorporates 10 | the terms and conditions of version 3 of the GNU General Public 11 | License, supplemented by the additional permissions listed below. 12 | 13 | 0. Additional Definitions. 14 | 15 | As used herein, "this License" refers to version 3 of the GNU Lesser 16 | General Public License, and the "GNU GPL" refers to version 3 of the GNU 17 | General Public License. 18 | 19 | "The Library" refers to a covered work governed by this License, 20 | other than an Application or a Combined Work as defined below. 21 | 22 | An "Application" is any work that makes use of an interface provided 23 | by the Library, but which is not otherwise based on the Library. 24 | Defining a subclass of a class defined by the Library is deemed a mode 25 | of using an interface provided by the Library. 26 | 27 | A "Combined Work" is a work produced by combining or linking an 28 | Application with the Library. The particular version of the Library 29 | with which the Combined Work was made is also called the "Linked 30 | Version". 31 | 32 | The "Minimal Corresponding Source" for a Combined Work means the 33 | Corresponding Source for the Combined Work, excluding any source code 34 | for portions of the Combined Work that, considered in isolation, are 35 | based on the Application, and not on the Linked Version. 36 | 37 | The "Corresponding Application Code" for a Combined Work means the 38 | object code and/or source code for the Application, including any data 39 | and utility programs needed for reproducing the Combined Work from the 40 | Application, but excluding the System Libraries of the Combined Work. 41 | 42 | 1. Exception to Section 3 of the GNU GPL. 43 | 44 | You may convey a covered work under sections 3 and 4 of this License 45 | without being bound by section 3 of the GNU GPL. 46 | 47 | 2. Conveying Modified Versions. 48 | 49 | If you modify a copy of the Library, and, in your modifications, a 50 | facility refers to a function or data to be supplied by an Application 51 | that uses the facility (other than as an argument passed when the 52 | facility is invoked), then you may convey a copy of the modified 53 | version: 54 | 55 | a) under this License, provided that you make a good faith effort to 56 | ensure that, in the event an Application does not supply the 57 | function or data, the facility still operates, and performs 58 | whatever part of its purpose remains meaningful, or 59 | 60 | b) under the GNU GPL, with none of the additional permissions of 61 | this License applicable to that copy. 62 | 63 | 3. Object Code Incorporating Material from Library Header Files. 64 | 65 | The object code form of an Application may incorporate material from 66 | a header file that is part of the Library. You may convey such object 67 | code under terms of your choice, provided that, if the incorporated 68 | material is not limited to numerical parameters, data structure 69 | layouts and accessors, or small macros, inline functions and templates 70 | (ten or fewer lines in length), you do both of the following: 71 | 72 | a) Give prominent notice with each copy of the object code that the 73 | Library is used in it and that the Library and its use are 74 | covered by this License. 75 | 76 | b) Accompany the object code with a copy of the GNU GPL and this license 77 | document. 78 | 79 | 4. Combined Works. 80 | 81 | You may convey a Combined Work under terms of your choice that, 82 | taken together, effectively do not restrict modification of the 83 | portions of the Library contained in the Combined Work and reverse 84 | engineering for debugging such modifications, if you also do each of 85 | the following: 86 | 87 | a) Give prominent notice with each copy of the Combined Work that 88 | the Library is used in it and that the Library and its use are 89 | covered by this License. 90 | 91 | b) Accompany the Combined Work with a copy of the GNU GPL and this license 92 | document. 93 | 94 | c) For a Combined Work that displays copyright notices during 95 | execution, include the copyright notice for the Library among 96 | these notices, as well as a reference directing the user to the 97 | copies of the GNU GPL and this license document. 98 | 99 | d) Do one of the following: 100 | 101 | 0) Convey the Minimal Corresponding Source under the terms of this 102 | License, and the Corresponding Application Code in a form 103 | suitable for, and under terms that permit, the user to 104 | recombine or relink the Application with a modified version of 105 | the Linked Version to produce a modified Combined Work, in the 106 | manner specified by section 6 of the GNU GPL for conveying 107 | Corresponding Source. 108 | 109 | 1) Use a suitable shared library mechanism for linking with the 110 | Library. A suitable mechanism is one that (a) uses at run time 111 | a copy of the Library already present on the user's computer 112 | system, and (b) will operate properly with a modified version 113 | of the Library that is interface-compatible with the Linked 114 | Version. 115 | 116 | e) Provide Installation Information, but only if you would otherwise 117 | be required to provide such information under section 6 of the 118 | GNU GPL, and only to the extent that such information is 119 | necessary to install and execute a modified version of the 120 | Combined Work produced by recombining or relinking the 121 | Application with a modified version of the Linked Version. (If 122 | you use option 4d0, the Installation Information must accompany 123 | the Minimal Corresponding Source and Corresponding Application 124 | Code. If you use option 4d1, you must provide the Installation 125 | Information in the manner specified by section 6 of the GNU GPL 126 | for conveying Corresponding Source.) 127 | 128 | 5. Combined Libraries. 129 | 130 | You may place library facilities that are a work based on the 131 | Library side by side in a single library together with other library 132 | facilities that are not Applications and are not covered by this 133 | License, and convey such a combined library under terms of your 134 | choice, if you do both of the following: 135 | 136 | a) Accompany the combined library with a copy of the same work based 137 | on the Library, uncombined with any other library facilities, 138 | conveyed under the terms of this License. 139 | 140 | b) Give prominent notice with the combined library that part of it 141 | is a work based on the Library, and explaining where to find the 142 | accompanying uncombined form of the same work. 143 | 144 | 6. Revised Versions of the GNU Lesser General Public License. 145 | 146 | The Free Software Foundation may publish revised and/or new versions 147 | of the GNU Lesser General Public License from time to time. Such new 148 | versions will be similar in spirit to the present version, but may 149 | differ in detail to address new problems or concerns. 150 | 151 | Each version is given a distinguishing version number. If the 152 | Library as you received it specifies that a certain numbered version 153 | of the GNU Lesser General Public License "or any later version" 154 | applies to it, you have the option of following the terms and 155 | conditions either of that published version or of any later version 156 | published by the Free Software Foundation. If the Library as you 157 | received it does not specify a version number of the GNU Lesser 158 | General Public License, you may choose any version of the GNU Lesser 159 | General Public License ever published by the Free Software Foundation. 160 | 161 | If the Library as you received it specifies that a proxy can decide 162 | whether future versions of the GNU Lesser General Public License shall 163 | apply, that proxy's public statement of acceptance of any version is 164 | permanent authorization for you to choose that version for the 165 | Library. 166 | -------------------------------------------------------------------------------- /Plugin/DvbCssWc/.gitignore: -------------------------------------------------------------------------------- 1 | #.gitignore 2 | 3 | Build/Release/ 4 | Build/Debug/ -------------------------------------------------------------------------------- /Plugin/DvbCssWc/Build/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /Plugin/DvbCssWc/Project/Android/jni/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | include $(CLEAR_VARS) 3 | 4 | GUB_ROOT := $(abspath $(LOCAL_PATH)/../../../../..) 5 | DVB_CSS_WC_SOURCE_PATH := $(GUB_ROOT)/Plugin/DvbCssWc/Source 6 | GSTREAMER_PROJECT_PATH := $(GUB_ROOT)/Plugin/Externals/gstreamer/Project/Android 7 | 8 | LOCAL_MODULE := DvbCssWc 9 | LOCAL_SRC_FILES := $(DVB_CSS_WC_SOURCE_PATH)/gstdvbcsswcclient.c \ 10 | $(DVB_CSS_WC_SOURCE_PATH)/gstdvbcsswcpacket.c \ 11 | $(DVB_CSS_WC_SOURCE_PATH)/gstdvbcsswcserver.c \ 12 | $(DVB_CSS_WC_SOURCE_PATH)/export/client-export.c \ 13 | $(DVB_CSS_WC_SOURCE_PATH)/export/server-export.c 14 | LOCAL_SHARED_LIBRARIES := gstreamer_android 15 | include $(BUILD_SHARED_LIBRARY) 16 | 17 | include $(CLEAR_VARS) 18 | include $(GSTREAMER_PROJECT_PATH)/jni/Android.mk 19 | -------------------------------------------------------------------------------- /Plugin/DvbCssWc/Project/Android/jni/Application.mk: -------------------------------------------------------------------------------- 1 | APP_PLATFORM := $(NDK_TARGET_LEVEL) 2 | APP_ABI := $(NDK_APP_ABI) 3 | -------------------------------------------------------------------------------- /Plugin/DvbCssWc/Project/COPYING: -------------------------------------------------------------------------------- 1 | GNU LESSER GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | 9 | This version of the GNU Lesser General Public License incorporates 10 | the terms and conditions of version 3 of the GNU General Public 11 | License, supplemented by the additional permissions listed below. 12 | 13 | 0. Additional Definitions. 14 | 15 | As used herein, "this License" refers to version 3 of the GNU Lesser 16 | General Public License, and the "GNU GPL" refers to version 3 of the GNU 17 | General Public License. 18 | 19 | "The Library" refers to a covered work governed by this License, 20 | other than an Application or a Combined Work as defined below. 21 | 22 | An "Application" is any work that makes use of an interface provided 23 | by the Library, but which is not otherwise based on the Library. 24 | Defining a subclass of a class defined by the Library is deemed a mode 25 | of using an interface provided by the Library. 26 | 27 | A "Combined Work" is a work produced by combining or linking an 28 | Application with the Library. The particular version of the Library 29 | with which the Combined Work was made is also called the "Linked 30 | Version". 31 | 32 | The "Minimal Corresponding Source" for a Combined Work means the 33 | Corresponding Source for the Combined Work, excluding any source code 34 | for portions of the Combined Work that, considered in isolation, are 35 | based on the Application, and not on the Linked Version. 36 | 37 | The "Corresponding Application Code" for a Combined Work means the 38 | object code and/or source code for the Application, including any data 39 | and utility programs needed for reproducing the Combined Work from the 40 | Application, but excluding the System Libraries of the Combined Work. 41 | 42 | 1. Exception to Section 3 of the GNU GPL. 43 | 44 | You may convey a covered work under sections 3 and 4 of this License 45 | without being bound by section 3 of the GNU GPL. 46 | 47 | 2. Conveying Modified Versions. 48 | 49 | If you modify a copy of the Library, and, in your modifications, a 50 | facility refers to a function or data to be supplied by an Application 51 | that uses the facility (other than as an argument passed when the 52 | facility is invoked), then you may convey a copy of the modified 53 | version: 54 | 55 | a) under this License, provided that you make a good faith effort to 56 | ensure that, in the event an Application does not supply the 57 | function or data, the facility still operates, and performs 58 | whatever part of its purpose remains meaningful, or 59 | 60 | b) under the GNU GPL, with none of the additional permissions of 61 | this License applicable to that copy. 62 | 63 | 3. Object Code Incorporating Material from Library Header Files. 64 | 65 | The object code form of an Application may incorporate material from 66 | a header file that is part of the Library. You may convey such object 67 | code under terms of your choice, provided that, if the incorporated 68 | material is not limited to numerical parameters, data structure 69 | layouts and accessors, or small macros, inline functions and templates 70 | (ten or fewer lines in length), you do both of the following: 71 | 72 | a) Give prominent notice with each copy of the object code that the 73 | Library is used in it and that the Library and its use are 74 | covered by this License. 75 | 76 | b) Accompany the object code with a copy of the GNU GPL and this license 77 | document. 78 | 79 | 4. Combined Works. 80 | 81 | You may convey a Combined Work under terms of your choice that, 82 | taken together, effectively do not restrict modification of the 83 | portions of the Library contained in the Combined Work and reverse 84 | engineering for debugging such modifications, if you also do each of 85 | the following: 86 | 87 | a) Give prominent notice with each copy of the Combined Work that 88 | the Library is used in it and that the Library and its use are 89 | covered by this License. 90 | 91 | b) Accompany the Combined Work with a copy of the GNU GPL and this license 92 | document. 93 | 94 | c) For a Combined Work that displays copyright notices during 95 | execution, include the copyright notice for the Library among 96 | these notices, as well as a reference directing the user to the 97 | copies of the GNU GPL and this license document. 98 | 99 | d) Do one of the following: 100 | 101 | 0) Convey the Minimal Corresponding Source under the terms of this 102 | License, and the Corresponding Application Code in a form 103 | suitable for, and under terms that permit, the user to 104 | recombine or relink the Application with a modified version of 105 | the Linked Version to produce a modified Combined Work, in the 106 | manner specified by section 6 of the GNU GPL for conveying 107 | Corresponding Source. 108 | 109 | 1) Use a suitable shared library mechanism for linking with the 110 | Library. A suitable mechanism is one that (a) uses at run time 111 | a copy of the Library already present on the user's computer 112 | system, and (b) will operate properly with a modified version 113 | of the Library that is interface-compatible with the Linked 114 | Version. 115 | 116 | e) Provide Installation Information, but only if you would otherwise 117 | be required to provide such information under section 6 of the 118 | GNU GPL, and only to the extent that such information is 119 | necessary to install and execute a modified version of the 120 | Combined Work produced by recombining or relinking the 121 | Application with a modified version of the Linked Version. (If 122 | you use option 4d0, the Installation Information must accompany 123 | the Minimal Corresponding Source and Corresponding Application 124 | Code. If you use option 4d1, you must provide the Installation 125 | Information in the manner specified by section 6 of the GNU GPL 126 | for conveying Corresponding Source.) 127 | 128 | 5. Combined Libraries. 129 | 130 | You may place library facilities that are a work based on the 131 | Library side by side in a single library together with other library 132 | facilities that are not Applications and are not covered by this 133 | License, and convey such a combined library under terms of your 134 | choice, if you do both of the following: 135 | 136 | a) Accompany the combined library with a copy of the same work based 137 | on the Library, uncombined with any other library facilities, 138 | conveyed under the terms of this License. 139 | 140 | b) Give prominent notice with the combined library that part of it 141 | is a work based on the Library, and explaining where to find the 142 | accompanying uncombined form of the same work. 143 | 144 | 6. Revised Versions of the GNU Lesser General Public License. 145 | 146 | The Free Software Foundation may publish revised and/or new versions 147 | of the GNU Lesser General Public License from time to time. Such new 148 | versions will be similar in spirit to the present version, but may 149 | differ in detail to address new problems or concerns. 150 | 151 | Each version is given a distinguishing version number. If the 152 | Library as you received it specifies that a certain numbered version 153 | of the GNU Lesser General Public License "or any later version" 154 | applies to it, you have the option of following the terms and 155 | conditions either of that published version or of any later version 156 | published by the Free Software Foundation. If the Library as you 157 | received it does not specify a version number of the GNU Lesser 158 | General Public License, you may choose any version of the GNU Lesser 159 | General Public License ever published by the Free Software Foundation. 160 | 161 | If the Library as you received it specifies that a proxy can decide 162 | whether future versions of the GNU Lesser General Public License shall 163 | apply, that proxy's public statement of acceptance of any version is 164 | permanent authorization for you to choose that version for the 165 | Library. 166 | -------------------------------------------------------------------------------- /Plugin/DvbCssWc/Project/Linux/Makefile: -------------------------------------------------------------------------------- 1 | SHELL = /bin/sh 2 | CC = gcc 3 | FLAGS = # -std=gnu99 -Iinclude 4 | 5 | OUTDIR = ../../Build/Linux 6 | SRCDIR = ../../Source 7 | 8 | CFLAGS = -fPIC -g `pkg-config gstreamer-1.0 --cflags-only-I` #-pedantic -Wall -Wextra -ggdb3 9 | LDFLAGS = -shared 10 | LIBS = $(shell pkg-config --libs glib-2.0) $(shell pkg-config --libs gio-2.0) $(shell pkg-config --libs gstreamer-1.0) $(shell pkg-config --libs gstreamer-net-1.0) -lm 11 | ADDLIBS = 12 | DEBUGFLAGS = -O0 -D _DEBUG 13 | RELEASEFLAGS = -O2 -D NDEBUG -fwhole-program 14 | 15 | TARGET = $(OUTDIR)/libDvbCssWc.so 16 | SOURCES = ${wildcard $(SRCDIR)/*.c $(SRCDIR)/export/*.c} 17 | OBJECTS = $(SOURCES:.c=.o) 18 | 19 | PREFIX = $(DESTDIR)/usr/local 20 | BINDIR = $(PREFIX)/bin 21 | 22 | all: $(TARGET) examples_client examples_server 23 | 24 | $(TARGET): $(OBJECTS) 25 | $(CC) $(FLAGS) $(CFLAGS) $(RELEASEFLAGS) -o $(TARGET) $(LDFLAGS) $(OBJECTS) $(LIBS) 26 | 27 | clean: 28 | @rm -rf $(OBJECTS) $(TARGET) $(OUTDIR)/test_client $(OUTDIR)/test_server $(OUTDIR)/sync_test $(OUTDIR)/export_client_test 29 | 30 | examples_client: 31 | $(CC) $(FLAGS) $(CFLAGS) -I$(SRCDIR) $(DEBUGFLAGS) -L. -o $(OUTDIR)/test_client $(SRCDIR)/examples/dvbcsswc-client.c $(LIBS) -l:$(TARGET) $(ADDLIBS) 32 | 33 | examples_server: 34 | $(CC) $(FLAGS) $(CFLAGS) -I$(SRCDIR) $(DEBUGFLAGS) -L. -o $(OUTDIR)/test_server $(SRCDIR)/examples/dvbcsswc-server.c $(LIBS) -l:$(TARGET) $(ADDLIBS) 35 | 36 | sync_test: 37 | $(CC) $(FLAGS) $(CFLAGS) -I$(SRCDIR) $(DEBUGFLAGS) -L. -o $(OUTDIR)/sync_test $(SRCDIR)/tests/dvbcsswc-sync.c $(LIBS) -l:$(TARGET) $(ADDLIBS) 38 | 39 | export_client_test: 40 | $(CC) $(FLAGS) $(CFLAGS) -I$(SRCDIR) $(DEBUGFLAGS) -L. -o $(OUTDIR)/export_client_test $(SRCDIR)/tests/export-client.c $(LIBS) -l:$(TARGET) $(ADDLIBS) 41 | -------------------------------------------------------------------------------- /Plugin/DvbCssWc/Project/README.md: -------------------------------------------------------------------------------- 1 | # GStreamer - DVB CSS WC plugin 2 | 3 | Gstreamer Clock implementing the ETSI TS 103 286-2 V1.1.1 (2015-05) Wall Clock. 4 | 5 | Tested on Windows 8.1, 10 and Linux Ubuntu 16.04 using Gstreamer 1.8.1 6 | 7 | # Building 8 | 9 | On Linux: 10 | -On Ubuntu 16.04 call make 11 | -On older distros install gstreamer 1.8.1 and missing dependencies 12 | 13 | On Windows: 14 | -For x86 download gstreamer-1.0-devel-x86-1.8.1.msi and gstreamer-1.0-x86-1.8.1.msi from https://gstreamer.freedesktop.org/download/ and install it. 15 | -For x64 download gstreamer-1.0-devel-x86_64-1.8.1.msi and gstreamer-1.0-x86_64-1.8.1.msi from https://gstreamer.freedesktop.org/download/ and install it. 16 | -Make sure the GSTREAMER_1_0_ROOT_X86 or GSTREAMER_1_0_ROOT_X86_64 environment variable is defined and points to the proper place. 17 | -Open: win32/*sln in Visual Studio 2015 18 | -Compile in VS for selected platform 19 | 20 | # Running 21 | Make sure that at runtime, GStreamer can access its libraries and plugins. It can be done by adding %GSTREAMER_SDK_ROOT_X86%\bin to the %PATH% environment variable, 22 | or by running the application from this same folder. 23 | 24 | List of dependecies on Windows: 25 | -libglib-2.0-0.dll 26 | -libgobject-2.0-0.dll 27 | -libgstreamer-1.0-0.dll 28 | -libwinpthread-1.dll 29 | 30 | # TODO 31 | 32 | Black box tests 33 | 34 | # ACKNOWLEDGEMENT 35 | 36 | This software has been created within the [ImmersiaTV](http://immersiatv.eu) project. This project has received funding from the European Union Horizon 2020 research and innovation programme under grant agreement 688619. 37 | -------------------------------------------------------------------------------- /Plugin/DvbCssWc/Project/Windows/DvbCssWc.def: -------------------------------------------------------------------------------- 1 | EXPORTS 2 | gst_dvb_css_wc_server_new 3 | gst_dvb_css_wc_client_clock_new 4 | -------------------------------------------------------------------------------- /Plugin/DvbCssWc/Project/Windows/DvbCssWc.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | export 9 | 10 | 11 | export 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | export 20 | 21 | 22 | export 23 | 24 | 25 | 26 | 27 | 28 | {0dbc6078-d8eb-47aa-880f-05c60e06d67a} 29 | 30 | 31 | -------------------------------------------------------------------------------- /Plugin/DvbCssWc/Source/examples/dvbcsswc-client.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | static gboolean 6 | handle_bus_message (GstBus * bus, GstMessage * message, GstClock * client_clock) 7 | { 8 | if (GST_MESSAGE_TYPE (message) == GST_MESSAGE_ELEMENT) { 9 | const GstStructure *s = gst_message_get_structure (message); 10 | gchar *str; 11 | 12 | if (s == NULL) 13 | return TRUE; 14 | str = gst_structure_to_string (s); 15 | g_print ("%s\n", str); 16 | g_free (str); 17 | } 18 | return TRUE; 19 | } 20 | 21 | gint 22 | main (gint argc, gchar * argv[]) 23 | { 24 | GMainLoop *loop; 25 | gchar *host; 26 | guint16 port; 27 | GstClock *client_clock; 28 | GstBus *bus; 29 | 30 | gst_init (&argc, &argv); 31 | 32 | if (argc < 3) { 33 | g_print ("Usage: dvbcsswc-client \n"); 34 | return 1; 35 | } 36 | 37 | host = argv[1]; 38 | port = atoi (argv[2]); 39 | 40 | client_clock = gst_dvb_css_wc_client_clock_new (NULL, host, port, 0); 41 | if (client_clock == NULL) { 42 | g_printerr ("Failed to create dvb clock client\n"); 43 | return 1; 44 | } 45 | 46 | bus = gst_bus_new (); 47 | gst_bus_add_watch (bus, (GstBusFunc) handle_bus_message, client_clock); 48 | g_object_set (G_OBJECT (client_clock), "bus", bus, NULL); 49 | 50 | loop = g_main_loop_new (NULL, FALSE); 51 | 52 | g_main_loop_run (loop); 53 | 54 | /* cleanup */ 55 | g_main_loop_unref (loop); 56 | g_object_unref (client_clock); 57 | 58 | return 0; 59 | } 60 | -------------------------------------------------------------------------------- /Plugin/DvbCssWc/Source/examples/dvbcsswc-server.c: -------------------------------------------------------------------------------- 1 | /* GStreamer 2 | * Copyright (C) 2014 Jan Schmidt 3 | * 4 | * netclock-server.c: Publish a network clock provider 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Library General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Library General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Library General Public 17 | * License along with this library; if not, write to the 18 | * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 19 | * Boston, MA 02110-1301, USA. 20 | */ 21 | #ifdef HAVE_CONFIG_H 22 | # include "config.h" 23 | #endif 24 | 25 | #include 26 | #include 27 | #include 28 | 29 | gint 30 | main (gint argc, gchar * argv[]) 31 | { 32 | GMainLoop *loop; 33 | GstClock *clock; 34 | GstDvbCssWcServer *net_clock; 35 | int clock_port = 0; 36 | int mfe = 500; 37 | 38 | gst_init (&argc, &argv); 39 | 40 | if (argc > 1) { 41 | clock_port = atoi (argv[1]); 42 | } 43 | 44 | loop = g_main_loop_new (NULL, FALSE); 45 | 46 | clock = gst_system_clock_obtain (); 47 | 48 | net_clock = gst_dvb_css_wc_server_new (clock, "127.0.0.1", clock_port, TRUE, mfe); 49 | gst_object_unref (clock); 50 | 51 | g_object_get (net_clock, "port", &clock_port, NULL); 52 | 53 | g_print ("Published network clock on port %u\n", clock_port); 54 | 55 | g_main_loop_run (loop); 56 | 57 | /* cleanup */ 58 | g_main_loop_unref (loop); 59 | 60 | return 0; 61 | } 62 | -------------------------------------------------------------------------------- /Plugin/DvbCssWc/Source/export.c: -------------------------------------------------------------------------------- 1 | /* GStreamer 2 | * Copyright (C) 2016 Tomasz Merda 3 | * Copyright (C) 2016 Wojciech Kapsa 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Library General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2 of the License, or (at your option) any later version. 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 | * Library General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Library General Public 16 | * License along with this library; if not, write to the 17 | * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 18 | * Boston, MA 02110-1301, USA. 19 | */ 20 | 21 | #include 22 | #include "gstdvbcsswcserver.h" 23 | #include 24 | #include "export.h" 25 | #include 26 | 27 | typedef struct _Server { 28 | void *gstdvbcsswcserver; 29 | GMainLoop *loop; 30 | GstClock *clock; 31 | GThread *thread; 32 | } Server; 33 | 34 | static Server* sServer = NULL; 35 | G_LOCK_DEFINE_STATIC(mutex); 36 | 37 | extern EXPORT_API Server* server_new(void){ 38 | Server* s = NULL; 39 | s = malloc(sizeof(Server)); 40 | s->gstdvbcsswcserver = NULL; 41 | s->loop = NULL; 42 | s->clock = NULL; 43 | s->thread = NULL; 44 | return s; 45 | } 46 | 47 | void server_free(Server** s) { 48 | if((*s)->loop){ 49 | gst_object_unref((*s)->loop); 50 | (*s)->loop = NULL; 51 | } 52 | if((*s)->thread){ 53 | gst_object_unref((*s)->thread); 54 | (*s)->thread = NULL; 55 | } 56 | if((*s)->clock){ 57 | gst_object_unref((*s)->clock); 58 | (*s)->clock = NULL; 59 | } 60 | if((*s)->gstdvbcsswcserver){ 61 | gst_object_unref((*s)->gstdvbcsswcserver); 62 | (*s)->gstdvbcsswcserver = NULL; 63 | } 64 | 65 | free(*s); 66 | *s = NULL; 67 | } 68 | 69 | extern EXPORT_API gboolean gst_dvb_css_wc_start(const gchar *address, gint port, gboolean followup, guint32 max_freq_error_ppm, gboolean isDebug) { 70 | GST_DEBUG("dvb_css_wc_start\n"); 71 | G_LOCK(mutex); 72 | sServer = server_new(); 73 | if (sServer == NULL) { 74 | goto server_struct_not_initialized; 75 | } 76 | gst_init(NULL, NULL); 77 | sServer->loop = g_main_loop_new(NULL, FALSE); 78 | sServer->clock = gst_system_clock_obtain(); 79 | 80 | if(isDebug == FALSE){ 81 | sServer->gstdvbcsswcserver = gst_dvb_css_wc_server_new(sServer->clock, address, port, followup, max_freq_error_ppm); 82 | } 83 | else{ 84 | sServer->gstdvbcsswcserver = gst_net_time_provider_new(sServer->clock, address, port); 85 | } 86 | 87 | if (sServer->gstdvbcsswcserver == NULL) { 88 | GST_ERROR("Dvb_css_wc server not created\n"); 89 | goto cleanup; 90 | } 91 | 92 | g_object_get(sServer->gstdvbcsswcserver, "port", &port, NULL); 93 | GST_DEBUG("Published network clock on port %u\n", port); 94 | 95 | sServer->thread = g_thread_try_new("dvb_css_wc_thread", (GThreadFunc) g_main_loop_run, sServer->loop, NULL); 96 | if (sServer->thread == NULL) { 97 | GST_ERROR("Thread for dvb_css_wc server not created\n"); 98 | goto cleanup; 99 | } 100 | 101 | GST_DEBUG("Dvb_css_wc server started\n"); 102 | G_UNLOCK(mutex); 103 | return TRUE; 104 | 105 | /* ERRORS */ 106 | server_struct_not_initialized:{ 107 | GST_ERROR("Dvb_css_wc server struct not initialized\n"); 108 | G_UNLOCK(mutex); 109 | return FALSE; 110 | } 111 | cleanup:{ 112 | server_free(&sServer); 113 | G_UNLOCK(mutex); 114 | return FALSE; 115 | } 116 | } 117 | 118 | extern EXPORT_API void gst_dvb_css_wc_stop(void) { 119 | GST_DEBUG("dvb_css_wc_stop\n"); 120 | G_LOCK(mutex); 121 | if (sServer == NULL) { 122 | G_UNLOCK(mutex); 123 | return; 124 | } 125 | GST_DEBUG("Stopping dvb_css_wc server\n"); 126 | if (sServer->loop != NULL) { 127 | g_main_loop_quit(sServer->loop); 128 | g_thread_join(sServer->thread); 129 | sServer->thread = NULL; 130 | sServer->loop = NULL; 131 | } 132 | server_free(&sServer); 133 | GST_INFO("Dvb_css_wc server stopped\n"); 134 | G_UNLOCK(mutex); 135 | } 136 | 137 | extern EXPORT_API GstClockTime gst_dvb_css_wc_get_time(void) { 138 | GstClockTime time; 139 | GST_DEBUG("dvb_css_wc_get_time\n"); 140 | G_LOCK(mutex); 141 | if (sServer != NULL && sServer->clock != NULL) { 142 | time = gst_clock_get_time(sServer->clock); 143 | G_UNLOCK(mutex); 144 | return time; 145 | } 146 | else { 147 | GST_ERROR("Dvb_css_wc server not ready\n"); 148 | } 149 | G_UNLOCK(mutex); 150 | return 0; 151 | } 152 | -------------------------------------------------------------------------------- /Plugin/DvbCssWc/Source/export.h: -------------------------------------------------------------------------------- 1 | /* GStreamer 2 | * Copyright (C) 2016 Tomasz Merda 3 | * Copyright (C) 2016 Wojciech Kapsa 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Library General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2 of the License, or (at your option) any later version. 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 | * Library General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Library General Public 16 | * License along with this library; if not, write to the 17 | * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 18 | * Boston, MA 02110-1301, USA. 19 | */ 20 | 21 | #ifndef __EXPORT_H__ 22 | #define __EXPORT_H__ 23 | #include 24 | 25 | #ifdef _WIN32 26 | #define EXPORT_API __declspec(dllexport) 27 | #else 28 | #define EXPORT_API 29 | #endif 30 | 31 | /** 32 | * gst_dvb_css_wc_start: 33 | * @address: (allow-none): an address to bind on as a dotted quad 34 | * (xxx.xxx.xxx.xxx), IPv6 address, or NULL to bind to all addresses 35 | * @port: a port to bind on, or 0 to let the kernel choose 36 | * @max_freq_error_ppm The clock maximum frequency error in parts-per-million 37 | * @followup Set to True if the Wall Clock Server should send follow-up responses 38 | * 39 | * Creates and starts DVC CSS WC clock 40 | * 41 | */ 42 | extern EXPORT_API gboolean gst_dvb_css_wc_start(const gchar *address, gint port, gboolean followup, guint32 max_freq_error_ppm, gboolean isDebug); 43 | 44 | /** 45 | * gst_dvb_css_wc_stop: 46 | * Stops DVC CSS WC clock 47 | */ 48 | extern EXPORT_API void gst_dvb_css_wc_stop(void); 49 | 50 | /** 51 | * gst_dvb_css_wc_get_time: 52 | * Get current DVC CSS WC clock time 53 | * Returns: 0 on error or GstClockTime 54 | */ 55 | extern EXPORT_API GstClockTime gst_dvb_css_wc_get_time(void); 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /Plugin/DvbCssWc/Source/export/client-export.c: -------------------------------------------------------------------------------- 1 | /* GStreamer 2 | * Copyright (C) 2016 Daniel Piesik 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Library General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Library General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Library General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | #include "../gstdvbcsswcclient.h" 21 | #include "client-export.h" 22 | 23 | extern EXPORT_API GstClock* 24 | gst_dvb_css_wc_client_start(const gchar *name, const gchar *remote_address, gint remote_port, GstClockTime base_time) 25 | { 26 | GstClock* dvb_css_wc_client = gst_dvb_css_wc_client_clock_new(name, remote_address, remote_port, base_time); 27 | if(dvb_css_wc_client == NULL) 28 | { 29 | GST_ERROR("dvb_css_wc_client clock not created\n"); 30 | return NULL; 31 | } 32 | 33 | return dvb_css_wc_client; 34 | } 35 | 36 | extern EXPORT_API void 37 | gst_dvb_css_wc_client_stop(GstClock *dvb_css_wc_client) 38 | { 39 | if(dvb_css_wc_client != NULL) 40 | { 41 | gst_object_unref(dvb_css_wc_client); 42 | dvb_css_wc_client = NULL; 43 | } 44 | } 45 | 46 | extern EXPORT_API gboolean 47 | gst_dvb_css_wc_client_is_synced(GstClock *dvb_css_wc_client) 48 | { 49 | if(dvb_css_wc_client != NULL) 50 | { 51 | return gst_clock_is_synced(dvb_css_wc_client); 52 | } 53 | return FALSE; 54 | } 55 | 56 | extern EXPORT_API GstClockTime 57 | gst_dvb_css_wc_client_get_time(GstClock *dvb_css_wc_client) 58 | { 59 | if(dvb_css_wc_client != NULL) 60 | { 61 | return gst_clock_get_time(dvb_css_wc_client); 62 | } 63 | return 0; 64 | } 65 | 66 | extern EXPORT_API GstClockTime 67 | gst_dvb_css_wc_client_get_time_local(GstClock *dvb_css_wc_client) 68 | { 69 | GstClockTime time = 0; 70 | GstClock* clock = gst_system_clock_obtain(); 71 | time = gst_clock_get_time(clock); 72 | gst_object_unref(clock); 73 | return time; 74 | } -------------------------------------------------------------------------------- /Plugin/DvbCssWc/Source/export/client-export.h: -------------------------------------------------------------------------------- 1 | /* GStreamer 2 | * Copyright (C) 2016 Daniel Piesik 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Library General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Library General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Library General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | #ifndef __DVB_CSS_WC_CLIENT_EXPORT_H__ 21 | #define __DVB_CSS_WC_CLIENT_EXPORT_H__ 22 | #include 23 | 24 | #ifdef _WIN32 25 | #define EXPORT_API __declspec(dllexport) 26 | #else 27 | #define EXPORT_API 28 | #endif 29 | 30 | /** 31 | * gst_dvb_css_wc_client_start: 32 | * @name: a name for the client 33 | * @remote_address: the address or hostname of the remote clock provider 34 | * @remote_port: the port of the remote clock provider 35 | * @base_time: initial time of the clock 36 | * 37 | * Create a new #GstClock that will report the time 38 | * provided by the wall clock server on @remote_address and @remote_port. 39 | * 40 | * Returns: a new #GstClock* that receives a time from the remote clock. 41 | */ 42 | extern EXPORT_API GstClock* gst_dvb_css_wc_client_start(const gchar *name, const gchar *remote_address, gint remote_port, GstClockTime base_time); 43 | 44 | /** 45 | * gst_dvb_css_wc_stop: 46 | * @dvb_css_wc_client: client that will be stopped 47 | * 48 | * Stop reporting the time from the remote clock 49 | * 50 | * Returns: none 51 | */ 52 | extern EXPORT_API void gst_dvb_css_wc_client_stop(GstClock *dvb_css_wc_client); 53 | 54 | /** 55 | * gst_dvb_css_wc_client_is_synced: 56 | * @dvb_css_wc_client: client to be checked if is synchronized with the remote clock 57 | * 58 | * Get information about synchronization with the remote clock 59 | * 60 | * Returns: TRUE if is synchronized or FALSE in other case 61 | */ 62 | extern EXPORT_API gboolean gst_dvb_css_wc_client_is_synced(GstClock *dvb_css_wc_client); 63 | 64 | /** 65 | * gst_dvb_css_wc_client_get_time: 66 | * @dvb_css_wc_client: client that will return a time 67 | * 68 | * Get the current time from the client 69 | * 70 | * Returns: 0 on error or GstClockTime 71 | */ 72 | extern EXPORT_API GstClockTime gst_dvb_css_wc_client_get_time(GstClock *dvb_css_wc_client); 73 | 74 | /** 75 | * gst_dvb_css_wc_client_get_time_local: 76 | * @dvb_css_wc_client: client that will return a time 77 | * 78 | * Get the system time 79 | * 80 | * Returns: 0 on error or GstClockTime 81 | */ 82 | extern EXPORT_API GstClockTime gst_dvb_css_wc_client_get_time_local(GstClock *dvb_css_wc_client); 83 | 84 | 85 | #endif /* __DVB_CSS_WC_CLIENT_EXPORT_H__ */ 86 | -------------------------------------------------------------------------------- /Plugin/DvbCssWc/Source/export/server-export.c: -------------------------------------------------------------------------------- 1 | /* GStreamer 2 | * Copyright (C) 2016 Tomasz Merda 3 | * Copyright (C) 2016 Wojciech Kapsa 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Library General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2 of the License, or (at your option) any later version. 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 | * Library General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Library General Public 16 | * License along with this library; if not, write to the 17 | * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 18 | * Boston, MA 02110-1301, USA. 19 | */ 20 | 21 | #include 22 | #include "../gstdvbcsswcserver.h" 23 | #include 24 | #include "server-export.h" 25 | #include 26 | 27 | typedef struct _DVBCSSWCserver { 28 | void *gstdvbcsswcserver; 29 | GMainLoop *loop; 30 | GstClock *clock; 31 | GThread *thread; 32 | } DVBCSSWCserver; 33 | 34 | //static Server* sServer = NULL; 35 | G_LOCK_DEFINE_STATIC(mutex); 36 | 37 | extern EXPORT_API DVBCSSWCserver* server_new(void){ 38 | DVBCSSWCserver* s = NULL; 39 | s = malloc(sizeof(DVBCSSWCserver)); 40 | s->gstdvbcsswcserver = NULL; 41 | s->loop = NULL; 42 | s->clock = NULL; 43 | s->thread = NULL; 44 | return s; 45 | } 46 | 47 | void server_free(DVBCSSWCserver** s) { 48 | if((*s)->loop){ 49 | gst_object_unref((*s)->loop); 50 | (*s)->loop = NULL; 51 | } 52 | if((*s)->thread){ 53 | gst_object_unref((*s)->thread); 54 | (*s)->thread = NULL; 55 | } 56 | if((*s)->clock){ 57 | gst_object_unref((*s)->clock); 58 | (*s)->clock = NULL; 59 | } 60 | if((*s)->gstdvbcsswcserver){ 61 | gst_object_unref((*s)->gstdvbcsswcserver); 62 | (*s)->gstdvbcsswcserver = NULL; 63 | } 64 | 65 | free(*s); 66 | *s = NULL; 67 | } 68 | 69 | extern EXPORT_API DVBCSSWCserver* gst_dvb_css_wc_start(const gchar *address, gint port, gboolean followup, guint32 max_freq_error_ppm, gboolean isDebug) { 70 | GST_TRACE("dvb_css_wc_start\n"); 71 | G_LOCK(mutex); 72 | DVBCSSWCserver* sServer = server_new(); 73 | if (sServer == NULL) { 74 | goto server_struct_not_initialized; 75 | } 76 | gst_init(NULL, NULL); 77 | sServer->loop = g_main_loop_new(NULL, FALSE); 78 | sServer->clock = gst_system_clock_obtain(); 79 | 80 | if(isDebug == FALSE){ 81 | sServer->gstdvbcsswcserver = gst_dvb_css_wc_server_new(sServer->clock, address, port, followup, max_freq_error_ppm); 82 | } 83 | else{ 84 | sServer->gstdvbcsswcserver = gst_net_time_provider_new(sServer->clock, address, port); 85 | } 86 | 87 | if (sServer->gstdvbcsswcserver == NULL) { 88 | GST_ERROR("Dvb_css_wc server not created\n"); 89 | goto cleanup; 90 | } 91 | 92 | g_object_get(sServer->gstdvbcsswcserver, "port", &port, NULL); 93 | GST_DEBUG("Published network clock on port %u\n", port); 94 | 95 | sServer->thread = g_thread_try_new("dvb_css_wc_thread", (GThreadFunc) g_main_loop_run, sServer->loop, NULL); 96 | if (sServer->thread == NULL) { 97 | GST_ERROR("Thread for dvb_css_wc server not created\n"); 98 | goto cleanup; 99 | } 100 | 101 | GST_DEBUG("Dvb_css_wc server started\n"); 102 | G_UNLOCK(mutex); 103 | return sServer; 104 | 105 | /* ERRORS */ 106 | server_struct_not_initialized:{ 107 | GST_ERROR("Dvb_css_wc server struct not initialized\n"); 108 | G_UNLOCK(mutex); 109 | return NULL; 110 | } 111 | cleanup:{ 112 | server_free(&sServer); 113 | G_UNLOCK(mutex); 114 | return NULL; 115 | } 116 | } 117 | 118 | extern EXPORT_API void gst_dvb_css_wc_stop(DVBCSSWCserver* sServer) { 119 | GST_TRACE("dvb_css_wc_stop\n"); 120 | G_LOCK(mutex); 121 | if (sServer == NULL) { 122 | G_UNLOCK(mutex); 123 | return; 124 | } 125 | GST_TRACE("Stopping dvb_css_wc server\n"); 126 | if (sServer->loop != NULL) { 127 | g_main_loop_quit(sServer->loop); 128 | g_thread_join(sServer->thread); 129 | sServer->thread = NULL; 130 | sServer->loop = NULL; 131 | } 132 | server_free(&sServer); 133 | GST_DEBUG("Dvb_css_wc server stopped\n"); 134 | G_UNLOCK(mutex); 135 | } 136 | 137 | extern EXPORT_API GstClockTime gst_dvb_css_wc_get_time(DVBCSSWCserver* sServer) { 138 | GstClockTime time; 139 | G_LOCK(mutex); 140 | if (sServer != NULL && sServer->clock != NULL) { 141 | time = gst_clock_get_time(sServer->clock); 142 | G_UNLOCK(mutex); 143 | return time; 144 | } 145 | G_UNLOCK(mutex); 146 | return 0; 147 | } 148 | -------------------------------------------------------------------------------- /Plugin/DvbCssWc/Source/export/server-export.h: -------------------------------------------------------------------------------- 1 | /* GStreamer 2 | * Copyright (C) 2016 Tomasz Merda 3 | * Copyright (C) 2016 Wojciech Kapsa 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Library General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2 of the License, or (at your option) any later version. 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 | * Library General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Library General Public 16 | * License along with this library; if not, write to the 17 | * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 18 | * Boston, MA 02110-1301, USA. 19 | */ 20 | 21 | #ifndef __DVB_CSS_WC_SERVER_EXPORT_H__ 22 | #define __DVB_CSS_WC_SERVER_EXPORT_H__ 23 | #include 24 | 25 | #ifdef _WIN32 26 | #define EXPORT_API __declspec(dllexport) 27 | #else 28 | #define EXPORT_API 29 | #endif 30 | 31 | typedef struct _DVBCSSWCserver DVBCSSWCserver; 32 | /** 33 | * gst_dvb_css_wc_start: 34 | * @address: (allow-none): an address to bind on as a dotted quad 35 | * (xxx.xxx.xxx.xxx), IPv6 address, or NULL to bind to all addresses 36 | * @port: a port to bind on, or 0 to let the kernel choose 37 | * @max_freq_error_ppm The clock maximum frequency error in parts-per-million 38 | * @followup Set to True if the Wall Clock Server should send follow-up responses 39 | * 40 | * Creates and starts DVC CSS WC clock 41 | * 42 | */ 43 | extern EXPORT_API DVBCSSWCserver* gst_dvb_css_wc_start(const gchar *address, gint port, gboolean followup, guint32 max_freq_error_ppm, gboolean isDebug); 44 | 45 | /** 46 | * gst_dvb_css_wc_stop: 47 | * Stops DVC CSS WC clock 48 | */ 49 | extern EXPORT_API void gst_dvb_css_wc_stop(DVBCSSWCserver*); 50 | 51 | /** 52 | * gst_dvb_css_wc_get_time: 53 | * Get current DVC CSS WC clock time 54 | * Returns: 0 on error or GstClockTime 55 | */ 56 | extern EXPORT_API GstClockTime gst_dvb_css_wc_get_time(DVBCSSWCserver*); 57 | 58 | #endif /* __DVB_CSS_WC_SERVER_EXPORT_H__ */ 59 | -------------------------------------------------------------------------------- /Plugin/DvbCssWc/Source/gstdvbcsswcclient.h: -------------------------------------------------------------------------------- 1 | #ifndef __DVB_CSS_WC_CLIENT_H__ 2 | #define __DVB_CSS_WC_CLIENT_H__ 3 | 4 | /* GStreamer 5 | * Copyright (C) 2016 6 | * Authors: Wojciech Kapsa PSNC 7 | * Authors: Xavi Artigas 8 | * Authors: Daniel Piesik 9 | * 10 | * gstdvbcsswcclient.h: clock that synchronizes itself to a time over 11 | * the network using DVB CSS WC 12 | * 13 | * This library is free software; you can redistribute it and/or 14 | * modify it under the terms of the GNU Library General Public 15 | * License as published by the Free Software Foundation; either 16 | * version 2 of the License, or (at your option) any later version. 17 | * 18 | * This library is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 21 | * Library General Public License for more details. 22 | * 23 | * You should have received a copy of the GNU Library General Public 24 | * License along with this library; if not, write to the 25 | * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 26 | * Boston, MA 02110-1301, USA. 27 | */ 28 | 29 | #include 30 | #include 31 | 32 | G_BEGIN_DECLS 33 | 34 | #define GST_TYPE_DVB_CSS_WC_CLIENT_CLOCK (gst_dvb_css_wc_client_clock_get_type()) 35 | #define GST_DVB_CSS_WC_CLIENT_CLOCK(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GST_TYPE_DVB_CSS_WC_CLIENT_CLOCK, GstDvbCssWcClientClock)) 36 | #define GST_DVB_CSS_WC_CLIENT_CLOCK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GST_TYPE_DVB_CSS_WC_CLIENT_CLOCK, GstDvbCssWcClientClockClass)) 37 | #define GST_IS_DVB_CSS_WC_CLIENT_CLOCK(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GST_TYPE_DVB_CSS_WC_CLIENT_CLOCK)) 38 | #define GST_IS_DVB_CSS_WC_CLIENT_CLOCK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), GST_TYPE_DVB_CSS_WC_CLIENT_CLOCK)) 39 | 40 | typedef struct _GstDvbCssWcClientClock GstDvbCssWcClientClock; 41 | typedef struct _GstDvbCssWcClientClockClass GstDvbCssWcClientClockClass; 42 | typedef struct _GstDvbCssWcClientClockPrivate GstDvbCssWcClientClockPrivate; 43 | 44 | /** 45 | * GstDvbCssWcClient: 46 | * 47 | * Opaque #GstDvbCssWcClient structure. 48 | */ 49 | struct _GstDvbCssWcClientClock 50 | { 51 | GstSystemClock clock; 52 | 53 | /*< private >*/ 54 | GstDvbCssWcClientClockPrivate *priv; 55 | gpointer _gst_reserved[GST_PADDING]; 56 | }; 57 | 58 | struct _GstDvbCssWcClientClockClass 59 | { 60 | GstSystemClockClass parent_class; 61 | 62 | /*< private >*/ 63 | gpointer _gst_reserved[GST_PADDING]; 64 | }; 65 | 66 | /** 67 | * gst_dvb_css_wc_client_clock_new: 68 | * @name: a name for the clock 69 | * @remote_address: the address or hostname of the remote clock provider 70 | * @remote_port: the port of the remote clock provider 71 | * @base_time: initial time of the clock 72 | * 73 | * Create a new #GstClock that will report the time 74 | * provided by the #GstDvbCssWcServer on @remote_address and 75 | * @remote_port. 76 | * 77 | * Returns: a new #GstClock that receives a time from the remote 78 | * clock. 79 | */ 80 | GstClock* gst_dvb_css_wc_client_clock_new (const gchar *name, const gchar *remote_address, gint remote_port, GstClockTime base_time); 81 | GType gst_dvb_css_wc_client_clock_get_type (void); 82 | 83 | #ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC 84 | G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstDvbCssWcClientClock, gst_object_unref) 85 | #endif 86 | 87 | G_END_DECLS 88 | 89 | #endif /* __DVB_CSS_WC_CLIENT_H__ */ 90 | -------------------------------------------------------------------------------- /Plugin/DvbCssWc/Source/gstdvbcsswccommon.h: -------------------------------------------------------------------------------- 1 | #ifndef __DVB_CSS_WC_COMMON_H__ 2 | #define __DVB_CSS_WC_COMMON_H__ 3 | 4 | #include 5 | 6 | #define PRECISION_MEASUR_NUMBER 100 7 | 8 | static gdouble measure_precision_sec (GstClock *clock); 9 | 10 | //============================================================================== 11 | //============================================================================== 12 | 13 | static gdouble 14 | measure_precision_sec (GstClock *clock) 15 | { 16 | if(clock == NULL) 17 | { 18 | return 0; 19 | } 20 | 21 | GstClockTimeDiff diff_max = 0; 22 | 23 | int i; 24 | for(i = 0; i < PRECISION_MEASUR_NUMBER; ++i) 25 | { 26 | GstClockTime measurement_1 = gst_clock_get_internal_time (clock); 27 | GstClockTime measurement_2 = gst_clock_get_internal_time (clock); 28 | GstClockTimeDiff diff = measurement_2 - measurement_1; 29 | if(diff > diff_max) 30 | { 31 | diff_max = diff; 32 | } 33 | } 34 | gdouble precision_sec = GST_TIME_AS_SECONDS( gst_guint64_to_gdouble(diff_max)); 35 | return precision_sec; 36 | } 37 | 38 | #endif /* __DVB_CSS_WC_COMMON_H__ */ 39 | -------------------------------------------------------------------------------- /Plugin/DvbCssWc/Source/gstdvbcsswcpacket.h: -------------------------------------------------------------------------------- 1 | /* GStreamer 2 | * Copyright (C) 2016 Wojciech Kapsa 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Library General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Library General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Library General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | 21 | #ifndef __GST_DVB_CSS_WC_PACKET_H__ 22 | #define __GST_DVB_CSS_WC_PACKET_H__ 23 | 24 | #include 25 | #include 26 | 27 | G_BEGIN_DECLS 28 | 29 | /** 30 | * GST_DVB_CSS_WC_PACKET_SIZE: 31 | * 32 | * The size of the packets sent between DVB-CSS-WC clocks. 33 | */ 34 | #define GST_DVB_CSS_WC_PACKET_SIZE 32 35 | #define GST_DVB_CSS_WC_VERSION 0 36 | 37 | #define GST_DVB_CSS_WC_TYPE_PACKET gst_dvb_css_wc_packet_get_type () 38 | typedef struct _GstDvbCssWcPacket GstDvbCssWcPacket; 39 | 40 | enum { 41 | GST_DVB_CSS_WC_MSG_REQUEST = 0, 42 | GST_DVB_CSS_WC_MSG_RESPONSE = 1, 43 | GST_DVB_CSS_WC_MSG_RESPONSE_WITH_FOLLOWUP = 2, 44 | GST_DVB_CSS_WC_MSG_FOLLOWUP = 3 45 | }; 46 | 47 | /** 48 | * GstDvbCssWcPacket 49 | */ 50 | struct _GstDvbCssWcPacket { 51 | guint8 version; 52 | guint8 message_type; 53 | gint8 precision; 54 | gint8 reserved; 55 | guint32 max_freq_error; 56 | 57 | guint32 originate_timevalue_secs; 58 | guint32 originate_timevalue_nanos; 59 | GstClockTime receive_timevalue; 60 | GstClockTime transmit_timevalue; 61 | 62 | // this is not part of packet to send 63 | GstClockTime response_timevalue; 64 | }; 65 | 66 | GType gst_dvb_css_wc_packet_get_type(void); 67 | 68 | GstDvbCssWcPacket* gst_dvb_css_wc_packet_new(const guint8 *buffer); 69 | GstDvbCssWcPacket* gst_dvb_css_wc_packet_copy(const GstDvbCssWcPacket *packet); 70 | void gst_dvb_css_wc_packet_free(GstDvbCssWcPacket *packet); 71 | 72 | guint8* gst_dvb_css_wc_packet_serialize(const GstDvbCssWcPacket *packet); 73 | 74 | GstDvbCssWcPacket* gst_dvb_css_wc_packet_receive(GSocket * socket, 75 | GSocketAddress ** src_address, 76 | GError ** error); 77 | 78 | gboolean gst_dvb_css_wc_packet_send(const GstDvbCssWcPacket * packet, 79 | GSocket * socket, 80 | GSocketAddress * dest_address, 81 | GError ** error); 82 | 83 | gint8 gst_dvb_css_wc_packet_encode_precision(gdouble precisionSecs); 84 | gdouble gst_dvb_css_wc_packet_decode_precision(gint8 precision); 85 | guint32 gst_dvb_css_wc_packet_encode_max_freq_error(gdouble max_freq_error_ppm); 86 | gdouble gst_dvb_css_wc_packet_decode_max_freq_error(guint32 max_freq_error); 87 | 88 | GstClockTime wc_timestamp_to_gst_clock_time (guint32 seconds, guint32 fraction); 89 | guint32 gst_clock_time_to_wc_timestamp_seconds (GstClockTime gst); 90 | guint32 gst_clock_time_to_wc_timestamp_fraction (GstClockTime gst); 91 | 92 | #ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC 93 | G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstDvbCssWcPacket, gst_dvb_css_wc_packet_free) 94 | #endif 95 | 96 | G_END_DECLS 97 | 98 | #endif /* __GST_DVB_CSS_WC_PACKET_H__ */ 99 | -------------------------------------------------------------------------------- /Plugin/DvbCssWc/Source/gstdvbcsswcserver.h: -------------------------------------------------------------------------------- 1 | /* GStreamer 2 | * Copyright (C) 2016 Wojciech Kapsa 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Library General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Library General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Library General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | 21 | #ifndef __GST_DVB_CSS_WC_SERVER_H__ 22 | #define __GST_DVB_CSS_WC_SERVER_H__ 23 | 24 | #include 25 | 26 | G_BEGIN_DECLS 27 | 28 | #define GST_TYPE_DVB_CSS_WC_SERVER \ 29 | (gst_dvb_css_wc_server_get_type()) 30 | #define GST_DVB_CSS_WC_SERVER(obj) \ 31 | (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_DVB_CSS_WC_SERVER,GstDvbCssWcServer)) 32 | #define GST_DVB_CSS_WC_SERVER_CLASS(klass) \ 33 | (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_DVB_CSS_WC_SERVER,GstDvbCssWcServerClass)) 34 | #define GST_IS_DVB_CSS_WC_SERVER(obj) \ 35 | (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_DVB_CSS_WC_SERVER)) 36 | #define GST_IS_DVB_CSS_WC_SERVER_CLASS(klass) \ 37 | (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_DVB_CSS_WC_SERVER)) 38 | 39 | typedef struct _GstDvbCssWcServer GstDvbCssWcServer; 40 | typedef struct _GstDvbCssWcServerClass GstDvbCssWcServerClass; 41 | typedef struct _GstDvbCssWcServerPrivate GstDvbCssWcServerPrivate; 42 | 43 | /** 44 | * GstDvbCssWcServer: 45 | * 46 | * Opaque #GstDvbCssWcServer structure. 47 | */ 48 | struct _GstDvbCssWcServer { 49 | GstObject parent; 50 | 51 | /*< private >*/ 52 | GstDvbCssWcServerPrivate *priv; 53 | 54 | gpointer _gst_reserved[GST_PADDING]; 55 | }; 56 | 57 | struct _GstDvbCssWcServerClass { 58 | GstObjectClass parent_class; 59 | 60 | gpointer _gst_reserved[GST_PADDING]; 61 | }; 62 | 63 | GType gst_dvb_css_wc_server_get_type (void); 64 | 65 | /** 66 | * gst_dvb_css_wc_server_new: 67 | * @clock: a #GstClock to export over the network 68 | * @address: (allow-none): an address to bind on as a dotted quad 69 | * (xxx.xxx.xxx.xxx), IPv6 address, or NULL to bind to all addresses 70 | * @port: a port to bind on, or 0 to let the kernel choose 71 | * 72 | * Allows network clients to get the current time of @clock. 73 | * 74 | * Returns: the new #GstDvbCssWcServer, or NULL on error 75 | */ 76 | GstDvbCssWcServer* gst_dvb_css_wc_server_new (GstClock *clock, 77 | const gchar *address, 78 | gint port, 79 | gboolean followup, 80 | guint32 max_freq_error_ppm); 81 | 82 | #ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC 83 | G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstDvbCssWcServer, gst_object_unref) 84 | #endif 85 | 86 | G_END_DECLS 87 | 88 | 89 | #endif /* __GST_DVB_CSS_WC_SERVER_H__ */ 90 | -------------------------------------------------------------------------------- /Plugin/DvbCssWc/Source/tests/dvbcsswc-sync.c: -------------------------------------------------------------------------------- 1 | // #include 2 | // #include 3 | // #include 4 | // #include 5 | 6 | #include 7 | #include 8 | 9 | static const char* SERVER_ADDRESS = "192.168.53.190"; 10 | static const int SERVER_GSTNET_PORT = 5001; 11 | static const int SERVER_GSTDVBCSSWC_PORT = 5000; 12 | static const int MAX_SYNC_WAIT_TIME_SEC = 5; 13 | 14 | static gboolean synchronization(GstClock *inClock); 15 | 16 | int main (int argc, char *argv[]) 17 | { 18 | gst_init(&argc, &argv); 19 | 20 | GstClock *net_clock = gst_net_client_clock_new ("net_clock", (gchar*)SERVER_ADDRESS, SERVER_GSTNET_PORT, 0); 21 | GstClock *dvb_clock = gst_dvb_css_wc_client_clock_new("dvb_clock", (gchar*)SERVER_ADDRESS, SERVER_GSTDVBCSSWC_PORT, 0); 22 | 23 | synchronization(net_clock); 24 | synchronization(dvb_clock); 25 | 26 | unsigned int counter = 0; 27 | while(TRUE) 28 | { 29 | GstClockTime net_time = gst_clock_get_time(net_clock); 30 | GstClockTime dvb_time = gst_clock_get_time(dvb_clock); 31 | 32 | gboolean net_is_synced = gst_clock_is_synced(net_clock); 33 | gboolean dvb_is_synced = gst_clock_is_synced(dvb_clock); 34 | 35 | g_print("%03d: \tnet = %015" G_GUINT64_FORMAT " (%d) \tdvb = %015" G_GUINT64_FORMAT " (%d) \n" 36 | , counter, net_time, net_is_synced, dvb_time, dvb_is_synced 37 | ); 38 | 39 | ++counter; 40 | g_usleep(G_USEC_PER_SEC); 41 | } 42 | 43 | gst_object_unref(net_clock); 44 | gst_object_unref(dvb_clock); 45 | 46 | return 0; 47 | } 48 | 49 | 50 | static gboolean synchronization(GstClock *inClock) 51 | { 52 | gst_clock_wait_for_sync(inClock, MAX_SYNC_WAIT_TIME_SEC * GST_SECOND); 53 | gboolean synced = gst_clock_is_synced(inClock); 54 | if(synced == FALSE) 55 | { 56 | g_print("Could not synced clock\n"); 57 | } 58 | return synced; 59 | } 60 | -------------------------------------------------------------------------------- /Plugin/DvbCssWc/Source/tests/export-client.c: -------------------------------------------------------------------------------- 1 | #include "../export/client-export.h" 2 | 3 | int main(int argc, char *argv[]) 4 | { 5 | GstClock* dvb_client = gst_dvb_css_wc_client_start("dvbClient", "192.168.53.190", 5000, 0); 6 | 7 | int counter = 0; 8 | while(counter < 10) 9 | { 10 | GstClockTime time = gst_dvb_css_wc_client_get_time(dvb_client); 11 | gboolean is_synced = gst_dvb_css_wc_client_is_synced(dvb_client); 12 | g_print("%03d: time = %015" G_GUINT64_FORMAT " \tis_synced = %d \n", counter, time, is_synced); 13 | g_usleep(G_USEC_PER_SEC); 14 | ++counter; 15 | } 16 | 17 | gst_dvb_css_wc_client_stop(dvb_client); 18 | 19 | return 0; 20 | } 21 | -------------------------------------------------------------------------------- /Plugin/DvbCssWc/Source/tests/gstdvbcsswcserver.c: -------------------------------------------------------------------------------- 1 | /* GStreamer 2 | * Copyright (C) 2005 Andy Wingo 3 | * 4 | * gstnettimeprovider.c: Unit test for the network time provider 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Library General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Library General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Library General Public 17 | * License along with this library; if not, write to the 18 | * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 19 | * Boston, MA 02110-1301, USA. 20 | */ 21 | 22 | #include 23 | #include 24 | 25 | #include 26 | #include 27 | 28 | //#include "gstdvbcsswcserver.h" 29 | 30 | GST_START_TEST (test_refcounts) 31 | { 32 | GstDvbCssWcServer *wc; 33 | GstClock *clock; 34 | 35 | clock = gst_system_clock_obtain (); 36 | fail_unless (clock != NULL, "failed to get system clock"); 37 | 38 | /* one for gstreamer, one for us */ 39 | ASSERT_OBJECT_REFCOUNT (clock, "system clock", 2); 40 | 41 | wc = gst_dvb_css_wc_server_new (clock, "127.0.0.1", 37034, FALSE, 500); 42 | fail_unless (wc != NULL, "failed to create dvb css wc server"); 43 | 44 | /* one for ntp, one for gstreamer, one for us */ 45 | ASSERT_OBJECT_REFCOUNT (clock, "system clock", 3); 46 | /* one for us */ 47 | ASSERT_OBJECT_REFCOUNT (wc, "dvb css wc server", 1); 48 | 49 | gst_object_unref (wc); 50 | ASSERT_OBJECT_REFCOUNT (clock, "dvb css wc server", 2); 51 | 52 | gst_object_unref (clock); 53 | } 54 | 55 | GST_END_TEST; 56 | 57 | GST_START_TEST (test_packet) 58 | { 59 | GstDvbCssWcPacket *packet; 60 | guint8* buf; 61 | 62 | packet = gst_dvb_css_wc_packet_new (NULL); 63 | fail_unless (packet != NULL, "failed to create packet"); 64 | 65 | packet->message_type = 1; 66 | packet->precision = 2; 67 | packet->max_freq_error = 3; 68 | packet->originate_timevalue_secs = 4; 69 | packet->originate_timevalue_nanos = 5; 70 | packet->receive_timevalue = 320000000009; 71 | packet->transmit_timevalue = 7; 72 | gst_dvb_css_wc_packet_print(packet); 73 | buf = gst_dvb_css_wc_packet_serialize(packet); 74 | g_free (packet); 75 | 76 | packet = gst_dvb_css_wc_packet_new (buf); 77 | gst_dvb_css_wc_packet_print(packet); 78 | fail_unless (packet != NULL, "failed to create packet"); 79 | 80 | fail_unless(packet->message_type == 1, "Wrong type"); 81 | fail_unless(packet->precision == 2, "Wrong precision"); 82 | fail_unless(packet->max_freq_error == 3, "Wrong max_freq_error"); 83 | fail_unless(packet->originate_timevalue_secs == 4, "Wrong originate_timevalue_secs"); 84 | fail_unless(packet->originate_timevalue_nanos == 5, "Wrong originate_timevalue_nanos"); 85 | fail_unless(packet->receive_timevalue == 320000000009, "Wrong receive_timevalue"); 86 | fail_unless(packet->transmit_timevalue == 7, "Wrong transmit_timevalue"); 87 | g_free (packet); 88 | 89 | fail_unless(gst_dvb_css_wc_packet_encode_precision(pow(2, -128)) == -128, "encode precision failed"); 90 | fail_unless(gst_dvb_css_wc_packet_encode_precision(pow(2, 127)) == 127, "encode precision failed"); 91 | fail_unless(gst_dvb_css_wc_packet_encode_precision(0.00001) == -16, "encode precision failed"); 92 | fail_unless(gst_dvb_css_wc_packet_encode_precision(0.0007) == -10, "encode precision failed"); 93 | fail_unless(gst_dvb_css_wc_packet_encode_precision(0.001) == -9, "encode precision failed"); 94 | 95 | fail_unless(gst_dvb_css_wc_packet_decode_precision(-128) == pow(2, -128), "decode precision failed"); 96 | fail_unless(gst_dvb_css_wc_packet_decode_precision(127) == pow(2, 127), "decode precision failed"); 97 | fail_unless(gst_dvb_css_wc_packet_decode_precision(-16) == pow(2, -16), "decode precision failed"); 98 | fail_unless(gst_dvb_css_wc_packet_decode_precision(-10) == pow(2, -10), "decode precision failed"); 99 | fail_unless(gst_dvb_css_wc_packet_decode_precision(-9) == pow(2, -9), "decode precision failed"); 100 | 101 | fail_unless(gst_dvb_css_wc_packet_encode_max_freq_error(50) == 12800, "encode mfe failed"); 102 | fail_unless(gst_dvb_css_wc_packet_encode_max_freq_error(1900) == 486400, "encode mfe failed"); 103 | fail_unless(gst_dvb_css_wc_packet_encode_max_freq_error(0.01) == 3, "encode mfe failed"); 104 | fail_unless(gst_dvb_css_wc_packet_encode_max_freq_error(28) == 7168, "encode mfe failed"); 105 | fail_unless(gst_dvb_css_wc_packet_encode_max_freq_error(100000) == 25600000, "encode mfe failed"); 106 | fail_unless(gst_dvb_css_wc_packet_encode_max_freq_error(0) == 0, "encode mfe failed"); 107 | 108 | fail_unless(gst_dvb_css_wc_packet_decode_max_freq_error(12800) == 50, "decode mfe failed"); 109 | fail_unless(gst_dvb_css_wc_packet_decode_max_freq_error(486400) == 1900, "decode mfe failed"); 110 | fail_unless(gst_dvb_css_wc_packet_decode_max_freq_error(3) == 0.01171875, "decode mfe failed"); 111 | fail_unless(gst_dvb_css_wc_packet_decode_max_freq_error(7168) == 28, "decode mfe failed"); 112 | fail_unless(gst_dvb_css_wc_packet_decode_max_freq_error(25600000) == 100000, "decode mfe failed"); 113 | fail_unless(gst_dvb_css_wc_packet_decode_max_freq_error(0) == 0, "decode mfe failed"); 114 | 115 | 116 | } 117 | 118 | GST_END_TEST 119 | 120 | GST_START_TEST (test_functioning) 121 | { 122 | GstDvbCssWcServer *wc; 123 | GstDvbCssWcPacket *packet; 124 | GstClock *clock; 125 | guint32 local_secs, local_nanos; 126 | GSocketAddress *server_addr; 127 | GInetAddress *addr; 128 | GSocket *socket; 129 | gint port = -1; 130 | GstClockTime prev_receive_timevalue, prev_transmit_timevalue; 131 | 132 | clock = gst_system_clock_obtain (); 133 | fail_unless (clock != NULL, "failed to get system clock"); 134 | wc = gst_dvb_css_wc_server_new (clock, "127.0.0.1", 37034, TRUE, 500); 135 | fail_unless (wc != NULL, "failed to create dvb css wc server"); 136 | 137 | g_object_get (wc, "port", &port, NULL); 138 | fail_unless (port > 0); 139 | 140 | socket = g_socket_new (G_SOCKET_FAMILY_IPV4, G_SOCKET_TYPE_DATAGRAM, 141 | G_SOCKET_PROTOCOL_UDP, NULL); 142 | fail_unless (socket != NULL, "could not create socket"); 143 | 144 | addr = g_inet_address_new_from_string ("127.0.0.1"); 145 | server_addr = g_inet_socket_address_new (addr, port); 146 | g_object_unref (addr); 147 | 148 | packet = gst_dvb_css_wc_packet_new (NULL); 149 | fail_unless (packet != NULL, "failed to create packet"); 150 | 151 | packet->message_type = GST_DVB_CSS_WC_MSG_REQUEST; 152 | packet->originate_timevalue_secs = local_secs = 123; 153 | packet->originate_timevalue_nanos = local_nanos = 456; 154 | 155 | fail_unless (gst_dvb_css_wc_packet_send (packet, socket, server_addr, NULL)); 156 | 157 | g_free (packet); 158 | 159 | packet = gst_dvb_css_wc_packet_receive (socket, NULL, NULL); 160 | fail_unless (packet != NULL, "failed to receive packet"); 161 | fail_unless (packet->message_type == GST_DVB_CSS_WC_MSG_RESPONSE_WITH_FOLLOWUP, "wrong msg type"); 162 | fail_unless (packet->originate_timevalue_secs == local_secs, "originate_timevalue_secs is not the same"); 163 | fail_unless (packet->originate_timevalue_nanos == local_nanos, "originate_timevalue_nanos is not the same"); 164 | fail_unless (packet->receive_timevalue < packet->transmit_timevalue, "remote time not after local time"); 165 | fail_unless (packet->transmit_timevalue < gst_clock_get_time (clock), "remote time in the future"); 166 | 167 | prev_receive_timevalue = packet->receive_timevalue; 168 | prev_transmit_timevalue = packet->transmit_timevalue; 169 | 170 | g_free (packet); 171 | 172 | packet = gst_dvb_css_wc_packet_receive (socket, NULL, NULL); 173 | fail_unless (packet != NULL, "failed to receive packet"); 174 | fail_unless (packet->message_type == GST_DVB_CSS_WC_MSG_FOLLOWUP, "wrong msg type"); 175 | fail_unless (packet->originate_timevalue_secs == local_secs, "originate_timevalue_secs is not the same"); 176 | fail_unless (packet->originate_timevalue_nanos == local_nanos, "originate_timevalue_nanos is not the same"); 177 | fail_unless (packet->receive_timevalue < packet->transmit_timevalue, "remote time not after local time"); 178 | fail_unless (packet->transmit_timevalue < gst_clock_get_time (clock), "remote time in the future"); 179 | 180 | fail_unless (prev_receive_timevalue == packet->receive_timevalue, "remote time not after local time"); 181 | fail_unless (prev_transmit_timevalue < packet->transmit_timevalue, "remote time not after local time"); 182 | 183 | g_free (packet); 184 | 185 | 186 | 187 | packet = gst_dvb_css_wc_packet_new (NULL); 188 | fail_unless (packet != NULL, "failed to create packet"); 189 | packet->message_type = GST_DVB_CSS_WC_MSG_REQUEST; 190 | fail_unless (gst_dvb_css_wc_packet_send (packet, socket, server_addr, NULL)); 191 | g_free (packet); 192 | 193 | packet = gst_dvb_css_wc_packet_new (NULL); 194 | fail_unless (packet != NULL, "failed to create packet"); 195 | packet->message_type = GST_DVB_CSS_WC_MSG_RESPONSE; //wrong msg ignored by server 196 | fail_unless (gst_dvb_css_wc_packet_send (packet, socket, server_addr, NULL)); 197 | g_free (packet); 198 | 199 | packet = gst_dvb_css_wc_packet_receive (socket, NULL, NULL); 200 | fail_unless (packet != NULL, "failed to receive packet"); 201 | fail_unless (packet->message_type == GST_DVB_CSS_WC_MSG_RESPONSE_WITH_FOLLOWUP, "wrong msg type"); 202 | g_free (packet); 203 | 204 | g_object_unref (socket); 205 | g_object_unref (server_addr); 206 | 207 | gst_object_unref (wc); 208 | gst_object_unref (clock); 209 | } 210 | 211 | GST_END_TEST; 212 | 213 | static Suite * 214 | gst_net_time_provider_suite (void) 215 | { 216 | Suite *s = suite_create ("GstNetTimeProvider"); 217 | TCase *tc_chain = tcase_create ("generic tests"); 218 | 219 | suite_add_tcase (s, tc_chain); 220 | tcase_add_test (tc_chain, test_refcounts); 221 | tcase_add_test (tc_chain, test_packet); 222 | tcase_add_test (tc_chain, test_functioning); 223 | 224 | return s; 225 | } 226 | 227 | GST_CHECK_MAIN (gst_net_time_provider); 228 | -------------------------------------------------------------------------------- /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/GUB/.gitignore: -------------------------------------------------------------------------------- 1 | #gub .gitignore 2 | 3 | Build/Release/android_arm 4 | Build/Release/x86 5 | Build/Release/x86_64 6 | 7 | Build/Debug/android_arm 8 | Build/Debug/x86 9 | Build/Debug/x86_64 10 | 11 | Project/obj/ 12 | Project/*.exe 13 | Project/*.mdb 14 | Project/*.pc 15 | Project/*.pidb 16 | Project/*.userprefs 17 | Project/*.usertasks 18 | Project/.DS_Store 19 | Project/bin/ 20 | -------------------------------------------------------------------------------- /Plugin/GUB/Project/Android/.env: -------------------------------------------------------------------------------- 1 | COMPOSE_CONVERT_WINDOWS_PATHS=0 -------------------------------------------------------------------------------- /Plugin/GUB/Project/Android/GUB/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /Plugin/GUB/Project/Android/GUB/jni/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | include $(CLEAR_VARS) 3 | 4 | IMMERSIATV_PLAYER_ROOT := $(abspath $(LOCAL_PATH)/../../../../../..) 5 | GUB_SOURCE_PATH := $(IMMERSIATV_PLAYER_ROOT)/Plugin/GUB/Source 6 | DVB_CSS_WC_HEADERS_PATH := $(IMMERSIATV_PLAYER_ROOT)/Plugin/DvbCssWc/Source 7 | DVB_CSS_WC_PROJECT_PATH := $(IMMERSIATV_PLAYER_ROOT)/Plugin/DvbCssWc/Project/Android 8 | 9 | LOCAL_MODULE := GstUnityBridge 10 | LOCAL_C_INCLUDES := $(DVB_CSS_WC_HEADERS_PATH) 11 | LOCAL_SRC_FILES := $(GUB_SOURCE_PATH)/gub_graphics.c \ 12 | $(GUB_SOURCE_PATH)/gub_gstreamer.c \ 13 | $(GUB_SOURCE_PATH)/gub_pipeline.c \ 14 | $(GUB_SOURCE_PATH)/gub_log.c 15 | LOCAL_SHARED_LIBRARIES := gstreamer_android DvbCssWc 16 | LOCAL_LDLIBS := -llog -lGLESv2 17 | include $(BUILD_SHARED_LIBRARY) 18 | 19 | include $(CLEAR_VARS) 20 | include $(DVB_CSS_WC_PROJECT_PATH)/jni/Android.mk 21 | -------------------------------------------------------------------------------- /Plugin/GUB/Project/Android/Readme.md: -------------------------------------------------------------------------------- 1 | # **Android GUB Dockerfile** 2 | 3 | Dockerfile for building GUB under Android 4 | 5 | 6 | ## **Linux** 7 | 8 | The instruction is prepare for Ubuntu distribution and it was tested on Ubuntu 16.04. 9 | 10 | ### Prerequisites 11 | 12 | You need to install [Docker](https://www.docker.com/) and [Docker Compose](https://docs.docker.com/compose/). To do it, you can: 13 | 14 | * follow the instruction [here](https://docs.docker.com/compose/install), **or** 15 | * run script below (up to date on 19.12.2016). 16 | 17 | ``` 18 | ./docker/install.sh 19 | ``` 20 | 21 | 22 | ### Prebuild 23 | 24 | Create new Docker image: 25 | 26 | ``` 27 | docker-compose -f docker/docker-compose.yml build 28 | ``` 29 | 30 | 31 | ### Build 32 | 33 | Compile GUB for Android: 34 | 35 | ``` 36 | ./build.sh 37 | ``` 38 | 39 | 40 | ### Settings 41 | 42 | In ``docker/docker-compose.yml`` is configuration for building and running docker image. 43 | If you don't want to use default settings, you can modify this file. 44 | 45 | ---------- 46 | 47 | ## **Windows 10** *(Docker)* 48 | 49 | This part is only for **Windows 10 Professional or Enterprise 64-bit**. If you have other Windows system, or you use *Doocker Toolbox*, please go to [Other Windows](#other-windows-docker-toolbox) section. 50 | 51 | 52 | ### Prerequisites 53 | 54 | You need to install [Docker](https://www.docker.com/) and [Docker Compose](https://docs.docker.com/compose/). To do it, you can: 55 | 56 | * download and install [this](https://download.docker.com/win/stable/InstallDocker.msi) 57 | 58 | 59 | ### Prebuild 60 | 61 | Create new Docker image: 62 | 63 | ``` 64 | docker-compose -f docker/docker-compose.yml build 65 | ``` 66 | 67 | 68 | ### Build 69 | 70 | Compile GUB for Android: 71 | 72 | ``` 73 | docker-compose -f docker/docker-compose.yml run gub-android 74 | ``` 75 | 76 | 77 | ### Settings 78 | 79 | In ``docker/docker-compose.yml`` is configuration for building and running docker image. 80 | If you don't want to use default settings, you can modify this file. 81 | 82 | ---------- 83 | 84 | ## **Other Windows** *(Docker Toolbox)* 85 | 86 | 87 | ### Prerequisites 88 | 89 | You need to install [Docker Toolbox](www.docker.com/products/docker-toolbox) and [Docker Compose](https://docs.docker.com/compose/). To do it, you can: 90 | 91 | * download and install [this](https://download.docker.com/win/stable/DockerToolbox.exe) 92 | 93 | 94 | ### Prebuild 95 | 96 | Configure *Docker Toolbox* and *VirtualBox*: 97 | 98 | 1. Run *Docker Toolbox* and wait to end of processing 99 | 2. Run *VirtualBox* 100 | 3. Stop the image named *default*. Close -> Power off 101 | 4. On image named *default* go to Settings -> Shared Folders 102 | 5. Add your gst-unity-bridge repository folder as shared folder: 103 | ***Folder Path*** - path to your gst-unity-bridge repository 104 | ***Folder Name*** = gst-unity-bridge 105 | ***Auto-mount*** - checked 106 | 6. Reopen *Docker Toolbox* and navigate to this *Readme* location 107 | 108 | Create new Docker image: 109 | 110 | ``` 111 | docker-compose -f docker/docker-compose-toolbox.yml build 112 | ``` 113 | 114 | 115 | ### Build 116 | 117 | Compile GUB for Android: 118 | 119 | ``` 120 | docker-compose -f docker/docker-compose-toolbox.yml run gub-android 121 | ``` 122 | 123 | 124 | ### Settings 125 | 126 | In ``docker/docker-compose-toolbox.yml`` is configuration for building and running docker image. 127 | If you don't want to use default settings, you can modify this file. 128 | 129 | ---------- 130 | 131 | ## Clear 132 | 133 | To remove all containers and images: 134 | 135 | ``` 136 | docker rm $(docker ps -a -q) 137 | docker rmi $(docker images -q) 138 | ``` -------------------------------------------------------------------------------- /Plugin/GUB/Project/Android/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | cd $(dirname $(realpath $0)) 4 | sudo docker-compose -f docker/docker-compose.yml run gub-android $@ 5 | -------------------------------------------------------------------------------- /Plugin/GUB/Project/Android/build4DockerToolbox.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | cd $(dirname $(realpath $0)) 4 | docker-compose -f docker/docker-compose-toolbox.yml run gub-android $@ 5 | -------------------------------------------------------------------------------- /Plugin/GUB/Project/Android/docker/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:16.04 2 | 3 | 4 | #A docker with ubuntu:16.04 for Android GUB 5 | 6 | 7 | #=====================required linux build====================================== 8 | RUN apt-get update && apt-get -y install git build-essential pkg-config wget unzip default-jre openjdk-8-jdk file 9 | #=============================================================================== 10 | 11 | 12 | #=====================optional linux build====================================== 13 | #GUB Ubuntu dependencies 14 | #RUN apt-get -y install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libgstreamer-plugins-bad1.0-dev libgl1-mesa-dev libgles2-mesa-dev 15 | #GUB test app dependencies 16 | #RUN apt-get -y install libsdl2-dev libglu1-mesa-dev freeglut3-dev 17 | #=============================================================================== 18 | 19 | 20 | #=====================install android ndk======================================= 21 | ARG NDK_TARGET_LEVEL 22 | ARG NDK_APP_ABI 23 | 24 | ENV NDK_TARGET_LEVEL=${NDK_TARGET_LEVEL} 25 | ENV NDK_APP_ABI=${NDK_APP_ABI} 26 | ENV ANDROID_NDK_HOME /usr/local/android-ndk-r12b 27 | 28 | RUN wget https://dl.google.com/android/repository/android-ndk-r12b-linux-x86_64.zip && \ 29 | unzip -q android-ndk-r12b-linux-x86_64.zip -d /usr/local/ && \ 30 | rm android-ndk-r12b-linux-x86_64.zip 31 | ENV PATH $PATH:$ANDROID_NDK_HOME 32 | #=============================================================================== 33 | 34 | 35 | #=====================install ant=============================================== 36 | ARG ANT_VERSION 37 | 38 | ENV ANT_VERSION=${ANT_VERSION} 39 | ENV ANT_HOME=/opt/ant 40 | 41 | RUN wget http://archive.apache.org/dist/ant/binaries/apache-ant-${ANT_VERSION}-bin.tar.gz && \ 42 | tar -xzf apache-ant-${ANT_VERSION}-bin.tar.gz && \ 43 | mv apache-ant-${ANT_VERSION} ${ANT_HOME} && \ 44 | rm apache-ant-${ANT_VERSION}-bin.tar.gz 45 | ENV PATH ${PATH}:${ANT_HOME}/bin 46 | #=============================================================================== 47 | 48 | 49 | #=====================install android SDK======================================= 50 | ENV ANDROID_SDK_HOME=/usr/local/android-sdk-linux 51 | 52 | RUN wget https://dl.google.com/android/android-sdk_r24.4.1-linux.tgz && \ 53 | tar -xzf android-sdk_r24.4.1-linux.tgz -C /usr/local && \ 54 | rm android-sdk_r24.4.1-linux.tgz && \ 55 | cd ${ANDROID_SDK_HOME}/tools && ( sleep 4 && while [ 1 ]; do sleep 1; echo y; done ) | ./android update sdk --no-ui -a --filter 1,2,3,4,${NDK_TARGET_LEVEL} 56 | ENV PATH $PATH:$ANDROID_SDK_HOME/tools 57 | #=============================================================================== 58 | 59 | 60 | #=====================get gstreamer for android================================= 61 | ARG GST_ANDROID_ARCH 62 | ARG GST_ANDROID_VERSION 63 | 64 | ENV GST_ANDROID_ARCH=${GST_ANDROID_ARCH} 65 | ENV GST_ANDROID_VERSION=${GST_ANDROID_VERSION} 66 | ENV GSTREAMER_ROOT_ANDROID=/usr/local/gstreamer/${GST_ANDROID_ARCH} 67 | 68 | RUN SORTED_VERSIONS=$(printf ${GST_ANDROID_VERSION}'\n1.9.90' | sort -V) && \ 69 | case "${SORTED_VERSIONS}" in \ 70 | 1.9.90*) export GST_ANDROID_PART=universal && \ 71 | export GST_ANDROID_PATH=/usr/local/gstreamer ;; \ 72 | * ) export GST_ANDROID_PART=${GST_ANDROID_ARCH} && \ 73 | export GST_ANDROID_PATH=/usr/local/gstreamer/${GST_ANDROID_ARCH} ;; \ 74 | esac && \ 75 | 76 | wget https://gstreamer.freedesktop.org/data/pkg/android/${GST_ANDROID_VERSION}/gstreamer-1.0-android-${GST_ANDROID_PART}-${GST_ANDROID_VERSION}.tar.bz2 && \ 77 | mkdir -p ${GST_ANDROID_PATH} && \ 78 | tar -xjf gstreamer-1.0-android-${GST_ANDROID_PART}-${GST_ANDROID_VERSION}.tar.bz2 -C ${GST_ANDROID_PATH} && \ 79 | rm gstreamer-1.0-android-${GST_ANDROID_PART}-${GST_ANDROID_VERSION}.tar.bz2 80 | 81 | RUN sed -i -e 's/#define GST_GL_HAVE_GLSYNC 0/#define GST_GL_HAVE_GLSYNC 1/g' $GSTREAMER_ROOT_ANDROID/lib/gstreamer-1.0/include/gst/gl/gstglconfig.h 82 | RUN sed -i -e 's/#define GST_GL_HAVE_GLUINT64 0/#define GST_GL_HAVE_GLUINT64 1/g' $GSTREAMER_ROOT_ANDROID/lib/gstreamer-1.0/include/gst/gl/gstglconfig.h 83 | RUN sed -i -e 's/#define GST_GL_HAVE_GLINT64 0/#define GST_GL_HAVE_GLINT64 1/g' $GSTREAMER_ROOT_ANDROID/lib/gstreamer-1.0/include/gst/gl/gstglconfig.h 84 | 85 | RUN cp $GSTREAMER_ROOT_ANDROID/lib/gstreamer-1.0/include/gst/gl/gstglconfig.h $GSTREAMER_ROOT_ANDROID/include/gstreamer-1.0/gst/gl/ 86 | #=============================================================================== 87 | 88 | 89 | #=====================entry point=============================================== 90 | COPY ./entrypoint/ /home/docker-entrypoint 91 | RUN sed -i -e 's/\r//g' /home/docker-entrypoint/*.sh 92 | RUN chmod +x /home/docker-entrypoint/*.sh 93 | ENTRYPOINT ["/home/docker-entrypoint/docker-entrypoint.sh"] 94 | #=============================================================================== 95 | -------------------------------------------------------------------------------- /Plugin/GUB/Project/Android/docker/docker-compose-toolbox.yml: -------------------------------------------------------------------------------- 1 | version: '2.0' 2 | 3 | services: 4 | gub-android: 5 | image: gub/android 6 | build: 7 | context: . 8 | args: 9 | NDK_TARGET_LEVEL: android-23 10 | NDK_APP_ABI: armeabi-v7a 11 | ANT_VERSION: 1.9.4 12 | GST_ANDROID_ARCH: armv7 13 | GST_ANDROID_VERSION: 1.10.5 14 | environment: 15 | MOUNT_GST_UNITY_BRIDGE: /mnt/gst-unity-bridge 16 | MOUNT_OUTPUT_PATH: /mnt/output 17 | MOUNT_LIB_GST_ANDROID: /mnt/libgstreamer_android.so 18 | #entrypoint: /bin/bash 19 | volumes: 20 | - /gst-unity-bridge:/mnt/gst-unity-bridge:ro 21 | - /gst-unity-bridge/Plugin/GUB/Build/Android:/mnt/output 22 | -------------------------------------------------------------------------------- /Plugin/GUB/Project/Android/docker/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '2.0' 2 | 3 | services: 4 | gub-android: 5 | image: gub/android 6 | build: 7 | context: . 8 | args: 9 | NDK_TARGET_LEVEL: android-23 10 | NDK_APP_ABI: armeabi-v7a 11 | ANT_VERSION: 1.9.4 12 | GST_ANDROID_ARCH: armv7 13 | GST_ANDROID_VERSION: 1.10.5 14 | environment: 15 | MOUNT_GST_UNITY_BRIDGE: /mnt/gst-unity-bridge 16 | MOUNT_OUTPUT_PATH: /mnt/output 17 | MOUNT_LIB_GST_ANDROID: /mnt/libgstreamer_android.so 18 | #entrypoint: /bin/bash 19 | volumes: 20 | - ../../../../../:/mnt/immersiatv-player:ro 21 | - ../../../Build/Android:/mnt/output 22 | -------------------------------------------------------------------------------- /Plugin/GUB/Project/Android/docker/entrypoint/commands.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | DOCKER_GST_UNITY_BRIDGE="/home/gst-unity-bridge" 4 | 5 | function copyRepo 6 | { 7 | declare -a arr=(Plugin/GUB/Project/Android 8 | Plugin/GUB/Source 9 | Plugin/DvbCssWc/Source 10 | Plugin/DvbCssWc/Project/Android 11 | Plugin/Externals/gstreamer/Project/Android 12 | ) 13 | 14 | cd ${MOUNT_GST_UNITY_BRIDGE} 15 | find -type d -exec mkdir -p "$DOCKER_GST_UNITY_BRIDGE/{}" \; 16 | for i in "${arr[@]}" 17 | do 18 | cp -r ${MOUNT_GST_UNITY_BRIDGE}/$i $DOCKER_GST_UNITY_BRIDGE/$(dirname $i) 19 | done 20 | } 21 | 22 | function buildGUB 23 | { 24 | # it HAVE TO be subdirectory of ${MOUNT_OUTPUT_PATH} 25 | OUTPUT_PATH=${MOUNT_OUTPUT_PATH}/gub 26 | cd $DOCKER_GST_UNITY_BRIDGE/Plugin/GUB/Project/Android/GUB 27 | buildAPK release $OUTPUT_PATH 28 | cd bin/classes 29 | jar cvf gub.jar org/* 30 | cp gub.jar $OUTPUT_PATH 31 | cd ../../ 32 | cp -r libs/${NDK_APP_ABI} $OUTPUT_PATH 33 | } 34 | 35 | function buildAPK 36 | { 37 | BUILD_TARGET=$1 38 | BUILD_OUTPUT_PATH=$2 39 | 40 | # be careful with rm command. Be sure that you remove the subdirectory of ${MOUNT_OUTPUT_PATH} 41 | # it HAVE TO be subdirectory, because remember that someone can give you in config OUTPUT_PATH to "/" 42 | rm -r $BUILD_OUTPUT_PATH 43 | mkdir -p $BUILD_OUTPUT_PATH 44 | 45 | android update project -p . -s --target ${NDK_TARGET_LEVEL} 46 | ndk-build APP_ABI=${NDK_APP_ABI} 47 | if [ $? -ne 0 ]; then 48 | echo BUILD FAILED 49 | exit 1 50 | fi 51 | if [ "$COPY_GST_AND_LIB" = true ]; then 52 | cp ${MOUNT_LIB_GST_ANDROID} libs/${NDK_APP_ABI}/libgstreamer_android.so 53 | fi 54 | ant $BUILD_TARGET 55 | } -------------------------------------------------------------------------------- /Plugin/GUB/Project/Android/docker/entrypoint/docker-entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | . $(dirname $0)/commands.sh 3 | 4 | usage=" 5 | $(basename "$0") [-t] [-g] [-h] -- program to build GUB (GStreamer Unity Bridge) 6 | 7 | where: 8 | -t | --test build android application for testing GUB 9 | -g | --gstAnd use prebuilded libgstreamer_android.so 10 | -h | --help show this help text 11 | " 12 | 13 | BUILD_TEST=false 14 | COPY_GST_AND_LIB=false 15 | 16 | show_help=false 17 | while [[ $# -gt 0 ]] 18 | do 19 | key="$1" 20 | case $key in 21 | 22 | -h|--help) show_help=true 23 | ;; 24 | 25 | *) echo "Unknown argument : " $key 26 | show_help=true 27 | ;; 28 | esac 29 | shift 30 | done 31 | 32 | if [ "$show_help" = true ]; then 33 | echo "$usage" 34 | exit 35 | fi 36 | 37 | copyRepo 38 | 39 | buildGUB 40 | -------------------------------------------------------------------------------- /Plugin/GUB/Project/Android/docker/install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | sudo apt install curl 4 | 5 | echo 6 | echo "*************************************************************************" 7 | echo "INSTALL DOCKER" 8 | echo "*************************************************************************" 9 | echo 10 | 11 | curl -sSL "https://get.docker.com/" | sudo sh 12 | 13 | echo 14 | echo "*************************************************************************" 15 | echo "INSTALL DOCKER-COMPOSE" 16 | echo "*************************************************************************" 17 | echo 18 | 19 | sudo curl -L "https://github.com/docker/compose/releases/download/1.9.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose 20 | sudo chmod +x /usr/local/bin/docker-compose 21 | 22 | echo 23 | echo "*************************************************************************" 24 | echo "INSTALLED VERSIONS :" 25 | sudo docker --version 26 | sudo docker-compose --version 27 | echo "*************************************************************************" 28 | echo 29 | -------------------------------------------------------------------------------- /Plugin/GUB/Project/Linux/Makefile: -------------------------------------------------------------------------------- 1 | SHELL = /bin/sh 2 | CC = gcc 3 | CXX = g++ 4 | CXXFLAGS = -std=c++14 5 | FLAGS = # -std=gnu99 -Iinclude 6 | 7 | OUTDIR = ../../Build/Linux 8 | SRCDIR = ../../Source 9 | PLUGINDIR = ../../../DvbCssWc 10 | 11 | CFLAGS = -fPIC -g `pkg-config gstreamer-1.0 --cflags` -I/usr/local/lib/gstreamer-1.0/include -I/usr/local/include/gstreamer-1.0 -I./$(PLUGINDIR)/Source -I./Plugin/src#-pedantic -Wall -Wextra -ggdb3 12 | LDFLAGS = -shared 13 | LIBS = $(shell pkg-config --libs glib-2.0) $(shell pkg-config --libs gio-2.0) $(shell pkg-config --libs gstreamer-1.0) -lm 14 | DEBUGFLAGS = -O0 -D _DEBUG 15 | RELEASEFLAGS = -O2 -D NDEBUG -fwhole-program 16 | 17 | TARGET = $(OUTDIR)/GstUnityBridge.so 18 | SOURCES = $(shell echo $(SRCDIR)/*.c) 19 | OBJECTS = $(SOURCES:.c=.o) 20 | 21 | TARGET_TEST = testGUB-Linux 22 | TEST_OUTDIR = $(OUTDIR)/test 23 | 24 | PREFIX = $(DESTDIR)/usr/local 25 | BINDIR = $(PREFIX)/bin 26 | 27 | all: $(TARGET) 28 | 29 | $(TARGET): $(OBJECTS) 30 | rm -rf $(OUTDIR) && mkdir -p $(OUTDIR) 31 | $(CC) $(FLAGS) $(CFLAGS) $(RELEASEFLAGS) -o $(TARGET) $(LDFLAGS) $(OBJECTS) $(LIBS) 32 | 33 | clean: 34 | @rm -rf src/*.o $(TARGET) 35 | 36 | test: 37 | rm -rf $(TEST_OUTDIR) && mkdir -p $(TEST_OUTDIR) 38 | $(CXX) $(CXXFLAGS) $(CFLAGS) -I$(SRCDIR) $(DEBUGFLAGS) -L. -o $(TEST_OUTDIR)/$(TARGET_TEST) $(SRCDIR)/tests/linux-test/testGUB-Linux.c $(LIBS) -l:$(TARGET) -lgstnet-1.0 -lgstapp-1.0 -lgstvideo-1.0 -lgstgl-1.0 -lgstpbutils-1.0 -l:$(PLUGINDIR)/Build/libDvbCssWc.so -lSDL2 -l:$(OUTDIR)/GstUnityBridge.so -lGL 39 | -------------------------------------------------------------------------------- /Plugin/GUB/Project/Windows/GstUnityBridge.VC.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ua-i2cat/gst-unity-bridge/d08860e472334c2735c99c98636e17c6e1454bb7/Plugin/GUB/Project/Windows/GstUnityBridge.VC.db -------------------------------------------------------------------------------- /Plugin/GUB/Project/Windows/GstUnityBridge.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}") = "GstUnityBridge", "GstUnityBridge.vcxproj", "{F2726BBD-4008-4E86-8E07-1A0975B16124}" 7 | ProjectSection(ProjectDependencies) = postProject 8 | {F9DE5C55-0645-4BCE-835F-AC1CFCB7DAC9} = {F9DE5C55-0645-4BCE-835F-AC1CFCB7DAC9} 9 | EndProjectSection 10 | EndProject 11 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DvbCssWc", "..\..\..\DvbCssWc\Project\Windows\DvbCssWc.vcxproj", "{F9DE5C55-0645-4BCE-835F-AC1CFCB7DAC9}" 12 | EndProject 13 | Global 14 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 15 | Debug|x64 = Debug|x64 16 | Debug|x86 = Debug|x86 17 | Release|x64 = Release|x64 18 | Release|x86 = Release|x86 19 | EndGlobalSection 20 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 21 | {F2726BBD-4008-4E86-8E07-1A0975B16124}.Debug|x64.ActiveCfg = Debug|x64 22 | {F2726BBD-4008-4E86-8E07-1A0975B16124}.Debug|x64.Build.0 = Debug|x64 23 | {F2726BBD-4008-4E86-8E07-1A0975B16124}.Debug|x86.ActiveCfg = Debug|Win32 24 | {F2726BBD-4008-4E86-8E07-1A0975B16124}.Debug|x86.Build.0 = Debug|Win32 25 | {F2726BBD-4008-4E86-8E07-1A0975B16124}.Release|x64.ActiveCfg = Release|x64 26 | {F2726BBD-4008-4E86-8E07-1A0975B16124}.Release|x64.Build.0 = Release|x64 27 | {F2726BBD-4008-4E86-8E07-1A0975B16124}.Release|x86.ActiveCfg = Release|Win32 28 | {F2726BBD-4008-4E86-8E07-1A0975B16124}.Release|x86.Build.0 = Release|Win32 29 | {F9DE5C55-0645-4BCE-835F-AC1CFCB7DAC9}.Debug|x64.ActiveCfg = Debug|x64 30 | {F9DE5C55-0645-4BCE-835F-AC1CFCB7DAC9}.Debug|x64.Build.0 = Debug|x64 31 | {F9DE5C55-0645-4BCE-835F-AC1CFCB7DAC9}.Debug|x86.ActiveCfg = Debug|Win32 32 | {F9DE5C55-0645-4BCE-835F-AC1CFCB7DAC9}.Debug|x86.Build.0 = Debug|Win32 33 | {F9DE5C55-0645-4BCE-835F-AC1CFCB7DAC9}.Release|x64.ActiveCfg = Release|x64 34 | {F9DE5C55-0645-4BCE-835F-AC1CFCB7DAC9}.Release|x64.Build.0 = Release|x64 35 | {F9DE5C55-0645-4BCE-835F-AC1CFCB7DAC9}.Release|x86.ActiveCfg = Release|Win32 36 | {F9DE5C55-0645-4BCE-835F-AC1CFCB7DAC9}.Release|x86.Build.0 = Release|Win32 37 | EndGlobalSection 38 | GlobalSection(SolutionProperties) = preSolution 39 | HideSolutionNode = FALSE 40 | EndGlobalSection 41 | EndGlobal 42 | -------------------------------------------------------------------------------- /Plugin/GUB/Source/gub.h: -------------------------------------------------------------------------------- 1 | /* 2 | * GStreamer - Unity3D bridge (GUB). 3 | * Copyright (C) 2016 Fundacio i2CAT, Internet i Innovacio digital a Catalunya 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program 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 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program. If not, see . 17 | * 18 | * Authors: Xavi Artigas 19 | */ 20 | 21 | #ifndef __GUB_H__ 22 | #define __GUB_H__ 23 | 24 | #include 25 | 26 | #if _WIN32 27 | #define EXPORT_API __declspec(dllexport) 28 | #else 29 | #define EXPORT_API 30 | #endif 31 | 32 | /* Created from the gst pipeline */ 33 | typedef void GUBGraphicContext; 34 | 35 | GUBGraphicContext *gub_create_graphic_context(GstPipeline *pipeline, float crop_left, float crop_top, float crop_right, float crop_bottom); 36 | GstContext *gub_provide_graphic_context(GUBGraphicContext *gcontext, const gchar *type); 37 | void gub_destroy_graphic_context(GUBGraphicContext *context); 38 | gboolean gub_blit_image(GUBGraphicContext *gcontext, GstSample *sample, void *texture_native_ptr); 39 | const gchar *gub_get_video_branch_description(); 40 | 41 | void gub_log(const char *format, ...); 42 | void gub_log_error(const char *message); 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /Plugin/GUB/Source/gub_graphics.h: -------------------------------------------------------------------------------- 1 | /* 2 | * GStreamer - Unity3D bridge (GUB). 3 | * Copyright (C) 2016 Fundacio i2CAT, Internet i Innovacio digital a Catalunya 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program 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 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program. If not, see . 17 | * 18 | * Authors: Xavi Artigas 19 | */ 20 | 21 | #include "gub.h" 22 | 23 | /* Copied from IUnityGraphics.h and added some bits */ 24 | typedef enum UnityGfxRenderer { 25 | kUnityGfxRendererOpenGL = 0, // Desktop OpenGL 26 | kUnityGfxRendererD3D9 = 1, // Direct3D 9 27 | kUnityGfxRendererD3D11 = 2, // Direct3D 11 28 | kUnityGfxRendererGCM = 3, // PlayStation 3 29 | kUnityGfxRendererNull = 4, // "null" device (used in batch mode) 30 | kUnityGfxRendererXenon = 6, // Xbox 360 31 | kUnityGfxRendererOpenGLES20 = 8, // OpenGL ES 2.0 32 | kUnityGfxRendererOpenGLES30 = 11, // OpenGL ES 3.0 33 | kUnityGfxRendererGXM = 12, // PlayStation Vita 34 | kUnityGfxRendererPS4 = 13, // PlayStation 4 35 | kUnityGfxRendererXboxOne = 14, // Xbox One 36 | kUnityGfxRendererMetal = 16, // iOS Metal 37 | kUnityGfxRendererGLCore = 17, // OpenGL Core 38 | kUnityGfxRendererD3D12 = 18, // Direct3D 12 39 | } UnityGfxRenderer; 40 | 41 | typedef enum UnityGfxDeviceEventType { 42 | kUnityGfxDeviceEventInitialize = 0, 43 | kUnityGfxDeviceEventShutdown = 1, 44 | kUnityGfxDeviceEventBeforeReset = 2, 45 | kUnityGfxDeviceEventAfterReset = 3, 46 | } UnityGfxDeviceEventType; 47 | 48 | // -------------------------------------------------------------------------------------------------------------------- 49 | // ------------------------------------------------- Unity integration ------------------------------------------------ 50 | // -------------------------------------------------------------------------------------------------------------------- 51 | // If exported by a plugin, this function will be called when graphics device is created, destroyed, 52 | // and before and after it is reset (ie, resolution changed). 53 | void EXPORT_API UnitySetGraphicsDevice(void* device, int deviceType, int eventType); 54 | -------------------------------------------------------------------------------- /Plugin/GUB/Source/gub_gstreamer.c: -------------------------------------------------------------------------------- 1 | /* 2 | * GStreamer - Unity3D bridge (GUB). 3 | * Copyright (C) 2016 Fundacio i2CAT, Internet i Innovacio digital a Catalunya 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program 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 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program. If not, see . 17 | * 18 | * Authors: Xavi Artigas 19 | */ 20 | #include "gub_gstreamer.h" 21 | 22 | static GstClockTime _priv_gst_info_start_time; 23 | 24 | gint gub_ref_count = 0; 25 | GThread *gub_main_loop_thread = NULL; 26 | GMainLoop *gub_main_loop = NULL; 27 | 28 | gpointer gub_main_loop_func(gpointer data) 29 | { 30 | gub_log("Entering main loop"); 31 | gub_main_loop = g_main_loop_new(NULL, FALSE); 32 | g_main_loop_run(gub_main_loop); 33 | gub_log("Quitting main loop"); 34 | 35 | return NULL; 36 | } 37 | 38 | static void gst_debug_gub(GstDebugCategory * category, GstDebugLevel level, 39 | const gchar * file, const gchar * function, gint line, 40 | GObject * object, GstDebugMessage * message, gpointer unused) 41 | { 42 | GstClockTime elapsed; 43 | gchar *tag; 44 | const gchar *level_str; 45 | 46 | if (level > gst_debug_category_get_threshold(category)) 47 | return; 48 | 49 | elapsed = GST_CLOCK_DIFF(_priv_gst_info_start_time, 50 | gst_util_get_timestamp()); 51 | 52 | switch (level) { 53 | case GST_LEVEL_ERROR: 54 | level_str = "ERR"; 55 | break; 56 | case GST_LEVEL_WARNING: 57 | level_str = "WRN"; 58 | break; 59 | case GST_LEVEL_INFO: 60 | level_str = "NFO"; 61 | break; 62 | case GST_LEVEL_DEBUG: 63 | level_str = "DBG"; 64 | break; 65 | default: 66 | level_str = "LOG"; 67 | break; 68 | } 69 | 70 | tag = g_strdup_printf("%s", gst_debug_category_get_name(category)); 71 | 72 | if (object) { 73 | gchar *obj; 74 | 75 | if (GST_IS_PAD(object) && GST_OBJECT_NAME(object)) { 76 | obj = g_strdup_printf("<%s:%s>", GST_DEBUG_PAD_NAME(object)); 77 | } 78 | else if (GST_IS_OBJECT(object) && GST_OBJECT_NAME(object)) { 79 | obj = g_strdup_printf("<%s>", GST_OBJECT_NAME(object)); 80 | } 81 | else if (G_IS_OBJECT(object)) { 82 | obj = g_strdup_printf("<%s@%p>", G_OBJECT_TYPE_NAME(object), object); 83 | } 84 | else { 85 | obj = g_strdup_printf("<%p>", object); 86 | } 87 | 88 | gub_log( 89 | "%" GST_TIME_FORMAT " %p %s %s %s:%d:%s:%s %s", 90 | GST_TIME_ARGS(elapsed), g_thread_self(), level_str, tag, 91 | file, line, function, obj, gst_debug_message_get(message)); 92 | 93 | g_free(obj); 94 | } 95 | else { 96 | gub_log( 97 | "%" GST_TIME_FORMAT " %p %s %s %s:%d:%s %s", 98 | GST_TIME_ARGS(elapsed), g_thread_self(), level_str, tag, 99 | file, line, function, gst_debug_message_get(message)); 100 | } 101 | g_free(tag); 102 | } 103 | 104 | EXPORT_API void gub_ref(const char *gst_debug_string) 105 | { 106 | gub_log("GST ref (%d -> %d)", gub_ref_count, gub_ref_count + 1); 107 | if (gub_ref_count == 0) { 108 | GError *err = 0; 109 | gchar *version = NULL; 110 | 111 | if (!gst_init_check(0, 0, &err)) { 112 | gub_log("Failed to initialize GStreamer: %s", err ? err->message : ""); 113 | return; 114 | } 115 | 116 | /* get time we started for debugging messages */ 117 | _priv_gst_info_start_time = gst_util_get_timestamp(); 118 | 119 | gst_debug_remove_log_function(gst_debug_log_default); 120 | gst_debug_add_log_function((GstLogFunction)gst_debug_gub, NULL, NULL); 121 | if (gst_debug_string) { 122 | gub_log("Setting debug level to %s", gst_debug_string); 123 | gst_debug_set_active(TRUE); 124 | gst_debug_set_threshold_from_string(gst_debug_string, TRUE); 125 | } else { 126 | gst_debug_set_active(FALSE); 127 | } 128 | 129 | #if defined (__ANDROID__) 130 | gst_android_register_static_plugins(); 131 | gst_android_load_gio_modules(); 132 | #endif 133 | 134 | gub_main_loop_thread = g_thread_new("GstUnityBridge Main Thread", gub_main_loop_func, NULL); 135 | if (!gub_main_loop_thread) { 136 | gub_log("Failed to create GLib main thread: %s", err ? err->message : ""); 137 | return; 138 | } 139 | 140 | version = gst_version_string(); 141 | gub_log("%s initialized", version); 142 | g_free(version); 143 | } 144 | 145 | gub_ref_count++; 146 | } 147 | 148 | EXPORT_API void gub_unref() 149 | { 150 | gub_log("GST unref (%d -> %d)", gub_ref_count, gub_ref_count - 1); 151 | if (gub_ref_count == 0) { 152 | gub_log("Trying to unref past zero"); 153 | return; 154 | } 155 | 156 | gub_ref_count--; 157 | 158 | if (gub_ref_count == 0) { 159 | if (!gub_main_loop) { 160 | return; 161 | } 162 | g_main_loop_quit(gub_main_loop); 163 | gub_main_loop = NULL; 164 | g_thread_join(gub_main_loop_thread); 165 | gub_main_loop_thread = NULL; 166 | } 167 | } 168 | 169 | EXPORT_API gint32 gub_is_active() 170 | { 171 | gub_log("is_active"); 172 | return (gub_ref_count > 0); 173 | } 174 | -------------------------------------------------------------------------------- /Plugin/GUB/Source/gub_gstreamer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * GStreamer - Unity3D bridge (GUB). 3 | * Copyright (C) 2016 Fundacio i2CAT, Internet i Innovacio digital a Catalunya 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program 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 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program. If not, see . 17 | * 18 | * Authors: Xavi Artigas 19 | */ 20 | 21 | #include 22 | #include 23 | #include "gub.h" 24 | 25 | EXPORT_API void gub_ref(const char *gst_debug_string); 26 | 27 | EXPORT_API void gub_unref(); 28 | 29 | EXPORT_API gint32 gub_is_active(); 30 | -------------------------------------------------------------------------------- /Plugin/GUB/Source/gub_log.c: -------------------------------------------------------------------------------- 1 | /* 2 | * GStreamer - Unity3D bridge (GUB). 3 | * Copyright (C) 2016 Fundacio i2CAT, Internet i Innovacio digital a Catalunya 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program 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 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program. If not, see . 17 | * 18 | * Authors: Xavi Artigas 19 | */ 20 | 21 | #include "gub_log.h" 22 | #include 23 | #include 24 | 25 | GUBUnityDebugLogPFN gub_unity_debug_log = NULL; 26 | 27 | EXPORT_API void gub_log_set_unity_handler(GUBUnityDebugLogPFN pfn) { 28 | gub_unity_debug_log = pfn; 29 | } 30 | 31 | #if !defined(__ANDROID__) 32 | 33 | void gub_log(const char *format, ...) 34 | { 35 | va_list args; 36 | 37 | va_start(args, format); 38 | if (!gub_unity_debug_log) { 39 | static FILE *logf = NULL; 40 | if (!logf) { 41 | logf = fopen("gub.log", "w+t"); 42 | } 43 | vfprintf(logf, format, args); 44 | fprintf(logf, "\n"); 45 | fflush(logf); 46 | } else { 47 | gchar *message = g_strdup_vprintf(format, args); 48 | gub_unity_debug_log(3, message); 49 | g_free(message); 50 | } 51 | va_end(args); 52 | } 53 | 54 | #else 55 | 56 | #include 57 | #include 58 | 59 | void gub_log(const char *format, ...) 60 | { 61 | va_list args; 62 | gchar *msg; 63 | va_start(args, format); 64 | msg = g_strdup_vprintf(format, args); 65 | __android_log_print(ANDROID_LOG_INFO, "gub", "%s", msg); 66 | g_free(msg); 67 | va_end(args); 68 | } 69 | 70 | #endif 71 | 72 | void gub_log_error(const char *message) 73 | { 74 | if (gub_unity_debug_log) { 75 | gub_unity_debug_log(0, message); 76 | } 77 | else { 78 | gub_log("ERROR: %s", message); 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /Plugin/GUB/Source/gub_log.h: -------------------------------------------------------------------------------- 1 | /* 2 | * GStreamer - Unity3D bridge (GUB). 3 | * Copyright (C) 2016 Fundacio i2CAT, Internet i Innovacio digital a Catalunya 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program 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 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program. If not, see . 17 | * 18 | * Authors: Xavi Artigas 19 | */ 20 | 21 | #include "gub.h" 22 | 23 | typedef void(*GUBUnityDebugLogPFN)(gint32 level, const char *message); 24 | 25 | EXPORT_API void gub_log_set_unity_handler(GUBUnityDebugLogPFN pfn); 26 | -------------------------------------------------------------------------------- /Plugin/GUB/Source/gub_pipeline.h: -------------------------------------------------------------------------------- 1 | /* 2 | * GStreamer - Unity3D bridge (GUB). 3 | * Copyright (C) 2016 Fundacio i2CAT, Internet i Innovacio digital a Catalunya 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program 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 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program. If not, see . 17 | * 18 | * Authors: Xavi Artigas 19 | */ 20 | 21 | #include 22 | #include 23 | #include "gub.h" 24 | 25 | typedef struct _GUBPipeline GUBPipeline; 26 | 27 | typedef void(*GUBPipelineOnEosPFN)(GUBPipeline *userdata); 28 | typedef void(*GUBPipelineOnErrorPFN)(GUBPipeline *userdata, char *message); 29 | typedef void(*GUBPipelineOnQosPFN)(GUBPipeline *userdata, 30 | gint64 current_jitter, guint64 current_running_time, guint64 current_stream_time, guint64 current_timestamp, 31 | gdouble proportion, guint64 processed, guint64 dropped); 32 | 33 | void gub_log_pipeline(GUBPipeline *pipeline, const char *format, ...); 34 | 35 | EXPORT_API void *gub_pipeline_create(const char *name, 36 | GUBPipelineOnEosPFN eos_handler, GUBPipelineOnErrorPFN error_handler, GUBPipelineOnQosPFN qos_handler, 37 | void *userdata); 38 | 39 | EXPORT_API void gub_pipeline_close(GUBPipeline *pipeline); 40 | 41 | EXPORT_API void gub_pipeline_destroy(GUBPipeline *pipeline); 42 | 43 | EXPORT_API void gub_pipeline_play(GUBPipeline *pipeline); 44 | 45 | EXPORT_API void gub_pipeline_pause(GUBPipeline *pipeline); 46 | 47 | EXPORT_API void gub_pipeline_stop(GUBPipeline *pipeline); 48 | 49 | EXPORT_API gint32 gub_pipeline_is_loaded(GUBPipeline *pipeline); 50 | 51 | EXPORT_API gint32 gub_pipeline_is_playing(GUBPipeline *pipeline); 52 | 53 | EXPORT_API double gub_pipeline_get_duration(GUBPipeline *pipeline); 54 | 55 | EXPORT_API double gub_pipeline_get_position(GUBPipeline *pipeline); 56 | 57 | EXPORT_API void gub_pipeline_set_position(GUBPipeline *pipeline, double position); 58 | 59 | EXPORT_API void gub_pipeline_setup_decoding_clock(GUBPipeline *pipeline, const gchar *uri, int video_index, int audio_index, 60 | const gchar *net_clock_addr, int net_clock_port, guint64 basetime, 61 | float crop_left, float crop_top, float crop_right, float crop_bottom, gboolean isDvbWc); 62 | 63 | EXPORT_API void gub_pipeline_setup_decoding(GUBPipeline *pipeline, const gchar *uri, int video_index, int audio_index, 64 | const gchar *net_clock_addr, int net_clock_port, guint64 basetime, 65 | float crop_left, float crop_top, float crop_right, float crop_bottom); 66 | 67 | EXPORT_API gint32 gub_pipeline_grab_frame(GUBPipeline *pipeline, int *width, int *height); 68 | 69 | EXPORT_API void gub_pipeline_blit_image(GUBPipeline *pipeline, void *_TextureNativePtr); 70 | 71 | EXPORT_API void gub_pipeline_setup_encoding(GUBPipeline *pipeline, const gchar *filename, 72 | int width, int height); 73 | 74 | EXPORT_API void gub_pipeline_consume_image(GUBPipeline *pipeline, guint8 *rawdata, int size); 75 | 76 | EXPORT_API void gub_pipeline_stop_encoding(GUBPipeline *pipeline); 77 | 78 | EXPORT_API void gub_pipeline_set_volume(GUBPipeline *pipeline, gdouble volume); 79 | 80 | EXPORT_API void gub_pipeline_set_adaptive_bitrate_limit(GUBPipeline *pipeline, gfloat bitrate_limit); 81 | 82 | EXPORT_API void gub_pipeline_set_basetime(GUBPipeline *pipeline, guint64 basetime); 83 | -------------------------------------------------------------------------------- /Plugin/README.md: -------------------------------------------------------------------------------- 1 | #Building the native plugin 2 | It is easier to use the prebuilt binaries included in the test project. However, should you need to build your own native plugin, use these instructions. 3 | 4 | Building the plugin for Windows 5 | --- 6 | Solution and Project files are included for Visual Studio 2015 (works with the Free Community Edition). Just open and build. 7 | Make sure the latest GStreamer 1.x is installed (http://gstreamer.freedesktop.org/data/pkg/windows/) and the 8 | GSTREAMER_1_0_ROOT_X86 or GSTREAMER_1_0_ROOT_X86_64 environment variable is defined and points to the proper place. 9 | The project already copies the resulting GstUnityBridge.dll to the Unity\Assets\Plugins\x86 or x86_64 folder of the included Unity project. 10 | 11 | Building the plugin for Android 12 | --- 13 | Follow the instructions allocated in GUB/Project/Android. 14 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # GStreamer - Unity3D Bridge (GUB) 2 | 3 | Play any media URI inside [Unity3D](http://www.unity3d.com) textures using [GStreamer 1.x](http://gstreamer.freedesktop.org) pipelines. 4 | 5 | Inspired on code from https://github.com/mrayy/mrayGStreamerUnity 6 | 7 | Tested on Windows and Android. 8 | 9 | The system is composed of a bunch of C# scripts to be used inside Unity, which interact with a native plugin (`GstUnityBridge.dll` or `libGstUnityBridge.so`). 10 | 11 | The plugin, in turn, calls the GStreamer libraries, which can be deployed alongside the plugin, or it will use the system's ones. 12 | 13 | On Android, GStreamer is statically linked into a single library which can be deployed with your application (`libGstUnityBridge.so` and `libgstreamer_android.so`). 14 | 15 | The `Plugin` folder contains the source code for building the native plugin, with its own readme.txt file. 16 | 17 | The `Unity` folder contains the prebuilt plugins, C# scripts and sample scenes, along with its own readme.txt file. 18 | 19 | DVB-CSS-WC support. 20 | 1. Compile libDvbCssWc/win32/DvbCssWc.sln using Visual Studio for x86. 21 | 2. Compile GstUnityBridge.sln using Visual Studio for x86. 22 | 3. Copy libDvbCssWc.dll into the same place as GstUnityBridge.dll 23 | 24 | # TODO 25 | 26 | - Better error reporting (when sync fails, for example) 27 | - Allow using other synchronization mechanisms (NTP or PTP, for example) 28 | - Due to some unknown issue with the Android GStreamer audio sink, presence breaks network synchronization. 29 | - The Unity3D Editor loads all native plugins at startup, so it does not pick up changes you make later on. https://github.com/mrayy/mrayGStreamerUnity already took care of this. 30 | - iOS support 31 | - OSX support 32 | 33 | # REQUIREMENT 34 | - Unity version 5.6.0 or higuer 35 | 36 | # ACKNOWLEDGEMENT 37 | 38 | This software has been created within the [ImmersiaTV](http://immersiatv.eu) project. This project has received funding from the European Union�s Horizon 2020 research and innovation programme under grant agreement 688619. 39 | -------------------------------------------------------------------------------- /Unity/.gitignore: -------------------------------------------------------------------------------- 1 | 2 | #For Mac developers 3 | .DS_Store 4 | 5 | Assets/UnityVS 6 | 7 | [Oo]bj/ 8 | [Tt]emp/ 9 | [Ll]ibrary 10 | 11 | #These are files in the root folder of the project 12 | *.tmproj 13 | *.csproj 14 | *.unityproj 15 | *.sln 16 | *.suo 17 | *.user 18 | *.pidb 19 | *.userprefs 20 | 21 | AnnotationManager 22 | assetDatabase3 23 | AssetImportState 24 | assetservercachev3 25 | AssetServerCacheV3 26 | AssetVersioning.db 27 | AudioManager.asset 28 | BuildPlayer.prefs 29 | BuildSettings.asset 30 | DynamicsManager.asset 31 | EditorSettings.asset 32 | EditorUserBuildSettings.asset 33 | expandedItems 34 | FailedAssetImports.txt 35 | guidmapper 36 | InspectorExpandedItems.asset 37 | MonoManager.asset 38 | NetworkManager.asset 39 | ScriptMapper 40 | Assets/AssetStoreTools* 41 | Assets/Cardboard* 42 | Assets/Plugins/Android* 43 | 44 | 45 | ## Ignore Visual Studio files built from VSStudio4Unity 46 | 47 | *.suo 48 | *.user 49 | *.sln.docstates 50 | *.DotSettings 51 | *.csproj 52 | *.tli 53 | *.tlh 54 | *.tmp 55 | *.tmp_proj 56 | *.log 57 | *.vspscc 58 | *.vssscc 59 | .builds 60 | *.pidb 61 | *.svclog 62 | *.scc 63 | 64 | # Chutzpah Test files 65 | _Chutzpah* 66 | 67 | # Visual C++ cache files 68 | ipch/ 69 | *.aps 70 | *.ncb 71 | *.opensdf 72 | *.sdf 73 | *.cachefile 74 | 75 | # Visual Studio profiler 76 | *.psess 77 | *.vsp 78 | *.vspx 79 | 80 | # TFS 2012 Local Workspace 81 | $tf/ 82 | 83 | # Guidance Automation Toolkit 84 | *.gpState 85 | 86 | # ReSharper is a .NET coding add-in 87 | _ReSharper*/ 88 | *.[Rr]e[Ss]harper 89 | *.DotSettings.user 90 | 91 | # JustCode is a .NET coding addin-in 92 | .JustCode 93 | 94 | # TeamCity is a build add-in 95 | _TeamCity* 96 | 97 | # DotCover is a Code Coverage Tool 98 | *.dotCover 99 | 100 | # NCrunch 101 | _NCrunch_* 102 | .*crunch*.local.xml 103 | 104 | # MightyMoose 105 | *.mm.* 106 | AutoTest.Net/ 107 | 108 | # Web workbench (sass) 109 | .sass-cache/ 110 | 111 | # Installshield output folder 112 | [Ee]xpress/ 113 | 114 | # DocProject is a documentation generator add-in 115 | DocProject/buildhelp/ 116 | DocProject/Help/*.HxT 117 | DocProject/Help/*.HxC 118 | DocProject/Help/*.hhc 119 | DocProject/Help/*.hhk 120 | DocProject/Help/*.hhp 121 | DocProject/Help/Html2 122 | DocProject/Help/html 123 | 124 | # Click-Once directory 125 | publish/ 126 | 127 | # Publish Web Output 128 | *.[Pp]ublish.xml 129 | *.azurePubxml 130 | # TODO: Comment the next line if you want to checkin your web deploy settings 131 | # but database connection strings (with potential passwords) will be unencrypted 132 | *.pubxml 133 | *.publishproj 134 | 135 | # NuGet Packages 136 | *.nupkg 137 | # The packages folder can be ignored because of Package Restore 138 | **/packages/* 139 | # except build/, which is used as an MSBuild target. 140 | !**/packages/build/ 141 | # If using the old MSBuild-Integrated Package Restore, uncomment this: 142 | #!**/packages/repositories.config 143 | 144 | # Windows Azure Build Output 145 | csx/ 146 | *.build.csdef 147 | 148 | # Windows Store app package directory 149 | AppPackages/ 150 | 151 | # Others 152 | sql/ 153 | *.Cache 154 | ClientBin/ 155 | [Ss]tyle[Cc]op.* 156 | ~$* 157 | *~ 158 | *.dbmdl 159 | *.dbproj.schemaview 160 | *.pfx 161 | *.publishsettings 162 | node_modules/ 163 | 164 | # RIA/Silverlight projects 165 | Generated_Code/ 166 | 167 | # Backup & report files from converting an old project file 168 | # to a newer Visual Studio version. Backup files are not needed, 169 | # because we have git ;-) 170 | _UpgradeReport_Files/ 171 | Backup*/ 172 | UpgradeLog*.XML 173 | UpgradeLog*.htm 174 | 175 | # SQL Server files 176 | *.mdf 177 | *.ldf 178 | 179 | # Business Intelligence projects 180 | *.rdl.data 181 | *.bim.layout 182 | *.bim_*.settings 183 | 184 | # Microsoft Fakes 185 | FakesAssemblies/ 186 | -------------------------------------------------------------------------------- /Unity/AssetStore/GMT-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ua-i2cat/gst-unity-bridge/d08860e472334c2735c99c98636e17c6e1454bb7/Unity/AssetStore/GMT-icon.png -------------------------------------------------------------------------------- /Unity/AssetStore/GMT-large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ua-i2cat/gst-unity-bridge/d08860e472334c2735c99c98636e17c6e1454bb7/Unity/AssetStore/GMT-large.png -------------------------------------------------------------------------------- /Unity/AssetStore/GMT-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ua-i2cat/gst-unity-bridge/d08860e472334c2735c99c98636e17c6e1454bb7/Unity/AssetStore/GMT-small.png -------------------------------------------------------------------------------- /Unity/AssetStore/screenshot-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ua-i2cat/gst-unity-bridge/d08860e472334c2735c99c98636e17c6e1454bb7/Unity/AssetStore/screenshot-1.png -------------------------------------------------------------------------------- /Unity/AssetStore/screenshot-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ua-i2cat/gst-unity-bridge/d08860e472334c2735c99c98636e17c6e1454bb7/Unity/AssetStore/screenshot-2.png -------------------------------------------------------------------------------- /Unity/AssetStore/screenshot-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ua-i2cat/gst-unity-bridge/d08860e472334c2735c99c98636e17c6e1454bb7/Unity/AssetStore/screenshot-3.png -------------------------------------------------------------------------------- /Unity/Assets/GstUnityBridge.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a8187f69841627f4aace4a4030c52daa 3 | folderAsset: yes 4 | timeCreated: 1500037166 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Unity/Assets/GstUnityBridge/Materials.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 43f1611fcf45dd7438a9cd4bdc367146 3 | folderAsset: yes 4 | timeCreated: 1469795197 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Unity/Assets/GstUnityBridge/Materials/ExternalAlphaBase.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ua-i2cat/gst-unity-bridge/d08860e472334c2735c99c98636e17c6e1454bb7/Unity/Assets/GstUnityBridge/Materials/ExternalAlphaBase.mat -------------------------------------------------------------------------------- /Unity/Assets/GstUnityBridge/Materials/ExternalAlphaBase.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ea582520fd1b7cf459feb7bc7ea4a555 3 | timeCreated: 1469795201 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Unity/Assets/GstUnityBridge/Materials/ExternalAlphaGuide.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ua-i2cat/gst-unity-bridge/d08860e472334c2735c99c98636e17c6e1454bb7/Unity/Assets/GstUnityBridge/Materials/ExternalAlphaGuide.mat -------------------------------------------------------------------------------- /Unity/Assets/GstUnityBridge/Materials/ExternalAlphaGuide.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5400a3d7b4503d54f9fdca1302487910 3 | timeCreated: 1497010052 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | mainObjectFileID: -1 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Unity/Assets/GstUnityBridge/Materials/ExternalAlphaOverlay.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ua-i2cat/gst-unity-bridge/d08860e472334c2735c99c98636e17c6e1454bb7/Unity/Assets/GstUnityBridge/Materials/ExternalAlphaOverlay.mat -------------------------------------------------------------------------------- /Unity/Assets/GstUnityBridge/Materials/ExternalAlphaOverlay.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fad55eee0f3a3e047b3ced60d3bd62fc 3 | timeCreated: 1469795201 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Unity/Assets/GstUnityBridge/Materials/matShaderColorMask.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ua-i2cat/gst-unity-bridge/d08860e472334c2735c99c98636e17c6e1454bb7/Unity/Assets/GstUnityBridge/Materials/matShaderColorMask.mat -------------------------------------------------------------------------------- /Unity/Assets/GstUnityBridge/Materials/matShaderColorMask.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a818d10ae9aab4742912862ff341fa29 3 | timeCreated: 1469795201 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Unity/Assets/GstUnityBridge/Materials/matShaderMask.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ua-i2cat/gst-unity-bridge/d08860e472334c2735c99c98636e17c6e1454bb7/Unity/Assets/GstUnityBridge/Materials/matShaderMask.mat -------------------------------------------------------------------------------- /Unity/Assets/GstUnityBridge/Materials/matShaderMask.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 870cae6c46939a24a8cd1790da271237 3 | timeCreated: 1469795201 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Unity/Assets/GstUnityBridge/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 528586ac42c59d24fb55483d54cd6053 3 | folderAsset: yes 4 | timeCreated: 1449660873 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Unity/Assets/GstUnityBridge/Scripts/GstUnityBridge.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1ac552fd7e71ffd4282a2c0fe190c600 3 | folderAsset: yes 4 | timeCreated: 1463552002 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Unity/Assets/GstUnityBridge/Scripts/GstUnityBridge/EventProcessor.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System; 3 | using System.Collections.Generic; 4 | 5 | /* 6 | * Event processor to ensure events are executed from the main thread. 7 | * http://stackoverflow.com/questions/22513881/unity3d-how-to-process-events-in-the-correct-thread 8 | */ 9 | 10 | public class EventProcessor : MonoBehaviour 11 | { 12 | 13 | public void QueueEvent(Action action) 14 | { 15 | lock (m_queueLock) 16 | { 17 | m_queuedEvents.Add(action); 18 | } 19 | } 20 | 21 | void Update() 22 | { 23 | MoveQueuedEventsToExecuting(); 24 | 25 | while (m_executingEvents.Count > 0) 26 | { 27 | Action e = m_executingEvents[0]; 28 | m_executingEvents.RemoveAt(0); 29 | e(); 30 | } 31 | } 32 | 33 | private void MoveQueuedEventsToExecuting() 34 | { 35 | lock (m_queueLock) 36 | { 37 | while (m_queuedEvents.Count > 0) 38 | { 39 | Action e = m_queuedEvents[0]; 40 | m_executingEvents.Add(e); 41 | m_queuedEvents.RemoveAt(0); 42 | } 43 | } 44 | } 45 | 46 | private object m_queueLock = new object(); 47 | private List m_queuedEvents = new List(); 48 | private List m_executingEvents = new List(); 49 | } 50 | -------------------------------------------------------------------------------- /Unity/Assets/GstUnityBridge/Scripts/GstUnityBridge/EventProcessor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 98f86572628947344b0945fd78734056 3 | timeCreated: 1463062716 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/Assets/GstUnityBridge/Scripts/GstUnityBridge/GStreamer.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * GStreamer - Unity3D bridge (GUB). 3 | * Copyright (C) 2016 Fundacio i2CAT, Internet i Innovacio digital a Catalunya 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program 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 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program. If not, see . 17 | * 18 | * Authors: Xavi Artigas 19 | */ 20 | 21 | using UnityEngine; 22 | using System.Runtime.InteropServices; // For DllImport. 23 | using System; 24 | using System.IO; 25 | 26 | public class GStreamer 27 | { 28 | internal const string DllName = "GstUnityBridge"; 29 | 30 | [DllImport("gstreamer_android", CallingConvention = CallingConvention.Cdecl)] 31 | extern static private UIntPtr gst_android_get_application_class_loader(); 32 | 33 | [DllImport(DllName, CallingConvention = CallingConvention.Cdecl)] 34 | [return: MarshalAs(UnmanagedType.I4)] 35 | extern static private bool gub_ref([MarshalAs(UnmanagedType.LPStr)]string gst_debug_string); 36 | 37 | [DllImport(DllName, CallingConvention = CallingConvention.Cdecl)] 38 | extern static private void gub_unref(); 39 | 40 | [DllImport(DllName, CallingConvention = CallingConvention.Cdecl)] 41 | [return: MarshalAs(UnmanagedType.I4)] 42 | extern static private bool gub_is_active(); 43 | 44 | [UnmanagedFunctionPointer(CallingConvention.Cdecl)] 45 | internal delegate void GUBUnityDebugLogPFN( 46 | [MarshalAs(UnmanagedType.I4)]int level, 47 | [MarshalAs(UnmanagedType.LPStr)]string message); 48 | 49 | [DllImport(DllName, CallingConvention = CallingConvention.Cdecl)] 50 | extern static private void gub_log_set_unity_handler(GUBUnityDebugLogPFN pfn); 51 | 52 | internal static bool IsActive 53 | { 54 | get 55 | { 56 | return gub_is_active(); 57 | } 58 | } 59 | 60 | public static void AddPluginsToPath() 61 | { 62 | 63 | #if UNITY_ANDROID 64 | // Force loading of gstreamer_android.so before GstUnityBridge.so 65 | gst_android_get_application_class_loader(); 66 | AndroidJNIHelper.debug = true; 67 | AndroidJavaClass unityPlayer = new AndroidJavaClass("com.unity3d.player.UnityPlayer"); 68 | AndroidJavaObject activity = unityPlayer.GetStatic("currentActivity"); 69 | AndroidJavaClass gstAndroid = new AndroidJavaClass("org.freedesktop.gstreamer.GStreamer"); 70 | gstAndroid.CallStatic("init", activity); 71 | #endif 72 | 73 | // Setup the PATH environment variable so it can find the GstUnityBridge dll. 74 | var currentPath = Environment.GetEnvironmentVariable("PATH", 75 | EnvironmentVariableTarget.Process); 76 | var dllPath = ""; 77 | 78 | #if UNITY_EDITOR 79 | 80 | #if UNITY_EDITOR_32 81 | dllPath = Application.dataPath + "/Plugins/GStreamer/x86"; 82 | #elif UNITY_EDITOR_64 83 | dllPath = Application.dataPath + "/Plugins/GStreamer/x86_64"; 84 | #endif 85 | 86 | if (currentPath != null && currentPath.Contains(dllPath) == false) 87 | Environment.SetEnvironmentVariable("PATH", 88 | dllPath + Path.PathSeparator + 89 | dllPath + "/GStreamer/bin" + Path.PathSeparator + 90 | currentPath, 91 | EnvironmentVariableTarget.Process); 92 | #else 93 | dllPath = Application.dataPath + "/Plugins"; 94 | if (currentPath != null && currentPath.Contains(dllPath) == false) 95 | Environment.SetEnvironmentVariable("PATH", 96 | dllPath + Path.PathSeparator + 97 | currentPath, 98 | EnvironmentVariableTarget.Process); 99 | Environment.SetEnvironmentVariable("GST_PLUGIN_PATH", dllPath, EnvironmentVariableTarget.Process); 100 | #endif 101 | } 102 | 103 | internal static void Ref(string gst_debug_string, GUBUnityDebugLogPFN log_handler) 104 | { 105 | 106 | gub_log_set_unity_handler(log_handler); 107 | gub_ref(gst_debug_string); 108 | } 109 | 110 | internal static void Unref() 111 | { 112 | gub_unref(); 113 | } 114 | } 115 | -------------------------------------------------------------------------------- /Unity/Assets/GstUnityBridge/Scripts/GstUnityBridge/GStreamer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bc9bb370ed8f9e7428be0c5da86cc280 3 | timeCreated: 1449676123 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/Assets/GstUnityBridge/Scripts/GstUnityBridge/GstUnityBridgeCapture.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | using UnityEngine; 3 | 4 | #if EXPERIMENTAL 5 | 6 | class GstUnityBridgeCapture : MonoBehaviour 7 | { 8 | public Texture2D m_Source = null; 9 | public string m_Filename = null; 10 | 11 | private GstUnityBridgePipeline m_Pipeline; 12 | private GCHandle m_instanceHandle; 13 | 14 | private bool m_EOS = false; 15 | private int m_width = 0, m_height = 0; 16 | 17 | void Awake() 18 | { 19 | GStreamer.AddPluginsToPath(); 20 | } 21 | 22 | void Update() 23 | { 24 | if (m_Source == null || m_Filename == null) return; 25 | 26 | if (m_width != m_Source.width || m_height != m_Source.height) 27 | { 28 | m_width = m_Source.width; 29 | m_height = m_Source.height; 30 | m_Pipeline.SetupEncoding(m_Filename, m_Source.width, m_Source.height); 31 | m_Pipeline.Play(); 32 | } 33 | 34 | var pixels = m_Source.GetPixels32(); 35 | var handle = GCHandle.Alloc(pixels, GCHandleType.Pinned); 36 | m_Pipeline.ConsumeImage(handle.AddrOfPinnedObject(), pixels.Length * 4); 37 | handle.Free(); 38 | } 39 | 40 | 41 | private static void OnFinish(System.IntPtr p) 42 | { 43 | GstUnityBridgeCapture self = ((GCHandle)p).Target as GstUnityBridgeCapture; 44 | self.m_EOS = true; 45 | } 46 | 47 | void Initialize() 48 | { 49 | GStreamer.GUBUnityDebugLogPFN log_handler = null; 50 | if (Application.isEditor) 51 | { 52 | log_handler = (int level, string message) => Debug.logger.Log((LogType)level, "GUB", message); 53 | } 54 | 55 | GStreamer.Ref("2", log_handler); 56 | m_instanceHandle = GCHandle.Alloc(this); 57 | m_Pipeline = new GstUnityBridgePipeline(name + GetInstanceID(), OnFinish, null, null, (System.IntPtr)m_instanceHandle); 58 | } 59 | 60 | void Start() 61 | { 62 | Initialize(); 63 | if (string.IsNullOrEmpty(m_Filename)) 64 | { 65 | Debug.LogError("Please provide a filename"); 66 | return; 67 | } 68 | if (m_Source != null) 69 | { 70 | m_Pipeline.SetupEncoding(m_Filename, m_Source.width, m_Source.height); 71 | m_Pipeline.Play(); 72 | } 73 | } 74 | 75 | void OnDestroy() 76 | { 77 | Destroy(); 78 | } 79 | 80 | void OnApplicationQuit() 81 | { 82 | Destroy(); 83 | } 84 | 85 | private void Destroy() 86 | { 87 | if (m_Pipeline != null) 88 | { 89 | // Send EOS down the pipeline 90 | m_Pipeline.StopEncoding(); 91 | // Wait for EOS to reach the end 92 | while (!m_EOS) 93 | { 94 | System.Threading.Thread.Sleep(1000); 95 | } 96 | m_Pipeline.Destroy(); 97 | m_Pipeline = null; 98 | GStreamer.Unref(); 99 | m_instanceHandle.Free(); 100 | } 101 | } 102 | } 103 | 104 | #endif -------------------------------------------------------------------------------- /Unity/Assets/GstUnityBridge/Scripts/GstUnityBridge/GstUnityBridgeCapture.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7c8b345ff12658142bba993ec9963d6a 3 | timeCreated: 1463578186 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/Assets/GstUnityBridge/Scripts/GstUnityBridge/GstUnityBridgePipeline.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * GStreamer - Unity3D bridge (GUB). 3 | * Copyright (C) 2016 Fundacio i2CAT, Internet i Innovacio digital a Catalunya 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program 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 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program. If not, see . 17 | * 18 | * Authors: Xavi Artigas 19 | */ 20 | 21 | using UnityEngine; 22 | using System.Runtime.InteropServices; // For DllImport. 23 | 24 | public class GstUnityBridgePipeline 25 | { 26 | internal const string DllName = "GstUnityBridge"; 27 | 28 | [DllImport(DllName, CallingConvention = CallingConvention.Cdecl)] 29 | extern static private void gub_pipeline_destroy(System.IntPtr p); 30 | 31 | [DllImport(DllName, CallingConvention = CallingConvention.Cdecl)] 32 | extern static private void gub_pipeline_play(System.IntPtr p); 33 | 34 | [DllImport(DllName, CallingConvention = CallingConvention.Cdecl)] 35 | extern static private void gub_pipeline_pause(System.IntPtr p); 36 | 37 | [DllImport(DllName, CallingConvention = CallingConvention.Cdecl)] 38 | extern static private void gub_pipeline_stop(System.IntPtr p); 39 | 40 | [DllImport(DllName, CallingConvention = CallingConvention.Cdecl)] 41 | extern static private bool gub_pipeline_is_loaded(System.IntPtr p); 42 | 43 | [DllImport(DllName, CallingConvention = CallingConvention.Cdecl)] 44 | extern static private bool gub_pipeline_is_playing(System.IntPtr p); 45 | 46 | [DllImport(DllName, CallingConvention = CallingConvention.Cdecl)] 47 | extern static private void gub_pipeline_close(System.IntPtr p); 48 | 49 | [DllImport(DllName, CallingConvention = CallingConvention.Cdecl)] 50 | extern static private System.IntPtr gub_pipeline_create( 51 | [MarshalAs(UnmanagedType.LPStr)]string name, 52 | System.IntPtr eos_pfn, 53 | System.IntPtr error_pfn, 54 | System.IntPtr qos_pfn, 55 | System.IntPtr userdata); 56 | 57 | [DllImport(DllName, CallingConvention = CallingConvention.Cdecl)] 58 | extern static private void gub_pipeline_setup_decoding(System.IntPtr p, 59 | [MarshalAs(UnmanagedType.LPStr)]string uri, 60 | int video_index, 61 | int audio_index, 62 | [MarshalAs(UnmanagedType.LPStr)]string net_clock_address, 63 | int net_clock_port, 64 | ulong basetime, 65 | float crop_left, float crop_top, float crop_right, float crop_bottom); 66 | 67 | [DllImport(DllName, CallingConvention = CallingConvention.Cdecl)] 68 | extern static private void gub_pipeline_setup_decoding_clock(System.IntPtr p, 69 | [MarshalAs(UnmanagedType.LPStr)]string uri, 70 | int video_index, 71 | int audio_index, 72 | [MarshalAs(UnmanagedType.LPStr)]string net_clock_address, 73 | int net_clock_port, 74 | ulong basetime, 75 | float crop_left, float crop_top, float crop_right, float crop_bottom, 76 | bool isDvbWc); 77 | 78 | [DllImport(DllName, CallingConvention = CallingConvention.Cdecl)] 79 | extern static private int gub_pipeline_grab_frame(System.IntPtr p, ref int w, ref int h); 80 | 81 | [DllImport(DllName, CallingConvention = CallingConvention.Cdecl)] 82 | extern static private void gub_pipeline_blit_image(System.IntPtr p, System.IntPtr _TextureNativePtr); 83 | 84 | [UnmanagedFunctionPointer(CallingConvention.Cdecl)] 85 | internal delegate void GUBPipelineOnEosPFN(System.IntPtr p); 86 | 87 | [UnmanagedFunctionPointer(CallingConvention.Cdecl)] 88 | internal delegate void GUBPipelineOnErrorPFN(System.IntPtr p, 89 | [MarshalAs(UnmanagedType.LPStr)]string message); 90 | 91 | [UnmanagedFunctionPointer(CallingConvention.Cdecl)] 92 | internal delegate void GUBPipelineOnQosPFN(System.IntPtr p, 93 | long current_jitter, ulong current_running_time, ulong current_stream_time, ulong current_timestamp, 94 | double proportion, ulong processed, ulong dropped); 95 | 96 | [DllImport(DllName, CallingConvention = CallingConvention.Cdecl)] 97 | extern static private double gub_pipeline_get_duration(System.IntPtr p); 98 | 99 | [DllImport(DllName, CallingConvention = CallingConvention.Cdecl)] 100 | extern static private double gub_pipeline_get_position(System.IntPtr p); 101 | 102 | [DllImport(DllName, CallingConvention = CallingConvention.Cdecl)] 103 | extern static private void gub_pipeline_set_position(System.IntPtr p, double position); 104 | 105 | [DllImport(DllName, CallingConvention = CallingConvention.Cdecl)] 106 | extern static private void gub_pipeline_set_basetime(System.IntPtr p, ulong basetime); 107 | 108 | [DllImport(DllName, CallingConvention = CallingConvention.Cdecl)] 109 | extern static private void gub_pipeline_setup_encoding(System.IntPtr p, 110 | [MarshalAs(UnmanagedType.LPStr)]string filename, 111 | int width, int height); 112 | 113 | [DllImport(DllName, CallingConvention = CallingConvention.Cdecl)] 114 | extern static private void gub_pipeline_consume_image(System.IntPtr p, System.IntPtr rawdata, int size); 115 | 116 | [DllImport(DllName, CallingConvention = CallingConvention.Cdecl)] 117 | extern static private void gub_pipeline_stop_encoding(System.IntPtr p); 118 | 119 | [DllImport(DllName, CallingConvention = CallingConvention.Cdecl)] 120 | extern static private void gub_pipeline_set_volume(System.IntPtr p, double volume); 121 | 122 | [DllImport(DllName, CallingConvention = CallingConvention.Cdecl)] 123 | extern static private void gub_pipeline_set_adaptive_bitrate_limit(System.IntPtr p, float bitrate_limit); 124 | 125 | protected System.IntPtr m_Instance; 126 | 127 | internal bool IsLoaded 128 | { 129 | get 130 | { 131 | return gub_pipeline_is_loaded(m_Instance); 132 | } 133 | } 134 | 135 | internal bool IsPlaying 136 | { 137 | get 138 | { 139 | return gub_pipeline_is_playing(m_Instance); 140 | } 141 | } 142 | 143 | internal void Destroy() 144 | { 145 | gub_pipeline_destroy(m_Instance); 146 | } 147 | 148 | internal void Play() 149 | { 150 | gub_pipeline_play(m_Instance); 151 | } 152 | 153 | internal void Pause() 154 | { 155 | gub_pipeline_pause(m_Instance); 156 | } 157 | 158 | internal void Stop() 159 | { 160 | gub_pipeline_stop(m_Instance); 161 | } 162 | 163 | internal void Close() 164 | { 165 | gub_pipeline_close(m_Instance); 166 | } 167 | 168 | internal double Duration 169 | { 170 | get { return gub_pipeline_get_duration(m_Instance); } 171 | } 172 | 173 | internal double Position 174 | { 175 | get { return gub_pipeline_get_position(m_Instance); } 176 | set { gub_pipeline_set_position(m_Instance, value); } 177 | } 178 | 179 | internal ulong Basetime 180 | { 181 | set { gub_pipeline_set_basetime(m_Instance, value); } 182 | } 183 | 184 | internal GstUnityBridgePipeline(string name, GUBPipelineOnEosPFN eos_pfn, GUBPipelineOnErrorPFN error_pfn, GUBPipelineOnQosPFN qos_pfn, System.IntPtr userdata) 185 | { 186 | m_Instance = gub_pipeline_create(name, 187 | eos_pfn == null ? (System.IntPtr)null : Marshal.GetFunctionPointerForDelegate(eos_pfn), 188 | error_pfn == null ? (System.IntPtr)null : Marshal.GetFunctionPointerForDelegate(error_pfn), 189 | qos_pfn == null ? (System.IntPtr)null : Marshal.GetFunctionPointerForDelegate(qos_pfn), 190 | userdata); 191 | } 192 | 193 | internal void SetupDecoding(string uri, int video_index, int audio_index, string net_clock_address, int net_clock_port, ulong basetime, float crop_left, float crop_top, float crop_right, float crop_bottom, bool isDvbWc = false) 194 | { 195 | if (isDvbWc) 196 | { 197 | gub_pipeline_setup_decoding_clock(m_Instance, uri, video_index, audio_index, net_clock_address, net_clock_port, basetime, crop_left, crop_top, crop_right, crop_bottom, isDvbWc); 198 | } 199 | else 200 | { 201 | gub_pipeline_setup_decoding(m_Instance, uri, video_index, audio_index, net_clock_address, net_clock_port, basetime, crop_left, crop_top, crop_right, crop_bottom); 202 | } 203 | } 204 | 205 | internal bool GrabFrame(ref Vector2 frameSize) 206 | { 207 | int w = 0, h = 0; 208 | if (gub_pipeline_grab_frame(m_Instance, ref w, ref h) == 1) 209 | { 210 | frameSize.x = w; 211 | frameSize.y = h; 212 | return true; 213 | } 214 | return false; 215 | } 216 | 217 | internal void BlitTexture(System.IntPtr _NativeTexturePtr, int _TextureWidth, int _TextureHeight) 218 | { 219 | if (_NativeTexturePtr == System.IntPtr.Zero) return; 220 | 221 | gub_pipeline_blit_image(m_Instance, _NativeTexturePtr); 222 | } 223 | 224 | internal void SetupEncoding(string filename, int width, int height) 225 | { 226 | gub_pipeline_setup_encoding(m_Instance, filename, width, height); 227 | } 228 | 229 | internal void ConsumeImage(System.IntPtr ptr, int size) 230 | { 231 | gub_pipeline_consume_image(m_Instance, ptr, size); 232 | } 233 | 234 | internal void StopEncoding() 235 | { 236 | gub_pipeline_stop_encoding(m_Instance); 237 | } 238 | 239 | internal void SetVolume(double volume) 240 | { 241 | gub_pipeline_set_volume(m_Instance, volume); 242 | } 243 | 244 | internal void SetAdaptiveBitrateLimit(float bitrate_limit) 245 | { 246 | gub_pipeline_set_adaptive_bitrate_limit(m_Instance, bitrate_limit); 247 | } 248 | } 249 | -------------------------------------------------------------------------------- /Unity/Assets/GstUnityBridge/Scripts/GstUnityBridge/GstUnityBridgePipeline.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 85f7fe0eeb4e316409e100a6f82a194f 3 | timeCreated: 1449660873 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/Assets/GstUnityBridge/Scripts/GstUnityBridge/GstUnityBridgeStarter.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * GStreamer - Unity3D bridge (GUB). 3 | * Copyright (C) 2016 Fundacio i2CAT, Internet i Innovacio digital a Catalunya 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program 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 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program. If not, see . 17 | * 18 | * Authors: Xavi Artigas 19 | * Ibai Jurado 20 | */ 21 | 22 | using System.Collections; 23 | using System.Collections.Generic; 24 | using UnityEngine; 25 | 26 | public class GstUnityBridgeStarter : MonoBehaviour 27 | { 28 | [Tooltip("Enable the debug logs for GStreamer")] 29 | public bool GStreamerDebugActivated = true; 30 | private readonly string GStreamerDebugString = "2,dashdemux:5"; 31 | 32 | /// 33 | /// Initializes the GStreamer on Awake 34 | /// 35 | void Awake() 36 | { 37 | LoadGStreamer(); 38 | } 39 | 40 | /// 41 | /// When Application is closed calls UnloadGStreamer method 42 | /// 43 | void OnApplicationQuit() 44 | { 45 | UnLoadGStreamer(); 46 | } 47 | 48 | /// 49 | /// Loads GStreamer and makes the ref for the GStreamer's Log_handler. 50 | /// 51 | void LoadGStreamer() 52 | { 53 | try 54 | { 55 | GStreamer.AddPluginsToPath(); 56 | } 57 | catch 58 | { 59 | Debug.LogWarning("GStreamer not loaded correctly."); 60 | } 61 | 62 | GStreamer.GUBUnityDebugLogPFN log_handler = null; 63 | if (Application.isEditor && GStreamerDebugActivated) 64 | { 65 | log_handler = (int level, string message) => Debug.logger.Log((LogType)level, "GUB", message); 66 | } 67 | 68 | GStreamer.Ref(GStreamerDebugString.Length == 0 ? null : GStreamerDebugString, log_handler); 69 | } 70 | 71 | 72 | /// 73 | /// Unload the GStreamer's Log_handler 74 | /// 75 | void UnLoadGStreamer() 76 | { 77 | GStreamer.Unref(); 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /Unity/Assets/GstUnityBridge/Scripts/GstUnityBridge/GstUnityBridgeStarter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ac68f9d9beae9b74b809d41fc5451bf3 3 | timeCreated: 1497010049 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Unity/Assets/GstUnityBridge/Scripts/GstUnityBridge/GstUnityBridgeTexture.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 041fbe0a2bc0f15489ee461eb6f5009f 3 | timeCreated: 1449660873 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/Assets/GstUnityBridge/Shaders.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 14ab8bd58502c094fbda6654dfa20637 3 | folderAsset: yes 4 | timeCreated: 1469795197 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Unity/Assets/GstUnityBridge/Shaders/ExternalAlpha.shader: -------------------------------------------------------------------------------- 1 | // Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)' 2 | 3 | Shader "Unlit/ExternalAlpha" 4 | { 5 | Properties 6 | { 7 | _MainTex("Texture", 2D) = "white" {} 8 | _AlphaTex("Texture", 2D) = "white" {} 9 | } 10 | SubShader 11 | { 12 | Tags { "Queue" = "Transparent" "RenderType"="Transparent" } 13 | LOD 100 14 | 15 | Pass 16 | { 17 | Blend srcalpha oneminussrcalpha 18 | CGPROGRAM 19 | #pragma vertex vert 20 | #pragma fragment frag 21 | 22 | #include "UnityCG.cginc" 23 | 24 | struct appdata 25 | { 26 | float4 vertex : POSITION; 27 | float2 uv : TEXCOORD0; 28 | }; 29 | 30 | struct v2f 31 | { 32 | float2 uv : TEXCOORD0; 33 | float4 vertex : SV_POSITION; 34 | }; 35 | 36 | sampler2D _MainTex; 37 | sampler2D _AlphaTex; 38 | float4 _MainTex_ST; 39 | 40 | v2f vert (appdata v) 41 | { 42 | v2f o; 43 | o.vertex = UnityObjectToClipPos(v.vertex); 44 | o.uv = TRANSFORM_TEX(v.uv, _MainTex); 45 | return o; 46 | } 47 | 48 | fixed4 frag (v2f i) : SV_Target 49 | { 50 | // sample the texture 51 | fixed4 col = tex2D(_MainTex, i.uv); 52 | fixed4 alpha = tex2D(_AlphaTex, i.uv); 53 | col.a = alpha.r; 54 | return col; 55 | } 56 | ENDCG 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /Unity/Assets/GstUnityBridge/Shaders/ExternalAlpha.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1089f18c2cafb2949b20d58b098dd50a 3 | timeCreated: 1469795201 4 | licenseType: Free 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Unity/Assets/GstUnityBridge/Shaders/ExternalAlphaColor.shader: -------------------------------------------------------------------------------- 1 | // Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)' 2 | 3 | Shader "Unlit/ExternalAlphaColor" 4 | { 5 | Properties 6 | { 7 | _MainTex("Texture", 2D) = "white" {} 8 | _AlphaTex("Texture", 2D) = "white" {} 9 | _Color("Color Tint", Color) = (1,1,1,1) 10 | } 11 | SubShader 12 | { 13 | Tags { "Queue" = "Transparent" "RenderType"="Transparent" } 14 | LOD 100 15 | 16 | Pass 17 | { 18 | Blend srcalpha oneminussrcalpha 19 | CGPROGRAM 20 | #pragma vertex vert 21 | #pragma fragment frag 22 | 23 | #include "UnityCG.cginc" 24 | 25 | struct appdata 26 | { 27 | float4 vertex : POSITION; 28 | float2 uv : TEXCOORD0; 29 | }; 30 | 31 | struct v2f 32 | { 33 | float2 uv : TEXCOORD0; 34 | float4 vertex : SV_POSITION; 35 | }; 36 | 37 | sampler2D _MainTex; 38 | sampler2D _AlphaTex; 39 | float4 _Color; 40 | 41 | float4 _MainTex_ST; 42 | 43 | v2f vert (appdata v) 44 | { 45 | v2f o; 46 | o.vertex = UnityObjectToClipPos(v.vertex); 47 | o.uv = TRANSFORM_TEX(v.uv, _MainTex); 48 | return o; 49 | } 50 | 51 | fixed4 frag (v2f i) : SV_Target 52 | { 53 | // sample the texture 54 | fixed4 col = tex2D(_MainTex, i.uv); 55 | fixed4 alpha = tex2D(_AlphaTex, i.uv); 56 | col.rgb = col.rgb * _Color.rgb; 57 | col.a = alpha.r; 58 | return col; 59 | } 60 | ENDCG 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /Unity/Assets/GstUnityBridge/Shaders/ExternalAlphaColor.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c0524682b97393e43b2d2d5c9165a50d 3 | timeCreated: 1469795201 4 | licenseType: Free 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Unity/Assets/GstUnityBridge/Shaders/ExternalAlphaGuide.shader: -------------------------------------------------------------------------------- 1 | // Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)' 2 | 3 | Shader "GUB/TransitionsBase" { 4 | 5 | Properties{ 6 | _MainTex("Texture", 2D) = "white" {} 7 | _AlphaTex("Guide (RGB)", 2D) = "white" {} 8 | _Color("Color Tint", Color) = (1,1,1,1) 9 | _TransitionProgress("TransitionProgress",Range(0,1)) = 1 10 | [KeywordEnum(Disable,Enable)] _Inverse("Inverse", Float) = 0 11 | [KeywordEnum(Solid, Transparency, Threshold, Video)] _Solid("BodySolid", Float) = 3 12 | _TimeFactor("TimeFactor", Float) = 1 13 | 14 | } 15 | 16 | SubShader{ 17 | 18 | Tags{ "Queue" = "Transparent" "RenderType" = "Transparent" } 19 | LOD 200 20 | 21 | Pass 22 | { 23 | Blend srcalpha oneminussrcalpha 24 | CGPROGRAM 25 | #pragma vertex vert 26 | #pragma fragment frag 27 | 28 | #include "UnityCG.cginc" 29 | 30 | struct appdata 31 | { 32 | float4 vertex : POSITION; 33 | float2 uv : TEXCOORD0; 34 | }; 35 | 36 | struct v2f 37 | { 38 | float2 uv : TEXCOORD0; 39 | float4 vertex : SV_POSITION; 40 | }; 41 | 42 | sampler2D _MainTex; 43 | sampler2D _AlphaTex; 44 | float4 _Color; 45 | float _TransitionProgress; 46 | float _Inverse; 47 | float _Solid; 48 | float _TimeFactor; 49 | 50 | float4 _MainTex_ST; 51 | 52 | v2f vert(appdata v) 53 | { 54 | v2f o; 55 | o.vertex = UnityObjectToClipPos(v.vertex); 56 | o.uv = TRANSFORM_TEX(v.uv, _MainTex); 57 | return o; 58 | } 59 | 60 | fixed4 frag(v2f i) : SV_Target 61 | { 62 | fixed4 col = tex2D(_MainTex, i.uv); 63 | fixed4 g = tex2D(_AlphaTex, i.uv); 64 | col.rgb = col.rgb * _Color.rgb; 65 | 66 | half activeValue = 1; 67 | half inactiveValue = 0; 68 | half transparency = _TransitionProgress * _TimeFactor; 69 | 70 | if (_Solid == 2) 71 | { 72 | activeValue = transparency; 73 | } 74 | 75 | if (_Inverse) 76 | { 77 | activeValue = 0; 78 | inactiveValue = 1; 79 | transparency = 1 - transparency; 80 | 81 | if (_Solid == 2) 82 | { 83 | activeValue = transparency; 84 | } 85 | } 86 | 87 | if (_Solid == 3) 88 | { 89 | col.a = g.r; 90 | } 91 | else if (_Solid == 1) 92 | { 93 | col.a = transparency; 94 | } 95 | else if ((g.r + g.g + g.b)*0.33333f <= _TransitionProgress) 96 | { 97 | col.a = activeValue; 98 | } 99 | else 100 | { 101 | col.a = inactiveValue; 102 | } 103 | 104 | return col; 105 | 106 | } 107 | ENDCG 108 | } 109 | } 110 | } 111 | -------------------------------------------------------------------------------- /Unity/Assets/GstUnityBridge/Shaders/ExternalAlphaGuide.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 42ab695c73408e04fb783e296a58bc0e 3 | timeCreated: 1497010052 4 | licenseType: Pro 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Unity/Assets/GstUnityBridge/Test Scenes.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 08bd5e33561350347be57a85704517a1 3 | folderAsset: yes 4 | timeCreated: 1464253071 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Unity/Assets/GstUnityBridge/Test Scenes/Experimental.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c5d1de5fdc757e7478c55db0c79bddd6 3 | folderAsset: yes 4 | timeCreated: 1464353000 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Unity/Assets/GstUnityBridge/Test Scenes/Experimental/ExperimentalTestCapture.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | #if EXPERIMENTAL 4 | public class ExperimentalTestCapture : MonoBehaviour 5 | { 6 | 7 | // Use this for initialization 8 | void Start() 9 | { 10 | 11 | } 12 | 13 | // Update is called once per frame 14 | void LateUpdate() 15 | { 16 | RenderTexture rt = new RenderTexture(640, 480, 24); 17 | Camera cam = GetComponent(); 18 | cam.targetTexture = rt; 19 | RenderTexture.active = rt; 20 | cam.Render(); 21 | Texture2D tex = new Texture2D(640, 480, TextureFormat.RGB24, false); 22 | tex.ReadPixels(new Rect(0, 0, 640, 480), 0, 0); 23 | GstUnityBridgeCapture capture = GameObject.Find("Recorder").GetComponent(); 24 | capture.m_Source = tex; 25 | cam.targetTexture = null; 26 | RenderTexture.active = null; 27 | } 28 | } 29 | #endif 30 | -------------------------------------------------------------------------------- /Unity/Assets/GstUnityBridge/Test Scenes/Experimental/ExperimentalTestCapture.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e082c436f67d48847b70120b5dc99467 3 | timeCreated: 1464354277 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/Assets/GstUnityBridge/Test Scenes/Experimental/ExperimentalTestRotate.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | public class ExperimentalTestRotate : MonoBehaviour 4 | { 5 | 6 | // Use this for initialization 7 | void Start() 8 | { 9 | 10 | } 11 | 12 | // Update is called once per frame 13 | void Update() 14 | { 15 | transform.Rotate(new Vector3(1, 0, 0), 1F); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Unity/Assets/GstUnityBridge/Test Scenes/Experimental/ExperimentalTestRotate.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e933197486776bf46ad6633646b59064 3 | timeCreated: 1464354277 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/Assets/GstUnityBridge/Test Scenes/Experimental/TestAlphaCompositing.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 510acfbc4fd38e7478e44f46b5f6f178 3 | timeCreated: 1464188948 4 | licenseType: Free 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Unity/Assets/GstUnityBridge/Test Scenes/Experimental/TestAnimatedAlpha.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: dc649eaa24f73914595e96f3773c9a60 3 | timeCreated: 1464606063 4 | licenseType: Free 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Unity/Assets/GstUnityBridge/Test Scenes/Experimental/TestCapture.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7f707ee5af4be3647a8a215eecab96d3 3 | timeCreated: 1463648678 4 | licenseType: Free 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Unity/Assets/GstUnityBridge/Test Scenes/Experimental/TestStaticAlpha.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 42c381c01c9dc1047b47b76fa58c313f 3 | timeCreated: 1464606155 4 | licenseType: Free 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Unity/Assets/GstUnityBridge/Test Scenes/Experimental/readme_experimental.txt: -------------------------------------------------------------------------------- 1 | EXPERIMENTAL FEATURES 2 | --------------------- 3 | 4 | The scenes contained in this folder demonstrate some features of the GStreamer 5 | Movie Texture which are still marked as EXPERIMENTAL, meaning that they might 6 | be unstable, deprecated in the future or their usage might change. In any case, 7 | they should not be relied upon. 8 | To enable them, write EXPERIMENTAL in the Script Define Symbol box in the 9 | Player Settings (Under Other Settings). 10 | 11 | These features are: 12 | 13 | PROPERTIES 14 | ---------- 15 | - Is Alpha: When this flag is not checked (normal use case) the video frames 16 | are used as the main texture (_MainTex) of the first material in the 17 | Renderer component of the Game Object. When the flag is set, instead, the 18 | video frames are used in a texture called _AlphaTex. When used with the 19 | provided ExternalAlpha shader, this allows having two GUBTexture components 20 | stacked over the same Game Object, one providing the video color and the 21 | other the video transparency. 22 | - Base Time: Basetime allows connecting to an already playing pipeline, by 23 | using the same basetime on all players. Set to 0 to start playing the media 24 | from the beginning (normal use). 25 | 26 | COMPONENTS 27 | ---------- 28 | - GstUnityBridgeCapture: On its Update() function will read the texture 29 | indicated in the Source property, encode it and write it into an MP4/H.264 30 | file. 31 | -------------------------------------------------------------------------------- /Unity/Assets/GstUnityBridge/Test Scenes/Experimental/readme_experimental.txt.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 19d5aafb2e657154d9f48454690fc99a 3 | timeCreated: 1464353000 4 | licenseType: Free 5 | TextScriptImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Unity/Assets/GstUnityBridge/Test Scenes/Local-clip.unity: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ua-i2cat/gst-unity-bridge/d08860e472334c2735c99c98636e17c6e1454bb7/Unity/Assets/GstUnityBridge/Test Scenes/Local-clip.unity -------------------------------------------------------------------------------- /Unity/Assets/GstUnityBridge/Test Scenes/Local-clip.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8513cd35ae430d249b1709263e7a8b7b 3 | timeCreated: 1459772981 4 | licenseType: Free 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Unity/Assets/GstUnityBridge/Test Scenes/Multiple-remote-clips.unity: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ua-i2cat/gst-unity-bridge/d08860e472334c2735c99c98636e17c6e1454bb7/Unity/Assets/GstUnityBridge/Test Scenes/Multiple-remote-clips.unity -------------------------------------------------------------------------------- /Unity/Assets/GstUnityBridge/Test Scenes/Multiple-remote-clips.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ca3dc1062c98e5d41baff916abd0f1e0 3 | timeCreated: 1459773521 4 | licenseType: Free 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Unity/Assets/GstUnityBridge/Test Scenes/Remote-clip.unity: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ua-i2cat/gst-unity-bridge/d08860e472334c2735c99c98636e17c6e1454bb7/Unity/Assets/GstUnityBridge/Test Scenes/Remote-clip.unity -------------------------------------------------------------------------------- /Unity/Assets/GstUnityBridge/Test Scenes/Remote-clip.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5b42b66c431b13a41b673ae490289439 3 | timeCreated: 1459846625 4 | licenseType: Free 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Unity/Assets/Plugins.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d21a20df23f4e78459632f7295c52f7b 3 | folderAsset: yes 4 | timeCreated: 1452157320 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Unity/Assets/Plugins/GStreamer.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: add03111b54bfef489eec401fa05f720 3 | folderAsset: yes 4 | timeCreated: 1500619183 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Unity/Assets/Plugins/GStreamer/android_arm.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ffee99f927ef4c64ab88a50ed7899216 3 | folderAsset: yes 4 | timeCreated: 1500627352 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Unity/Assets/Plugins/GStreamer/android_arm/libgstreamer_android.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ua-i2cat/gst-unity-bridge/d08860e472334c2735c99c98636e17c6e1454bb7/Unity/Assets/Plugins/GStreamer/android_arm/libgstreamer_android.so -------------------------------------------------------------------------------- /Unity/Assets/Plugins/GStreamer/android_arm/libgstreamer_android.so.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 040f3af70f7355d43b1df9042e19a6f4 3 | timeCreated: 1500381726 4 | licenseType: Pro 5 | PluginImporter: 6 | serializedVersion: 2 7 | iconMap: {} 8 | executionOrder: {} 9 | isPreloaded: 0 10 | isOverridable: 0 11 | platformData: 12 | data: 13 | first: 14 | Android: Android 15 | second: 16 | enabled: 1 17 | settings: 18 | CPU: ARMv7 19 | data: 20 | first: 21 | Any: 22 | second: 23 | enabled: 0 24 | settings: {} 25 | data: 26 | first: 27 | Editor: Editor 28 | second: 29 | enabled: 0 30 | settings: 31 | CPU: AnyCPU 32 | DefaultValueInitialized: true 33 | OS: AnyOS 34 | data: 35 | first: 36 | Facebook: Win 37 | second: 38 | enabled: 0 39 | settings: 40 | CPU: AnyCPU 41 | data: 42 | first: 43 | Facebook: Win64 44 | second: 45 | enabled: 0 46 | settings: 47 | CPU: AnyCPU 48 | data: 49 | first: 50 | Standalone: Linux 51 | second: 52 | enabled: 0 53 | settings: 54 | CPU: x86 55 | data: 56 | first: 57 | Standalone: Linux64 58 | second: 59 | enabled: 0 60 | settings: 61 | CPU: x86_64 62 | data: 63 | first: 64 | Standalone: OSXIntel 65 | second: 66 | enabled: 0 67 | settings: 68 | CPU: AnyCPU 69 | data: 70 | first: 71 | Standalone: OSXIntel64 72 | second: 73 | enabled: 0 74 | settings: 75 | CPU: AnyCPU 76 | data: 77 | first: 78 | Standalone: Win 79 | second: 80 | enabled: 0 81 | settings: 82 | CPU: AnyCPU 83 | data: 84 | first: 85 | Standalone: Win64 86 | second: 87 | enabled: 0 88 | settings: 89 | CPU: AnyCPU 90 | userData: 91 | assetBundleName: 92 | assetBundleVariant: 93 | -------------------------------------------------------------------------------- /Unity/Assets/Plugins/GstUnityBridge.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 26fe719887d3adf41a85e53581764836 3 | folderAsset: yes 4 | timeCreated: 1500037166 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Unity/Assets/Plugins/GstUnityBridge/android_arm.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a13dd69cb46ff424999874a066d96ec1 3 | folderAsset: yes 4 | timeCreated: 1452157320 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Unity/Assets/Plugins/GstUnityBridge/android_arm/gub.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ua-i2cat/gst-unity-bridge/d08860e472334c2735c99c98636e17c6e1454bb7/Unity/Assets/Plugins/GstUnityBridge/android_arm/gub.jar -------------------------------------------------------------------------------- /Unity/Assets/Plugins/GstUnityBridge/android_arm/gub.jar.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ee2c8bfa737cb70429b2bf626a446935 3 | timeCreated: 1456927710 4 | licenseType: Free 5 | PluginImporter: 6 | serializedVersion: 1 7 | iconMap: {} 8 | executionOrder: {} 9 | isPreloaded: 0 10 | platformData: 11 | Any: 12 | enabled: 1 13 | settings: {} 14 | userData: 15 | assetBundleName: 16 | assetBundleVariant: 17 | -------------------------------------------------------------------------------- /Unity/Assets/Plugins/GstUnityBridge/android_arm/libDvbCssWc.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ua-i2cat/gst-unity-bridge/d08860e472334c2735c99c98636e17c6e1454bb7/Unity/Assets/Plugins/GstUnityBridge/android_arm/libDvbCssWc.so -------------------------------------------------------------------------------- /Unity/Assets/Plugins/GstUnityBridge/android_arm/libDvbCssWc.so.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: facd49bebcd2e4c49821948c6082f48b 3 | timeCreated: 1470917932 4 | licenseType: Free 5 | PluginImporter: 6 | serializedVersion: 1 7 | iconMap: {} 8 | executionOrder: {} 9 | isPreloaded: 0 10 | platformData: 11 | Android: 12 | enabled: 1 13 | settings: 14 | CPU: AnyCPU 15 | Any: 16 | enabled: 0 17 | settings: {} 18 | Editor: 19 | enabled: 0 20 | settings: 21 | CPU: AnyCPU 22 | DefaultValueInitialized: true 23 | OS: AnyOS 24 | Linux: 25 | enabled: 0 26 | settings: 27 | CPU: x86 28 | Linux64: 29 | enabled: 0 30 | settings: 31 | CPU: x86_64 32 | OSXIntel: 33 | enabled: 0 34 | settings: 35 | CPU: AnyCPU 36 | OSXIntel64: 37 | enabled: 0 38 | settings: 39 | CPU: AnyCPU 40 | Win: 41 | enabled: 0 42 | settings: 43 | CPU: AnyCPU 44 | Win64: 45 | enabled: 0 46 | settings: 47 | CPU: AnyCPU 48 | userData: 49 | assetBundleName: 50 | assetBundleVariant: 51 | -------------------------------------------------------------------------------- /Unity/Assets/Plugins/GstUnityBridge/android_arm/libGstUnityBridge.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ua-i2cat/gst-unity-bridge/d08860e472334c2735c99c98636e17c6e1454bb7/Unity/Assets/Plugins/GstUnityBridge/android_arm/libGstUnityBridge.so -------------------------------------------------------------------------------- /Unity/Assets/Plugins/GstUnityBridge/android_arm/libGstUnityBridge.so.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2b47c3e21231ede4ea280ece1b850122 3 | timeCreated: 1452157576 4 | licenseType: Free 5 | PluginImporter: 6 | serializedVersion: 1 7 | iconMap: {} 8 | executionOrder: {} 9 | isPreloaded: 0 10 | platformData: 11 | Android: 12 | enabled: 1 13 | settings: 14 | CPU: AnyCPU 15 | Any: 16 | enabled: 0 17 | settings: {} 18 | Editor: 19 | enabled: 0 20 | settings: 21 | CPU: AnyCPU 22 | DefaultValueInitialized: true 23 | OS: AnyOS 24 | Linux: 25 | enabled: 0 26 | settings: 27 | CPU: x86 28 | Linux64: 29 | enabled: 0 30 | settings: 31 | CPU: x86_64 32 | LinuxUniversal: 33 | enabled: 0 34 | settings: 35 | CPU: None 36 | OSXIntel: 37 | enabled: 0 38 | settings: 39 | CPU: AnyCPU 40 | OSXIntel64: 41 | enabled: 0 42 | settings: 43 | CPU: AnyCPU 44 | OSXUniversal: 45 | enabled: 0 46 | settings: 47 | CPU: None 48 | Win: 49 | enabled: 0 50 | settings: 51 | CPU: AnyCPU 52 | Win64: 53 | enabled: 0 54 | settings: 55 | CPU: AnyCPU 56 | userData: 57 | assetBundleName: 58 | assetBundleVariant: 59 | -------------------------------------------------------------------------------- /Unity/Assets/Plugins/GstUnityBridge/x86.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 584f6b53f763e409390610a85304e249 3 | folderAsset: yes 4 | timeCreated: 1449672488 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Unity/Assets/Plugins/GstUnityBridge/x86/DvbCssWc.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ua-i2cat/gst-unity-bridge/d08860e472334c2735c99c98636e17c6e1454bb7/Unity/Assets/Plugins/GstUnityBridge/x86/DvbCssWc.dll -------------------------------------------------------------------------------- /Unity/Assets/Plugins/GstUnityBridge/x86/DvbCssWc.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fcaae56387251904ab0b39062c39b9bd 3 | timeCreated: 1500623449 4 | licenseType: Pro 5 | PluginImporter: 6 | serializedVersion: 2 7 | iconMap: {} 8 | executionOrder: {} 9 | isPreloaded: 0 10 | isOverridable: 0 11 | platformData: 12 | data: 13 | first: 14 | '': Any 15 | second: 16 | enabled: 0 17 | settings: 18 | Exclude Android: 1 19 | Exclude Editor: 1 20 | Exclude Linux: 0 21 | Exclude Linux64: 0 22 | Exclude LinuxUniversal: 0 23 | Exclude OSXIntel: 0 24 | Exclude OSXIntel64: 0 25 | Exclude OSXUniversal: 0 26 | Exclude Win: 0 27 | Exclude Win64: 1 28 | data: 29 | first: 30 | '': Editor 31 | second: 32 | enabled: 0 33 | settings: 34 | CPU: x86 35 | OS: AnyOS 36 | data: 37 | first: 38 | Android: Android 39 | second: 40 | enabled: 0 41 | settings: 42 | CPU: ARMv7 43 | data: 44 | first: 45 | Any: 46 | second: 47 | enabled: 0 48 | settings: {} 49 | data: 50 | first: 51 | Editor: Editor 52 | second: 53 | enabled: 0 54 | settings: 55 | DefaultValueInitialized: true 56 | data: 57 | first: 58 | Facebook: Win 59 | second: 60 | enabled: 0 61 | settings: 62 | CPU: AnyCPU 63 | data: 64 | first: 65 | Facebook: Win64 66 | second: 67 | enabled: 0 68 | settings: 69 | CPU: None 70 | data: 71 | first: 72 | Standalone: Linux 73 | second: 74 | enabled: 1 75 | settings: 76 | CPU: x86 77 | data: 78 | first: 79 | Standalone: Linux64 80 | second: 81 | enabled: 1 82 | settings: 83 | CPU: x86_64 84 | data: 85 | first: 86 | Standalone: LinuxUniversal 87 | second: 88 | enabled: 1 89 | settings: 90 | CPU: AnyCPU 91 | data: 92 | first: 93 | Standalone: OSXIntel 94 | second: 95 | enabled: 1 96 | settings: 97 | CPU: AnyCPU 98 | data: 99 | first: 100 | Standalone: OSXIntel64 101 | second: 102 | enabled: 1 103 | settings: 104 | CPU: AnyCPU 105 | data: 106 | first: 107 | Standalone: OSXUniversal 108 | second: 109 | enabled: 1 110 | settings: 111 | CPU: AnyCPU 112 | data: 113 | first: 114 | Standalone: Win 115 | second: 116 | enabled: 1 117 | settings: 118 | CPU: AnyCPU 119 | data: 120 | first: 121 | Standalone: Win64 122 | second: 123 | enabled: 0 124 | settings: 125 | CPU: None 126 | userData: 127 | assetBundleName: 128 | assetBundleVariant: 129 | -------------------------------------------------------------------------------- /Unity/Assets/Plugins/GstUnityBridge/x86/GstUnityBridge.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ua-i2cat/gst-unity-bridge/d08860e472334c2735c99c98636e17c6e1454bb7/Unity/Assets/Plugins/GstUnityBridge/x86/GstUnityBridge.dll -------------------------------------------------------------------------------- /Unity/Assets/Plugins/GstUnityBridge/x86/GstUnityBridge.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5006160b8ccaa9f4e80e6317f197484f 3 | timeCreated: 1458230321 4 | licenseType: Free 5 | PluginImporter: 6 | serializedVersion: 2 7 | iconMap: {} 8 | executionOrder: {} 9 | isPreloaded: 0 10 | isOverridable: 0 11 | platformData: 12 | data: 13 | first: 14 | '': Any 15 | second: 16 | enabled: 0 17 | settings: 18 | Exclude Android: 1 19 | Exclude Editor: 0 20 | Exclude Linux: 0 21 | Exclude Linux64: 1 22 | Exclude LinuxUniversal: 1 23 | Exclude OSXIntel: 0 24 | Exclude OSXIntel64: 1 25 | Exclude OSXUniversal: 1 26 | Exclude Win: 0 27 | Exclude Win64: 1 28 | data: 29 | first: 30 | '': Editor 31 | second: 32 | enabled: 0 33 | settings: 34 | CPU: x86 35 | OS: Windows 36 | data: 37 | first: 38 | Android: Android 39 | second: 40 | enabled: 0 41 | settings: 42 | CPU: ARMv7 43 | data: 44 | first: 45 | Any: 46 | second: 47 | enabled: 0 48 | settings: {} 49 | data: 50 | first: 51 | Editor: Editor 52 | second: 53 | enabled: 1 54 | settings: 55 | CPU: x86 56 | DefaultValueInitialized: true 57 | OS: AnyOS 58 | data: 59 | first: 60 | Facebook: Win 61 | second: 62 | enabled: 1 63 | settings: 64 | CPU: AnyCPU 65 | data: 66 | first: 67 | Facebook: Win64 68 | second: 69 | enabled: 0 70 | settings: 71 | CPU: None 72 | data: 73 | first: 74 | Standalone: Linux 75 | second: 76 | enabled: 1 77 | settings: 78 | CPU: x86 79 | data: 80 | first: 81 | Standalone: Linux64 82 | second: 83 | enabled: 0 84 | settings: 85 | CPU: None 86 | data: 87 | first: 88 | Standalone: LinuxUniversal 89 | second: 90 | enabled: 0 91 | settings: 92 | CPU: x86 93 | data: 94 | first: 95 | Standalone: OSXIntel 96 | second: 97 | enabled: 1 98 | settings: 99 | CPU: AnyCPU 100 | data: 101 | first: 102 | Standalone: OSXIntel64 103 | second: 104 | enabled: 0 105 | settings: 106 | CPU: None 107 | data: 108 | first: 109 | Standalone: OSXUniversal 110 | second: 111 | enabled: 0 112 | settings: 113 | CPU: x86 114 | data: 115 | first: 116 | Standalone: Win 117 | second: 118 | enabled: 1 119 | settings: 120 | CPU: AnyCPU 121 | data: 122 | first: 123 | Standalone: Win64 124 | second: 125 | enabled: 0 126 | settings: 127 | CPU: None 128 | userData: 129 | assetBundleName: 130 | assetBundleVariant: 131 | -------------------------------------------------------------------------------- /Unity/Assets/Plugins/GstUnityBridge/x86_64.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 006f50925eb084fb7a542a990aee6ee1 3 | folderAsset: yes 4 | timeCreated: 1449672488 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Unity/Assets/Plugins/GstUnityBridge/x86_64/DvbCssWc.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ua-i2cat/gst-unity-bridge/d08860e472334c2735c99c98636e17c6e1454bb7/Unity/Assets/Plugins/GstUnityBridge/x86_64/DvbCssWc.dll -------------------------------------------------------------------------------- /Unity/Assets/Plugins/GstUnityBridge/x86_64/DvbCssWc.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e5113ddeef0fe3a449d37be2d5d3f1af 3 | timeCreated: 1500623495 4 | licenseType: Pro 5 | PluginImporter: 6 | serializedVersion: 2 7 | iconMap: {} 8 | executionOrder: {} 9 | isPreloaded: 0 10 | isOverridable: 0 11 | platformData: 12 | data: 13 | first: 14 | '': Any 15 | second: 16 | enabled: 0 17 | settings: 18 | Exclude Android: 1 19 | Exclude Editor: 0 20 | Exclude Linux: 0 21 | Exclude Linux64: 0 22 | Exclude LinuxUniversal: 0 23 | Exclude OSXIntel: 0 24 | Exclude OSXIntel64: 0 25 | Exclude OSXUniversal: 0 26 | Exclude Win: 1 27 | Exclude Win64: 0 28 | data: 29 | first: 30 | '': Editor 31 | second: 32 | enabled: 0 33 | settings: 34 | CPU: x86_64 35 | OS: AnyOS 36 | data: 37 | first: 38 | Android: Android 39 | second: 40 | enabled: 0 41 | settings: 42 | CPU: ARMv7 43 | data: 44 | first: 45 | Any: 46 | second: 47 | enabled: 0 48 | settings: {} 49 | data: 50 | first: 51 | Editor: Editor 52 | second: 53 | enabled: 1 54 | settings: 55 | DefaultValueInitialized: true 56 | data: 57 | first: 58 | Facebook: Win 59 | second: 60 | enabled: 0 61 | settings: 62 | CPU: None 63 | data: 64 | first: 65 | Facebook: Win64 66 | second: 67 | enabled: 0 68 | settings: 69 | CPU: AnyCPU 70 | data: 71 | first: 72 | Standalone: Linux 73 | second: 74 | enabled: 1 75 | settings: 76 | CPU: x86 77 | data: 78 | first: 79 | Standalone: Linux64 80 | second: 81 | enabled: 1 82 | settings: 83 | CPU: x86_64 84 | data: 85 | first: 86 | Standalone: LinuxUniversal 87 | second: 88 | enabled: 1 89 | settings: 90 | CPU: AnyCPU 91 | data: 92 | first: 93 | Standalone: OSXIntel 94 | second: 95 | enabled: 1 96 | settings: 97 | CPU: AnyCPU 98 | data: 99 | first: 100 | Standalone: OSXIntel64 101 | second: 102 | enabled: 1 103 | settings: 104 | CPU: AnyCPU 105 | data: 106 | first: 107 | Standalone: OSXUniversal 108 | second: 109 | enabled: 1 110 | settings: 111 | CPU: AnyCPU 112 | data: 113 | first: 114 | Standalone: Win 115 | second: 116 | enabled: 0 117 | settings: 118 | CPU: None 119 | data: 120 | first: 121 | Standalone: Win64 122 | second: 123 | enabled: 1 124 | settings: 125 | CPU: AnyCPU 126 | userData: 127 | assetBundleName: 128 | assetBundleVariant: 129 | -------------------------------------------------------------------------------- /Unity/Assets/Plugins/GstUnityBridge/x86_64/GstUnityBridge.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ua-i2cat/gst-unity-bridge/d08860e472334c2735c99c98636e17c6e1454bb7/Unity/Assets/Plugins/GstUnityBridge/x86_64/GstUnityBridge.dll -------------------------------------------------------------------------------- /Unity/Assets/Plugins/GstUnityBridge/x86_64/GstUnityBridge.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 41ebbcbb85845784c9a4ea66a27e7d23 3 | timeCreated: 1449748160 4 | licenseType: Free 5 | PluginImporter: 6 | serializedVersion: 2 7 | iconMap: {} 8 | executionOrder: {} 9 | isPreloaded: 0 10 | isOverridable: 0 11 | platformData: 12 | data: 13 | first: 14 | '': Any 15 | second: 16 | enabled: 0 17 | settings: 18 | Exclude Android: 1 19 | Exclude Editor: 0 20 | Exclude Linux: 0 21 | Exclude Linux64: 0 22 | Exclude LinuxUniversal: 0 23 | Exclude OSXIntel: 0 24 | Exclude OSXIntel64: 0 25 | Exclude OSXUniversal: 0 26 | Exclude Win: 1 27 | Exclude Win64: 0 28 | data: 29 | first: 30 | '': Editor 31 | second: 32 | enabled: 0 33 | settings: 34 | CPU: x86_64 35 | OS: Windows 36 | data: 37 | first: 38 | '': WP8 39 | second: 40 | enabled: 0 41 | settings: 42 | CPU: AnyCPU 43 | DontProcess: False 44 | PlaceholderPath: 45 | data: 46 | first: 47 | Android: Android 48 | second: 49 | enabled: 0 50 | settings: 51 | CPU: ARMv7 52 | data: 53 | first: 54 | Any: 55 | second: 56 | enabled: 0 57 | settings: {} 58 | data: 59 | first: 60 | Editor: Editor 61 | second: 62 | enabled: 1 63 | settings: 64 | CPU: x86_64 65 | DefaultValueInitialized: true 66 | OS: AnyOS 67 | data: 68 | first: 69 | Facebook: Win 70 | second: 71 | enabled: 0 72 | settings: 73 | CPU: None 74 | data: 75 | first: 76 | Facebook: Win64 77 | second: 78 | enabled: 1 79 | settings: 80 | CPU: AnyCPU 81 | data: 82 | first: 83 | Samsung TV: SamsungTV 84 | second: 85 | enabled: 0 86 | settings: 87 | STV_MODEL: STANDARD_13 88 | data: 89 | first: 90 | Standalone: Linux 91 | second: 92 | enabled: 1 93 | settings: 94 | CPU: None 95 | data: 96 | first: 97 | Standalone: Linux64 98 | second: 99 | enabled: 1 100 | settings: 101 | CPU: x86_64 102 | data: 103 | first: 104 | Standalone: LinuxUniversal 105 | second: 106 | enabled: 1 107 | settings: 108 | CPU: AnyCPU 109 | data: 110 | first: 111 | Standalone: OSXIntel 112 | second: 113 | enabled: 1 114 | settings: 115 | CPU: None 116 | data: 117 | first: 118 | Standalone: OSXIntel64 119 | second: 120 | enabled: 1 121 | settings: 122 | CPU: AnyCPU 123 | data: 124 | first: 125 | Standalone: OSXUniversal 126 | second: 127 | enabled: 1 128 | settings: 129 | CPU: AnyCPU 130 | data: 131 | first: 132 | Standalone: Win 133 | second: 134 | enabled: 0 135 | settings: 136 | CPU: None 137 | data: 138 | first: 139 | Standalone: Win64 140 | second: 141 | enabled: 1 142 | settings: 143 | CPU: AnyCPU 144 | data: 145 | first: 146 | Windows Store Apps: WindowsStoreApps 147 | second: 148 | enabled: 0 149 | settings: 150 | CPU: AnyCPU 151 | DontProcess: False 152 | PlaceholderPath: 153 | SDK: AnySDK 154 | data: 155 | first: 156 | iPhone: iOS 157 | second: 158 | enabled: 0 159 | settings: 160 | CompileFlags: 161 | FrameworkDependencies: 162 | userData: 163 | assetBundleName: 164 | assetBundleVariant: 165 | -------------------------------------------------------------------------------- /Unity/ProjectSettings/ClusterInputManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!236 &1 4 | ClusterInputManager: 5 | m_ObjectHideFlags: 0 6 | m_Inputs: [] 7 | -------------------------------------------------------------------------------- /Unity/ProjectSettings/EditorBuildSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ua-i2cat/gst-unity-bridge/d08860e472334c2735c99c98636e17c6e1454bb7/Unity/ProjectSettings/EditorBuildSettings.asset -------------------------------------------------------------------------------- /Unity/ProjectSettings/GraphicsSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ua-i2cat/gst-unity-bridge/d08860e472334c2735c99c98636e17c6e1454bb7/Unity/ProjectSettings/GraphicsSettings.asset -------------------------------------------------------------------------------- /Unity/ProjectSettings/InputManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!13 &1 4 | InputManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Axes: 8 | - serializedVersion: 3 9 | m_Name: Horizontal 10 | descriptiveName: 11 | descriptiveNegativeName: 12 | negativeButton: left 13 | positiveButton: right 14 | altNegativeButton: a 15 | altPositiveButton: d 16 | gravity: 3 17 | dead: 0.001 18 | sensitivity: 3 19 | snap: 1 20 | invert: 0 21 | type: 0 22 | axis: 0 23 | joyNum: 0 24 | - serializedVersion: 3 25 | m_Name: Vertical 26 | descriptiveName: 27 | descriptiveNegativeName: 28 | negativeButton: down 29 | positiveButton: up 30 | altNegativeButton: s 31 | altPositiveButton: w 32 | gravity: 3 33 | dead: 0.001 34 | sensitivity: 3 35 | snap: 1 36 | invert: 0 37 | type: 0 38 | axis: 0 39 | joyNum: 0 40 | - serializedVersion: 3 41 | m_Name: Fire1 42 | descriptiveName: 43 | descriptiveNegativeName: 44 | negativeButton: 45 | positiveButton: left ctrl 46 | altNegativeButton: 47 | altPositiveButton: mouse 0 48 | gravity: 1000 49 | dead: 0.001 50 | sensitivity: 1000 51 | snap: 0 52 | invert: 0 53 | type: 0 54 | axis: 0 55 | joyNum: 0 56 | - serializedVersion: 3 57 | m_Name: Fire2 58 | descriptiveName: 59 | descriptiveNegativeName: 60 | negativeButton: 61 | positiveButton: left alt 62 | altNegativeButton: 63 | altPositiveButton: mouse 1 64 | gravity: 1000 65 | dead: 0.001 66 | sensitivity: 1000 67 | snap: 0 68 | invert: 0 69 | type: 0 70 | axis: 0 71 | joyNum: 0 72 | - serializedVersion: 3 73 | m_Name: Fire3 74 | descriptiveName: 75 | descriptiveNegativeName: 76 | negativeButton: 77 | positiveButton: left shift 78 | altNegativeButton: 79 | altPositiveButton: mouse 2 80 | gravity: 1000 81 | dead: 0.001 82 | sensitivity: 1000 83 | snap: 0 84 | invert: 0 85 | type: 0 86 | axis: 0 87 | joyNum: 0 88 | - serializedVersion: 3 89 | m_Name: Jump 90 | descriptiveName: 91 | descriptiveNegativeName: 92 | negativeButton: 93 | positiveButton: space 94 | altNegativeButton: 95 | altPositiveButton: 96 | gravity: 1000 97 | dead: 0.001 98 | sensitivity: 1000 99 | snap: 0 100 | invert: 0 101 | type: 0 102 | axis: 0 103 | joyNum: 0 104 | - serializedVersion: 3 105 | m_Name: Mouse X 106 | descriptiveName: 107 | descriptiveNegativeName: 108 | negativeButton: 109 | positiveButton: 110 | altNegativeButton: 111 | altPositiveButton: 112 | gravity: 0 113 | dead: 0 114 | sensitivity: 0.1 115 | snap: 0 116 | invert: 0 117 | type: 1 118 | axis: 0 119 | joyNum: 0 120 | - serializedVersion: 3 121 | m_Name: Mouse Y 122 | descriptiveName: 123 | descriptiveNegativeName: 124 | negativeButton: 125 | positiveButton: 126 | altNegativeButton: 127 | altPositiveButton: 128 | gravity: 0 129 | dead: 0 130 | sensitivity: 0.1 131 | snap: 0 132 | invert: 0 133 | type: 1 134 | axis: 1 135 | joyNum: 0 136 | - serializedVersion: 3 137 | m_Name: Mouse ScrollWheel 138 | descriptiveName: 139 | descriptiveNegativeName: 140 | negativeButton: 141 | positiveButton: 142 | altNegativeButton: 143 | altPositiveButton: 144 | gravity: 0 145 | dead: 0 146 | sensitivity: 0.1 147 | snap: 0 148 | invert: 0 149 | type: 1 150 | axis: 2 151 | joyNum: 0 152 | - serializedVersion: 3 153 | m_Name: Horizontal 154 | descriptiveName: 155 | descriptiveNegativeName: 156 | negativeButton: 157 | positiveButton: 158 | altNegativeButton: 159 | altPositiveButton: 160 | gravity: 0 161 | dead: 0.19 162 | sensitivity: 1 163 | snap: 0 164 | invert: 0 165 | type: 2 166 | axis: 0 167 | joyNum: 0 168 | - serializedVersion: 3 169 | m_Name: Vertical 170 | descriptiveName: 171 | descriptiveNegativeName: 172 | negativeButton: 173 | positiveButton: 174 | altNegativeButton: 175 | altPositiveButton: 176 | gravity: 0 177 | dead: 0.19 178 | sensitivity: 1 179 | snap: 0 180 | invert: 1 181 | type: 2 182 | axis: 1 183 | joyNum: 0 184 | - serializedVersion: 3 185 | m_Name: Fire1 186 | descriptiveName: 187 | descriptiveNegativeName: 188 | negativeButton: 189 | positiveButton: joystick button 0 190 | altNegativeButton: 191 | altPositiveButton: 192 | gravity: 1000 193 | dead: 0.001 194 | sensitivity: 1000 195 | snap: 0 196 | invert: 0 197 | type: 0 198 | axis: 0 199 | joyNum: 0 200 | - serializedVersion: 3 201 | m_Name: Fire2 202 | descriptiveName: 203 | descriptiveNegativeName: 204 | negativeButton: 205 | positiveButton: joystick button 1 206 | altNegativeButton: 207 | altPositiveButton: 208 | gravity: 1000 209 | dead: 0.001 210 | sensitivity: 1000 211 | snap: 0 212 | invert: 0 213 | type: 0 214 | axis: 0 215 | joyNum: 0 216 | - serializedVersion: 3 217 | m_Name: Fire3 218 | descriptiveName: 219 | descriptiveNegativeName: 220 | negativeButton: 221 | positiveButton: joystick button 2 222 | altNegativeButton: 223 | altPositiveButton: 224 | gravity: 1000 225 | dead: 0.001 226 | sensitivity: 1000 227 | snap: 0 228 | invert: 0 229 | type: 0 230 | axis: 0 231 | joyNum: 0 232 | - serializedVersion: 3 233 | m_Name: Jump 234 | descriptiveName: 235 | descriptiveNegativeName: 236 | negativeButton: 237 | positiveButton: joystick button 3 238 | altNegativeButton: 239 | altPositiveButton: 240 | gravity: 1000 241 | dead: 0.001 242 | sensitivity: 1000 243 | snap: 0 244 | invert: 0 245 | type: 0 246 | axis: 0 247 | joyNum: 0 248 | - serializedVersion: 3 249 | m_Name: Submit 250 | descriptiveName: 251 | descriptiveNegativeName: 252 | negativeButton: 253 | positiveButton: return 254 | altNegativeButton: 255 | altPositiveButton: joystick button 0 256 | gravity: 1000 257 | dead: 0.001 258 | sensitivity: 1000 259 | snap: 0 260 | invert: 0 261 | type: 0 262 | axis: 0 263 | joyNum: 0 264 | - serializedVersion: 3 265 | m_Name: Submit 266 | descriptiveName: 267 | descriptiveNegativeName: 268 | negativeButton: 269 | positiveButton: enter 270 | altNegativeButton: 271 | altPositiveButton: space 272 | gravity: 1000 273 | dead: 0.001 274 | sensitivity: 1000 275 | snap: 0 276 | invert: 0 277 | type: 0 278 | axis: 0 279 | joyNum: 0 280 | - serializedVersion: 3 281 | m_Name: Cancel 282 | descriptiveName: 283 | descriptiveNegativeName: 284 | negativeButton: 285 | positiveButton: escape 286 | altNegativeButton: 287 | altPositiveButton: joystick button 1 288 | gravity: 1000 289 | dead: 0.001 290 | sensitivity: 1000 291 | snap: 0 292 | invert: 0 293 | type: 0 294 | axis: 0 295 | joyNum: 0 296 | -------------------------------------------------------------------------------- /Unity/ProjectSettings/NavMeshAreas.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!126 &1 4 | NavMeshAreas: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | areas: 8 | - name: Walkable 9 | cost: 1 10 | - name: Not Walkable 11 | cost: 1 12 | - name: Jump 13 | cost: 2 14 | - name: 15 | cost: 1 16 | - name: 17 | cost: 1 18 | - name: 19 | cost: 1 20 | - name: 21 | cost: 1 22 | - name: 23 | cost: 1 24 | - name: 25 | cost: 1 26 | - name: 27 | cost: 1 28 | - name: 29 | cost: 1 30 | - name: 31 | cost: 1 32 | - name: 33 | cost: 1 34 | - name: 35 | cost: 1 36 | - name: 37 | cost: 1 38 | - name: 39 | cost: 1 40 | - name: 41 | cost: 1 42 | - name: 43 | cost: 1 44 | - name: 45 | cost: 1 46 | - name: 47 | cost: 1 48 | - name: 49 | cost: 1 50 | - name: 51 | cost: 1 52 | - name: 53 | cost: 1 54 | - name: 55 | cost: 1 56 | - name: 57 | cost: 1 58 | - name: 59 | cost: 1 60 | - name: 61 | cost: 1 62 | - name: 63 | cost: 1 64 | - name: 65 | cost: 1 66 | - name: 67 | cost: 1 68 | - name: 69 | cost: 1 70 | - name: 71 | cost: 1 72 | -------------------------------------------------------------------------------- /Unity/ProjectSettings/Physics2DSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!19 &1 4 | Physics2DSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Gravity: {x: 0, y: -9.81} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_VelocityIterations: 8 10 | m_PositionIterations: 3 11 | m_VelocityThreshold: 1 12 | m_MaxLinearCorrection: 0.2 13 | m_MaxAngularCorrection: 8 14 | m_MaxTranslationSpeed: 100 15 | m_MaxRotationSpeed: 360 16 | m_MinPenetrationForPenalty: 0.01 17 | m_BaumgarteScale: 0.2 18 | m_BaumgarteTimeOfImpactScale: 0.75 19 | m_TimeToSleep: 0.5 20 | m_LinearSleepTolerance: 0.01 21 | m_AngularSleepTolerance: 2 22 | m_QueriesHitTriggers: 1 23 | m_QueriesStartInColliders: 1 24 | m_ChangeStopsCallbacks: 0 25 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 26 | -------------------------------------------------------------------------------- /Unity/ProjectSettings/ProjectSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ua-i2cat/gst-unity-bridge/d08860e472334c2735c99c98636e17c6e1454bb7/Unity/ProjectSettings/ProjectSettings.asset -------------------------------------------------------------------------------- /Unity/ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 5.6.0f3 2 | -------------------------------------------------------------------------------- /Unity/ProjectSettings/QualitySettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!47 &1 4 | QualitySettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 5 7 | m_CurrentQuality: 5 8 | m_QualitySettings: 9 | - serializedVersion: 2 10 | name: Fastest 11 | pixelLightCount: 0 12 | shadows: 0 13 | shadowResolution: 0 14 | shadowProjection: 1 15 | shadowCascades: 1 16 | shadowDistance: 15 17 | shadowNearPlaneOffset: 2 18 | shadowCascade2Split: 0.33333334 19 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 20 | blendWeights: 1 21 | textureQuality: 1 22 | anisotropicTextures: 0 23 | antiAliasing: 0 24 | softParticles: 0 25 | softVegetation: 0 26 | realtimeReflectionProbes: 0 27 | billboardsFaceCameraPosition: 0 28 | vSyncCount: 0 29 | lodBias: 0.3 30 | maximumLODLevel: 0 31 | particleRaycastBudget: 4 32 | asyncUploadTimeSlice: 2 33 | asyncUploadBufferSize: 4 34 | excludedTargetPlatforms: [] 35 | - serializedVersion: 2 36 | name: Fast 37 | pixelLightCount: 0 38 | shadows: 0 39 | shadowResolution: 0 40 | shadowProjection: 1 41 | shadowCascades: 1 42 | shadowDistance: 20 43 | shadowNearPlaneOffset: 2 44 | shadowCascade2Split: 0.33333334 45 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 46 | blendWeights: 2 47 | textureQuality: 0 48 | anisotropicTextures: 0 49 | antiAliasing: 0 50 | softParticles: 0 51 | softVegetation: 0 52 | realtimeReflectionProbes: 0 53 | billboardsFaceCameraPosition: 0 54 | vSyncCount: 0 55 | lodBias: 0.4 56 | maximumLODLevel: 0 57 | particleRaycastBudget: 16 58 | asyncUploadTimeSlice: 2 59 | asyncUploadBufferSize: 4 60 | excludedTargetPlatforms: [] 61 | - serializedVersion: 2 62 | name: Simple 63 | pixelLightCount: 1 64 | shadows: 1 65 | shadowResolution: 0 66 | shadowProjection: 1 67 | shadowCascades: 1 68 | shadowDistance: 20 69 | shadowNearPlaneOffset: 2 70 | shadowCascade2Split: 0.33333334 71 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 72 | blendWeights: 2 73 | textureQuality: 0 74 | anisotropicTextures: 1 75 | antiAliasing: 0 76 | softParticles: 0 77 | softVegetation: 0 78 | realtimeReflectionProbes: 0 79 | billboardsFaceCameraPosition: 0 80 | vSyncCount: 0 81 | lodBias: 0.7 82 | maximumLODLevel: 0 83 | particleRaycastBudget: 64 84 | asyncUploadTimeSlice: 2 85 | asyncUploadBufferSize: 4 86 | excludedTargetPlatforms: [] 87 | - serializedVersion: 2 88 | name: Good 89 | pixelLightCount: 2 90 | shadows: 2 91 | shadowResolution: 1 92 | shadowProjection: 1 93 | shadowCascades: 2 94 | shadowDistance: 40 95 | shadowNearPlaneOffset: 2 96 | shadowCascade2Split: 0.33333334 97 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 98 | blendWeights: 2 99 | textureQuality: 0 100 | anisotropicTextures: 1 101 | antiAliasing: 0 102 | softParticles: 0 103 | softVegetation: 1 104 | realtimeReflectionProbes: 1 105 | billboardsFaceCameraPosition: 1 106 | vSyncCount: 1 107 | lodBias: 1 108 | maximumLODLevel: 0 109 | particleRaycastBudget: 256 110 | asyncUploadTimeSlice: 2 111 | asyncUploadBufferSize: 4 112 | excludedTargetPlatforms: [] 113 | - serializedVersion: 2 114 | name: Beautiful 115 | pixelLightCount: 3 116 | shadows: 2 117 | shadowResolution: 2 118 | shadowProjection: 1 119 | shadowCascades: 2 120 | shadowDistance: 70 121 | shadowNearPlaneOffset: 2 122 | shadowCascade2Split: 0.33333334 123 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 124 | blendWeights: 4 125 | textureQuality: 0 126 | anisotropicTextures: 2 127 | antiAliasing: 2 128 | softParticles: 1 129 | softVegetation: 1 130 | realtimeReflectionProbes: 1 131 | billboardsFaceCameraPosition: 1 132 | vSyncCount: 1 133 | lodBias: 1.5 134 | maximumLODLevel: 0 135 | particleRaycastBudget: 1024 136 | asyncUploadTimeSlice: 2 137 | asyncUploadBufferSize: 4 138 | excludedTargetPlatforms: [] 139 | - serializedVersion: 2 140 | name: Fantastic 141 | pixelLightCount: 4 142 | shadows: 2 143 | shadowResolution: 2 144 | shadowProjection: 1 145 | shadowCascades: 4 146 | shadowDistance: 150 147 | shadowNearPlaneOffset: 2 148 | shadowCascade2Split: 0.33333334 149 | shadowCascade4Split: {x: 0.06666667, y: 0.19999999, z: 0.46666664} 150 | blendWeights: 4 151 | textureQuality: 0 152 | anisotropicTextures: 2 153 | antiAliasing: 2 154 | softParticles: 1 155 | softVegetation: 1 156 | realtimeReflectionProbes: 1 157 | billboardsFaceCameraPosition: 1 158 | vSyncCount: 1 159 | lodBias: 2 160 | maximumLODLevel: 0 161 | particleRaycastBudget: 4096 162 | asyncUploadTimeSlice: 2 163 | asyncUploadBufferSize: 4 164 | excludedTargetPlatforms: [] 165 | m_PerPlatformDefaultQuality: 166 | Android: 2 167 | BlackBerry: 2 168 | GLES Emulation: 5 169 | Nintendo 3DS: 5 170 | PS3: 5 171 | PS4: 5 172 | PSM: 5 173 | PSP2: 2 174 | Samsung TV: 2 175 | Standalone: 5 176 | Tizen: 2 177 | WP8: 5 178 | Web: 5 179 | WebGL: 3 180 | Wii U: 5 181 | WiiU: 5 182 | Windows Store Apps: 5 183 | XBOX360: 5 184 | XboxOne: 5 185 | iPhone: 2 186 | -------------------------------------------------------------------------------- /Unity/ProjectSettings/TagManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!78 &1 4 | TagManager: 5 | serializedVersion: 2 6 | tags: [] 7 | layers: 8 | - Default 9 | - TransparentFX 10 | - Ignore Raycast 11 | - 12 | - Water 13 | - UI 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 | - 39 | - 40 | m_SortingLayers: 41 | - name: Default 42 | uniqueID: 0 43 | locked: 0 44 | -------------------------------------------------------------------------------- /Unity/ProjectSettings/TimeManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!5 &1 4 | TimeManager: 5 | m_ObjectHideFlags: 0 6 | Fixed Timestep: 0.02 7 | Maximum Allowed Timestep: 0.33333334 8 | m_TimeScale: 1 9 | -------------------------------------------------------------------------------- /Unity/ProjectSettings/UnityConnectSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ua-i2cat/gst-unity-bridge/d08860e472334c2735c99c98636e17c6e1454bb7/Unity/ProjectSettings/UnityConnectSettings.asset -------------------------------------------------------------------------------- /Unity/README.md: -------------------------------------------------------------------------------- 1 | #GStreamer Movie Texture 2 | 3 | This asset allows playing media (Audio and Video) as a texture on Unity, 4 | using the GStreamer framework (https://gstreamer.freedesktop.org), which 5 | is contained in the Plugins folder. 6 | Works for Windows (32 and 64 bits) and Android (arm_v7). 7 | 8 | Works from within the Unity Editor on Windows, if it is launched in DirectX9 9 | mode (Launch with the -force-d3d9 option). 10 | 11 | Sample scenes are included. 12 | 13 | USAGE 14 | --- 15 | 16 | Drag the GstUnityBridgeTexture script onto your object (the other scripts 17 | cannot be used as Components), or instantiate from script. 18 | 19 | PROPERTIES 20 | --- 21 | - FlipX: Invert texture horizontally 22 | - FlipY: Invert texture vertically 23 | - Loop: Play media from the beginning when it reaches the end 24 | - URI: The URI of the media stream. GStreamer understands several protocols, 25 | including local and remote media. For example, file://, rtsp:// or http:// 26 | - Video Index: Which stream to use when the input URI contains more than one 27 | video stream. This is a zero-based index. -1 disables video altogether. 28 | - Audio Index: Which stream to use when the input URI contains more than one 29 | audio stream. This is a zero-based index. -1 disables audio altogether. 30 | - Target Material: Optional material whose texture will be replaced. If it is 31 | None, the first material in the Renderer of this GameObject will be used. 32 | - Initialize On Start: Whether the GStreamer pipeline must be created and set 33 | to PLAYING when the scene is loaded. Leave this on unless you plan to 34 | activate the pipeline manually from a script later on by calling 35 | Initialize(), Setup() and Play(). 36 | - Position: Is the current media position, in seconds. Can be read and written. 37 | Only accessible through scripting. 38 | - Duration: Is the current media length, in seconds. Can only be read. 39 | Only accessible through scripting. 40 | The value is only correct if IsPlaying() returns true. 41 | 42 | More properties are available, detailed in the next sections: 43 | 44 | EVENTS 45 | 46 | - OnFinish: Called when the media ends. 47 | - OnError (string message): Called when there is any kind of error. 48 | - OnQOS (QosData data): Called when frames are discarded due to lateness. 49 | The QosData structure contains information about the discarded frame and 50 | statistics regarding the whole playback session: 51 | current_jitter: Nanoseconds. How late a buffer was. Negative is early, 52 | positive is late. Early buffers are not reported. 53 | current_running_time: Nanoseconds. Running time when the late buffer was 54 | reported. 55 | current_stream_time: Nanoseconds. Stream time when the late buffer was 56 | reported. 57 | current_timestamp: Nanoseconds. Timestamp of the late buffer. 58 | proportion: Long term prediction of the ideal rate relative to normal rate 59 | to get optimal quality. 60 | processed: Total number of correctly processed frames. 61 | dropped: Total number of dropped frames, because they were late. 62 | 63 | Fore more information: 64 | https://gstreamer.freedesktop.org/data/doc/gstreamer/head/pwg/html/chapter-advanced-qos.html 65 | https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstMessage.html#gst-message-parse-qos 66 | 67 | VIDEO CROPPING 68 | --- 69 | 70 | The incoming video can be cropped before using in Unity. This can be very handy, 71 | but keep in mind that the whole video is transmitted and decoded, which might be 72 | wasteful if the amount of cropping is large. 73 | 74 | - Left, Top, Right, Bottom: Amount to crop from each edge, from 0.0 (no crop) to 75 | 1.0 (full crop, no image is displayed) 76 | 77 | NETWORK SYNCHRONIZATION (Advanced usage) 78 | 79 | When enabled, will synchronize the GStreamer pipeline to a GStreamer network 80 | clock. This allows synchronized playback across multiple devices. The clock 81 | server address and port must be provided through properties: 82 | 83 | - Enable: Enable network clock usage. If unchecked, the following two 84 | properties are ignored. 85 | - Master Clock Address: Server address (IP or host name) of the clock provider. 86 | - Master Clock Port: Port where the clock is provided. 87 | 88 | The quickest way to have a clock server running is using the test-netclock 89 | example from https://cgit.freedesktop.org/gstreamer/gst-rtsp-server/ 90 | 91 | DEBUG OUTPUT 92 | 93 | - Enabled: Enable to write debug output to the Unity Editor Console, LogCat on 94 | Android or gub.txt on a Standalone player. Does not work properly when there 95 | is more than one instance of the plugin with different Debug settings. 96 | - GStreamerDebugString: Comma-separated list of categories and log levels as 97 | used with the GST_DEBUG environment variable. Setting to '2' is normally 98 | enough. Leave empty to disable GStreamer debug output. 99 | 100 | METHODS 101 | ------- 102 | 103 | A number of methods ara available through scripting: 104 | 105 | - Initialize(): 106 | Call this before anything else. 107 | Called from Start() if InitializeOnStart=true. 108 | - Setup(string URI, int videoIndec, int audioIndex): 109 | Set the URI and streams to play. Can be called multiple times. 110 | Called from Start() if InitializeOnStart=true. 111 | - Play(): 112 | - Pause(): 113 | - Stop(): 114 | No description. You have to guess. 115 | Play() is called automatically from Start() if InitializeOnStart=true. 116 | 117 | ANDROID NOTES 118 | ------------- 119 | 120 | The version of GStreamer used does not support OpenGLES3 yet, therefore, Unity 121 | must be forced to use OpenGLES2 instead. To do so, go to: 122 | Edit -> Project Settings -> Player -> Android -> Other Settings -> Rendering 123 | And set "Auto Graphics API" to OFF. 124 | Then, in the list of graphic APIs, remove OpenGLES3 and leave only OpenGLES2. 125 | 126 | SOURCE CODE 127 | ----------- 128 | 129 | The project is Open Source. Code available at: 130 | https://github.com/ua-i2cat/gst-unity-bridge 131 | -------------------------------------------------------------------------------- /Unity/readme_unity.md: -------------------------------------------------------------------------------- 1 | #GStreamer Movie Texture 2 | 3 | This asset allows playing media (Audio and Video) as a texture on Unity, using the GStreamer framework (https://gstreamer.freedesktop.org), which is contained in the Plugins folder. 4 | 5 | Works for Windows (32 and 64 bits) and Android (arm_v7). 6 | 7 | Works from within the Unity Editor on Windows, if it is launched in DirectX9 mode (Launch with the -force-d3d9 option). 8 | 9 | Sample scenes are included. 10 | 11 | 12 | ##USAGE 13 | 14 | 1st) Drag GstUnityBridgeStarter script onto any gameobject of the scene. This scripts initializes and loads GStreamer. 15 | 2nd) Drag the GstUnityBridgeTexture script onto your object with a Renderer component (ie: MeshRender), or instantiate from script. 16 | 17 | ##PROPERTIES 18 | 19 | - FlipX: Invert texture horizontally 20 | - FlipY: Invert texture vertically 21 | - Loop: Play media from the beginning when it reaches the end 22 | - URI: The URI of the media stream. GStreamer understands several protocols, including local and remote media. For example, file://, rtsp:// or http:// 23 | - Video Index: Which stream to use when the input URI contains more than one video stream. This is a zero-based index. -1 disables video altogether. 24 | - Audio Index: Which stream to use when the input URI contains more than one audio stream. This is a zero-based index. -1 disables audio altogether. 25 | - Target Material: Optional material whose texture will be replaced. If it is None, the first material in the Renderer of this GameObject will be used. 26 | - Initialize On Start: Whether the GStreamer pipeline must be created and set to PLAYING when the scene is loaded. Leave this on unless you plan to activate the pipeline manually from a script later on by calling Initialize(), Setup() and Play(). 27 | - Position: Is the current media position, in seconds. Can be read and written. Only accessible through scripting. 28 | - Duration: Is the current media length, in seconds. Can only be read. Only accessible through scripting. The value is only correct if IsPlaying() returns true. 29 | 30 | More properties are available, detailed in the next sections: 31 | 32 | ###EVENTS 33 | 34 | - OnFinish: Called when the media ends. 35 | - OnError (string message): Called when there is any kind of error. 36 | - OnQOS (QosData data): Called when frames are discarded due to lateness. The QosData structure contains information about the discarded frame and statistics regarding the whole playback session: 37 | - current_jitter: Nanoseconds. How late a buffer was. Negative is early, positive is late. Early buffers are not reported. 38 | - current_running_time: Nanoseconds. Running time when the late buffer was reported. 39 | - current_stream_time: Nanoseconds. Stream time when the late buffer was reported. 40 | - current_timestamp: Nanoseconds. Timestamp of the late buffer. 41 | - proportion: Long term prediction of the ideal rate relative to normal rate to get optimal quality. 42 | - processed: Total number of correctly processed frames. 43 | - dropped: Total number of dropped frames, because they were late. 44 | 45 | Fore more information: 46 | https://gstreamer.freedesktop.org/data/doc/gstreamer/head/pwg/html/chapter-advanced-qos.html 47 | https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstMessage.html#gst-message-parse-qos 48 | 49 | ###VIDEO CROPPING 50 | 51 | The incoming video can be cropped before using in Unity. This can be very handy, but keep in mind that the whole video is transmitted and decoded, which might be wasteful if the amount of cropping is large. 52 | 53 | - Left, Top, Right, Bottom: Amount to crop from each edge, from 0.0 (no crop) to 1.0 (full crop, no image is displayed) 54 | 55 | ###NETWORK SYNCHRONIZATION (Advanced usage) 56 | 57 | When enabled, will synchronize the GStreamer pipeline to a GStreamer network clock. This allows synchronized playback across multiple devices. The clock server address and port must be provided through properties: 58 | - Enable: Enable network clock usage. If unchecked, the following two properties are ignored. 59 | - Master Clock Address: Server address (IP or host name) of the clock provider. 60 | - Master Clock Port: Port where the clock is provided. 61 | 62 | The quickest way to have a clock server running is using the test-netclock example from: 63 | https://cgit.freedesktop.org/gstreamer/gst-rtsp-server/ 64 | 65 | ###DEBUG OUTPUT 66 | 67 | - Enabled: Enable to write debug output to the Unity Editor Console, LogCat on Android or gub.txt on a Standalone player. Does not work properly when there is more than one instance of the plugin with different Debug settings. 68 | - GStreamerDebugString: Comma-separated list of categories and log levels as used with the GST_DEBUG environment variable. Setting to '2' is normally enough. Leave empty to disable GStreamer debug output. 69 | 70 | 71 | ##METHODS 72 | 73 | A number of methods ara available through scripting: 74 | 75 | - Initialize(): 76 | - Call this before anything else. 77 | - Called from Start() if InitializeOnStart=true. 78 | - Setup(string URI, int videoIndec, int audioIndex): 79 | - Set the URI and streams to play. Can be called multiple times. 80 | - Called from Start() if InitializeOnStart=true. 81 | - Play(): 82 | - Pause(): 83 | - Stop(): 84 | - No description. You have to guess. 85 | Play() is called automatically from Start() if InitializeOnStart=true. 86 | 87 | ##ANDROID NOTES 88 | 89 | The version of GStreamer does not support OpenGLES3 yet, therefore, Unity must be forced to use OpenGLES2 instead. To do so, go to: 90 | - Edit -> Project Settings -> Player -> Android -> Other Settings -> Rendering 91 | - And set "Auto Graphics API" to OFF. 92 | - Then, in the list of graphic APIs, remove OpenGLES3 and leave only OpenGLES2. 93 | 94 | Gub needs internet access, so it have to be activated: 95 | - Edit -> Project Settings -> Player -> Android -> Other Settings -> Configuration 96 | - And select "Require" in Internet Access options. 97 | 98 | In Android builds Unity's default material doesn't work correctly with GUB. You should select/drag any of the materials from GstUnityBridge\Materials to the MeshRenderer component. We recommend "ExternalAlphaBase". 99 | 100 | 101 | ##SOURCE CODE 102 | 103 | The project is Open Source. Code available at: 104 | https://github.com/ua-i2cat/gst-unity-bridge 105 | --------------------------------------------------------------------------------