putCameraStreamSurface support for TextureView
137 1 4-4 00:54
Uploading and Loding Picture ...(0/1)
o(^-^)o
djiuser_KLosE1u98yWy
lvl.1
Austria
Offline

Hi everyone,

I am currently working with

CameraStreamManager.getInstance().putCameraStreamSurface(@NonNull  ComponentIndexType cameraIndex, @NonNull Surface surface, int  surfaceWidth, int surfaceHeight, @NonNull ICameraStreamManager.ScaleType  scaleType)

in the documentation  Mobile-SDK-Android-V5-dev-sdk-main/Docs/Android_API/en/Components/IMediaDataCenter/ICameraStreamManager.html#icamerastreammanager_putcamerastreamsurface_inline
it says with the Surface parameter:

Set the surface that needs to display the  video  stream. Supports SurfaceView, TextureView and MediaCodeC Surface,  does  not support GLSurfaceView surface and any surface bound to  OpenGL.

Now I am wondering about that support for TextureView. I currently have  (from an existing project) a TextureView which I would like to use with  putCameraStreamSurface, but of course TextureView does not have Surface  in its ancestry. Nor does the SurfaceTexture from  TextureView.getSurfaceTexture(). Do I somehow need to get the Canvas and  create a new surface or how is this compatibility achived?

4-4 00:54
Use props
djiuser_KLosE1u98yWy
lvl.1
Austria
Offline

Ok found it myself:

Surface s = new Surface(textureView.getSurfaceTexture());
4-4 01:10
Use props
Advanced
You need to log in before you can reply Login | Register now

Credit Rules