Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set properties SurfaceFilterRender #1693

Open
BLS-Mobile-Team-LuanDinh opened this issue Dec 30, 2024 · 3 comments
Open

set properties SurfaceFilterRender #1693

BLS-Mobile-Team-LuanDinh opened this issue Dec 30, 2024 · 3 comments

Comments

@BLS-Mobile-Team-LuanDinh
Copy link

BLS-Mobile-Team-LuanDinh commented Dec 30, 2024

Hi Pedro
I get the width, height, rotation, x, y, opacity of a view compared to the parent view. So how do I add SurfaceFilterRender with the above properties to the same parent view? Thank you for your feedback, thank you

@pedroSG94
Copy link
Owner

Hello,

You have this methods to use in SurfaceFilterRender:

  public void setAlpha(float alpha)
  public void setScale(float scaleX, float scaleY)
  public void setPosition(float x, float y)
  public void setPosition(TranslateTo positionTo)
  public PointF getScale()
  public PointF getPosition()
  public void setRotation(int angle)
  public int getRotation()

Remember that scale and position works in percent (0 to 100), rotation in degrees (0 to 360) and alpha with float (0.0f to 1.0f)

@BLS-Mobile-Team-LuanDinh
Copy link
Author

I used SurfaceFilterRender to add the video to the fillter but it didn't actually position and size it like I wanted. Then I tried using AndroidViewFilterRender and added a videoview, but when I added the fillter, the video couldn't play and wasn't displayed. Do you have any way to add or play video in AndroidViewFilterRender. Please help me .Thanks

@pedroSG94
Copy link
Owner

pedroSG94 commented Jan 8, 2025

Hello,

Sorry for late response.
The reason about the AndroidViewFilterRender is that this render use canvas to get frames from the view but fews views can't do it like VideoView, SurfaceView, GlSurfaceView or TextureView. The reason is that this views use a gl texture to render and you can't get frames using canvas from that views.

SurfaceFilterRender was designed for this cases when you want draw into a texture. Your only way is use SurfaceFilterRender with methods that I told you in my last post

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants