summaryrefslogtreecommitdiff
path: root/platform/android
diff options
context:
space:
mode:
authorBastiaanOlij <mux213@gmail.com>2017-08-21 00:17:24 +1000
committerBastiaan Olij <mux213@gmail.com>2019-06-15 21:30:32 +1000
commit02ea99129e8f3882914431374c60a7d80c5146e1 (patch)
tree6e41adaa70a2d5a3441ba6c1d455d9b63ea8c1de /platform/android
parent0a3c21d999559617cc9cdfe261d631e6d1267374 (diff)
Adding a new Camera Server implementation to Godot.
This is a new singleton where camera sources such as webcams or cameras on a mobile phone can register themselves with the Server. Other parts of Godot can interact with this to obtain images from the camera as textures. This work includes additions to the Visual Server to use this functionality to present the camera image in the background. This is specifically targetted at AR applications.
Diffstat (limited to 'platform/android')
-rw-r--r--platform/android/os_android.cpp6
-rw-r--r--platform/android/os_android.h3
2 files changed, 9 insertions, 0 deletions
diff --git a/platform/android/os_android.cpp b/platform/android/os_android.cpp
index f8076dfd2d..ebc319e57d 100644
--- a/platform/android/os_android.cpp
+++ b/platform/android/os_android.cpp
@@ -176,6 +176,9 @@ Error OS_Android::initialize(const VideoMode &p_desired, int p_video_driver, int
input = memnew(InputDefault);
input->set_fallback_mapping("Default Android Gamepad");
+ ///@TODO implement a subclass for Android and instantiate that instead
+ camera_server = memnew(CameraServer);
+
//power_manager = memnew(PowerAndroid);
return OK;
@@ -193,6 +196,9 @@ void OS_Android::delete_main_loop() {
}
void OS_Android::finalize() {
+
+ memdelete(camera_server);
+
memdelete(input);
}
diff --git a/platform/android/os_android.h b/platform/android/os_android.h
index 4dbc96f4da..e74d4cfd43 100644
--- a/platform/android/os_android.h
+++ b/platform/android/os_android.h
@@ -39,6 +39,7 @@
#include "main/input_default.h"
//#include "power_android.h"
#include "servers/audio_server.h"
+#include "servers/camera_server.h"
#include "servers/visual/rasterizer.h"
class GodotJavaWrapper;
@@ -77,6 +78,8 @@ private:
VisualServer *visual_server;
+ CameraServer *camera_server;
+
mutable String data_dir_cache;
//AudioDriverAndroid audio_driver_android;