ExternalStreamManagerAndroid actually depends on GLES
Since ExternalStreamManagerAndroid depends on GLES, move it to the opengl directory.
This commit is contained in:
committed by
Mathias Agopian
parent
3ceec28189
commit
ff190847a1
@@ -87,7 +87,7 @@ if (FILAMENT_SUPPORTS_OPENGL AND NOT FILAMENT_USE_EXTERNAL_GLES3 AND NOT FILAMEN
|
||||
list(APPEND SRCS src/VirtualMachineEnv.cpp)
|
||||
endif ()
|
||||
if (ANDROID)
|
||||
list(APPEND SRCS src/android/ExternalStreamManagerAndroid.cpp)
|
||||
list(APPEND SRCS src/opengl/ExternalStreamManagerAndroid.cpp)
|
||||
list(APPEND SRCS src/android/ExternalTextureManagerAndroid.cpp)
|
||||
list(APPEND SRCS src/opengl/PlatformEGLAndroid.cpp)
|
||||
elseif (IOS)
|
||||
|
||||
@@ -31,6 +31,15 @@
|
||||
|
||||
namespace filament {
|
||||
|
||||
/*
|
||||
* ExternalTextureManagerAndroid::ExternalTexture is basically a wrapper for AHardwareBuffer.
|
||||
*
|
||||
* This class doesn't rely on GL or EGL, and could be used for other Android platform if needed
|
||||
* (e.g. Vulkan).
|
||||
*
|
||||
* ExternalTextureManagerAndroid handle allocation/destruction using either Java or the NDK,
|
||||
* whichever is available.
|
||||
*/
|
||||
class ExternalTextureManagerAndroid {
|
||||
public:
|
||||
|
||||
@@ -47,7 +56,7 @@ public:
|
||||
// not quite sure on which thread this is going to be called
|
||||
~ExternalTextureManagerAndroid() noexcept;
|
||||
|
||||
// called on gl thread
|
||||
// called on backend thread
|
||||
backend::Platform::ExternalTexture* create() noexcept;
|
||||
|
||||
// called on app thread
|
||||
|
||||
@@ -31,6 +31,11 @@ typedef struct ASurfaceTexture ASurfaceTexture;
|
||||
|
||||
namespace filament {
|
||||
|
||||
/*
|
||||
* ExternalStreamManagerAndroid::Stream is basically a wrapper for SurfaceTexture.
|
||||
*
|
||||
* This class DOES DEPEND on having a GLES context, because that's how SurfaceTexture works.
|
||||
*/
|
||||
class ExternalStreamManagerAndroid {
|
||||
public:
|
||||
using Stream = backend::Platform::Stream;
|
||||
@@ -40,8 +45,14 @@ public:
|
||||
|
||||
Stream* acquire(jobject surfaceTexture) noexcept;
|
||||
void release(Stream* stream) noexcept;
|
||||
|
||||
// attach Stream to current GLES context
|
||||
void attach(Stream* stream, intptr_t tname) noexcept;
|
||||
|
||||
// detach Stream to current GLES context
|
||||
void detach(Stream* stream) noexcept;
|
||||
|
||||
// must be called on GLES context thread, updates the stream content
|
||||
void updateTexImage(Stream* stream, int64_t* timestamp) noexcept;
|
||||
|
||||
private:
|
||||
@@ -20,7 +20,7 @@
|
||||
#include "OpenGLContext.h"
|
||||
|
||||
#include "android/ExternalTextureManagerAndroid.h"
|
||||
#include "android/ExternalStreamManagerAndroid.h"
|
||||
#include "ExternalStreamManagerAndroid.h"
|
||||
#include "private/backend/VirtualMachineEnv.h"
|
||||
|
||||
#include <android/api-level.h>
|
||||
|
||||
Reference in New Issue
Block a user