Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
1 View

WoogeenSurfaceRenderer Circular Shape

Hi,

I'm trying to shape my stream preview as a circle but after a few seconds it goes square again.
Here you can see the issue: 
https://www.youtube.com/watch?v=8WnFywDCZrI

 

As a renderer I'm extending WoogenSurfaceRenderer and shaping it as a circle:

public class CircularSurfaceRenderer extends WoogeenSurfaceRenderer {
    private float x;
    private float y;

    public CircularSurfaceRenderer(Context context, float x, float y) {
        super(context);
        this.x = x;
        this.y = y;
    }

    public CircularSurfaceRenderer(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    @Override
    protected void dispatchDraw(Canvas canvas) {
        Path path = new Path();
        int count = canvas.save();

        path.addCircle(x, y, 100, Path.Direction.CW);

        canvas.clipPath(path);
        super.dispatchDraw(canvas);
        canvas.restoreToCount(count);
    }

 

 

Tags (2)
0 Kudos
8 Replies
Highlighted
Employee
1 View

Hi Germán, i had a quick try

Hi Germán, i had a quick try with your code and didn't reproduce the issue.

maybe you could try to track which method(s) will be triggered in WoogeenSurfaceRenderer when the circle becomes a square,

i'll appreciate it if let me know your result :)

0 Kudos
Highlighted
Beginner
1 View

Hi, 

Hi, 

I debugged and it seems to become square-shaped after one renderFrame execution, but I can't tell exactly after which event because after a few hours of debugging I couldn't find any consistent flow.

Did remain circle shaped for you? Maybe we are using a different WoogenSurfaceRenderer class version?

Thanks again,

German.

0 Kudos
Highlighted
Beginner
1 View

I'm experiencing the same,

I'm experiencing the same, but only when rendering YUV textures. For OES textures seems to work fine.

0 Kudos
Highlighted
Employee
1 View

Germán and Yolanda, which

Germán and Yolanda, which version(s) of Woogeen SDK did you use?

 

0 Kudos
Highlighted
Beginner
1 View

He, I'm using version 3.2.1.

He, I'm using version 3.2.1.

0 Kudos
Highlighted
Beginner
1 View

Hey, v3.3 here.

Hey, v3.3 here.

0 Kudos
Highlighted
Beginner
1 View

I fixed this by replacing the

I fixed this by replacing the SurfaceViews with TextureViews and clipping the canvas of the TextureView's parent.

0 Kudos
Highlighted
Employee
1 View

Quote:Yolanda C. wrote:

Yolanda C. wrote:

I fixed this by replacing the SurfaceViews with TextureViews and clipping the canvas of the TextureView's parent.

 

Awesome! Glad to hear it. Thanks Yolanda for sharing this to us all !

0 Kudos